EMANE  1.2.1
EMANE::StatisticRegistrar Class Referenceabstract

The StatisticRegistrar allows NEM layers to register statistics and statistic tables. Statistics and Statistic tables are owned by the emulator framework and a borrowed reference is returned to the registering NEM layer. More...

#include <statisticregistrar.h>

Inheritance diagram for EMANE::StatisticRegistrar:
EMANE::StatisticRegistrarProxy

Public Member Functions

virtual ~StatisticRegistrar ()
 
template<typename T >
StatisticNumeric< T > * registerNumeric (const std::string &sName, const StatisticProperties &properties=StatisticProperties::NONE, const std::string &sDescription="")
 
template<typename T >
StatisticNonNumeric< T > * registerNonNumeric (const std::string &sName, const StatisticProperties &properties=StatisticProperties::NONE, const std::string &sDescription="")
 
template<typename Key , typename Compare = std::less<EMANE::Any>, std::size_t scolumn = 0>
StatisticTable< Key, Compare, scolumn > * registerTable (const std::string &sName, const StatisticTableLabels &labels, const StatisticProperties &properties=StatisticProperties::NONE, const std::string &sDescription="")
 
template<typename Key , typename Function , typename Compare = std::less<EMANE::Any>, std::size_t scolumn = 0>
StatisticTable< Key, Compare, scolumn > * registerTable (const std::string &sName, const StatisticTableLabels &labels, Function clearFunc, const std::string &sDescription="")
 
template<typename T >
EMANE::StatisticNumeric< T > * registerNumeric (const std::string &sName, const StatisticProperties &properties, const std::string &sDescription)
 
template<typename T >
EMANE::StatisticNonNumeric< T > * registerNonNumeric (const std::string &sName, const StatisticProperties &properties, const std::string &sDescription)
 
template<typename Key , typename Compare , std::size_t scolumn>
EMANE::StatisticTable< Key, Compare, scolumn > * registerTable (const std::string &sName, const StatisticTableLabels &labels, const StatisticProperties &properties, const std::string &sDescription)
 
template<typename Key , typename Function , typename Compare , std::size_t scolumn>
EMANE::StatisticTable< Key, Compare, scolumn > * registerTable (const std::string &sName, const StatisticTableLabels &labels, Function clearFunc, const std::string &sDescription)
 

Protected Member Functions

virtual void registerStatistic (const std::string &sName, Any::Type type, const StatisticProperties &properties, const std::string &sDescription, Statistic *pStatistic)=0
 
virtual void registerTablePublisher (const std::string &sName, const StatisticProperties &properties, const std::string &sDescription, StatisticTablePublisher *pStatiticTablePublisher, std::function< void(StatisticTablePublisher *p)> clearFunc)=0
 

Detailed Description

The StatisticRegistrar allows NEM layers to register statistics and statistic tables. Statistics and Statistic tables are owned by the emulator framework and a borrowed reference is returned to the registering NEM layer.

Note
Registration may only occur during Component::initialize()

Definition at line 59 of file statisticregistrar.h.

Constructor & Destructor Documentation

◆ ~StatisticRegistrar()

virtual EMANE::StatisticRegistrar::~StatisticRegistrar ( )
inlinevirtual

Destroys an instance

Definition at line 65 of file statisticregistrar.h.

Member Function Documentation

◆ registerNonNumeric() [1/2]

template<typename T >
EMANE::StatisticNonNumeric<T>* EMANE::StatisticRegistrar::registerNonNumeric ( const std::string &  sName,
const StatisticProperties properties,
const std::string &  sDescription 
)

Definition at line 58 of file statisticregistrar.inl.

◆ registerNonNumeric() [2/2]

template<typename T >
StatisticNonNumeric<T>* EMANE::StatisticRegistrar::registerNonNumeric ( const std::string &  sName,
const StatisticProperties properties = StatisticProperties::NONE,
const std::string &  sDescription = "" 
)

Register a non-numeric statistic. The registered statistic is owned by the StatisticRegistrar.

Parameters
sNameName of the statistic
propertiesStatistic properties
sDescriptionStatistic description
Returns
A borrowed reference to the statistic that may be used during the lifetime of the registered component.
Exceptions
RegistrarExceptionwhen a error occurs during registration.

◆ registerNumeric() [1/2]

template<typename T >
EMANE::StatisticNumeric<T>* EMANE::StatisticRegistrar::registerNumeric ( const std::string &  sName,
const StatisticProperties properties,
const std::string &  sDescription 
)

Definition at line 37 of file statisticregistrar.inl.

◆ registerNumeric() [2/2]

