00001
00002
00005
00006
00007
00008 #ifndef _POGROUPMSG_H_
00009 #define _POGROUPMSG_H_
00010 #include<POMessage.h>
00011 #include<string>
00012 using namespace std;
00013
00014
00015 class PEXPR_API POGroupMsg : public POMessage
00016 {
00017 public:
00018 enum COMMAND{JOIN, LEAVE, ADD, REMOVE};
00019 POGroupMsg( int cmd = JOIN );
00020 POGroupMsg( const POAddress& add_address, int add_rem = ADD );
00021 POGroupMsg( const POGroupMsg& cpy );
00022 virtual ~POGroupMsg();
00023 virtual string messageType()const { return "POGroupMsg"; };
00024
00025 int getCommand()const { return m_cmd.val(); }
00026 void setCommand( int cmd ) { m_cmd = cmd; }
00027
00030 POAddress getAddress()const { return m_adr; }
00032 void setAddress( const POAddress& adr ) { m_adr = adr; }
00033
00034 virtual POMessage* clone()const;
00035
00036
00037
00038
00039 int packsize()const;
00040 int pack( char* buf )const;
00041 int unpack( char* buf );
00042
00043 private:
00044 POInt m_cmd;
00045 POAddress m_adr;
00046 };
00047
00048 #endif