Changeset 2307 for code/branches/network64/src/network
- Timestamp:
- Dec 2, 2008, 7:44:22 PM (16 years ago)
- Location:
- code/branches/network64/src/network/synchronisable
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network64/src/network/synchronisable/CMakeLists.txt
r2245 r2307 1 1 SET( SRC_FILES 2 2 Synchronisable.cc 3 SynchronisableSpecialisations.cc 3 4 SynchronisableVariable.cc 4 5 ) -
code/branches/network64/src/network/synchronisable/Synchronisable.cc
r2245 r2307 40 40 41 41 #include "Synchronisable.h" 42 #include "SynchronisableSpecialisations.cc" // this defines all specialisations for registerVariable43 42 44 43 #include <cstring> -
code/branches/network64/src/network/synchronisable/Synchronisable.h
r2245 r2307 148 148 149 149 // ================= Specialisation declarations 150 template <> void Synchronisable::registerVariable( const ColourValue& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional);template <>void Synchronisable::registerVariable( const ColourValue& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional);151 template <> void Synchronisable::registerVariable( ColourValue& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional);152 template <> void Synchronisable::registerVariable( const Vector2& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional);153 template <> void Synchronisable::registerVariable( Vector2& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional);154 template <> void Synchronisable::registerVariable( const Vector3& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional);155 template <> void Synchronisable::registerVariable( Vector3& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional);156 template <> void Synchronisable::registerVariable( const Vector4& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional);157 template <> void Synchronisable::registerVariable( Vector4& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional);158 template <> void Synchronisable::registerVariable( mbool& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional);159 template <> void Synchronisable::registerVariable( const Quaternion& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional);160 template <> void Synchronisable::registerVariable( Quaternion& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional);161 // template <> void Synchronisable::registerVariable( LODParticle::LOD& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional);162 // template <> void Synchronisable::registerVariable( Ogre::Light::LightTypes& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional);150 template <> _NetworkExport void Synchronisable::registerVariable( const ColourValue& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional); 151 template <> _NetworkExport void Synchronisable::registerVariable( ColourValue& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional); 152 template <> _NetworkExport void Synchronisable::registerVariable( const Vector2& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional); 153 template <> _NetworkExport void Synchronisable::registerVariable( Vector2& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional); 154 template <> _NetworkExport void Synchronisable::registerVariable( const Vector3& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional); 155 template <> _NetworkExport void Synchronisable::registerVariable( Vector3& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional); 156 template <> _NetworkExport void Synchronisable::registerVariable( const Vector4& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional); 157 template <> _NetworkExport void Synchronisable::registerVariable( Vector4& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional); 158 template <> _NetworkExport void Synchronisable::registerVariable( mbool& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional); 159 template <> _NetworkExport void Synchronisable::registerVariable( const Quaternion& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional); 160 template <> _NetworkExport void Synchronisable::registerVariable( Quaternion& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional); 161 // template <> _NetworkExport void Synchronisable::registerVariable( LODParticle::LOD& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional); 162 // template <> _NetworkExport void Synchronisable::registerVariable( Ogre::Light::LightTypes& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional); 163 163 } 164 164 -
code/branches/network64/src/network/synchronisable/SynchronisableSpecialisations.cc
r2246 r2307 28 28 */ 29 29 30 30 #include "network/synchronisable/Synchronisable.h" 31 31 32 32 // ================ template spezialisation -
code/branches/network64/src/network/synchronisable/SynchronisableVariable.h
r2246 r2307 31 31 #define _NETWORK_SYNCHRONISABLEVARIABLE__ 32 32 33 #include "network/NetworkPrereqs.h" 34 35 #include <string> 36 #include <cassert> 37 #include "util/Integers.h" 33 38 #include "core/Core.h" 34 39 #include "core/CoreIncludes.h" 35 #include <string> 36 #include <cassert> 37 #include "network/NetworkPrereqs.h" 40 #include "network/synchronisable/NetworkCallback.h" 38 41 39 42 namespace orxonox{ … … 64 67 65 68 template <class T> 66 class _NetworkExportSynchronisableVariable: public SynchronisableVariableBase69 class SynchronisableVariable: public SynchronisableVariableBase 67 70 { 68 71 public: … … 72 75 virtual inline uint8_t getMode(){ return mode_; } 73 76 virtual void getData(uint8_t*& mem, uint8_t mode); 74 virtual void putData(uint8_t*& mem, uint8_t mode, bool forceCallback = false);75 virtual inlineuint32_t getSize(uint8_t mode);76 virtual void* getReference(){ return (void *)&this->variable_; }77 virtual inline void putData(uint8_t*& mem, uint8_t mode, bool forceCallback = false); 78 virtual uint32_t getSize(uint8_t mode); 79 virtual inline void* getReference(){ return (void *)&this->variable_; } 77 80 protected: 78 inlinebool checkEquality(uint8_t* mem);79 inlinevoid setAndIncrease(uint8_t*& mem);80 inlinevoid getAndIncrease(uint8_t*& mem);81 inlineuint32_t returnSize();81 bool checkEquality(uint8_t* mem); 82 void setAndIncrease(uint8_t*& mem); 83 void getAndIncrease(uint8_t*& mem); 84 uint32_t returnSize(); 82 85 83 86 T& variable_; … … 87 90 88 91 template <class T> 89 class _NetworkExportSynchronisableVariableBidirectional: public SynchronisableVariable<T>92 class SynchronisableVariableBidirectional: public SynchronisableVariable<T> 90 93 { 91 94 public: … … 96 99 virtual void getData(uint8_t*& mem, uint8_t mode); 97 100 virtual void putData(uint8_t*& mem, uint8_t mode, bool forceCallback = false); 98 virtual inlineuint32_t getSize(uint8_t mode);101 virtual uint32_t getSize(uint8_t mode); 99 102 private: 100 103 T varBuffer_; … … 153 156 return 0; 154 157 } 158 159 template <> _NetworkExport uint32_t SynchronisableVariable<const bool>::returnSize(); 160 template <> _NetworkExport void SynchronisableVariable<const bool>::setAndIncrease(uint8_t*& mem); 161 template <> _NetworkExport void SynchronisableVariable<const bool>::getAndIncrease(uint8_t*& mem); 162 template <> _NetworkExport bool SynchronisableVariable<const bool>::checkEquality(uint8_t* mem); 163 template <> _NetworkExport uint32_t SynchronisableVariable<const unsigned char>::returnSize(); 164 template <> _NetworkExport void SynchronisableVariable<const unsigned char>::setAndIncrease(uint8_t*& mem); 165 template <> _NetworkExport void SynchronisableVariable<const unsigned char>::getAndIncrease(uint8_t*& mem); 166 template <> _NetworkExport bool SynchronisableVariable<const unsigned char>::checkEquality(uint8_t* mem); 167 template <> _NetworkExport uint32_t SynchronisableVariable<const short>::returnSize(); 168 template <> _NetworkExport void SynchronisableVariable<const short>::setAndIncrease(uint8_t*& mem); 169 template <> _NetworkExport void SynchronisableVariable<const short>::getAndIncrease(uint8_t*& mem); 170 template <> _NetworkExport bool SynchronisableVariable<const short>::checkEquality(uint8_t* mem); 171 template <> _NetworkExport uint32_t SynchronisableVariable<const unsigned short>::returnSize(); 172 template <> _NetworkExport void SynchronisableVariable<const unsigned short>::setAndIncrease(uint8_t*& mem); 173 template <> _NetworkExport void SynchronisableVariable<const unsigned short>::getAndIncrease(uint8_t*& mem); 174 template <> _NetworkExport bool SynchronisableVariable<const unsigned short>::checkEquality(uint8_t* mem); 175 template <> _NetworkExport uint32_t SynchronisableVariable<const int>::returnSize(); 176 template <> _NetworkExport void SynchronisableVariable<const int>::setAndIncrease(uint8_t*& mem); 177 template <> _NetworkExport void SynchronisableVariable<const int>::getAndIncrease(uint8_t*& mem); 178 template <> _NetworkExport bool SynchronisableVariable<const int>::checkEquality(uint8_t* mem); 179 template <> _NetworkExport uint32_t SynchronisableVariable<const unsigned int>::returnSize(); 180 template <> _NetworkExport void SynchronisableVariable<const unsigned int>::setAndIncrease(uint8_t*& mem); 181 template <> _NetworkExport void SynchronisableVariable<const unsigned int>::getAndIncrease(uint8_t*& mem); 182 template <> _NetworkExport bool SynchronisableVariable<const unsigned int>::checkEquality(uint8_t* mem); 183 template <> _NetworkExport uint32_t SynchronisableVariable<const long>::returnSize(); 184 template <> _NetworkExport void SynchronisableVariable<const long>::setAndIncrease(uint8_t*& mem); 185 template <> _NetworkExport void SynchronisableVariable<const long>::getAndIncrease(uint8_t*& mem); 186 template <> _NetworkExport bool SynchronisableVariable<const long>::checkEquality(uint8_t* mem); 187 template <> _NetworkExport uint32_t SynchronisableVariable<const unsigned long>::returnSize(); 188 template <> _NetworkExport void SynchronisableVariable<const unsigned long>::setAndIncrease(uint8_t*& mem); 189 template <> _NetworkExport void SynchronisableVariable<const unsigned long>::getAndIncrease(uint8_t*& mem); 190 template <> _NetworkExport bool SynchronisableVariable<const unsigned long>::checkEquality(uint8_t* mem); 191 template <> _NetworkExport uint32_t SynchronisableVariable<const long long>::returnSize(); 192 template <> _NetworkExport void SynchronisableVariable<const long long>::setAndIncrease(uint8_t*& mem); 193 template <> _NetworkExport void SynchronisableVariable<const long long>::getAndIncrease(uint8_t*& mem); 194 template <> _NetworkExport bool SynchronisableVariable<const long long>::checkEquality(uint8_t* mem); 195 template <> _NetworkExport uint32_t SynchronisableVariable<const unsigned long long>::returnSize(); 196 template <> _NetworkExport void SynchronisableVariable<const unsigned long long>::setAndIncrease(uint8_t*& mem); 197 template <> _NetworkExport void SynchronisableVariable<const unsigned long long>::getAndIncrease(uint8_t*& mem); 198 template <> _NetworkExport bool SynchronisableVariable<const unsigned long long>::checkEquality(uint8_t* mem); 199 template <> _NetworkExport uint32_t SynchronisableVariable<const float>::returnSize(); 200 template <> _NetworkExport void SynchronisableVariable<const float>::setAndIncrease(uint8_t*& mem); 201 template <> _NetworkExport void SynchronisableVariable<const float>::getAndIncrease(uint8_t*& mem); 202 template <> _NetworkExport bool SynchronisableVariable<const float>::checkEquality(uint8_t* mem); 203 template <> _NetworkExport uint32_t SynchronisableVariable<const double>::returnSize(); 204 template <> _NetworkExport void SynchronisableVariable<const double>::setAndIncrease(uint8_t*& mem); 205 template <> _NetworkExport void SynchronisableVariable<const double>::getAndIncrease(uint8_t*& mem); 206 template <> _NetworkExport bool SynchronisableVariable<const double>::checkEquality(uint8_t* mem); 207 template <> _NetworkExport uint32_t SynchronisableVariable<const long double>::returnSize(); 208 template <> _NetworkExport void SynchronisableVariable<const long double>::setAndIncrease(uint8_t*& mem); 209 template <> _NetworkExport void SynchronisableVariable<const long double>::getAndIncrease(uint8_t*& mem); 210 template <> _NetworkExport bool SynchronisableVariable<const long double>::checkEquality(uint8_t* mem); 211 template <> _NetworkExport uint32_t SynchronisableVariable<const std::string>::returnSize(); 212 template <> _NetworkExport void SynchronisableVariable<const std::string>::setAndIncrease(uint8_t*& mem); 213 template <> _NetworkExport void SynchronisableVariable<const std::string>::getAndIncrease(uint8_t*& mem); 214 template <> _NetworkExport bool SynchronisableVariable<const std::string>::checkEquality(uint8_t* mem); 215 template <> _NetworkExport uint32_t SynchronisableVariable<const Degree>::returnSize(); 216 template <> _NetworkExport void SynchronisableVariable<const Degree>::setAndIncrease(uint8_t*& mem); 217 template <> _NetworkExport void SynchronisableVariable<const Degree>::getAndIncrease(uint8_t*& mem); 218 template <> _NetworkExport bool SynchronisableVariable<const Degree>::checkEquality(uint8_t* mem); 219 155 220 156 221
Note: See TracChangeset
for help on using the changeset viewer.