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)

Member Typedef Documentation

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

Definition at line 321 of file Protocol.h.

Referenced by begin(), and ACE_RMCast::Link::send_().

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

Definition at line 250 of file Protocol.h.


Constructor & Destructor Documentation

ACE_RMCast::Message::Message  )  [inline]
 

Definition at line 253 of file Protocol.h.

References profiles_.

Referenced by clone().

00254         : profiles_ (4)
00255     {
00256     }

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

Definition at line 265 of file Protocol.h.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::bind(), and profiles_.

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


Member Function Documentation

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

Definition at line 283 of file Protocol.h.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::bind(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::find(), ACE_RMCast::Profile_ptr, profiles_, and ACE_RMCast::u16.

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

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

Definition at line 324 of file Protocol.h.

References ProfileIterator, and profiles_.

00325     {
00326       return ProfileIterator (profiles_);
00327     }

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

Definition at line 259 of file Protocol.h.

References Message().

00260     {
00261       return new Message (*this);
00262     }

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

Definition at line 310 of file Protocol.h.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::find(), profiles_, and ACE_RMCast::u16.

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

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

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

Definition at line 304 of file Protocol.h.

References profiles_, ACE_RMCast::u16, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::unbind().

00305     {
00306       profiles_.unbind (id);
00307     }

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

Definition at line 298 of file Protocol.h.

References ACE_RMCast::Profile_ptr, profiles_, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::rebind().

00299     {
00300       profiles_.rebind (p->id (), p);
00301     }

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

Definition at line 331 of file Protocol.h.

References profiles_, ACE_RMCast::sstream, ACE_SizeCDR::total_length(), and ACE_RMCast::u32.

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


Friends And Related Function Documentation

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

Definition at line 349 of file Protocol.h.

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


Member Data Documentation

Profiles ACE_RMCast::Message::profiles_ [private]
 

Definition at line 364 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 Thu Nov 9 11:41:11 2006 for ACE_RMCast by doxygen 1.3.6