libhomegear-base  0.7
Base library for Homegear and Homegear family modules.
BaseLib::SharedObjects Class Reference

This is the base library main class. More...

#include <BaseLib.h>

Public Member Functions

 SharedObjects (const SharedObjects &)=delete
 
SharedObjectsoperator= (const SharedObjects &)=delete
 
int64_t getStartTime ()
 Return the time of the creation of the object (the Homegear start time). More...
 
void setStartTime (int64_t time)
 Set the start time. More...
 
 SharedObjects (bool testMaxThreadCount=false)
 Main constructor. More...
 
virtual ~SharedObjects ()
 Destructor. More...
 

Static Public Member Functions

static std::string version ()
 Returns the Homegear version. More...
 

Public Attributes

int32_t debugLevel = 3
 The current debug level for logging. More...
 
uid_t userId = 0
 
gid_t groupId = 0
 
std::atomic_bool booting {true}
 True when Homegear is still starting. More...
 
std::atomic_bool shuttingDown {false}
 True when Homegear received signal 15. More...
 
std::atomic_bool slaveMode {false}
 True when Homegear runs in slave mode of a master/slave installation. More...
 
std::atomic_bool maintenanceMode {false}
 True when maintenance mode is enabled. More...
 
FileDescriptorManager fileDescriptorManager
 The FileDescriptorManager object where all file or socket descriptors should be registered. More...
 
SerialDeviceManager serialDeviceManager
 The serial device manager can be used to access one serial device across multiple modules. More...
 
Settings settings
 The main.conf settings. More...
 
std::shared_ptr< Database::IDatabaseControllerdb
 Provides database access. More...
 
uint32_t rpcPort = 0
 Port, the non-ssl RPC server listens on. More...
 
Systems::UpdateInfo deviceUpdateInfo
 Object to store information about running updates and to only allow one update at a time. More...
 
HelperFunctions hf
 Functions to ease your life for a lot of standard operations. More...
 
Io io
 Functions for io operations. More...
 
Output out
 The main output object to print text to the standard and error output. More...
 
ThreadManager threadManager
 The thread manager. More...
 
Systems::GlobalServiceMessages globalServiceMessages
 Global service messages. More...
 
std::shared_ptr< Hgdchgdc
 Homegear Daisy Chain. More...
 

Static Public Attributes

static sigset_t defaultSignalMask
 Default signal mask. More...
 

Detailed Description

This is the base library main class.

It is used to share objects and data between all modules and the main program.

Constructor & Destructor Documentation

§ SharedObjects() [1/2]

BaseLib::SharedObjects::SharedObjects ( const SharedObjects )
delete

§ SharedObjects() [2/2]

BaseLib::SharedObjects::SharedObjects ( bool  testMaxThreadCount = false)
explicit

Main constructor.

Parameters
testMaxThreadCountIf set to "true", the library tests the maximum number of threads possible. This takes some time. This is only relevant when using the thread manager.

§ ~SharedObjects()

BaseLib::SharedObjects::~SharedObjects ( )
virtual

Destructor.

Member Function Documentation

§ getStartTime()

int64_t BaseLib::SharedObjects::getStartTime ( )

Return the time of the creation of the object (the Homegear start time).

Returns
The unix epoch time in milliseconds.

§ operator=()

SharedObjects& BaseLib::SharedObjects::operator= ( const SharedObjects )
delete

§ setStartTime()

void BaseLib::SharedObjects::setStartTime ( int64_t  time)

Set the start time.

§ version()

std::string BaseLib::SharedObjects::version ( )
static

Returns the Homegear version.

Returns
The Homegear version string.

Member Data Documentation

§ booting

std::atomic_bool BaseLib::SharedObjects::booting {true}

True when Homegear is still starting.

It is set to false, when start up is complete and isOpen() of all interfaces is "true" (plus 30 seconds).

§ db

std::shared_ptr<Database::IDatabaseController> BaseLib::SharedObjects::db

Provides database access.

§ debugLevel

int32_t BaseLib::SharedObjects::debugLevel = 3

The current debug level for logging.

§ defaultSignalMask

sigset_t BaseLib::SharedObjects::defaultSignalMask
static

Default signal mask.

§ deviceUpdateInfo

Systems::UpdateInfo BaseLib::SharedObjects::deviceUpdateInfo

Object to store information about running updates and to only allow one update at a time.

§ fileDescriptorManager

FileDescriptorManager BaseLib::SharedObjects::fileDescriptorManager

The FileDescriptorManager object where all file or socket descriptors should be registered.

This should be done to avoid errors as it can happen, that a closed file descriptor is reopened and suddenly valid again without the object using the old descriptor noticing it.

§ globalServiceMessages

Systems::GlobalServiceMessages BaseLib::SharedObjects::globalServiceMessages

Global service messages.

§ groupId

gid_t BaseLib::SharedObjects::groupId = 0

§ hf

HelperFunctions BaseLib::SharedObjects::hf

Functions to ease your life for a lot of standard operations.

As all methods are static, this variable is only kept for backwards compatibility.

§ hgdc

std::shared_ptr<Hgdc> BaseLib::SharedObjects::hgdc

Homegear Daisy Chain.

§ io

Io BaseLib::SharedObjects::io

Functions for io operations.

§ maintenanceMode

std::atomic_bool BaseLib::SharedObjects::maintenanceMode {false}

True when maintenance mode is enabled.

§ out

Output BaseLib::SharedObjects::out

The main output object to print text to the standard and error output.

§ rpcPort

uint32_t BaseLib::SharedObjects::rpcPort = 0

Port, the non-ssl RPC server listens on.

§ serialDeviceManager

SerialDeviceManager BaseLib::SharedObjects::serialDeviceManager

The serial device manager can be used to access one serial device across multiple modules.

§ settings

Settings BaseLib::SharedObjects::settings

The main.conf settings.

§ shuttingDown

std::atomic_bool BaseLib::SharedObjects::shuttingDown {false}

True when Homegear received signal 15.

§ slaveMode

std::atomic_bool BaseLib::SharedObjects::slaveMode {false}

True when Homegear runs in slave mode of a master/slave installation.

§ threadManager

ThreadManager BaseLib::SharedObjects::threadManager

The thread manager.

§ userId

uid_t BaseLib::SharedObjects::userId = 0

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