AndroMeta  2.0.0
AndroMeta/include/AndroMeta/MHub.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2009-2012 AndroMeta LLC. All rights reserved.
00003  *
00004  * AndroMeta LLC retains all intellectual property and proprietary 
00005  * rights to this software and related documentation and any modifications 
00006  * thereto.  Any use, reproduction, disclosure, or distribution of this 
00007  * software and related documentation without an express license agreement 
00008  * from AndroMeta LLC is strictly prohibited.
00009  * 
00010  */
00011 
00018 #ifndef ANDROMETA_M_HUB_H
00019 #define ANDROMETA_M_HUB_H
00020 
00021 #include <AndroMeta/MObject.h>
00022 
00023 namespace Meta{
00024   
00025   class MAuth;
00026   class MProcTask;
00027   
00046   class MHub : public MObjectBase{
00047   public:
00048     
00057     MHub(MProcTask* task, MAuth* auth);
00058     
00062     MHub(MProcTask* task, MAuth* auth, const mvar& v, RestoreOpt opt);
00063     
00067     virtual ~MHub();
00068     
00072     void store(mvar& v) const;
00073     
00077     MProcTask* task();
00078     
00082     MAuth* auth();
00083     
00087     const MAuth* auth() const;
00088     
00094     bool listen(int port);
00095     
00100     bool requireSubmit() const;
00101     
00106     void setRequireSubmit(bool flag);
00107     
00111     long maxPackageSize() const;
00112     
00116     void setMaxPackageSize(long size);
00117     
00121     size_t maxPeers() const;
00122     
00126     void setMaxPeers(size_t maxPeers);
00127     
00131     mvar peerInfo(long peerId) const;
00132     
00136     mvar groupInfo(long groupId) const;
00137     
00143     virtual bool onPeerConnect(const mvar& peerInfo);
00144     
00148     virtual void onPeerDisconnect(const mvar& peerInfo);
00149     
00155     virtual bool onGroupSubmit(const mvar& groupInfo);
00156     
00160     virtual void onGroupEnd(const mvar& groupInfo);
00161     
00162   private:  
00163     MHub& operator=(const MHub&);
00164     MHub(const MHub&);
00165     
00166     class MHub_* x_;
00167   };
00168   
00169 } // end namespace Meta
00170 
00171 #endif // ANDROMETA_M_HUB_H