Changeset 748 for XIOS/trunk/src/type/type.hpp
- Timestamp:
- 10/21/15 13:40:57 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/type/type.hpp
r591 r748 13 13 14 14 template <typename T> class CType_ref ; 15 16 template <typename T> 15 16 template <typename T> 17 17 class CType : public virtual CBaseType 18 18 { 19 19 public: 20 20 21 21 CType(void) ; 22 22 CType(const T& val) ; … … 35 35 CType& operator = (const CType_ref<T>& val) ; 36 36 operator T&() ; 37 37 operator const T&() const ; 38 38 39 inline virtual CBaseType* clone(void) const { return _clone(); } 39 40 virtual void fromString(const string& str) { _fromString(str); } … … 42 43 virtual bool toBuffer(CBufferOut& buffer) const { return _toBuffer(buffer); } 43 44 virtual void reset(void) { _reset(); } 44 virtual bool isEmpty() const { return _isEmpty(); } 45 virtual bool isEmpty() const { return _isEmpty(); } 45 46 virtual size_t size(void) const { return _size(); } 46 47 47 48 void allocate(void) ; 48 49 void checkEmpty(void) const; 49 50 50 51 T* ptrValue ; 51 52 bool empty ; 52 53 friend class CType_ref<T> ; 54 53 54 friend class CType_ref<T> ; 55 55 56 private : 56 57 57 58 CType* _clone(void) const; 58 59 void _fromString(const string& str) ; … … 61 62 bool _toBuffer(CBufferOut& buffer) const; 62 63 void _reset(void) ; 63 bool _isEmpty() const ; 64 bool _isEmpty() const ; 64 65 size_t _size(void) const ; 65 66 66 67 } ; 67 68 68 69 69 70 template<typename T> class CType ; 70 71 template <typename T> 71 72 template <typename T> 72 73 class CType_ref : public virtual CBaseType 73 74 { 74 75 public: 75 76 76 77 CType_ref(void) ; 77 78 CType_ref(T& val) ; … … 89 90 void set_ref(CType<T>& val) ; 90 91 void set_ref(const CType_ref& val) ; 91 92 92 93 const CType_ref& operator = (T& val) const ; 93 94 const CType_ref& operator = (CType<T>& val) const ; … … 103 104 virtual bool toBuffer(CBufferOut& buffer) const { return _toBuffer(buffer); } 104 105 virtual void reset(void) { _reset(); } 105 virtual bool isEmpty() const { return _isEmpty(); } 106 virtual bool isEmpty() const { return _isEmpty(); } 106 107 virtual size_t size(void) const { return _size(); } 107 108 108 109 void checkEmpty(void) const; 109 110 110 111 111 112 T mutable * ptrValue ; 112 113 bool empty ; 113 114 friend class CType<T> ; 114 115 115 116 private : 116 117 117 118 CType_ref* _clone(void) const; 118 119 void _fromString(const string& str) ; … … 123 124 bool _toBuffer(CBufferOut& buffer) const; 124 125 void _reset(void) ; 125 bool _isEmpty() const ; 126 bool _isEmpty() const ; 126 127 size_t _size(void) const ; 127 128 } ; 128 129 129 130 130 131 class CMessage ; 131 132 132 133 template <typename T> 133 134 CBufferOut& operator<<(CBufferOut& buffer, const CType<T>& type) ; … … 135 136 template <typename T> 136 137 CBufferOut& operator<<(CBufferOut& buffer, const CType_ref<T>& type) ; 137 138 138 139 template <typename T> 139 140 CBufferOut& operator<<(CBufferOut& buffer, const T& type) ; 140 141 141 142 template <typename T> 142 143 CBufferOut& operator<<(CBufferOut& buffer, T& type) ; … … 158 159 template <typename T> 159 160 CMessage& operator<<(CMessage& msg, const CType_ref<T>& type) ; 160 */ 161 161 */ 162 162 163 template <typename T> 163 164 CMessage& operator<<(CMessage& msg, const T& type) ;
Note: See TracChangeset
for help on using the changeset viewer.