solarpowerlog trunk
Registry Class Reference

#include <Registry.h>

Collaboration diagram for Registry:

List of all members.

Public Member Functions

bool LoadConfig (std::string name)
IInverterBaseGetInverter (const string &name) const
void AddInverter (const IInverterBase *inverter)

Static Public Member Functions

static RegistryInstance ()
static libconfig::Config * Configuration ()
static ILoggerGetMainLogger (void)
static CWorkSchedulerGetMainScheduler (void)

Protected Member Functions

 Registry ()
virtual ~Registry ()

Friends

class CConfigHelper

Detailed Description

The Registry stores some information needed by several program parts. It also provides a global WorkScheduler.

The Registry is a Singleton.

See also:
The Configuration Concept
The Object Register

Definition at line 129 of file Registry.h.


Constructor & Destructor Documentation

Registry::Registry ( ) [protected]

singleton: no object generation

constructor for the registry.

Definition at line 49 of file Registry.cpp.

Registry::~Registry ( ) [protected, virtual]

destructor

Definition at line 135 of file Registry.cpp.


Member Function Documentation

void Registry::AddInverter ( const IInverterBase inverter)

Add the a new created inveter/logger to the object database

Note:
: This function is only for the bootstrap process!

Definition at line 128 of file Registry.cpp.

static libconfig::Config* Registry::Configuration ( ) [inline, static]

Shortcut to get the configuration.

Please note, that it must be config_loaded beforehand. (but if coding for solarpowerlog, this will be done early in the startup phase, so one can expect a valid object here.

Definition at line 149 of file Registry.h.

Here is the call graph for this function:

IInverterBase * Registry::GetInverter ( const string &  name) const

search for an inverter/logger object with the object name

Parameters:
nameof the object
Returns:
Pointer to the object or NULL if not found.

Definition at line 116 of file Registry.cpp.

static ILogger& Registry::GetMainLogger ( void  ) [inline, static]

Definition at line 154 of file Registry.h.

Here is the call graph for this function:

static CWorkScheduler* Registry::GetMainScheduler ( void  ) [inline, static]

Get the main scheduler to scheule work...

Returns:
pointer to the scheduler

Definition at line 241 of file Registry.h.

Here is the call graph for this function:

static Registry& Registry::Instance ( ) [inline, static]

return the static, global object of the registry.

Definition at line 136 of file Registry.h.

bool Registry::LoadConfig ( std::string  name)

(re)load configuration file

Just brings it in memory... The old one will be deleted.

Parameters:
[in]nameFilename to load
Returns:
false on error, true on success.

Definition at line 56 of file Registry.cpp.


Friends And Related Function Documentation

friend class CConfigHelper [friend]

Definition at line 133 of file Registry.h.


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