Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2798 for code/branches


Ignore:
Timestamp:
Mar 18, 2009, 9:00:48 PM (16 years ago)
Author:
rgrieder
Message:

Added static function to SynchronisableVariableBase to avoid including Core.h in SynchronisableVariable.h

Location:
code/branches/gui/src/network/synchronisable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gui/src/network/synchronisable/SynchronisableVariable.cc

    r2710 r2798  
    3030#include <cstring>
    3131#include "util/Math.h"
     32#include "core/Core.h"
    3233
    3334
     
    3637uint8_t SynchronisableVariableBase::state_ = 0;
    3738
     39/*static*/ void SynchronisableVariableBase::setState()
     40{
     41  if ( state_ == 0x0 )
     42  {
     43    state_ = Core::isMaster() ? 0x1 : 0x2;  // set the appropriate mode here
     44  }
     45}
    3846
    3947
  • code/branches/gui/src/network/synchronisable/SynchronisableVariable.h

    r2710 r2798  
    3535#include <string>
    3636#include <cassert>
    37 #include "core/Core.h"
    3837#include "core/CoreIncludes.h"
    3938#include "network/synchronisable/NetworkCallback.h"
     
    6362      virtual ~SynchronisableVariableBase() {}
    6463    protected:
     64      static void setState();
    6565      static uint8_t state_;
    6666  };
     
    110110      variable_( variable ), mode_( syncDirection ), callback_( cb )
    111111  {
    112     if ( state_ == 0x0 )
    113     {
    114       state_ = Core::isMaster() ? 0x1 : 0x2;  // set the appropriate mode here
    115     }
     112      setState();
    116113  }
    117114 
Note: See TracChangeset for help on using the changeset viewer.