FARGOS/VISTA Object Management Environment Core  ..
FARGOS/VISTA Object Management Environment Core Table of Contents
OMEprofileCounter< NUMTYPE > Class Template Reference

Base class for application profiling counters or numerical system information. More...

#include <OMEdebugInfo.h>

+ Inheritance diagram for OMEprofileCounter< NUMTYPE >:

Public Member Functions

 OMEprofileCounter (const char *varName, NUMTYPE initVal=0, SharedMemoryVariableManager *mgr=&DEFAULT_sharedMemoryVariableManager) NONNULL_CLASS_PARAMETERS(2)
 Initialize a counter with a potentially external source. More...
 
 OMEprofileCounter (const char *varName, SharedMemoryVariableNode *parentNode, NUMTYPE initVal=0) NONNULL_CLASS_PARAMETERS(2)
 Initialize a counter with a constant value. More...
 
virtual ~OMEprofileCounter ()
 
virtual const char * getName (uint_fast32_t *retNameLen=nullptr) const override
 Return name of statistics variable. More...
 
OMEprofileCounter< NUMTYPE > & operator= (const NUMTYPE v)
 
virtual const OMEtype getValue () const override
 Retrieve the variable's value. More...
 
virtual void setValue (const OMEtype &newV) override
 Set the variable's value. More...
 
virtual void incValue (NUMTYPE amt=1)
 A convenience function to increment a counter. More...
 
- Public Member Functions inherited from OMEprofileRecord
 OMEprofileRecord ()
 
virtual ~OMEprofileRecord ()
 
- Public Member Functions inherited from SMV_StandaloneNumeric< NUMTYPE >
 SMV_StandaloneNumeric (const char *varName, SharedMemoryVariableManager *mgr=&DEFAULT_sharedMemoryVariableManager, NUMTYPE initVal=0) NONNULL_CLASS_PARAMETERS(2)
 
 SMV_StandaloneNumeric (const char *varName, SharedMemoryVariableNode *parentNode, NUMTYPE initVal=0)
 
 operator NUMTYPE () const OME_ALWAYS_INLINE
 Cast operator for a numeric shared memory variable. More...
 
NUMTYPE * getAddress () const OME_ALWAYS_INLINE
 Get address of shared memory variable. More...
 
 operator const NUMTYPE * () const OME_ALWAYS_INLINE
 Cast operator for a pointer to a numeric shared memory variable. More...
 
NUMTYPE & operator= (const NUMTYPE arg) OME_ALWAYS_INLINE
 Assignment operator for a numeric shared memory variable. More...
 
NUMTYPE & operator+= (const NUMTYPE arg) OME_ALWAYS_INLINE
 Addition operator for a numeric shared memory variable. More...
 
NUMTYPE & operator-= (const NUMTYPE arg) OME_ALWAYS_INLINE
 Subtraction operator for a numeric shared memory variable. More...
 
NUMTYPE & operator*= (const NUMTYPE arg) OME_ALWAYS_INLINE
 Multiplication operator for a numeric shared memory variable. More...
 
NUMTYPE & operator/= (const NUMTYPE arg) OME_ALWAYS_INLINE
 Division operator for a numeric shared memory variable. More...
 
NUMTYPE & operator++ () OME_ALWAYS_INLINE
 Prefix increment operator for a numeric shared memory variable. More...
 
NUMTYPE & operator-- () OME_ALWAYS_INLINE
 Prefix decrement operator for a numeric shared memory variable. More...
 
NUMTYPE operator++ (int) OME_ALWAYS_INLINE
 Postfix increment operator for a numeric shared memory variable. More...
 
NUMTYPE operator-- (int) OME_ALWAYS_INLINE
 Postfix decrement operator for a numeric shared memory variable. More...
 
virtual void noteNowRegistered (SharedMemoryVariable_Record *newArea) override
 Extension mechanism to allow derived classes to be informed when they are about to be assigned storage; called at most once per lifetime of object. More...
 
- Public Member Functions inherited from SharedMemoryVariable
SharedMemoryVariableNodegetParentNode () const
 
SharedMemoryVariableManagergetVariableManager () const
 
unsigned int getType () const OME_ALWAYS_INLINE
 Return type of variable, see SharedMemoryVariableType. More...
 
unsigned int getMinLength () const OME_ALWAYS_INLINE
 Return minimum number of bytes required for variable record. More...
 
const char * getName (uint_fast32_t *retNameLen=nullptr) const OME_ALWAYS_INLINE
 Get variable name. More...
 
int setName (const char *newName)
 Set new variable name. More...
 
uint_fast32_t getFullName (char *bfr, uint_fast32_t bfrLen) const
 Get full path name of variable. More...
 
 SharedMemoryVariable (class SharedMemoryVariableManager *mgr, const char *varName, int varType, size_t length)
 Construct an shared memory variable and attach to the indicated manager for the collection of variables. More...
 
 SharedMemoryVariable (class SharedMemoryVariableNode *parentNode, const char *varName, int varType, size_t length)
 
virtual ~SharedMemoryVariable ()
 
void makeAliasFor (SharedMemoryVariable *v)
 

Additional Inherited Members

