Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 2, 2008, 7:44:22 PM (16 years ago)
Author:
rgrieder
Message:
  • Removed source file inclusion in Synchronisable.cc (please don't do that, it had cost me half an hour to fix the build)
  • updated msvc files
  • Added missing declarations of template specialisations in order to export them properly
  • Added missing includes caused by the fix with source file inclusion.
  • Removed double declaration (there was the same declaration just behind) of registerVariable<const ColourValue>
  • Removed _NetworkExport macro in template definitions with parameters
  • Added _NetworkExport macro in template definitions that have no parameters any more (specialisations)
Location:
code/branches/network64/src/network/synchronisable
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network64/src/network/synchronisable/CMakeLists.txt

    r2245 r2307  
    11SET( SRC_FILES
    22  Synchronisable.cc
     3  SynchronisableSpecialisations.cc
    34  SynchronisableVariable.cc
    45)
  • code/branches/network64/src/network/synchronisable/Synchronisable.cc

    r2245 r2307  
    4040
    4141#include "Synchronisable.h"
    42 #include "SynchronisableSpecialisations.cc" // this defines all specialisations for registerVariable
    4342
    4443#include <cstring>
  • code/branches/network64/src/network/synchronisable/Synchronisable.h

    r2245 r2307  
    148148 
    149149  // ================= 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);
    163163}
    164164
  • code/branches/network64/src/network/synchronisable/SynchronisableSpecialisations.cc

    r2246 r2307  
    2828 */
    2929
    30 
     30#include "network/synchronisable/Synchronisable.h"
    3131
    3232// ================ template spezialisation
  • code/branches/network64/src/network/synchronisable/SynchronisableVariable.h

    r2246 r2307  
    3131#define _NETWORK_SYNCHRONISABLEVARIABLE__
    3232
     33#include "network/NetworkPrereqs.h"
     34
     35#include <string>
     36#include <cassert>
     37#include "util/Integers.h"
    3338#include "core/Core.h"
    3439#include "core/CoreIncludes.h"
    35 #include <string>
    36 #include <cassert>
    37 #include "network/NetworkPrereqs.h"
     40#include "network/synchronisable/NetworkCallback.h"
    3841
    3942namespace orxonox{
     
    6467
    6568  template <class T>
    66   class _NetworkExport SynchronisableVariable: public SynchronisableVariableBase
     69  class SynchronisableVariable: public SynchronisableVariableBase
    6770  {
    6871    public:
     
    7275      virtual inline uint8_t getMode(){ return mode_; }
    7376      virtual void getData(uint8_t*& mem, uint8_t mode);
    74       virtual void putData(uint8_t*& mem, uint8_t mode, bool forceCallback = false);
    75       virtual inline uint32_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_; }
    7780    protected:
    78       inline bool checkEquality(uint8_t* mem);
    79       inline void setAndIncrease(uint8_t*& mem);
    80       inline void getAndIncrease(uint8_t*& mem);
    81       inline uint32_t returnSize();
     81      bool checkEquality(uint8_t* mem);
     82      void setAndIncrease(uint8_t*& mem);
     83      void getAndIncrease(uint8_t*& mem);
     84      uint32_t returnSize();
    8285     
    8386      T& variable_;
     
    8790 
    8891  template <class T>
    89   class _NetworkExport SynchronisableVariableBidirectional: public SynchronisableVariable<T>
     92  class SynchronisableVariableBidirectional: public SynchronisableVariable<T>
    9093  {
    9194    public:
     
    9699      virtual void getData(uint8_t*& mem, uint8_t mode);
    97100      virtual void putData(uint8_t*& mem, uint8_t mode, bool forceCallback = false);
    98       virtual inline uint32_t getSize(uint8_t mode);
     101      virtual uint32_t getSize(uint8_t mode);
    99102    private:
    100103      T varBuffer_;
     
    153156      return 0;
    154157  }
     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
    155220
    156221
Note: See TracChangeset for help on using the changeset viewer.