RTFX  0.3
Real time special effects collaborative visualization and production library.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
RTFXParticipant.h
Go to the documentation of this file.
1 #ifndef __RTFX_PARTICIPANT__
2 #define __RTFX_PARTICIPANT__
3 
4 #pragma warning(disable: 4996)
5 
6 #include "RTFXParcel.h"
7 #include <deque>
8 
9 #include "RTFXBoostIncludes.h"
10 
18 using namespace std;
19 
20 namespace RTFX
21 {
26  class RTFXAPI RTFXParticipant
27  {
28  public:
29 
31  RTFXParticipant() : id( boost::uuids::random_generator() () )
32  {
33  for ( unsigned int i = 0; i < 16; i ++ )
34  mailboxName[i] = ' ';
35  };
36 
38  virtual ~RTFXParticipant () {};
39 
41  virtual void Deliver( const RTFXParcel &_parcel ) = 0;
42 
44  boost::uuids::uuid GetID()
45  {
46  return id;
47  }
48 
50  void SetID( boost::uuids::uuid _id )
51  {
52  id = _id;
53  }
54 
56  bool operator== ( RTFXParticipant &_rhs ) const
57  {
58  return id == _rhs.GetID();
59  }
60 
62  string GetIDAsString()
63  {
64  const string tmp_ = boost::lexical_cast<string>(id);
65  return tmp_;
66  }
67 
69  char * GetMailboxName() { return ( char * )mailboxName; }
70 
72  void SetMailboxName( char * _mailboxName )
73  {
74  strcpy( mailboxName, _mailboxName );
75  }
76 
77  private:
79  boost::uuids::uuid id;
80 
82  char mailboxName[16];
83  };
84 }
85 
86 #endif