OpenDDS::DCPS::PriorityKey Class Reference

Encapsulate a priority value and internet address as a key. More...

#include <PriorityKey.h>

Collaboration diagram for OpenDDS::DCPS::PriorityKey:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PriorityKey ()
 PriorityKey (Priority priority, ACE_INET_Addr address, bool is_loopback, bool active)
bool operator< (const PriorityKey &rhs) const
bool operator== (const PriorityKey &rhs) const
unsigned long hash () const
Prioritypriority ()
Priority priority () const
ACE_INET_Addraddress ()
ACE_INET_Addr address () const
bool & is_loopback ()
bool is_loopback () const
bool & is_active ()
bool is_active () const

Private Attributes

Priority priority_
ACE_INET_Addr address_
bool is_loopback_
bool is_active_

Detailed Description

Encapsulate a priority value and internet address as a key.

This class is encapsulates a priority value and an internet address value for use as a key in either an STL container or an ACE hash container. The '<' operator is used by the STL containers and the '==' operator and hash() method are used by the ACE hash map container(s). The ACE hash map container(s) also require the use of a default constructor as well.

To use keys of this type as an STL container key, simply include this type as the key template parameter. An example usage is:

typedef std::map<PriorityKey, ValueType> PriorityMap;

To use this type as an ACE hash container key, use the function object templates ACE_Hash and ACE_Equal_To for the HASH_KEY and COMPARE_KEYS template parameters. An example usage is:

typedef ACE_Hash_Map_Manager_Ex< PriorityKey, ValueType, ACE_Hash<PriorityKey>, ACE_Equal_To<PriorityKey>, SynchType > PriorityHashMap;

Default copy constructor and assigment are sufficient. Readonly and read/write accessors for member data are provided.

Definition at line 52 of file PriorityKey.h.


Constructor & Destructor Documentation

ACE_INLINE OpenDDS::DCPS::PriorityKey::PriorityKey (  ) 

Definition at line 14 of file PriorityKey.inl.

00015   : priority_(0), is_loopback_(false), is_active_(false)
00016 {
00017 }

ACE_INLINE OpenDDS::DCPS::PriorityKey::PriorityKey ( Priority  priority,
ACE_INET_Addr  address,
bool  is_loopback,
bool  active 
)

Definition at line 20 of file PriorityKey.inl.

00021   : priority_(priority), address_(address), is_loopback_(is_loopback), is_active_(active)
00022 {
00023 }


Member Function Documentation

ACE_INLINE ACE_INET_Addr OpenDDS::DCPS::PriorityKey::address ( void   )  const

Definition at line 79 of file PriorityKey.inl.

References address_.

00080 {
00081   return this->address_;
00082 }

ACE_INLINE ACE_INET_Addr & OpenDDS::DCPS::PriorityKey::address ( void   ) 

Definition at line 72 of file PriorityKey.inl.

References address_.

Referenced by OpenDDS::DCPS::TcpTransport::accept_datalink(), and OpenDDS::DCPS::TcpTransport::connect_datalink().

00073 {
00074   return this->address_;
00075 }

Here is the caller graph for this function:

ACE_INLINE unsigned long OpenDDS::DCPS::PriorityKey::hash ( void   )  const

Definition at line 50 of file PriorityKey.inl.

References address_, ACE_INET_Addr::hash(), is_active_, is_loopback_, and priority_.

00051 {
00052   return (this->priority_ << 16) + this->address_.hash() + this->is_loopback_
00053     + this->is_active_;
00054 }

Here is the call graph for this function:

ACE_INLINE bool OpenDDS::DCPS::PriorityKey::is_active (  )  const

Definition at line 107 of file PriorityKey.inl.

References is_active_.

00108 {
00109   return this->is_active_;
00110 }

ACE_INLINE bool & OpenDDS::DCPS::PriorityKey::is_active (  ) 

Definition at line 100 of file PriorityKey.inl.

References is_active_.

Referenced by OpenDDS::DCPS::TcpTransport::accept_datalink(), and OpenDDS::DCPS::TcpTransport::connect_datalink().

00101 {
00102   return this->is_active_;
00103 }

Here is the caller graph for this function:

ACE_INLINE bool OpenDDS::DCPS::PriorityKey::is_loopback ( void   )  const

Definition at line 93 of file PriorityKey.inl.

References is_loopback_.

00094 {
00095   return this->is_loopback_;
00096 }

ACE_INLINE bool & OpenDDS::DCPS::PriorityKey::is_loopback ( void   ) 

Definition at line 86 of file PriorityKey.inl.

References is_loopback_.

Referenced by OpenDDS::DCPS::TcpTransport::accept_datalink(), and OpenDDS::DCPS::TcpTransport::connect_datalink().

00087 {
00088   return this->is_loopback_;
00089 }

Here is the caller graph for this function:

ACE_INLINE bool OpenDDS::DCPS::PriorityKey::operator< ( const PriorityKey rhs  )  const

Definition at line 27 of file PriorityKey.inl.

References address_, is_active_, is_loopback_, and priority_.

00028 {
00029   return (this->address_ < rhs.address_)? true:
00030          (rhs.address_ < this->address_)? false:
00031          this->priority_ < rhs.priority_? true:
00032          (rhs.priority_ < this->priority_)? false :
00033          (this->is_loopback_ != rhs.is_loopback_) ? rhs.is_loopback_ :
00034          (this->is_active_ != rhs.is_active_) ? rhs.is_active_ :
00035          false;
00036 }

ACE_INLINE bool OpenDDS::DCPS::PriorityKey::operator== ( const PriorityKey rhs  )  const

Definition at line 40 of file PriorityKey.inl.

References address_, is_active_, is_loopback_, and priority_.

00041 {
00042   return (this->priority_ == rhs.priority_)
00043          && (this->address_ == rhs.address_)
00044          && (this->is_loopback_ == rhs.is_loopback_)
00045          && (this->is_active_ == rhs.is_active_);
00046 }

ACE_INLINE Priority OpenDDS::DCPS::PriorityKey::priority ( void   )  const

Definition at line 65 of file PriorityKey.inl.

References priority_.

00066 {
00067   return this->priority_;
00068 }

ACE_INLINE Priority & OpenDDS::DCPS::PriorityKey::priority ( void   ) 

Definition at line 58 of file PriorityKey.inl.

References priority_.

Referenced by OpenDDS::DCPS::TcpTransport::accept_datalink(), and OpenDDS::DCPS::TcpTransport::connect_datalink().

00059 {
00060   return this->priority_;
00061 }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 88 of file PriorityKey.h.

Referenced by address(), hash(), operator<(), and operator==().

Definition at line 91 of file PriorityKey.h.

Referenced by hash(), is_active(), operator<(), and operator==().

Definition at line 90 of file PriorityKey.h.

Referenced by hash(), is_loopback(), operator<(), and operator==().

Definition at line 85 of file PriorityKey.h.

Referenced by hash(), operator<(), operator==(), and priority().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1