Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 2, 2009, 11:35:24 AM (15 years ago)
Author:
scheusso
Message:

some cleaning up and improvements in synchronisation of vector2,3,4 and quaternions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/libraries/network/synchronisable/NetworkCallback.h

    r6073 r6192  
    3333#include "network/NetworkPrereqs.h"
    3434#include "NetworkCallbackManager.h"
     35// #include "util/MultiType.h"
    3536
    3637namespace orxonox{
     38 
     39  struct EmptyType{};
    3740 
    3841  class _NetworkExport NetworkCallbackBase
     
    5760      void (T::*function_) (void);
    5861  };
     62 
     63  template <class T, class U>
     64  class NetworkCallbackNotify: public NetworkCallbackBase
     65  {
     66    public:
     67      NetworkCallbackNotify(T* object, void (T::*function) (const U&)) : object_(object), function_(function) {}
     68      NetworkCallbackNotify() {}
     69      virtual ~NetworkCallbackNotify() {}
     70      virtual void call()
     71        { (this->object_->*function_)( this->oldValue_ ); }
     72      void setOldValue(const U& value){ this->oldValue_ = value; }
     73    private:
     74      T* object_;
     75      U oldValue_;
     76      void (T::*function_) (const U&);
     77  };
    5978
    6079}
Note: See TracChangeset for help on using the changeset viewer.