summaryrefslogtreecommitdiff
path: root/src/syncCommand.h
diff options
context:
space:
mode:
authorOthmar Gsenger <otti@anytun.org>2008-04-12 11:38:42 +0000
committerOthmar Gsenger <otti@anytun.org>2008-04-12 11:38:42 +0000
commitfffd213c8cba2135afda493d797c41c10354770e (patch)
treebb5eea1b12871d8c3fed0e687d83be3e504d11b2 /src/syncCommand.h
parentsvn cleanup (diff)
big svn cleanup
Diffstat (limited to 'src/syncCommand.h')
-rw-r--r--src/syncCommand.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/syncCommand.h b/src/syncCommand.h
new file mode 100644
index 0000000..b738513
--- /dev/null
+++ b/src/syncCommand.h
@@ -0,0 +1,58 @@
+#ifndef _SYNCCOMMAND_H
+#define _SYNCCOMMAND_H
+#include <boost/archive/text_oarchive.hpp>
+#include <boost/archive/text_iarchive.hpp>
+
+#include "connectionList.h"
+#include "threadUtils.hpp"
+#include "syncConnectionCommand.h"
+#include "syncRouteCommand.h"
+#include "syncRtpCommand.h"
+#include "networkPrefix.h"
+#include <string>
+
+class SyncCommand
+{
+public:
+ SyncCommand(ConnectionList & cl );
+ SyncCommand(ConnectionList & cl ,u_int16_t mux);
+ SyncCommand(const std::string &);
+ SyncCommand(NetworkPrefix);
+ ~SyncCommand();
+
+private:
+ SyncCommand(const SyncCommand &);
+ SyncConnectionCommand * scc_;
+ SyncRouteCommand * src_;
+ SyncRtpCommand * srtpc_;
+ friend class boost::serialization::access;
+ template<class Archive>
+ void serialize(Archive & ar, const unsigned int version)
+ {
+ std::string syncstr;
+ if (scc_)
+ {
+ syncstr = "connection";
+ }
+ if ( src_)
+ {
+ syncstr = "route";
+ }
+ if ( srtpc_)
+ {
+ syncstr = "rtp";
+ }
+ ar & syncstr;
+// std::cout << "syncstr received " <<syncstr << std::endl;
+ if (syncstr == "connection")
+ ar & *scc_;
+ if (syncstr == "route")
+ ar & *src_;
+ if (syncstr == "rtp")
+ ar & *srtpc_;
+// std::cout << "syncstr done " <<syncstr << std::endl;
+ }
+};
+
+
+#endif // _SYNCCOMMAND_H