ERC CISST - cisst software

cmnGenericObject Class Reference
[Common Tools]

#include <cmnGenericObject.h>

Inheritance diagram for cmnGenericObject:

Inheritance graph
[legend]
List of all members.

Detailed Description

Base class for high level objects.

See also:
cmnClassRegister cmnClassServiceBase

Definition at line 51 of file cmnGenericObject.h.

Public Member Functions


Constructor & Destructor Documentation

virtual cmnGenericObject::~cmnGenericObject ( void   )  [inline, virtual]

Destructor. Does nothing specific.

Definition at line 55 of file cmnGenericObject.h.


Member Function Documentation

virtual const cmnClassServicesBase* cmnGenericObject::Services ( void   )  const [pure virtual]

Pure virtual method to access the class services. The derived classes should always declare and implement this method using the macros CMN_DECLARE_SERVICES, CMN_DECLARE_SERVICES_INSTANTIATION and CMN_IMPLEMENT_SERVICES. In NO WAY, a user should redefine/overload this method otherwise.

Returns:
A pointer on the class services. This points to the unique instance of cmnClassServiceBase for a given class.
See also:
cmnClassRegister cmnClassServiceBase

Referenced by mtsStateArray< mtsGenericObjectProxyFinalType >::Create(), mtsCommandQualifiedReadBase::GetArgument1ClassServices(), mtsCommandQualifiedReadBase::GetArgument2ClassServices(), mtsCommandWriteBase::GetArgumentClassServices(), mtsCommandWriteGeneric< _classType >::mtsCommandWriteGeneric(), mtsObjectName(), mtsQueueGeneric::mtsQueueGeneric(), mtsQueueGeneric::Put(), cmnNamedMap< _elementType >::SetOwner(), mtsQueueGeneric::SetSize(), mtsCommandWrite< _classType, _argumentType >::ToStream(), and mtsCommandQualifiedRead< _classType, _argument1Type, _argument2Type >::ToStream().

bool cmnGenericObject::ReconstructFrom ( const cmnGenericObject other  ) 

Use the placement new with the copy constructor to re-construct this object based on an existing one. This method will call the destructor to free any memory allocated by the previous constructor. It is important to note that the memory allocated for the object itself is not freed/re-allocated and therefore the object's address remains valid.

An object of the same type, if the types (class derived from cmnGenericObject) don't correspond the method will return false and will not call the destructor and copy constructor.

Returns:
false if the object other is not of the right type.

std::string cmnGenericObject::ToString ( void   )  const

Formatted IO to a string. This method relies on ToStream which should be overloaded for each class.

Reimplemented in prmGainParameters, prmMaskedVector< _elementType >, mtsFixedSizeVector< _elementType, _size >, mtsHistory< _elementType >, mtsMatrix< _elementType >, and mtsVector< _elementType >.

Referenced by mtsProxySerializer::Serialize().

virtual void cmnGenericObject::ToStream ( std::ostream &  outputStream  )  const [virtual]

The default ToStream method returns the name of the class. This method must be overloaded to provide a useful message.

Reimplemented in prmActuatorState, prmEventButton, prmForceCartesianGet, prmForceCartesianSet, prmGainParameters, prmMaskedVector< _elementType >, prmPositionCartesianGet, prmPositionJointGet, prmRobotState, prmVelocityCartesianGet, prmVelocityJointGet, mtsComponent, mtsFixedSizeVector< _elementType, _size >, mtsGenericObject, mtsGenericObjectProxy< _elementType >, mtsGenericObjectProxyRef< _elementType >, mtsHistory< _elementType >, mtsInterfaceProvided, mtsInterfaceRequired, mtsIntervalStatistics, mtsManagerLocal, mtsMatrix< _elementType >, mtsDescriptionComponent, mtsDescriptionInterface, mtsDescriptionConnection, mtsComponentStatusControl, mtsComponentStateChange, mtsStateIndex, mtsStateTable, mtsTask, mtsVector< _elementType >, cmnGenericObjectProxy< _elementType >, and cmnPath.

Referenced by operator<<().

