COOLFluiD
Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
|
#include <NetworkThread.hpp>
Inherits QThread, and SignalHandler.
Public Member Functions | |
NetworkThread (QObject *parent=nullptr) | |
Constructor. More... | |
~NetworkThread () | |
bool | connect_to_host (const std::string &hostAddress, unsigned short port) |
void | disconnect_from_server (bool shutServer) |
Disconnects from the server, then closes. More... | |
bool | is_connected () const |
void | send (common::SignalArgs &signal) |
Sends a signal frame to the server. The client UuiD is added to the frame. More... | |
void | run () |
Executes the thread event loop. More... | |
void | set_error_handler (boost::weak_ptr< network::ErrorHandler > handler) |
Public Member Functions inherited from SignalHandler | |
~SignalHandler () | |
const storage_t & | signal_list () const |
SignalPtr | signal (const SignalID &sname) |
SignalCPtr | signal (const SignalID &sname) const |
SignalRet | call_signal (const SignalID &sname, SignalArgs &sinput) |
Calls the signal by providing its name and input. More... | |
SignalRet | call_signal (const SignalID &sname, std::vector< std::string > &sinput) |
Calls the signal by providing its name and input. More... | |
bool | signal_exists (const SignalID &sname) const |
Checks if a signal exists or not. More... | |
Signal & | regist_signal (const SignalID &sname) |
Regist signal. More... | |
void | unregist_signal (const SignalID &sname) |
Unregist signal. More... | |
Private Member Functions | |
void | init_read () |
void | callback_connect (const boost::system::error_code &error) |
void | callback_read (const boost::system::error_code &error) |
void | callback_send (const boost::system::error_code &error) |
Private Attributes | |
boost::shared_ptr< network::TCPConnection > | m_connection |
common::SignalArgs | m_buffer |
boost::asio::io_service * | m_io_service |
boost::asio::ip::tcp::endpoint * | m_endpoint |
boost::shared_ptr< network::ErrorHandler > | m_error_handler |
bool | m_request_disc |
QString | m_hostname |
quint16 | m_port |
QMutex | m_mutex |
Additional Inherited Members | |
Public Types inherited from SignalHandler | |
typedef std::vector< SignalPtr > | storage_t |
storage type for signals More... | |
Public Attributes inherited from SignalHandler | |
storage_t | m_signals |
storage of the signals More... | |
Thread that manages the network.
Definition at line 43 of file NetworkThread.hpp.
NetworkThread | ( | QObject * | parent = nullptr | ) |
Constructor.
Definition at line 44 of file NetworkThread.cpp.
~NetworkThread | ( | ) |
Definition at line 58 of file NetworkThread.cpp.
|
private |
Definition at line 200 of file NetworkThread.cpp.
|
private |
Definition at line 217 of file NetworkThread.cpp.
|
private |
Definition at line 262 of file NetworkThread.cpp.
bool connect_to_host | ( | const std::string & | hostAddress, |
unsigned short | port | ||
) |
Attempts to connect to a remote host.
hostAddress | Address of the host to connect to. |
port | The port number to use. |
Definition at line 76 of file NetworkThread.cpp.
void disconnect_from_server | ( | bool | shutServer | ) |
Disconnects from the server, then closes.
shutServer | If true , a request to shut down the server is sent. |
Definition at line 121 of file NetworkThread.cpp.
|
private |
Definition at line 188 of file NetworkThread.cpp.
bool is_connected | ( | ) | const |
Definition at line 111 of file NetworkThread.cpp.
void run | ( | ) |
Executes the thread event loop.
Definition at line 159 of file NetworkThread.cpp.
void send | ( | common::SignalArgs & | signal | ) |
Sends a signal frame to the server. The client UuiD is added to the frame.
signal | The signal to send. |
Definition at line 141 of file NetworkThread.cpp.
void set_error_handler | ( | boost::weak_ptr< network::ErrorHandler > | handler | ) |
|
private |
Definition at line 96 of file NetworkThread.hpp.
|
private |
Definition at line 94 of file NetworkThread.hpp.
|
private |
Definition at line 100 of file NetworkThread.hpp.
|
private |
Definition at line 102 of file NetworkThread.hpp.
|
private |
Definition at line 106 of file NetworkThread.hpp.
|
private |
Definition at line 98 of file NetworkThread.hpp.
|
private |
Definition at line 110 of file NetworkThread.hpp.
|
private |
Definition at line 108 of file NetworkThread.hpp.
|
private |
Definition at line 104 of file NetworkThread.hpp.
Send comments to: COOLFluiD Web Admin |