Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 3, 2010, 2:24:14 AM (14 years ago)
Author:
scheusso
Message:

std::set<T> is now synchronisable
this was neccessary to synchronise templates (now used in the Level class)
this was neccessary to synchronise lod templates and configuration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3/src/libraries/network/synchronisable/Synchronisable.h

    r6417 r7105  
    3737#include <map>
    3838#include <queue>
     39#include <set>
    3940
    4041#include "util/mbool.h"
     
    138139    Synchronisable(BaseObject* creator);
    139140    template <class T> void registerVariable(T& variable, uint8_t mode=0x1, NetworkCallbackBase *cb=0, bool bidirectional=false);
     141    template <class T> void registerVariable(std::set<T>& variable, uint8_t mode=0x1, NetworkCallbackBase *cb=0, bool bidirectional=false);
    140142
    141143    void setPriority(unsigned int freq){ objectFrequency_ = freq; }
     
    181183    }
    182184  }
     185 
     186  template <class T> void Synchronisable::registerVariable( std::set<T>& variable, uint8_t mode, NetworkCallbackBase *cb, bool bidirectional)
     187  {
     188    SynchronisableVariableBase* sv;
     189    if (bidirectional)
     190      sv = new SynchronisableVariableBidirectional<std::set<T> >(variable, mode, cb);
     191    else
     192      sv = new SynchronisableVariable<std::set<T> >(variable, mode, cb);
     193    syncList.push_back(sv);
     194    stringList.push_back(sv);
     195  }
    183196
    184197  template <> _NetworkExport void Synchronisable::registerVariable( std::string& variable, uint8_t mode, NetworkCallbackBase *cb, bool bidirectional);
     198//   template <class T> _NetworkExport void Synchronisable::registerVariable<std::set<T> >( std::set<T>& variable, uint8_t mode, NetworkCallbackBase *cb, bool bidirectional);
    185199
    186200
Note: See TracChangeset for help on using the changeset viewer.