Index: code/branches/netp/src/network/synchronisable/SynchronisableVariableSpecialisations.h
===================================================================
--- code/trunk/src/network/synchronisable/SynchronisableVariable.cc	(revision 2710)
+++ code/branches/netp/src/network/synchronisable/SynchronisableVariableSpecialisations.h	(revision 2794)
@@ -27,13 +27,12 @@
  */
 
-#include "SynchronisableVariable.h"
 #include <cstring>
 #include "util/Math.h"
 
+#ifndef _NETWORK_SYNCHRONISABLEVARIABLESPECIALISATIONS__
+#define _NETWORK_SYNCHRONISABLEVARIABLESPECIALISATIONS__
 
 namespace orxonox{
 
-uint8_t SynchronisableVariableBase::state_ = 0;
-
 
 
@@ -42,10 +41,10 @@
 // =========== bool
 
-template <> uint32_t SynchronisableVariable<const bool>::returnSize()
+template <> inline uint32_t SynchronisableVariable<const bool>::returnSize()
 {
   return sizeof(uint8_t);
 }
 
-template <> void SynchronisableVariable<const bool>::setAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const bool>::setAndIncrease( uint8_t*& mem )
 {
   *(uint8_t*)(&this->variable_) = *static_cast<uint8_t*>(mem);
@@ -53,5 +52,5 @@
 }
 
-template <> void SynchronisableVariable<const bool>::getAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const bool>::getAndIncrease( uint8_t*& mem )
 {
   *static_cast<uint8_t*>(mem) = *(uint8_t*)(&this->variable_);
@@ -59,5 +58,5 @@
 }
 
-template <> bool SynchronisableVariable<const bool>::checkEquality( uint8_t* mem )
+template <> inline bool SynchronisableVariable<const bool>::checkEquality( uint8_t* mem )
 {
   return *static_cast<uint8_t*>(mem) == *(uint8_t*)(&this->variable_);
@@ -66,10 +65,10 @@
 // =========== char
 
-template <> uint32_t SynchronisableVariable<const char>::returnSize()
+template <> inline uint32_t SynchronisableVariable<const char>::returnSize()
 {
   return sizeof(uint8_t);
 }
 
-template <> void SynchronisableVariable<const char>::setAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const char>::setAndIncrease( uint8_t*& mem )
 {
   *(uint8_t*)(&this->variable_) = *static_cast<uint8_t*>(mem);
@@ -77,5 +76,5 @@
 }
 
-template <> void SynchronisableVariable<const char>::getAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const char>::getAndIncrease( uint8_t*& mem )
 {
   *static_cast<uint8_t*>(mem) = *(uint8_t*)(&this->variable_);
@@ -83,5 +82,5 @@
 }
 
-template <> bool SynchronisableVariable<const char>::checkEquality( uint8_t* mem )
+template <> inline bool SynchronisableVariable<const char>::checkEquality( uint8_t* mem )
 {
   return *static_cast<uint8_t*>(mem) == *(uint8_t*)(&this->variable_);
@@ -90,10 +89,10 @@
 // =========== unsigned char
 
-template <> uint32_t SynchronisableVariable<const unsigned char>::returnSize()
+template <> inline uint32_t SynchronisableVariable<const unsigned char>::returnSize()
 {
   return sizeof(uint8_t);
 }
 
-template <> void SynchronisableVariable<const unsigned char>::setAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const unsigned char>::setAndIncrease( uint8_t*& mem )
 {
   *(uint8_t*)(&this->variable_) = *static_cast<uint8_t*>(mem);
@@ -101,5 +100,5 @@
 }
 
-template <> void SynchronisableVariable<const unsigned char>::getAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const unsigned char>::getAndIncrease( uint8_t*& mem )
 {
   *static_cast<uint8_t*>(mem) = *(uint8_t*)(&this->variable_);
@@ -107,5 +106,5 @@
 }
 
-template <> bool SynchronisableVariable<const unsigned char>::checkEquality( uint8_t* mem )
+template <> inline bool SynchronisableVariable<const unsigned char>::checkEquality( uint8_t* mem )
 {
   return *static_cast<uint8_t*>(mem) == *(uint8_t*)(&this->variable_);
@@ -114,10 +113,10 @@
 // =========== short
 
-template <> uint32_t SynchronisableVariable<const short>::returnSize()
+template <> inline uint32_t SynchronisableVariable<const short>::returnSize()
 {
   return sizeof(int16_t);
 }
 
-template <> void SynchronisableVariable<const short>::setAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const short>::setAndIncrease( uint8_t*& mem )
 {
   *(short*)(&this->variable_) = *(int16_t*)(mem);
@@ -125,5 +124,5 @@
 }
 
-template <> void SynchronisableVariable<const short>::getAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const short>::getAndIncrease( uint8_t*& mem )
 {
   *(int16_t*)(mem) = this->variable_;
@@ -131,5 +130,5 @@
 }
 
-template <> bool SynchronisableVariable<const short>::checkEquality( uint8_t* mem )
+template <> inline bool SynchronisableVariable<const short>::checkEquality( uint8_t* mem )
 {
   return *(int16_t*)(mem) == static_cast<int16_t>(this->variable_);
@@ -138,10 +137,10 @@
 // =========== unsigned short
 
-template <> uint32_t SynchronisableVariable<const unsigned short>::returnSize()
+template <> inline uint32_t SynchronisableVariable<const unsigned short>::returnSize()
 {
   return sizeof(uint16_t);
 }
 
-template <> void SynchronisableVariable<const unsigned short>::setAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const unsigned short>::setAndIncrease( uint8_t*& mem )
 {
   *(unsigned short*)(&this->variable_) = *(uint16_t*)(mem);
@@ -149,5 +148,5 @@
 }
 
-template <> void SynchronisableVariable<const unsigned short>::getAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const unsigned short>::getAndIncrease( uint8_t*& mem )
 {
   *(uint16_t*)(mem) = this->variable_;
@@ -155,5 +154,5 @@
 }
 
-template <> bool SynchronisableVariable<const unsigned short>::checkEquality( uint8_t* mem )
+template <> inline bool SynchronisableVariable<const unsigned short>::checkEquality( uint8_t* mem )
 {
   return *(uint16_t*)(mem) == this->variable_;
@@ -162,10 +161,10 @@
 // =========== int
 
-template <> uint32_t SynchronisableVariable<const int>::returnSize()
+template <> inline uint32_t SynchronisableVariable<const int>::returnSize()
 {
   return sizeof(int32_t);
 }
 
-template <> void SynchronisableVariable<const int>::setAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const int>::setAndIncrease( uint8_t*& mem )
 {
   *(int *)(&this->variable_) = *(int32_t*)(mem);
@@ -173,5 +172,5 @@
 }
 
-template <> void SynchronisableVariable<const int>::getAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const int>::getAndIncrease( uint8_t*& mem )
 {
   *(int32_t*)(mem) = this->variable_;
@@ -179,5 +178,5 @@
 }
 
-template <> bool SynchronisableVariable<const int>::checkEquality( uint8_t* mem )
+template <> inline bool SynchronisableVariable<const int>::checkEquality( uint8_t* mem )
 {
   return *(int32_t*)(mem) == this->variable_;
@@ -186,10 +185,10 @@
 // =========== unsigned int
 
-template <> uint32_t SynchronisableVariable<const unsigned int>::returnSize()
+template <> inline uint32_t SynchronisableVariable<const unsigned int>::returnSize()
 {
   return sizeof(uint32_t);
 }
     
-template <> void SynchronisableVariable<const unsigned int>::setAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const unsigned int>::setAndIncrease( uint8_t*& mem )
 {
   *(unsigned int*)(&this->variable_) = *(uint32_t*)(mem);
@@ -197,5 +196,5 @@
 }
 
-template <> void SynchronisableVariable<const unsigned int>::getAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const unsigned int>::getAndIncrease( uint8_t*& mem )
 {
   *(uint32_t*)(mem) = this->variable_;
@@ -203,5 +202,5 @@
 }
 
-template <> bool SynchronisableVariable<const unsigned int>::checkEquality( uint8_t* mem )
+template <> inline bool SynchronisableVariable<const unsigned int>::checkEquality( uint8_t* mem )
 {
   return *(uint32_t*)(mem) == this->variable_;
@@ -210,10 +209,10 @@
 // =========== long
 
-template <> uint32_t SynchronisableVariable<const long>::returnSize()
+template <> inline uint32_t SynchronisableVariable<const long>::returnSize()
 {
   return sizeof(int32_t);
 }
 
-template <> void SynchronisableVariable<const long>::setAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const long>::setAndIncrease( uint8_t*& mem )
 {
   *(long*)(&this->variable_) = *(int32_t*)(mem);
@@ -221,5 +220,5 @@
 }
 
-template <> void SynchronisableVariable<const long>::getAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const long>::getAndIncrease( uint8_t*& mem )
 {
   *(int32_t*)(mem) = this->variable_;
@@ -227,5 +226,5 @@
 }
 
-template <> bool SynchronisableVariable<const long>::checkEquality( uint8_t* mem )
+template <> inline bool SynchronisableVariable<const long>::checkEquality( uint8_t* mem )
 {
   return *(int32_t*)(mem) == this->variable_;
@@ -234,10 +233,10 @@
 // =========== unsigned long
 
-template <> uint32_t SynchronisableVariable<const unsigned long>::returnSize()
+template <> inline uint32_t SynchronisableVariable<const unsigned long>::returnSize()
 {
   return sizeof(uint32_t);
 }
 
-template <> void SynchronisableVariable<const unsigned long>::setAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const unsigned long>::setAndIncrease( uint8_t*& mem )
 {
   *(unsigned long*)(&this->variable_) = *(uint32_t*)(mem);
@@ -245,5 +244,5 @@
 }
 
-template <> void SynchronisableVariable<const unsigned long>::getAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const unsigned long>::getAndIncrease( uint8_t*& mem )
 {
   *(uint32_t*)(mem) = this->variable_;
@@ -251,5 +250,5 @@
 }
 
-template <> bool SynchronisableVariable<const unsigned long>::checkEquality( uint8_t* mem )
+template <> inline bool SynchronisableVariable<const unsigned long>::checkEquality( uint8_t* mem )
 {
   return *(uint32_t*)(mem) == this->variable_;
@@ -258,10 +257,10 @@
 // =========== long long
 
-template <> uint32_t SynchronisableVariable<const long long>::returnSize()
+template <> inline uint32_t SynchronisableVariable<const long long>::returnSize()
 {
   return sizeof(int64_t);
 }
 
-template <> void SynchronisableVariable<const long long>::setAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const long long>::setAndIncrease( uint8_t*& mem )
 {
   *(long long*)(&this->variable_) = *(int64_t*)(mem);
@@ -269,5 +268,5 @@
 }
 
-template <> void SynchronisableVariable<const long long>::getAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const long long>::getAndIncrease( uint8_t*& mem )
 {
   *(int64_t*)(mem) = this->variable_;
@@ -275,5 +274,5 @@
 }
 
-template <> bool SynchronisableVariable<const long long>::checkEquality( uint8_t* mem )
+template <> inline bool SynchronisableVariable<const long long>::checkEquality( uint8_t* mem )
 {
   return *(int64_t*)(mem) == this->variable_;
@@ -282,10 +281,10 @@
 // =========== unsigned long long
 
-template <> uint32_t SynchronisableVariable<const unsigned long long>::returnSize()
+template <> inline uint32_t SynchronisableVariable<const unsigned long long>::returnSize()
 {
   return sizeof(uint64_t);
 }
 
-template <> void SynchronisableVariable<const unsigned long long>::setAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const unsigned long long>::setAndIncrease( uint8_t*& mem )
 {
   *(unsigned long long*)(&this->variable_) = *(uint64_t*)(mem);
@@ -293,5 +292,5 @@
 }
 
-template <> void SynchronisableVariable<const unsigned long long>::getAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const unsigned long long>::getAndIncrease( uint8_t*& mem )
 {
   *(uint64_t*)(mem) = this->variable_;
@@ -299,5 +298,5 @@
 }
 
-template <> bool SynchronisableVariable<const unsigned long long>::checkEquality( uint8_t* mem )
+template <> inline bool SynchronisableVariable<const unsigned long long>::checkEquality( uint8_t* mem )
 {
   return *(uint64_t*)(mem) == this->variable_;
@@ -306,10 +305,10 @@
 // =========== float
 
-template <> uint32_t SynchronisableVariable<const float>::returnSize()
+template <> inline uint32_t SynchronisableVariable<const float>::returnSize()
 {
   return sizeof(uint32_t);
 }
 
-template <> void SynchronisableVariable<const float>::setAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const float>::setAndIncrease( uint8_t*& mem )
 {
   *(uint32_t*)(&this->variable_) = *(uint32_t*)(mem);
@@ -317,5 +316,5 @@
 }
 
-template <> void SynchronisableVariable<const float>::getAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const float>::getAndIncrease( uint8_t*& mem )
 {
   *(uint32_t*)(mem) = *(uint32_t*)(&this->variable_);
@@ -323,5 +322,5 @@
 }
 
-template <> bool SynchronisableVariable<const float>::checkEquality( uint8_t* mem )
+template <> inline bool SynchronisableVariable<const float>::checkEquality( uint8_t* mem )
 {
   return *(uint32_t*)(mem) == *(uint32_t*)(&this->variable_);
@@ -330,10 +329,10 @@
 // =========== double
 
-template <> uint32_t SynchronisableVariable<const double>::returnSize()
+template <> inline uint32_t SynchronisableVariable<const double>::returnSize()
 {
   return sizeof(uint64_t);
 }
 
-template <> void SynchronisableVariable<const double>::setAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const double>::setAndIncrease( uint8_t*& mem )
 {
   *(uint64_t*)(&this->variable_) = *(uint64_t*)(mem);
@@ -341,5 +340,5 @@
 }
 
-template <> void SynchronisableVariable<const double>::getAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const double>::getAndIncrease( uint8_t*& mem )
 {
   *(uint64_t*)(mem) = *(uint64_t*)(&this->variable_);
@@ -347,5 +346,5 @@
 }
 
-template <> bool SynchronisableVariable<const double>::checkEquality( uint8_t* mem )
+template <> inline bool SynchronisableVariable<const double>::checkEquality( uint8_t* mem )
 {
   return *(uint64_t*)(mem) == *(uint64_t*)(&this->variable_);
@@ -354,10 +353,10 @@
 // =========== long double
 
-template <> uint32_t SynchronisableVariable<const long double>::returnSize()
+template <> inline uint32_t SynchronisableVariable<const long double>::returnSize()
 {
   return sizeof(uint64_t);
 }
 
-template <> void SynchronisableVariable<const long double>::setAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const long double>::setAndIncrease( uint8_t*& mem )
 {
   double temp;
@@ -367,5 +366,5 @@
 }
 
-template <> void SynchronisableVariable<const long double>::getAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const long double>::getAndIncrease( uint8_t*& mem )
 {
   double temp = static_cast<double>(this->variable_);
@@ -374,5 +373,5 @@
 }
 
-template <> bool SynchronisableVariable<const long double>::checkEquality( uint8_t* mem )
+template <> inline bool SynchronisableVariable<const long double>::checkEquality( uint8_t* mem )
 {
   double temp = static_cast<double>(this->variable_);
@@ -382,10 +381,10 @@
 // =========== string
 
-template <> uint32_t SynchronisableVariable<const std::string>::returnSize()
+template <> inline uint32_t SynchronisableVariable<const std::string>::returnSize()
 {
   return variable_.length()+1;
 }
 
-template <> void SynchronisableVariable<const std::string>::getAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const std::string>::getAndIncrease( uint8_t*& mem )
 {
   memcpy(mem, this->variable_.c_str(), this->variable_.length()+1);
@@ -393,5 +392,5 @@
 }
 
-template <> void SynchronisableVariable<const std::string>::setAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const std::string>::setAndIncrease( uint8_t*& mem )
 {
   *(std::string*)(&this->variable_) = std::string((const char *)mem);
@@ -399,5 +398,5 @@
 }
 
-template <> bool SynchronisableVariable<const std::string>::checkEquality( uint8_t* mem )
+template <> inline bool SynchronisableVariable<const std::string>::checkEquality( uint8_t* mem )
 {
   return std::string((const char*)mem)==this->variable_;
@@ -406,10 +405,10 @@
 // =========== Degree
 
-template <> uint32_t SynchronisableVariable<const Degree>::returnSize()
+template <> inline uint32_t SynchronisableVariable<const Degree>::returnSize()
 {
   return sizeof(Ogre::Real);
 }
 
-template <> void SynchronisableVariable<const Degree>::getAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const Degree>::getAndIncrease( uint8_t*& mem )
 {
   Ogre::Real r = this->variable_.valueDegrees();
@@ -418,5 +417,5 @@
 }
 
-template <> void SynchronisableVariable<const Degree>::setAndIncrease( uint8_t*& mem )
+template <> inline void SynchronisableVariable<const Degree>::setAndIncrease( uint8_t*& mem )
 {
   Ogre::Real* r = (Ogre::Real*)mem;
@@ -425,5 +424,5 @@
 }
 
-template <> bool SynchronisableVariable<const Degree>::checkEquality( uint8_t* mem )
+template <> inline bool SynchronisableVariable<const Degree>::checkEquality( uint8_t* mem )
 {
   Ogre::Real* r = (Ogre::Real*)mem;
@@ -432,2 +431,5 @@
 
 }
+
+
+#endif
