sorry for last ceckin :(
[anytun.git] / syncCommand.h
blobb2f3fc57182cd91735fe332e0c9856790307b105
1 #ifndef _SYNCCOMMAND_H
2 #define _SYNCCOMMAND_H
3 #include <boost/archive/text_oarchive.hpp>
4 #include <boost/archive/text_iarchive.hpp>
6 #include "connectionList.h"
7 #include "threadUtils.hpp"
9 class SyncCommand
11 public:
12 SyncCommand(ConnectionList & cl );
13 SyncCommand(ConnectionList & cl ,u_int16_t mux);
14 u_int16_t getMux() const;
16 private:
17 SyncCommand(const SyncCommand &);
18 ConnectionList & cl_;
19 u_int16_t mux_;
20 friend class boost::serialization::access;
21 template<class Archive>
22 void serialize(Archive & ar, const unsigned int version)
24 Lock lock(cl_.getMutex());
25 ar & mux_;
26 ConnectionParam & conn = cl_.getOrNewConnectionUnlocked(mux_);
27 ar & conn;
32 #endif // _SYNCCOMMAND_H