Changeset 7908 for code/forks/sandbox_light/src/libraries/util/MultiType.h
- Timestamp:
- Feb 17, 2011, 5:47:22 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/forks/sandbox_light/src/libraries/util/MultiType.h
r7401 r7908 100 100 #include <cassert> 101 101 #include <string> 102 #include < OgreVector2.h>103 #include < OgreVector3.h>104 #include < OgreVector4.h>105 #include < OgreQuaternion.h>106 #include < OgreColourValue.h>102 #include <ogremath/OgreVector2.h> 103 #include <ogremath/OgreVector3.h> 104 #include <ogremath/OgreVector4.h> 105 #include <ogremath/OgreQuaternion.h> 106 #include <ogremath/OgreColourValue.h> 107 107 #include <loki/TypeTraits.h> 108 108 #include "mbool.h" … … 260 260 261 261 virtual void toString(std::ostream& outstream) const = 0; 262 263 virtual void importData( uint8_t*& mem )=0;264 virtual void exportData( uint8_t*& mem ) const=0;265 virtual uint8_t getSize() const=0;266 262 267 263 MT_Type::Value type_; ///< The type of the current value … … 374 370 std::string getTypename() const; 375 371 376 /// Saves the value of the MT to a bytestream (pointed at by mem) and increases mem pointer by size of MT377 inline void exportData(uint8_t*& mem) const { assert(sizeof(MT_Type::Value)<=8); *static_cast<uint8_t*>(mem) = this->getType(); mem+=sizeof(uint8_t); this->value_->exportData(mem); }378 /// Loads the value of the MT from a bytestream (pointed at by mem) and increases mem pointer by size of MT379 inline void importData(uint8_t*& mem) { assert(sizeof(MT_Type::Value)<=8); this->setType(static_cast<MT_Type::Value>(*static_cast<uint8_t*>(mem))); mem+=sizeof(uint8_t); this->value_->importData(mem); }380 /// Saves the value of the MT to a bytestream and increases pointer to bytestream by size of MT381 inline uint8_t*& operator << (uint8_t*& mem) { importData(mem); return mem; }382 /// Loads the value of the MT to a bytestream and increases pointer to bytestream by size of MT383 inline void operator >> (uint8_t*& mem) const { exportData(mem); }384 inline uint32_t getNetworkSize() const { assert(this->value_); return this->value_->getSize() + sizeof(uint8_t); }385 386 372 /// Checks whether the value is a default one (assigned after a failed conversion) 387 373 bool hasDefaultValue() const { return this->value_->hasDefaultValue(); }
Note: See TracChangeset
for help on using the changeset viewer.