B2BITS FIX Antenna HFT  1.0.16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
PlatformProps Struct Reference

Platform configuration parameters. More...

#include <b2b_platform.h>

+ Collaboration diagram for PlatformProps:

Public Member Functions

 _Pragma ("pack(1)")
 
 _Pragma ("pack()")
 
void exitHandler ()
 Runs exit handler callback. More...
 
void initDone_LoggerThread ()
 Sets the logger thread is initialized flag. More...
 
bool isAppInitializing ()
 Returns true if the user application is initializing. More...
 
bool isAppTerminating ()
 Returns true if the user application is terminating. More...
 
 PlatformProps ()
 The constructor. More...
 
void set_loglevel (enum PlatformLogLevel level)
 Sets the current log level for the platform logging functions. More...
 

Public Attributes

AppStatus appStatus
 The default AppStatus instance. More...
 
volatile AppStatusappStatusPtr
 The pointer to the AppStatus instance. More...
 
char canUseTSC
 Allows the use rdtsc if possible, the result is in the useTSC flag after the initialization. More...
 
char CmdShell_logConsoleEnabled
 Writes log messages to the console and the TCP command shell. More...
 
char CmdShell_showLogInCmdShell
 Shows log messages in the console command shell. More...
 
char dumpPacketData
 Writes the data received from the socket to the log. More...
 
Utils::Log::LogCategoryengineLog
 The log category for the platform logging functions. More...
 
EXIT_HANDLER_CB exitHandlerCB
 The exit handler callback. More...
 
char fixEnginePropsFilename [255]
 The path to the engine.properties file. More...
 
NanosTimeConvertStaticg_nanosCvt
 The time converter to convert nanoseconds to AbsoluteSystemTime. More...
 
HANDLE_CMD_CB handleCmdCB
 The command handler callback of the command shell. More...
 
volatile int init_LoggerThread
 Is true (non-zero) when the logger thread is initialized. More...
 
int init_on_start
 Is true (non-zero) if the initialize_on_start() function was called. More...
 
uint64_t logger_CPUMask
 The async logger thread affinity mask. More...
 
char loggerUseNanosecTimer
 Sets use get_nanosec() for log messages timestamps. More...
 
enum PlatformLogLevel logLevel
 The current log level for the platform logging functions. More...
 
char onloadIsPresent
 This flag is set by the platform to true if onload is present. More...
 
uint64_t otherThread_CPUMask
 The auxiliary threads affinity mask. More...
 
uint64_t process_CPUMask
 The affinity mask assigned to the process. More...
 
pthread_key_t pthread_specific_store
 The thread local storage used by the platform. More...
 
int realtimePrio_
 The realtime priority level that is used by the critical threads in the application. More...
 
char redirectStdinToLog
 Writes the stdin stream to the log. More...
 
uint64_t systemFreq
 The rdtsc frequency. More...
 
double systemFreqRatio
 The rdtsc ticks per nanosecond. More...
 
char TCPCmdShell_Enable
 Enables the TCP command shell. More...
 
int TCPCmdShell_Port
 The TCP listen port of the command shell. More...
 
char TCPCmdShell_RestrictToLocalhost
 Allows the TCP command shell connections from the localhost only. More...
 
bool useTSC
 Use rdtsc in get_nanosec() flag. More...
 

Detailed Description

Platform configuration parameters.

See Also
g_platformProps the global configuration.

Constructor & Destructor Documentation

PlatformProps::PlatformProps ( )

The constructor.

Sets default values.

Member Function Documentation

PlatformProps::_Pragma ( "pack(1)"  )
PlatformProps::_Pragma ( "pack()"  )
void PlatformProps::exitHandler ( )
inline

Runs exit handler callback.

It is invoked by the platform when the signal (Linux: SIGTERM,SIGINT; Windows: CTRL_C,CTRL_BREAK,other) is received.

See Also
initHandlers(traceOnFaults, traceOnAbort, traceOnSigUSR2) Linux.
initHandlers() Windows.

References exitHandlerCB.

void PlatformProps::initDone_LoggerThread ( )
inline

Sets the logger thread is initialized flag.

It is invoked by the platform when the logger thread is ready.

See Also
launch_logger_thread()

References init_LoggerThread.

bool PlatformProps::isAppInitializing ( )
inline

Returns true if the user application is initializing.

It is invoked by the platform.