virtual void cmnGenericObject::ToStreamRaw ( std::ostream &  outputStream,
const char  delimiter = ' ',
bool  headerOnly = false,
const std::string &  headerPrefix = "" 
) const [virtual]

Unformatted text output. Delimiter can be used to create CSV data files if the object requires multiple values (e.g. vector, matrix, ). When headerOnly is set to true, the method should create a label for each value (e.g. v1, v2, v3). The prefix can be used to generated a more useful label (e.g. position-v1)

Reimplemented in prmEventButton, prmForceCartesianGet, prmForceCartesianSet, prmPositionCartesianGet, prmPositionJointGet, prmVelocityCartesianGet, prmVelocityJointGet, mtsFixedSizeVector< _elementType, _size >, mtsGenericObject, mtsGenericObjectProxy< _elementType >, mtsGenericObjectProxyRef< _elementType >, mtsHistory< _elementType >, mtsIntervalStatistics, mtsMatrix< _elementType >, mtsStateIndex, mtsStateTable::IndexRange, and mtsVector< _elementType >.

virtual bool cmnGenericObject::FromStreamRaw ( std::istream &  inputStream,
const char  delimiter = ' ' 
) [virtual]

Read from an unformatted text input (e.g., one created by ToStreamRaw). Returns true if successful.

virtual void cmnGenericObject::SerializeRaw ( std::ostream &  outputStream  )  const [virtual]

Serialize the content of the object without any extra information, i.e. no class type nor format version. The "receiver" is supposed to already know what to expect.

Reimplemented in svlSample, svlSampleImage, svlSampleImageCustom< _ValueType, _DataChannels, _VideoChannels >, svlSampleMatrix, svlSampleMatrixCustom< _ValueType >, svlSampleTargets, svlSampleText, svlSampleTransform3D, prmEventButton, prmForceCartesianGet, prmForceCartesianSet, prmPositionCartesianGet, prmPositionJointGet, prmVelocityCartesianGet, prmVelocityJointGet, mtsFixedSizeVector< _elementType, _size >, mtsGenericObject, mtsGenericObjectProxy< _elementType >, mtsGenericObjectProxyRef< _elementType >, mtsIntervalStatistics, mtsMatrix< _elementType >, mtsDescriptionComponent, mtsDescriptionInterface, mtsDescriptionConnection, mtsComponentStatusControl, mtsComponentStateChange, mtsStateIndex, mtsVector< _elementType >, and cmnGenericObjectProxy< _elementType >.

virtual void cmnGenericObject::DeSerializeRaw ( std::istream &  inputStream  )  [virtual]

De-serialize the content of the object without any extra information, i.e. no class type nor format version.

Reimplemented in svlSample, svlSampleImage, svlSampleImageCustom< _ValueType, _DataChannels, _VideoChannels >, svlSampleMatrix, svlSampleMatrixCustom< _ValueType >, svlSampleTargets, svlSampleText, svlSampleTransform3D, prmEventButton, prmForceCartesianGet, prmForceCartesianSet, prmPositionCartesianGet, prmPositionJointGet, prmVelocityCartesianGet, prmVelocityJointGet, mtsFixedSizeVector< _elementType, _size >, mtsGenericObject, mtsGenericObjectProxy< _elementType >, mtsGenericObjectProxyRef< _elementType >, mtsIntervalStatistics, mtsMatrix< _elementType >, mtsDescriptionComponent, mtsDescriptionInterface, mtsDescriptionConnection, mtsComponentStatusControl, mtsComponentStateChange, mtsStateIndex, mtsVector< _elementType >, and cmnGenericObjectProxy< _elementType >.

virtual cmnLogger::StreamBufType* cmnGenericObject::GetLogMultiplexer ( void   )  const [virtual]

Get the multiplexer to use for logging. This is used by the macro CMN_LOG_CLASS to determine the log destination. By default, it uses cmnLogger. This method can be overloaded to define a log file/stream per object.


The documentation for this class was generated from the following file:
erc-cisst-devel<at>lists.johnshopkins.edu