- Public Types inherited from SharedMemoryVariable
enum  SharedMemoryVariableType {
  SMV_TYPE_NONE =0, SMV_TYPE_UNSIGNED =1, SMV_TYPE_LARGE =2, SMV_TYPE_INT32 =4,
  SMV_TYPE_UINT32 =SMV_TYPE_INT32|SMV_TYPE_UNSIGNED, SMV_TYPE_INT64 =SMV_TYPE_INT32|SMV_TYPE_LARGE, SMV_TYPE_UINT64 =SMV_TYPE_INT64|SMV_TYPE_UNSIGNED, SMV_TYPE_FLOAT =8,
  SMV_TYPE_DOUBLE =SMV_TYPE_FLOAT|SMV_TYPE_LARGE, SMV_TYPE_FIXED =SMV_TYPE_FLOAT|SMV_TYPE_UNSIGNED, SMV_TYPE_TINY_STRING =16, SMV_TYPE_TINY_BINARY_STRING =SMV_TYPE_TINY_STRING|SMV_TYPE_UNSIGNED,
  SMV_TYPE_STRING =SMV_TYPE_TINY_STRING|SMV_TYPE_LARGE, SMV_TYPE_BINARY_STRING =SMV_TYPE_STRING|SMV_TYPE_UNSIGNED, SMV_TYPE_NAME_NODE =32
}
 
enum  { SMV_DISPLAY_NAME =1, SMV_DISPLAY_VALUE =2, SMV_DISPLAY_TYPE =4, SMV_DISPLAY_EQUALS =8 }
 
- Static Public Member Functions inherited from OMEprofileRecord
static OMEarraylistDefinedCounters ()
 Get a list of all available information variables. More...
 
static OMEassocgetCounters ()
 Get a snapshot of all counters. More...
 
static const OMEtype getValueOfCounter (const char *name) NONNULL_PARAMETERS(1)
 Return the value of an named variable. More...
 
template<typename STREAMTYPE >
static STREAMTYPE & outputCounters (STREAMTYPE &o)
 Write a counter's value to an output stream. More...
 
- Static Public Member Functions inherited from SharedMemoryVariable
static const char * typeName (unsigned int t) OME_CONST_FUNCTION
 Return type as text string. More...
 
- Static Protected Member Functions inherited from OMEprofileRecord
static void addToList (OMEprofileRecord *rec)
 
static void removeFromList (OMEprofileRecord *recToRemove)
 
- Protected Attributes inherited from OMEprofileRecord
OMEprofileRecordnext
 
- Protected Attributes inherited from SMV_StandaloneNumeric< NUMTYPE >
SharedMemoryVariable::SharedMemoryVariable_Record initialCopy
 
- Protected Attributes inherited from SharedMemoryVariable
SharedMemoryVariable_RecorddataPointer
 
class SharedMemoryVariableNodeparentNodeRecord
 
class SharedMemoryVariableManagervariableManager
 
const char * variableName
 
uint32_t minLength
 
unsigned char dataType
 
unsigned char registered
 
unsigned char _pad1 [2]
 
- Static Protected Attributes inherited from OMEprofileRecord
static OMEprofileRecordstartOfList
 
- Static Protected Attributes inherited from SharedMemoryVariable
static SharedMemoryVariable_Record unallocated_data
 

Detailed Description

template<typename NUMTYPE>
class OMEprofileCounter< NUMTYPE >

Base class for application profiling counters or numerical system information.

The OMEprofileCounter class enables arbitrary performance and informative data to be made available to management applications. Each variable should be assigned a unique text name to enable its identification.

Constructor & Destructor Documentation

◆ OMEprofileCounter() [1/2]

template<typename NUMTYPE >
OMEprofileCounter< NUMTYPE >::OMEprofileCounter ( const char *  varName,
NUMTYPE  initVal = 0,
SharedMemoryVariableManager mgr = &DEFAULT_sharedMemoryVariableManager 
)
inlineexplicit

Initialize a counter with a potentially external source.

Parameters
varNameis a pointer to a null-terminated C string that identifies the name of the variable.
initValis the initial value of the counter.
mgrpoints to the manager for the shared memory segment exposing the counter.

◆ OMEprofileCounter() [2/2]

template<typename NUMTYPE >
OMEprofileCounter< NUMTYPE >::OMEprofileCounter ( const char *  varName,
SharedMemoryVariableNode parentNode,
NUMTYPE  initVal = 0 
)
inlineexplicit

Initialize a counter with a constant value.

Parameters
varNameis a pointer to a null-terminated C string that identifies the name of the variable.
parentNodepoints to the parent node used to name the variable.
initValprovides the initial value of the variable.

◆ ~OMEprofileCounter()

template<typename NUMTYPE >
virtual OMEprofileCounter< NUMTYPE >::~OMEprofileCounter ( )
inlinevirtual

Member Function Documentation

◆ getName()

template<typename NUMTYPE >
OMEprofileCounter< NUMTYPE >::getName ( uint_fast32_t *  retNameLen = nullptr) const
inlineoverridevirtual

Return name of statistics variable.

Returns
A pointer to a null-terminated C string that identifies the variable.

Implements OMEprofileRecord.

◆ getValue()

template<typename NUMTYPE >
OMEprofileCounter< NUMTYPE >::getValue ( ) const
inlineoverridevirtual

Retrieve the variable's value.

Returns
A read-only reference to an OMEtype that holds the value of the variable.

Implements OMEprofileRecord.

◆ incValue()

template<typename NUMTYPE >
virtual void OMEprofileCounter< NUMTYPE >::incValue ( NUMTYPE  amt = 1)
inlinevirtual

A convenience function to increment a counter.

Note
only makes sense if the counter holds an integer value.

◆ operator=()

template<typename NUMTYPE >
OMEprofileCounter<NUMTYPE>& OMEprofileCounter< NUMTYPE >::operator= ( const NUMTYPE  v)
inline

◆ setValue()

template<typename NUMTYPE >
OMEprofileCounter< NUMTYPE >::setValue ( const OMEtype newV)
inlineoverridevirtual

Set the variable's value.

Parameters
newVis an reference to an OMEtype that holds the new value to be saved.

Implements OMEprofileRecord.


The documentation for this class was generated from the following files:
Generated: Fri Jul 31 2020 18:19:16
Support Information