ACE_RMCast::NRTM Struct Reference

#include <Protocol.h>

Inheritance diagram for ACE_RMCast::NRTM:

Inheritance graph
[legend]
Collaboration diagram for ACE_RMCast::NRTM:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 map_ (10)
 map_ (10)
NRTM_ptr clone ()
void insert (Address const &addr, u64 sn)
u64 find (Address const &addr) const
bool empty () const
virtual void serialize_body (ostream &os) const
virtual void serialize_body (sstream &ss) const

Static Public Member Functions

u32 max_count (u32 max_size)

Public Attributes

 __pad0__: Profile (h)
 __pad1__: Profile (id)

Static Public Attributes

u16 const  id = 0x0006

Protected Member Functions

virtual Profile_ptr clone_ ()
done ()
advance ())

Protected Attributes

 __pad2__: Profile (nrtm) { for (Map::const_iterator i (nrtm.map_)

Private Types

typedef ACE_Hash_Map_Manager_Ex<
Address, u64, AddressHasher,
ACE_Equal_To< Address >,
ACE_Null_Mutex
Map

Private Attributes

Map map_

Member Typedef Documentation

typedef ACE_Hash_Map_Manager_Ex<Address, u64, AddressHasher, ACE_Equal_To<Address>, ACE_Null_Mutex> ACE_RMCast::NRTM::Map [private]
 

Definition at line 1110 of file Protocol.h.


Member Function Documentation

i ACE_RMCast::NRTM::advance  )  [inline, protected]
 

Definition at line 1006 of file Protocol.h.

References map_.

01007         : Profile (nrtm)
01008     {
01009       for (Map::const_iterator i (nrtm.map_); !i.done (); i.advance ())

NRTM_ptr ACE_RMCast::NRTM::clone void   )  [inline]
 

Reimplemented from ACE_RMCast::Profile.

Definition at line 990 of file Protocol.h.

00994     {

virtual Profile_ptr ACE_RMCast::NRTM::clone_  )  [inline, protected, virtual]
 

Implements ACE_RMCast::Profile.

Definition at line 997 of file Protocol.h.

References ACE_RMCast::Profile_ptr.

00998            :
00999     virtual Profile_ptr
01000     clone_ ()
01001     {
      Profile_ptr p (new NRTM (*this));

i ACE_RMCast::NRTM::done  )  [protected]
 

bool ACE_RMCast::NRTM::empty void   )  const [inline]
 

Definition at line 1032 of file Protocol.h.

01036     {

u64 ACE_RMCast::NRTM::find Address const &  addr  )  const [inline]
 

Definition at line 1022 of file Protocol.h.

Referenced by ACE_RMCast::Acknowledge::recv().

01026     {
01027       u64 sn;
01028 
01029       if (map_.find (addr, sn) == -1) return 0;

void ACE_RMCast::NRTM::insert Address const &  addr,
u64  sn
[inline]
 

Definition at line 1014 of file Protocol.h.

References ACE_RMCast::Address, ACE_RMCast::Profile::size(), and ACE_RMCast::u64.

01015         :
01016     void
01017     insert (Address const& addr, u64 sn)
01018     {
01019       map_.bind (addr, sn);

ACE_RMCast::NRTM::map_ 10   )  [inline]
 

Definition at line 984 of file Protocol.h.

00987         : Profile (id), map_ (10)

ACE_RMCast::NRTM::map_ 10   )  [inline]
 

Definition at line 956 of file Protocol.h.

References ACE_RMCast::Address, ACE_RMCast::istream, ACE_RMCast::sstream, ACE_SizeCDR::total_length(), ACE_RMCast::u16, ACE_RMCast::u32, and ACE_RMCast::u64.

00957         :
00958     NRTM (Header const& h, istream& is)
00959         : Profile (h), map_ (10)
00960     {
00961       u32 addr (0);
00962       u16 port (0);
00963       u64 sn (0);
00964 
00965       sstream ss;
00966 
00967       ss << sn;
00968       ss << addr;
00969       ss << port;
00970 
00971       size_t block_size (ss.total_length ());
00972 
00973 
00974       // num_of_blocks = size / block_size
00975       //
00976       for (size_t i (0); i < (h.size () / block_size); ++i)
00977       {
00978         is >> sn;
00979         is >> addr;
00980         is >> port;
00981 
        map_.bind (Address (port, addr), sn);

u32 ACE_RMCast::NRTM::max_count u32  max_size  )  [inline, static]
 

Definition at line 1042 of file Protocol.h.

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

01046     {
01047       u32 n (0);
01048 
01049       sstream ss;
01050 
01051       Profile::Header hdr (0, 0);
01052       ss << hdr;
01053 
01054       while (true)
01055       {
01056         u32 addr (0);
01057         u16 port (0);
01058         u64 sn (0);
01059 
01060         ss << sn;
01061         ss << addr;
01062         ss << port;
01063 
01064         if (ss.total_length () <= max_size)
01065           ++n;
01066 
01067         if (ss.total_length () >= max_size)
01068           break;
01069       }

virtual void ACE_RMCast::NRTM::serialize_body sstream ss  )  const [inline, virtual]
 

Implements ACE_RMCast::Profile.

Definition at line 1089 of file Protocol.h.

01093     {
01094       for (Map::const_iterator i (map_), e (map_, 1); i != e; ++i)
01095       {
01096         u32 addr (0);
01097         u16 port (0);
01098         u64 sn (0);
01099 
01100         ss << sn;
01101         ss << addr;

virtual void ACE_RMCast::NRTM::serialize_body ostream os  )  const [inline, virtual]
 

Implements ACE_RMCast::Profile.

Definition at line 1073 of file Protocol.h.

References ACE_RMCast::ostream, ACE_RMCast::u16, ACE_RMCast::u32, and ACE_RMCast::u64.

01074         :
01075     virtual void
01076     serialize_body (ostream& os) const
01077     {
01078       for (Map::const_iterator i (map_), e (map_, 1); i != e; ++i)
01079       {
01080         u32 addr ((*i).ext_id_.get_ip_address ());
01081         u16 port ((*i).ext_id_.get_port_number ());
01082         u64 sn ((*i).int_id_);
01083 
01084         os << sn;
01085         os << addr;
01086         os << port;


Member Data Documentation

ACE_RMCast::NRTM::__pad0__
 

Definition at line 956 of file Protocol.h.

ACE_RMCast::NRTM::__pad1__
 

Definition at line 984 of file Protocol.h.

ACE_RMCast::NRTM::__pad2__ [protected]
 

Definition at line 1006 of file Protocol.h.

u16 const ACE_RMCast::NRTM::id = 0x0006 [static]
 

Definition at line 14 of file Protocol.cpp.

Map ACE_RMCast::NRTM::map_ [private]
 

Definition at line 1112 of file Protocol.h.

Referenced by advance().


The documentation for this struct was generated from the following files:
Generated on Sun Jan 27 13:03:09 2008 for ACE_RMCast by doxygen 1.3.6