![](/media/cache/profiles/94aef38441efa3380a3bed3faf1f9d5d.50x50_q85.jpg)
Diff: RTno/BasicDataType.h
- Revision:
- 0:b14546a3cfab
- Child:
- 1:b96a6ff9bb6f
diff -r 000000000000 -r b14546a3cfab RTno/BasicDataType.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RTno/BasicDataType.h Fri Jul 29 11:23:06 2011 +0000 @@ -0,0 +1,165 @@ +/******************************************* + * BasicDataType.h + * @author Yuki Suga + * @copyright Yuki Suga (ysuga.net) Nov, 10th, 2010. + * @license LGPLv3 + *****************************************/ + +#ifndef BASIC_DATA_TYPE_HEADER_INCLUDED +#define BASIC_DATA_TYPE_HEADER_INCLUDED + +#include "SequenceDataType.h" +#include "SequenceOctet.h" +#include "SequenceChar.h" +#include "SequenceBoolean.h" +#include "SequenceLong.h" +#include "SequenceDouble.h" +#include "SequenceFloat.h" +/* +typedef struct __Time__ { + long sec; + long usec; +}Time; +*/ + +class TimedData { +public: + virtual void* GetBuffer() { + return 0; + } +}; + +class TimedBoolean : public TimedData { +public: + char data; + virtual void* GetBuffer() { + return &data; + } + const static char typecode = 'b'; +}; + +class TimedChar : public TimedData { +public: + char data; + virtual void* GetBuffer() { + return &data; + } + const static char typecode = 'c'; +}; + +class TimedOctet : public TimedData { +public: + char data; + virtual void* GetBuffer() { + return &data; + } + const static char typecode = 'o'; +}; + +class TimedLong : public TimedData { + // Time timestamp; +public: + long data; + virtual void* GetBuffer() { + return &data; + } + const static char typecode = 'l'; +}; + +class TimedDouble : public TimedData { +// Time timestamp; +public: + double data; + virtual void* GetBuffer() { + return &data; + } + const static char typecode = 'd'; +}; + +class TimedFloat : public TimedData { + // unsigned char length; +public: + float data; + virtual void* GetBuffer() { + return &data; + } + const static char typecode = 'f'; +}; + +class TimedDataSeq { +public: + virtual SequenceDataType* GetBuffer() { + return 0; + } +}; + +class TimedOctetSeq : public TimedDataSeq { + // Time timestamp; + // long length; +public: + SequenceOctet data; + virtual SequenceDataType* GetBuffer() { + return &data; + } + const static char typecode = 'O'; +}; + +class TimedCharSeq : public TimedDataSeq { + // Time timestamp; + // long length; +public: + SequenceChar data; + virtual SequenceDataType* GetBuffer() { + return &data; + } + const static char typecode = 'C'; +}; + +class TimedBooleanSeq : public TimedDataSeq { + // Time timestamp; + // long length; +public: + SequenceBoolean data; + virtual SequenceDataType* GetBuffer() { + return &data; + } + const static char typecode = 'B'; +}; + +class TimedLongSeq : public TimedDataSeq { + // Time timestamp; + // long length; +public: + SequenceLong data; + virtual SequenceDataType* GetBuffer() { + return &data; + } + const static char typecode = 'L'; +}; + +class TimedFloatSeq : public TimedDataSeq { + // Time timestamp; + // long length; + // float* data; +public: + SequenceFloat data; + virtual SequenceDataType* GetBuffer() { + return &data; + } + const static char typecode = 'F'; +}; + +struct TimedDoubleSeq : public TimedDataSeq { +// Time timestamp; + // long length; + // double* data; +public: + SequenceDouble data; + virtual SequenceDataType* GetBuffer() { + return &data; + } + const static char typecode = 'D'; +}; + + +#endif