6#ifndef _cisstMultiTask_mtsComponentState_h
7#define _cisstMultiTask_mtsComponentState_h
67static std::string EnumToString(
const Enum & value)
CISST_THROW(std::runtime_error);
68static Enum EnumFromString(
const std::string & value)
CISST_THROW(std::runtime_error);
97 bool operator < (
const ThisType & state)
const;
98 bool operator <= (
const ThisType & state)
const;
112 void ToStreamRaw(std::ostream & outputStream,
const char delimiter =
' ',
113 bool headerOnly =
false,
const std::string & headerPrefix =
"")
const;
117 void SerializeBinary(std::ostream & outputStream)
const CISST_THROW(std::runtime_error);
119 void SerializeText(std::ostream & outputStream,
const char delimiter =
',') const
CISST_THROW(
std::runtime_error);
121 void DeSerializeText(
std::istream & inputStream, const
char delimiter =
',')
CISST_THROW(
std::runtime_error);
125 double Scalar(const
size_t index) const
CISST_THROW(
std::out_of_range);
126 std::
string ScalarDescription(const
size_t index, const
std::
string & userDescription =
"") const
CISST_THROW(
std::out_of_range);
128 void SerializeTextJSON(Json::Value & jsonValue)
const;
129 void DeSerializeTextJSON(
const Json::Value & jsonValue)
CISST_THROW(std::runtime_error);
153 data.SerializeBinary(outputStream);
156 data.DeSerializeBinary(inputStream, localFormat, remoteFormat);
159 data.SerializeText(outputStream, delimiter);
162 data.DeSerializeText(inputStream, delimiter);
174 return data.ScalarDescription(index, userDescription);
177 return data.Scalar(index);
181 outputStream << cmnData<mtsComponentState >::HumanReadable(data);
static void DeSerializeText(DataType &data, std::istream &inputStream, const char delimiter=',') CISST_THROW(std
Definition mtsComponentState.h:161
static bool ScalarNumberIsFixed(const DataType &data)
Definition mtsComponentState.h:167
mtsComponentState DataType
Definition mtsComponentState.h:145
static void Copy(DataType &data, const DataType &source)
Definition mtsComponentState.h:146
static size_t ScalarNumber(const DataType &data)
Definition mtsComponentState.h:170
static std::string HumanReadable(const DataType &data)
Definition mtsComponentState.h:164
static std::string ScalarDescription(const DataType &data, const size_t index, const std::string &userDescription="") CISST_THROW(std
Definition mtsComponentState.h:173
static std::string SerializeDescription(const DataType &data, const char delimiter, const std::string &userDescription)
Definition mtsComponentState.h:149
static void SerializeText(const DataType &data, std::ostream &outputStream, const char delimiter=',') CISST_THROW(std
Definition mtsComponentState.h:158
@ IS_SPECIALIZED
Definition mtsComponentState.h:144
static void SerializeBinary(const DataType &data, std::ostream &outputStream) CISST_THROW(std
Definition mtsComponentState.h:152
static double Scalar(const DataType &data, const size_t index) CISST_THROW(std
Definition mtsComponentState.h:176
static void DeSerializeBinary(DataType &data, std::istream &inputStream, const cmnDataFormat &localFormat, const cmnDataFormat &remoteFormat) CISST_THROW(std
Definition mtsComponentState.h:155
Definition cmnDataFunctions.h:51
Definition mtsComponentState.h:34
void SetState(const mtsComponentState::Enum &newValue)
Enum
Definition mtsComponentState.h:66
@ READY
Definition mtsComponentState.h:66
@ ACTIVE
Definition mtsComponentState.h:66
@ FINISHED
Definition mtsComponentState.h:66
@ INITIALIZING
Definition mtsComponentState.h:66
@ FINISHING
Definition mtsComponentState.h:66
@ CONSTRUCTED
Definition mtsComponentState.h:66
bool ScalarNumberIsFixed(void) const
void SerializeBinary(std::ostream &outputStream) const CISST_THROW(std void DeSerializeBinary(std::istream &inputStream, const cmnDataFormat &localFormat, const cmnDataFormat &remoteFormat) CISST_THROW(std void SerializeText(std::ostream &outputStream, const char delimiter=',') const CISST_THROW(std std::string SerializeDescription(const char delimiter=',', const std::string &userDescription="") const
Definition mtsComponentState.h:120
void SerializeRaw(std::ostream &outputStream) const
void GetState(mtsComponentState::Enum &placeHolder) const
void DeSerializeText(std::istream &inputStream, const char delimiter=',') CISST_THROW(std std::string HumanReadable(void) const
Definition mtsComponentState.h:122
void ToStreamRaw(std::ostream &outputStream, const char delimiter=' ', bool headerOnly=false, const std::string &headerPrefix="") const
size_t ScalarNumber(void) const
mtsComponentState ThisType
Definition mtsComponentState.h:86
void DeSerializeRaw(std::istream &inputStream)
mtsComponentState::Enum mState
Definition mtsComponentState.h:73
mtsComponentState::Enum & State(void)
mtsComponentState::Enum GetState(void) const
Definition mtsComponentState.h:79
void ToStream(std::ostream &outputStream) const
void Copy(const mtsComponentState &source)
static std::string static EnumToString(const Enum &value) CISST_THROW(std Enum static EnumFromString(const std::string &value) CISST_THROW(std const std::vector< int > & EnumVectorInt(void)
Definition mtsComponentState.h:69
const mtsComponentState::Enum & State(void) const
mtsComponentState(const mtsComponentState &other)
mtsComponentState(const mtsComponentState::Enum &newState)
static const std::vector< std::string > & EnumVectorString(void)
Definition mtsGenericObjectProxy.h:376
Class registration macros.
#define CMN_DECLARE_SERVICES_INSTANTIATION(className)
Definition cmnClassRegisterMacros.h:199
Defines cmnClassServices.
#define CMN_DECLARE_DATA_FUNCTIONS_JSON_FOR_ENUM(_enum)
Definition cmnDataFunctionsEnumMacros.h:97
#define CMN_DATA_SPECIALIZATION_FOR_ENUM_USER_HUMAN_READABLE(_enum, _promotedType, _humanReadableFunction)
Definition cmnDataFunctionsEnumMacros.h:26
void cmnDeSerializeRaw(std::istream &inputStream, _elementType &data) CISST_THROW(std
Definition cmnDeSerializer.h:82
#define CISST_EXPORT
Definition cmnExportMacros.h:50
#define CISST_THROW(exceptionParameter)
Somewhat portable compilation warning message. This works with very recent versions of gcc (4....
Definition cmnPortability.h:559
void cmnSerializeRaw(std::ostream &outputStream, const _elementType &data) CISST_THROW(std
Definition cmnSerializer.h:76
mtsGenericObjectProxy< mtsComponentState > mtsComponentStateProxy
Definition mtsComponentState.h:135
std::string CISST_EXPORT cmnDataHumanReadable_mtsComponentState_Enum(const mtsComponentState::Enum &data)
std::ostream & operator<<(std::ostream &outputStream, const mtsComponentState &data)
Definition mtsComponentState.h:180
Forward declarations and #define for cisstMultiTask.
bool operator==(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
Definition vctDynamicConstMatrixBase.h:715
bool operator!=(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
Definition vctDynamicConstMatrixBase.h:743
ThisType & operator=(const vctDynamicConstMatrixBase< __matrixOwnerType, __elementType > &otherMatrix)
Definition vctDynamicMatrix.h:255