cisst-saw
|
Base class for high level objects. More...
#include <cmnGenericObject.h>
Public Member Functions | |
virtual | ~cmnGenericObject (void) |
virtual const cmnClassServicesBase * | Services (void) const =0 |
bool | ReconstructFrom (const cmnGenericObject &other) |
std::string | ToString (void) const |
virtual void | ToStream (std::ostream &outputStream) const |
virtual void | ToStreamRaw (std::ostream &outputStream, const char delimiter= ' ', bool headerOnly=false, const std::string &headerPrefix="") const |
virtual bool | FromStreamRaw (std::istream &inputStream, const char delimiter= ' ') |
virtual void | SerializeRaw (std::ostream &outputStream) const |
virtual void | DeSerializeRaw (std::istream &inputStream) |
virtual cmnLogger::StreamBufType * | GetLogMultiplexer (void) const |
virtual size_t | ScalarNumber (void) const |
virtual bool | ScalarNumberIsFixed (void) const |
virtual double | Scalar (const size_t CMN_UNUSED(index)) const throw (std::out_of_range) |
virtual std::string | ScalarDescription (const size_t CMN_UNUSED(index), const std::string &CMN_UNUSED(userDescription)) const |
Base class for high level objects.
|
inlinevirtual |
Destructor. Does nothing specific.
|
virtual |
De-serialize the content of the object without any extra information, i.e. no class type nor format version.
Reimplemented in mtsGenericObjectProxyRef< _elementType >, mtsGenericObjectProxy< _elementType >, mtsGenericObjectProxy< double >, mtsGenericObjectProxy< std::string >, mtsGenericObjectProxy< float >, mtsGenericObjectProxy< int >, mtsGenericObjectProxy< bool >, svlSampleImageCustom< _ValueType, _DataChannels, _VideoChannels >, svlSampleImageCustom< float, 3, 1 >, svlSampleImageCustom< unsigned char, 3, 1 >, prmPositionCartesianSet, prmVelocityCartesianSet, prmFixtureGainCartesianSet, svlSampleMatrixCustom< _ValueType >, svlSampleMatrixCustom< float >, mtsStateIndex, mtsIntervalStatistics, prmActuatorState, mtsGenericObject, mtsMatrix< _elementType >, mtsMatrix< double >, prmMaskedVector< _elementType >, cmnGenericObjectProxy< _elementType >, prmGainParameters, mtsVector< _elementType >, mtsVector< double >, mtsVector< short >, mtsVector< unsigned char >, mtsVector< bool >, mtsSocketProxyInitData, mtsStealthTool, prmVelocityCartesianGet, prmVelocityJointSet, mtsFixedSizeVector< _elementType, _size >, mtsLogMessage, prmIMUSensors, prmStateJoint, prmMotionBase, prmPositionJointSet, prmForceCartesianSet, prmVelocityJointGet, mtsConnection, prmForceCartesianGet, prmPositionCartesianGet, prmActuatorParameters, prmEventButton, prmForceTorqueJointSet, prmPositionJointGet, mtsStealthTool, mtsComponentConstructorNameAndArg< T >, prmRobotState, mtsEventHandlerList, svlSampleCameraGeometry, mtsQtApplicationConstructorArg, mtsSocketProxyServerConstructorArg, ireTaskConstructorArg, mtsSocketProxyClientConstructorArg, mtsTaskPeriodicConstructorArg, svlSampleImage, mtsTaskContinuousConstructorArg, svlSampleMatrix, svlSampleBlobs, svlSampleTargets, svlSampleText, svlSampleTransform3D, svlSample, and svlSampleCUDAImage.
|
virtual |
Read from an unformatted text input (e.g., one created by ToStreamRaw). Returns true if successful.
Reimplemented in mtsGenericObjectProxyRef< _elementType >, mtsGenericObjectProxy< _elementType >, mtsGenericObjectProxy< double >, mtsGenericObjectProxy< std::string >, mtsGenericObjectProxy< float >, mtsGenericObjectProxy< int >, mtsGenericObjectProxy< bool >, mtsGenericObject, mtsSocketProxyInitData, mtsComponentConstructorNameAndArg< T >, mtsQtApplicationConstructorArg, mtsSocketProxyServerConstructorArg, ireTaskConstructorArg, mtsSocketProxyClientConstructorArg, mtsTaskPeriodicConstructorArg, and mtsTaskContinuousConstructorArg.
|
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.
Reimplemented in mtsComponent.
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.
|
inlinevirtual |
Return the index-th (zero-based) value of data typecasted to double. Note that this method will throw an exception of type std::outputStream if the index exceeds the number of scalars.
|
inlinevirtual |
Return the name of index-th (zero-based) data typecasted to double. As for the Scalar, this method will throw an exception of type std::out_of_range if the index exceeds the number of scalar.
|
inlinevirtual |
Methods for data visualization. Derived classes should override the following methods in order to be properly processed by the data visualizer of the global component manager.
Return a number of data (which can be visualized, i.e., type-casted to double)
Reimplemented in prmFixtureGainCartesianSet, mtsGenericObject, prmIMUSensors, prmStateJoint, prmPositionCartesianGet, and prmPositionJointGet.
|
inlinevirtual |
Indicates if this object has a fixed number of scalars. This is used for arrays of object in order to optimize random access for a given scalar. When defining an object with a fixed number of scalars, overloading this method to return true allows some optimizations.
Reimplemented in prmFixtureGainCartesianSet, mtsGenericObject, prmIMUSensors, prmStateJoint, prmPositionCartesianGet, and prmPositionJointGet.
|
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 mtsGenericObjectProxyRef< _elementType >, mtsGenericObjectProxy< _elementType >, mtsGenericObjectProxy< double >, mtsGenericObjectProxy< std::string >, mtsGenericObjectProxy< float >, mtsGenericObjectProxy< int >, mtsGenericObjectProxy< bool >, svlSampleImageCustom< _ValueType, _DataChannels, _VideoChannels >, svlSampleImageCustom< float, 3, 1 >, svlSampleImageCustom< unsigned char, 3, 1 >, prmPositionCartesianSet, prmVelocityCartesianSet, prmFixtureGainCartesianSet, svlSampleMatrixCustom< _ValueType >, svlSampleMatrixCustom< float >, mtsStateIndex, mtsIntervalStatistics, prmActuatorState, mtsGenericObject, mtsMatrix< _elementType >, mtsMatrix< double >, cmnGenericObjectProxy< _elementType >, prmMaskedVector< _elementType >, mtsSocketProxyInitData, mtsStealthTool, mtsVector< _elementType >, mtsVector< double >, mtsVector< short >, mtsVector< unsigned char >, mtsVector< bool >, mtsLogMessage, prmVelocityCartesianGet, prmVelocityJointSet, prmGainParameters, prmIMUSensors, mtsFixedSizeVector< _elementType, _size >, prmStateJoint, prmMotionBase, prmPositionJointSet, prmForceCartesianSet, prmVelocityJointGet, mtsConnection, prmForceCartesianGet, prmPositionCartesianGet, prmPositionJointGet, prmActuatorParameters, prmEventButton, prmForceTorqueJointSet, mtsStealthTool, mtsEventHandlerList, svlSampleCameraGeometry, prmRobotState, mtsComponentConstructorNameAndArg< T >, mtsQtApplicationConstructorArg, mtsSocketProxyServerConstructorArg, ireTaskConstructorArg, mtsSocketProxyClientConstructorArg, mtsTaskPeriodicConstructorArg, svlSampleImage, mtsTaskContinuousConstructorArg, svlSampleMatrix, svlSampleBlobs, svlSampleTargets, svlSampleText, svlSampleTransform3D, svlSample, and svlSampleCUDAImage.
|
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.
Implemented in mtsGenericObjectProxyBase< _elementType >, mtsGenericObjectProxyBase< double >, mtsGenericObjectProxyBase< std::string >, mtsGenericObjectProxyBase< float >, mtsGenericObjectProxyBase< int >, and mtsGenericObjectProxyBase< bool >.
|
virtual |
The default ToStream method returns the name of the class. This method must be overloaded to provide a useful message.
Reimplemented in mtsManagerLocal, mtsGenericObjectProxyRef< _elementType >, mtsInterfaceProvided, mtsComponent, mtsStateTable, mtsGenericObjectProxy< _elementType >, mtsGenericObjectProxy< double >, mtsGenericObjectProxy< std::string >, mtsGenericObjectProxy< float >, mtsGenericObjectProxy< int >, mtsGenericObjectProxy< bool >, mtsInterfaceRequired, mtsStealthProbeCal, prmFixtureGainCartesianSet, mtsStealthRegistration, mtsStealthProbeCal, cmnPath, mtsStealthFrame, mtsStateIndex, mtsStealthRegistration, prmActuatorState, cmnGenericObjectProxy< _elementType >, mtsIntervalStatistics, mtsGenericObject, mtsSocketProxyInitData, mtsHistory< _elementType >, prmMaskedVector< _elementType >, mtsStealthTool, mtsStealthFrame, mtsLogMessage, mtsMatrix< _elementType >, mtsMatrix< double >, prmIMUSensors, prmStateJoint, prmVelocityCartesianGet, mtsVector< _elementType >, mtsVector< double >, mtsVector< short >, mtsVector< unsigned char >, mtsVector< bool >, prmGainParameters, mtsComponentConstructorNameAndArg< T >, mtsConnection, mtsFixedSizeVector< _elementType, _size >, prmPositionCartesianGet, prmPositionJointGet, prmForceCartesianSet, prmVelocityJointGet, prmForceCartesianGet, mtsStealthTool, mtsEventHandlerList, mtsQtApplicationConstructorArg, prmEventButton, mtsSocketProxyServerConstructorArg, ireTaskConstructorArg, prmRobotState, mtsSocketProxyClientConstructorArg, mtsTaskPeriodicConstructorArg, and mtsTaskContinuousConstructorArg.
|
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 mtsGenericObjectProxyRef< _elementType >, mtsGenericObjectProxy< _elementType >, mtsGenericObjectProxy< double >, mtsGenericObjectProxy< std::string >, mtsGenericObjectProxy< float >, mtsGenericObjectProxy< int >, mtsGenericObjectProxy< bool >, mtsStealthProbeCal, prmFixtureGainCartesianSet, mtsStealthRegistration, mtsStealthProbeCal, mtsStealthFrame, mtsStateIndex, mtsStealthRegistration, mtsIntervalStatistics, mtsGenericObject, mtsSocketProxyInitData, mtsHistory< _elementType >, mtsStealthTool, mtsStealthFrame, mtsMatrix< _elementType >, mtsMatrix< double >, prmIMUSensors, mtsVector< _elementType >, mtsVector< double >, mtsVector< short >, mtsVector< unsigned char >, mtsVector< bool >, prmVelocityCartesianGet, prmStateJoint, mtsFixedSizeVector< _elementType, _size >, mtsComponentConstructorNameAndArg< T >, mtsStateTable::IndexRange, prmPositionCartesianGet, prmForceCartesianSet, prmVelocityJointGet, prmPositionJointGet, prmForceCartesianGet, mtsStealthTool, mtsQtApplicationConstructorArg, prmEventButton, mtsSocketProxyServerConstructorArg, ireTaskConstructorArg, mtsSocketProxyClientConstructorArg, mtsTaskPeriodicConstructorArg, and mtsTaskContinuousConstructorArg.
std::string cmnGenericObject::ToString | ( | void | ) | const |
Formatted IO to a string. This method relies on ToStream which should be overloaded for each class.