Accelerated Computation Engine
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
Ace::LogServer Class Reference

#include <ace_logserver.h>

Inheritance diagram for Ace::LogServer:

Classes

class  Thread
 

Public Types

enum  Type { Log, Debug }
 

Public Member Functions

void wait ()
 
LogServerbroadcast (Type type, int thread, const QByteArray &data)
 

Static Public Member Functions

static void initialize (int port)
 
static LogServerlog ()
 
static QString host ()
 

Detailed Description

This is a global singleton TCP logging server used to output logging messages to all connected logging clients. This is a very low level class and only outputs byte arrays. This class is thread safe, using an internal thread and runs all TCP operations exclusively inside its own thread. This class acts as a TCP server, relaying all byte arrays streamed to it. This also provides static functions for initializing the log server and then accessing its instance.

Member Enumeration Documentation

◆ Type

Defines all message types that can be broadcast to clients.

Enumerator
Log 

Defines the log message type that is meant for normal logging messages.

Defines the debug message type that is meant for all debugging log messages.

Member Function Documentation

◆ broadcast()

LogServer & LogServer::broadcast ( Type  type,
int  thread,
const QByteArray &  data 
)

Writes out the given message to all connected clients.

Parameters
typeThe message type being broadcast to all clients.
threadThe thread ID where this message is coming from. This is only used for debugging messages.
dataAny optional data that is appended to the message.
Returns
Reference to this logger.

◆ host()

QString LogServer::host ( )
static

Returns the hostname of the machine this program is running on.

Returns
Hostname of the machine this program is running on.

◆ initialize()

void LogServer::initialize ( int  port)
static

Creates and initializes the global instance of the log server.

Parameters
portThe port number the global log server listens for new connections.

◆ log()

LogServer * LogServer::log ( )
static

Returns the global instance of the logging server or null if it was never initialized.

Returns
Global instance of the logging server or null if it was never initialized.

◆ wait()

void LogServer::wait ( )

Blocks execution until it gets a signal from a connected logging client to start analytic execution.


The documentation for this class was generated from the following files: