ACE_RMCast::Message Class Reference

#include <Protocol.h>

Collaboration diagram for ACE_RMCast::Message:

Collaboration graph
[legend]
List of all members.

Public Types

typedef Profiles::const_iterator ProfileIterator

Public Member Functions

 Message ()
Message_ptr clone ()
bool add (Profile_ptr p)
void replace (Profile_ptr p)
void remove (u16 id)
Profile const * find (u16 id) const
ProfileIterator begin () const
size_t size () const

Protected Member Functions

 Message (Message const &m)

Private Types

typedef ACE_Hash_Map_Manager<
u16, Profile_ptr, ACE_Null_Mutex
Profiles

Private Member Functions

Messageoperator= (Message const &)

Private Attributes

Profiles profiles_

Friends

ostreamoperator<< (ostream &os, Message const &m)

Detailed Description

Definition at line 248 of file Protocol.h.


Member Typedef Documentation

typedef Profiles::const_iterator ACE_RMCast::Message::ProfileIterator

Definition at line 324 of file Protocol.h.

typedef ACE_Hash_Map_Manager<u16, Profile_ptr, ACE_Null_Mutex> ACE_RMCast::Message::Profiles [private]

Definition at line 252 of file Protocol.h.


Constructor & Destructor Documentation

ACE_RMCast::Message::Message (  )  [inline]

Definition at line 255 of file Protocol.h.

00256         : profiles_ (4)
00257     {
00258     }

ACE_RMCast::Message::Message ( Message const &  m  )  [inline, protected]

Definition at line 268 of file Protocol.h.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind(), ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::done(), and profiles_.

00269         : profiles_ (4)
00270     {
00271       for (Profiles::const_iterator i (m.profiles_); !i.done (); i.advance ())
00272       {
00273         // Shallow copy of profiles. This implies that profiles are not
00274         // modified as they go up/down the stack.
00275         //
00276         profiles_.bind ((*i).ext_id_, (*i).int_id_);
00277       }
00278     }


Member Function Documentation

bool ACE_RMCast::Message::add ( Profile_ptr  p  )  [inline]

Definition at line 286 of file Protocol.h.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find(), and profiles_.

00287     {
00288       u16 id (p->id ());
00289 
00290       if (profiles_.find (id) == 0)
00291       {
00292         return false;
00293       }
00294 
00295       profiles_.bind (id, p);
00296 
00297       return true;
00298     }

ProfileIterator ACE_RMCast::Message::begin ( void   )  const [inline]

Definition at line 327 of file Protocol.h.

References profiles_.

00328     {
00329       return ProfileIterator (profiles_);
00330     }

Message_ptr ACE_RMCast::Message::clone ( void   )  [inline]

Definition at line 261 of file Protocol.h.

00262     {
00263       Message_ptr cloned (new Message (*this));
00264       return cloned;
00265     }

Profile const* ACE_RMCast::Message::find ( u16  id  )  const [inline]

Definition at line 313 of file Protocol.h.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find(), and profiles_.

00314     {
00315       Profiles::ENTRY* e = 0;
00316 
00317       if (profiles_.find (id, e) == -1) return 0;
00318 
00319       return e->int_id_.get ();
00320     }

Message& ACE_RMCast::Message::operator= ( Message const &   )  [private]

void ACE_RMCast::Message::remove ( u16  id  )  [inline]

Definition at line 307 of file Protocol.h.

References profiles_, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind().

00308     {
00309       profiles_.unbind (id);
00310     }

void ACE_RMCast::Message::replace ( Profile_ptr  p  )  [inline]

Definition at line 301 of file Protocol.h.

References profiles_, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind().

00302     {
00303       profiles_.rebind (p->id (), p);
00304     }

size_t ACE_RMCast::Message::size ( void   )  const [inline]

Definition at line 334 of file Protocol.h.

References ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::done(), profiles_, and ACE_SizeCDR::total_length().

00335     {
00336       sstream ss;
00337 
00338       u32 s (0);
00339 
00340       ss << s;
00341 
00342       for (Profiles::const_iterator i (profiles_); !i.done (); i.advance ())
00343       {
00344         ss << *((*i).int_id_);
00345       }
00346 
00347       return ss.total_length ();
00348     }


Friends And Related Function Documentation

ostream& operator<< ( ostream os,
Message const &  m 
) [friend]

Definition at line 352 of file Protocol.h.

00353     {
00354       u32 s (m.size ());
00355 
00356       os << s;
00357 
00358       for (Profiles::const_iterator i (m.profiles_); !i.done (); i.advance ())
00359       {
00360         os << *((*i).int_id_);
00361       }
00362 
00363       return os;
00364     }


Member Data Documentation

Profiles ACE_RMCast::Message::profiles_ [private]

Definition at line 367 of file Protocol.h.

Referenced by add(), begin(), find(), Message(), remove(), replace(), and size().


The documentation for this class was generated from the following file:
Generated on Tue Feb 2 17:36:29 2010 for ACE_RMCast by  doxygen 1.4.7