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

Convenience template for creating shared memory variables of one of the supported numeric types. At the cost of additional storage, these standalone variables can operate when the variable has not been registered and allocated with a SharedMemoryVariableManager. More...

#include <shared_variable.hpp>

+ Inheritance diagram for SMV_StandaloneNumeric< NUMTYPE >:

Public Member Functions

 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)
 

Protected Attributes

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]
 

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 SharedMemoryVariable
static const char * typeName (unsigned int t) OME_CONST_FUNCTION
 Return type as text string. More...
 
- Static Protected Attributes inherited from SharedMemoryVariable
static SharedMemoryVariable_Record unallocated_data
 

Detailed Description

template<typename NUMTYPE>
class SMV_StandaloneNumeric< NUMTYPE >

Convenience template for creating shared memory variables of one of the supported numeric types. At the cost of additional storage, these standalone variables can operate when the variable has not been registered and allocated with a SharedMemoryVariableManager.

Constructor & Destructor Documentation

◆ SMV_StandaloneNumeric() [1/2]

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

◆ SMV_StandaloneNumeric() [2/2]

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

Member Function Documentation

◆ getAddress()

template<typename NUMTYPE >
NUMTYPE* SMV_StandaloneNumeric< NUMTYPE >::getAddress ( ) const
inline

Get address of shared memory variable.

Referenced by OMEinitDebugFlag(), and OMEsetDebugFlag().

◆ noteNowRegistered()

template<typename NUMTYPE >
virtual void SMV_StandaloneNumeric< NUMTYPE >::noteNowRegistered ( SharedMemoryVariable_Record newArea)
inlineoverridevirtual

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.

Reimplemented from SharedMemoryVariable.

◆ operator const NUMTYPE *()

template<typename NUMTYPE >
SMV_StandaloneNumeric< NUMTYPE >::operator const NUMTYPE * ( ) const
inlineexplicit

Cast operator for a pointer to a numeric shared memory variable.

◆ operator NUMTYPE()

template<typename NUMTYPE >
SMV_StandaloneNumeric< NUMTYPE >::operator NUMTYPE ( ) const
inline

Cast operator for a numeric shared memory variable.

◆ operator*=()

template<typename NUMTYPE >
NUMTYPE& SMV_StandaloneNumeric< NUMTYPE >::operator*= ( const NUMTYPE  arg)
inline

Multiplication operator for a numeric shared memory variable.

◆ operator++() [1/2]

template<typename NUMTYPE >
NUMTYPE& SMV_StandaloneNumeric< NUMTYPE >::operator++ ( )
inline

Prefix increment operator for a numeric shared memory variable.

◆ operator++() [2/2]

template<typename NUMTYPE >
NUMTYPE SMV_StandaloneNumeric< NUMTYPE >::operator++ ( int  )
inline

Postfix increment operator for a numeric shared memory variable.

◆ operator+=()

template<typename NUMTYPE >
NUMTYPE& SMV_StandaloneNumeric< NUMTYPE >::operator+= ( const NUMTYPE  arg)
inline

Addition operator for a numeric shared memory variable.

◆ operator--() [1/2]

template<typename NUMTYPE >
NUMTYPE& SMV_StandaloneNumeric< NUMTYPE >::operator-- ( )
inline

Prefix decrement operator for a numeric shared memory variable.

◆ operator--() [2/2]

template<typename NUMTYPE >
NUMTYPE SMV_StandaloneNumeric< NUMTYPE >::operator-- ( int  )
inline

Postfix decrement operator for a numeric shared memory variable.

◆ operator-=()

template<typename NUMTYPE >
NUMTYPE& SMV_StandaloneNumeric< NUMTYPE >::operator-= ( const NUMTYPE  arg)
inline

Subtraction operator for a numeric shared memory variable.

◆ operator/=()

template<typename NUMTYPE >
NUMTYPE& SMV_StandaloneNumeric< NUMTYPE >::operator/= ( const NUMTYPE  arg)
inline

Division operator for a numeric shared memory variable.

◆ operator=()

template<typename NUMTYPE >
NUMTYPE& SMV_StandaloneNumeric< NUMTYPE >::operator= ( const NUMTYPE  arg)
inline

Assignment operator for a numeric shared memory variable.

Member Data Documentation

◆ initialCopy


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