FARGOS/VISTA Object Management Environment Core  ..
FARGOS/VISTA Object Management Environment Core Table of Contents
SharedMemoryVariable Class Reference

Shared memory variable which allows statistics and operational controls to be exposed to other processes with minimal runtime overhead. More...

#include <shared_variable.hpp>

+ Inheritance diagram for SharedMemoryVariable:

Classes

struct  SharedMemoryVariable_Record
 Storage layout for shared memory variable record within a memory mapped segment. More...
 

Public Types

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 }
 

Public Member Functions

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 ()
 
virtual void noteNowRegistered (SharedMemoryVariable_Record *newArea)
 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...
 
void makeAliasFor (SharedMemoryVariable *v)
 

Static Public Member Functions

static const char * typeName (unsigned int t) OME_CONST_FUNCTION
 Return type as text string. More...
 

Protected Attributes

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

static SharedMemoryVariable_Record unallocated_data
 

Friends

class SharedMemoryVariableManager
 

Detailed Description

Shared memory variable which allows statistics and operational controls to be exposed to other processes with minimal runtime overhead.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
SMV_DISPLAY_NAME 
SMV_DISPLAY_VALUE 
SMV_DISPLAY_TYPE 
SMV_DISPLAY_EQUALS 

◆ SharedMemoryVariableType

Enumerator
SMV_TYPE_NONE 
SMV_TYPE_UNSIGNED 
SMV_TYPE_LARGE 
SMV_TYPE_INT32 
SMV_TYPE_UINT32 
SMV_TYPE_INT64 
SMV_TYPE_UINT64 
SMV_TYPE_FLOAT 
SMV_TYPE_DOUBLE 
SMV_TYPE_FIXED 
SMV_TYPE_TINY_STRING 
SMV_TYPE_TINY_BINARY_STRING 
SMV_TYPE_STRING 
SMV_TYPE_BINARY_STRING 
SMV_TYPE_NAME_NODE 

Constructor & Destructor Documentation

◆ SharedMemoryVariable() [1/2]

SharedMemoryVariable::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.

References dataPointer, dataType, l, length(), minLength, OME_EXPECT_TRUE, parentNodeRecord, registered, SharedMemoryVariableManager::registerVariable(), variableManager, and variableName.

◆ SharedMemoryVariable() [2/2]

SharedMemoryVariable::SharedMemoryVariable ( class SharedMemoryVariableNode parentNode,
const char *  varName,
int  varType,
size_t  length 
)

◆ ~SharedMemoryVariable()

SharedMemoryVariable::~SharedMemoryVariable ( )
virtual

Member Function Documentation

◆ getFullName()

uint_fast32_t SharedMemoryVariable::getFullName ( char *  bfr,
uint_fast32_t  bfrLen 
) const

Get full path name of variable.

References getName(), and parentNodeRecord.

◆ getMinLength()

unsigned int SharedMemoryVariable::getMinLength ( ) const
inline

Return minimum number of bytes required for variable record.

References minLength.

Referenced by SharedMemoryVariableManager::allocateVariable().

◆ getName()

◆ getParentNode()

SharedMemoryVariableNode* SharedMemoryVariable::getParentNode ( ) const
inline

References parentNodeRecord.

◆ getType()

unsigned int SharedMemoryVariable::getType ( ) const
inline

Return type of variable, see SharedMemoryVariableType.

References dataType.

Referenced by SharedMemoryVariableManager::allocateVariable().

◆ getVariableManager()

SharedMemoryVariableManager* SharedMemoryVariable::getVariableManager ( ) const
inline

References variableManager.

Referenced by SharedMemoryVariable().

◆ makeAliasFor()

void SharedMemoryVariable::makeAliasFor ( SharedMemoryVariable v)
inline

References dataPointer.

◆ noteNowRegistered()

virtual void SharedMemoryVariable::noteNowRegistered ( SharedMemoryVariable_Record newArea)
inlinevirtual

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 in SMV_StandaloneString< MAXLEN >, SMV_StandaloneString< 128 >, SMV_StandaloneNumeric< NUMTYPE >, SMV_StandaloneNumeric< uint32_t >, SMV_StandaloneNumeric< int32_t >, and SMV_StandaloneNumeric< uint64_t >.

Referenced by SharedMemoryVariableManager::allocateVariable().

◆ setName()

◆ typeName()

const char * SharedMemoryVariable::typeName ( unsigned int  t)
static

Friends And Related Function Documentation

◆ SharedMemoryVariableManager

friend class SharedMemoryVariableManager
friend

Member Data Documentation

◆ _pad1

unsigned char SharedMemoryVariable::_pad1[2]
protected

◆ dataPointer

◆ dataType

unsigned char SharedMemoryVariable::dataType
protected

Referenced by getType(), and SharedMemoryVariable().

◆ minLength

uint32_t SharedMemoryVariable::minLength
protected

◆ parentNodeRecord

class SharedMemoryVariableNode* SharedMemoryVariable::parentNodeRecord
protected

◆ registered

◆ unallocated_data

SharedMemoryVariable_Record SharedMemoryVariable::unallocated_data
staticprotected

◆ variableManager

◆ variableName

const char* SharedMemoryVariable::variableName
protected

The documentation for this class was generated from the following files:
Generated: Tue Jul 28 2020 16:03:27
Support Information