See Also
appStatusPtr

References appStatusPtr, and AppStatus::initializing.

bool PlatformProps::isAppTerminating ( )
inline

Returns true if the user application is terminating.

It is invoked by the platform.

See Also
appStatusPtr

References appStatusPtr, and AppStatus::terminating.

void PlatformProps::set_loglevel ( enum PlatformLogLevel  level)
inline

Sets the current log level for the platform logging functions.

Parameters
levelthe lowest log level allowed, e.g. LOG_LEVEL_ERROR enables error + fatal + always
See Also
sockets_logging.h

References logLevel.

Member Data Documentation

AppStatus PlatformProps::appStatus

The default AppStatus instance.

volatile AppStatus* PlatformProps::appStatusPtr

The pointer to the AppStatus instance.

The pointer can be used by the user application to notify the platform about the user application status. It is initialized by the default AppStatus instance address.

Referenced by isAppInitializing(), and isAppTerminating().

char PlatformProps::canUseTSC

Allows the use rdtsc if possible, the result is in the useTSC flag after the initialization.

char PlatformProps::CmdShell_logConsoleEnabled

Writes log messages to the console and the TCP command shell.

char PlatformProps::CmdShell_showLogInCmdShell

Shows log messages in the console command shell.

char PlatformProps::dumpPacketData

Writes the data received from the socket to the log.

Utils::Log::LogCategory* PlatformProps::engineLog

The log category for the platform logging functions.

See Also
platform_initialize()
EXIT_HANDLER_CB PlatformProps::exitHandlerCB

The exit handler callback.

It is invoked by the platform when the signal (Linux: SIGTERM,SIGINT; Windows: CTRL_C,CTRL_BREAK,other) is received.

See Also
initHandlers(traceOnFaults, traceOnAbort, traceOnSigUSR2) Linux.
initHandlers() Windows.

Referenced by exitHandler().

char PlatformProps::fixEnginePropsFilename[255]

The path to the engine.properties file.

It is not used by the engine.

NanosTimeConvertStatic* PlatformProps::g_nanosCvt

The time converter to convert nanoseconds to AbsoluteSystemTime.

Referenced by get_currentTimeUsec1970().

HANDLE_CMD_CB PlatformProps::handleCmdCB

The command handler callback of the command shell.

It is invoked by the platform when a command is received.

See Also
platform_initialize()
volatile int PlatformProps::init_LoggerThread

Is true (non-zero) when the logger thread is initialized.

Referenced by initDone_LoggerThread().

int PlatformProps::init_on_start

Is true (non-zero) if the initialize_on_start() function was called.

uint64_t PlatformProps::logger_CPUMask

The async logger thread affinity mask.

See Also
launch_logger_thread()
char PlatformProps::loggerUseNanosecTimer

Sets use get_nanosec() for log messages timestamps.

enum PlatformLogLevel PlatformProps::logLevel

The current log level for the platform logging functions.

Referenced by set_loglevel().

char PlatformProps::onloadIsPresent

This flag is set by the platform to true if onload is present.

uint64_t PlatformProps::otherThread_CPUMask

The auxiliary threads affinity mask.

It is not used by the engine.

uint64_t PlatformProps::process_CPUMask

The affinity mask assigned to the process.

It is not used by the engine.

pthread_key_t PlatformProps::pthread_specific_store

The thread local storage used by the platform.

Referenced by get_thread_specific_store().

int PlatformProps::realtimePrio_

The realtime priority level that is used by the critical threads in the application.

It is not used by the engine.

char PlatformProps::redirectStdinToLog

Writes the stdin stream to the log.

uint64_t PlatformProps::systemFreq

The rdtsc frequency.

double PlatformProps::systemFreqRatio

The rdtsc ticks per nanosecond.

char PlatformProps::TCPCmdShell_Enable

Enables the TCP command shell.

int PlatformProps::TCPCmdShell_Port

The TCP listen port of the command shell.

char PlatformProps::TCPCmdShell_RestrictToLocalhost

Allows the TCP command shell connections from the localhost only.

bool PlatformProps::useTSC

Use rdtsc in get_nanosec() flag.

Shouldn't be set directly but via canUseTSC flag.

See Also
initialize_on_start(timeCalibrationCPUMask, assignCPUMaskAfterCalib)

Referenced by get_currentTimeUsec1970().