template<typename T >
StatisticNumeric<T>* EMANE::StatisticRegistrar::registerNumeric ( const std::string &  sName,
const StatisticProperties properties = StatisticProperties::NONE,
const std::string &  sDescription = "" 
)

Register a numeric statistic. The registered statistic is owned by the StatisticRegistrar.

Parameters
sNameName of the statistic
propertiesStatistic properties
sDescriptionStatistic description
Returns
A borrowed reference to the statistic that may be used during the lifetime of the registered component.
Exceptions
RegistrarExceptionwhen a error occurs during registration.

◆ registerStatistic()

virtual void EMANE::StatisticRegistrar::registerStatistic ( const std::string &  sName,
Any::Type  type,
const StatisticProperties properties,
const std::string &  sDescription,
Statistic pStatistic 
)
protectedpure virtual

Register a statistic and take ownership

Parameters
sNameName of the statistic
typeAny type of the statistic
propertiesStatistic propertied
sDescriptionStatistic description
pStatisticPointer to the statistic
Exceptions
RegistrarExceptionwhen a error occurs during registration.

◆ registerTable() [1/4]

template<typename Key , typename Compare , std::size_t scolumn>
EMANE::StatisticTable<Key,Compare,scolumn>* EMANE::StatisticRegistrar::registerTable ( const std::string &  sName,
const StatisticTableLabels labels,
const StatisticProperties properties,
const std::string &  sDescription 
)

Definition at line 77 of file statisticregistrar.inl.

◆ registerTable() [2/4]

template<typename Key , typename Function , typename Compare , std::size_t scolumn>
EMANE::StatisticTable<Key,Compare,scolumn>* EMANE::StatisticRegistrar::registerTable ( const std::string &  sName,
const StatisticTableLabels labels,
Function  clearFunc,
const std::string &  sDescription 
)

Definition at line 100 of file statisticregistrar.inl.

◆ registerTable() [3/4]

template<typename Key , typename Compare = std::less<EMANE::Any>, std::size_t scolumn = 0>
StatisticTable<Key,Compare,scolumn>* EMANE::StatisticRegistrar::registerTable ( const std::string &  sName,
const StatisticTableLabels labels,
const StatisticProperties properties = StatisticProperties::NONE,
const std::string &  sDescription = "" 
)

Register a statistic table. The registered statistic table is owned by the StatisticRegistrar.

Template Parameters
KeyType of the keys. Each row in the table is uniquely identified by its key value
CompareA binary predicate that takes two element keys as arguments and returns a bool
scolumnThe column used when sorting the table using Compare
Parameters
sNameName of the statistic table
labelsTable column labels
propertiesTable properties
sDescriptionStatistic table description
Returns
A borrowed reference to the statistic table that may be used during the lifetime of the registered component.
Exceptions
RegistrarExceptionwhen a error occurs during registration.

◆ registerTable() [4/4]

template<typename Key , typename Function , typename Compare = std::less<EMANE::Any>, std::size_t scolumn = 0>
StatisticTable<Key,Compare,scolumn>* EMANE::StatisticRegistrar::registerTable ( const std::string &  sName,
const StatisticTableLabels labels,
Function  clearFunc,
const std::string &  sDescription = "" 
)

Register a statistic table. The registered statistic table is owned by the StatisticRegistrar.

Template Parameters
KeyType of the keys. Each row in the table is uniquely identified by its key value
FunctionA function that takes a pointer to the statistic table and that is called when the table is cleared
CompareA binary predicate that takes two element keys as arguments and returns a bool
scolumnThe column used when sorting the table using Compare
Parameters
sNameName of the statistic table
labelsTable column labels
clearFuncFunction called when table clear is requested
sDescriptionStatistic table description
Returns
A borrowed reference to the statistic table that may be used during the lifetime of the registered component.
Exceptions
RegistrarExceptionwhen a error occurs during registration.
Note
The specified clear function is called on an internal emulator framework thread a synchronization object will most likely me needed to avoid race conditions. The function is responsible for clearing the statistic table.

◆ registerTablePublisher()

virtual void EMANE::StatisticRegistrar::registerTablePublisher ( const std::string &  sName,
const StatisticProperties properties,
const std::string &  sDescription,
StatisticTablePublisher pStatiticTablePublisher,
std::function< void(StatisticTablePublisher *p)>  clearFunc 
)
protectedpure virtual

Register a statistic table publisher and take ownership

Parameters
sNameName of the statistic table
propertiesTable properties
sDescriptionStatistic table description
pStatiticTablePublisherPointer to the statistic table publisher
clearFuncFunction called when table clear is requested
Exceptions
RegistrarExceptionwhen a error occurs during registration.

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