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

Convenience class for string variables that can be also be used if a shared memory segment is never attached. More...

#include <shared_variable.hpp>

+ Inheritance diagram for SMV_StandaloneString< MAXLEN >:

Public Member Functions

 SMV_StandaloneString (const char *varName, SharedMemoryVariableManager *mgr=&DEFAULT_sharedMemoryVariableManager)
 
 SMV_StandaloneString (const char *varName, SharedMemoryVariableNode *parentNode)
 
 operator const char * () const OME_ALWAYS_INLINE
 Cast operator for a shared memory string variable. More...
 
char * operator= (const char *val) OME_ALWAYS_INLINE
 Assignment operator into a shared memory string 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

union {
   SharedMemoryVariable::SharedMemoryVariable_Record   initialCopy
 
   char   reservedSpace [MAXLEN+sizeof(SharedMemoryVariable::SharedMemoryVariable_Record)]
 
space
 
- 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<size_t MAXLEN>
class SMV_StandaloneString< MAXLEN >

Convenience class for string variables that can be also be used if a shared memory segment is never attached.

Parameters
MAXLENspecifies the maximum length of the string.
Note
This implementation is templated to eliminate the need for any heap access. Users should minimize the number of distinct sizes in play to prevent a possible explosion of implementation routines.

Constructor & Destructor Documentation

◆ SMV_StandaloneString() [1/2]

template<size_t MAXLEN>
SMV_StandaloneString< MAXLEN >::SMV_StandaloneString ( const char *  varName,
SharedMemoryVariableManager mgr = &DEFAULT_sharedMemoryVariableManager 
)
inlineexplicit

◆ SMV_StandaloneString() [2/2]

template<size_t MAXLEN>
SMV_StandaloneString< MAXLEN >::SMV_StandaloneString ( const char *  varName,
SharedMemoryVariableNode parentNode 
)
inline

Member Function Documentation

◆ noteNowRegistered()

template<size_t MAXLEN>
virtual void SMV_StandaloneString< MAXLEN >::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 char *()

template<size_t MAXLEN>
SMV_StandaloneString< MAXLEN >::operator const char * ( ) const
inline

Cast operator for a shared memory string variable.

◆ operator=()

template<size_t MAXLEN>
char* SMV_StandaloneString< MAXLEN >::operator= ( const char *  val)
inline

Assignment operator into a shared memory string variable.

Member Data Documentation

◆ initialCopy

template<size_t MAXLEN>
SharedMemoryVariable::SharedMemoryVariable_Record SMV_StandaloneString< MAXLEN >::initialCopy

◆ reservedSpace

template<size_t MAXLEN>
char SMV_StandaloneString< MAXLEN >::reservedSpace[MAXLEN+sizeof(SharedMemoryVariable::SharedMemoryVariable_Record)]

◆ space

union { ... } SMV_StandaloneString< MAXLEN >::space

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