#include <hds_messenger_ls.hpp>
|
enum | State { SERVER = 0,
CLIENT,
UNDEFINED
} |
|
enum | MsgType {
UNDEFINED_MSG = 0,
INFO_MSG,
WARNING_MSG,
ERROR_MSG,
DEBUG_MSG,
SHOW_PROGRESS_MSG,
HIDE_PROGRESS_MSG,
SET_PROGRESS_VALUE_MSG,
SET_PROGRESS_RANGES_MSG,
SET_PROGRESS_STATUS_MSG
} |
|
|
virtual void | socket_connection_error (QLocalSocket::LocalSocketError socketError) |
|
virtual void | socket_connected () |
|
virtual void | socket_disconnected () |
|
Provideas log messages sending for HDS Module using local sockets.
State of logger
Enumerator |
---|
SERVER |
Logger initialized as a server.
|
CLIENT |
Logger initialized as a client.
|
UNDEFINED |
Logger not properly initialized.
|
hds::MessengerLS::MessengerLS |
( |
QObject * |
parent = 0x0 | ) |
|
Default constructor. State will be UNDEFINED untill init() called.
hds::MessengerLS::MessengerLS |
( |
const QString & |
sock_name, |
|
|
State |
state = CLIENT , |
|
|
int |
connection_time_out = 0 , |
|
|
QObject * |
parent = 0x0 |
|
) |
| |
Construct logger object for provided socket name. State will be UNDEFINED on errors.
- Parameters
-
sock_name | Name of the socket. |
state | Server(true) or client(false) state. |
connection_time_out | Delay (ms) for connection waiting |
parent | Parent for QObject. |
virtual hds::MessengerLS::~MessengerLS |
( |
| ) |
|
|
virtual |
Get first message with it's type, return message of undefined type
if no messages presents. Content of the message should be defined in compliance with the type.
Implements hds::Messenger.
bool hds::MessengerLS::hasMessages |
( |
| ) |
|
Return true if logger has messages not taken by getMsg().
Only in works in SERVER mode and for other modes return false.
State hds::MessengerLS::init |
( |
const QString & |
sock_name, |
|
|
State |
state = CLIENT , |
|
|
int |
connection_time_out = 0 |
|
) |
| |
Initialize logger in client or server mode.
If server was initialized as server early => stop listening and close it's socket. Return the state of object.
- Parameters
-
sock_name | Name of the socket. |
state | Server(true) or client(false) state. |
connection_time_out | Delay (ms) for connection waiting |
Send message with provided type. Content of the message
should be defined in compliance with the type.
Implements hds::Messenger.
void hds::MessengerLS::setConnectionTimeOut |
( |
int |
dt | ) |
|
|
inline |
Set delay dt(ms) for connection waiting.
const QString& hds::MessengerLS::socketName |
( |
| ) |
const |
|
inline |
Return current socket name.
State hds::MessengerLS::state |
( |
| ) |
const |
|
inline |
Return state of the logger.
int hds::MessengerLS::waitConnectionTimeOut |
( |
| ) |
const |
|
inline |
Delay for connection waiting (ms).
QLocalServer hds::MessengerLS::m_server |
|
mutableprotected |
< Local server. Local socket.
QLocalSocket hds::MessengerLS::m_socket |
|
mutableprotected |
Name of the local socket.
State hds::MessengerLS::m_state |
|
protected |
Current state of the logger. Current connection wait time out.
The documentation for this class was generated from the following file: