COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
Public Member Functions | Private Attributes | List of all members
NetworkInfo Class Reference

#include <NetworkInfo.hpp>

Public Member Functions

 NetworkInfo ()
 Constructor. More...
 
 ~NetworkInfo ()
 Destructor. More...
 
bool is_server () const
 
bool is_client () const
 
std::string hostname () const
 
unsigned short port () const
 
void start_server ()
 
void stop_server ()
 
void start_client ()
 
void stop_client ()
 
void set_hostname (const std::string &name)
 
void set_port (unsigned short port)
 

Private Attributes

bool m_is_server
 Indicates whether a server manages this CF instance. More...
 
bool m_is_client
 Indicates whether a client manages this CF instance. More...
 
std::string m_hostname
 The current hostname. More...
 
unsigned short m_port
 The current port number. More...
 

Detailed Description

Holds network information of the GUI. This class allows to access these pieces of information from inside the CF kernel or plugins without calling Qt libraries. Values are typically set by the GUI.

Author
Quentin Gasper.

Definition at line 24 of file NetworkInfo.hpp.

Constructor & Destructor Documentation

Constructor.

Definition at line 18 of file NetworkInfo.cpp.

Destructor.

Definition at line 29 of file NetworkInfo.cpp.

Member Function Documentation

std::string hostname ( ) const
Returns
Returns the current hostname.

Definition at line 47 of file NetworkInfo.cpp.

bool is_client ( ) const
Returns
Returns true if this CF instance is managed by the client

Definition at line 40 of file NetworkInfo.cpp.

bool is_server ( ) const
Returns
Returns true if this CF instance is managed by the server

Definition at line 33 of file NetworkInfo.cpp.

unsigned short port ( ) const
Returns
Returns the current port.

Definition at line 54 of file NetworkInfo.cpp.

void set_hostname ( const std::string &  name)

Sets the hostname.

Parameters
nameThe new hostname. Should be different from "localhost".

Definition at line 95 of file NetworkInfo.cpp.

void set_port ( unsigned short  port)

Sets the port.

Parameters
portThe new port number.

Definition at line 102 of file NetworkInfo.cpp.

void start_client ( )

"Starts" the client. If the server is already "started", it is "stopped".

Postcondition
is_client() returns true

Definition at line 78 of file NetworkInfo.cpp.

void start_server ( )

"Starts" the server. If the client is already "started", it is "stopped".

Postcondition
is_server() returns true

Definition at line 61 of file NetworkInfo.cpp.

void stop_client ( )

"Stops" the client.

Postcondition
is_client() returns false

Definition at line 88 of file NetworkInfo.cpp.

void stop_server ( )

"Stops" the server.

Postcondition
is_server() returns false

Definition at line 71 of file NetworkInfo.cpp.

Member Data Documentation

std::string m_hostname
private

The current hostname.

Definition at line 82 of file NetworkInfo.hpp.

bool m_is_client
private

Indicates whether a client manages this CF instance.

Definition at line 79 of file NetworkInfo.hpp.

bool m_is_server
private

Indicates whether a server manages this CF instance.

Definition at line 76 of file NetworkInfo.hpp.

unsigned short m_port
private

The current port number.

Definition at line 85 of file NetworkInfo.hpp.


The documentation for this class was generated from the following files:
Send comments to:
COOLFluiD Web Admin