FREEDM DGI
Static Public Member Functions | Private Types | Static Private Member Functions | Static Private Attributes | List of all members
freedm::broker::CTimings Class Reference

#include <CTimings.hpp>

Static Public Member Functions

static unsigned int Get (const std::string param)
 Returns the value of the specified timing parameter. More...
 
static void SetTimings (const std::string timingsFile)
 Loads timings values from the specified file. More...
 

Private Types

typedef std::map< std::string, unsigned int > TimingMap
 Typedef for timing datastore. More...
 
typedef TimingMap::iterator TimingMapIterator
 Typedef for timing datastore iterator. More...
 

Static Private Member Functions

static void RegisterTimingValue (po::options_description &, const std::string param)
 Adds individual parameter to the expected options. More...
 
static void TimingParameters (po::options_description &opts)
 Registers all the expected timing parameters. More...
 

Static Private Attributes

static TimingMap timing_values
 Data store for the timing parameter values. More...
 

Member Typedef Documentation

typedef std::map<std::string, unsigned int> freedm::broker::CTimings::TimingMap
private
typedef TimingMap::iterator freedm::broker::CTimings::TimingMapIterator
private

Member Function Documentation

unsigned int freedm::broker::CTimings::Get ( const std::string  param)
static

CTimings::Get

Description:
Returns the value of the specified timing parameter, in milliseconds, or throws an exception if the timing parameter does not exist in the timings set.
Precondition:
None
Postcondition:
Throws exception if timing parameter has not been registered.
Returns
The requested timing parameter in ms.
void freedm::broker::CTimings::RegisterTimingValue ( po::options_description &  opts,
const std::string  param 
)
staticprivate

CTimings::RegisterTimingValue

Description:
Registers a timing parameter with the configuration file parser.
Precondition:
None
Postcondition:
The configuration file parser expects a new parameter when loading the file. The timing value for the parameter is defaulted to zero.
Parameters
optsThe options parser that will parse the timings config
paramthe name of the timing parameter being added.
void freedm::broker::CTimings::SetTimings ( const std::string  timingsFile)
static

CTimings::SetTimings

Description:
Loads the specified timing configuration file and sets all the timing values from that file. If a timing value is missing from that file, an exception is thrown.
Precondition:
None
Postcondition:
The timings values are loaded from the specified file, or an exception is thrown because the file was missing one or more timing parameters.
Parameters
timingsFileThe name of the file that contains the timings config.
void freedm::broker::CTimings::TimingParameters ( po::options_description &  opts)
staticprivate

CTimings::TimingParameters

Description:
Registers all the expected timing values with the configuration file loader. If a programmer needs to add timing values, they should make additional calls to RegisterTimingValue in this function, which will add their value to the DGI.
Precondition:
None
Postcondition:
The program options have been modified to include the new timings options added by this function
Parameters
optsThe program options, configuration file processor, that will be used to load this values.

Member Data Documentation

CTimings::TimingMap freedm::broker::CTimings::timing_values
staticprivate

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