TAO_Notify::NVP Class Reference

Name/Value Pair. More...

#include <Name_Value_Pair.h>

Collaboration diagram for TAO_Notify::NVP:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 NVP ()
 Construct an undefined name/value (to allow use in collections).
 NVP (const TAO_Notify_Property_Short &p)
 Construct from a property containing a short value.
 NVP (const TAO_Notify_Property_Long &p)
 Construct from a property containing a long value.
 NVP (const TAO_Notify_Property_Time &p)
 Construct from a property containing a time value.
 NVP (const TAO_Notify_Property_Boolean &p)
 Construct from a property containing a boolean value.
 NVP (const char *n, CORBA::Long v)
 Construct from name and long value.
 NVP (const char *n, const char *v)
 Construct from name and string value.
 NVP (const char *n, const ACE_CString &v)
 Construct from name and string value.
bool operator== (const NVP &rhs) const
 Assignment operator.
bool operator!= (const NVP &rhs) const
 Comparison operator compares only name (not value).

Public Attributes

ACE_CString name
ACE_CString value

Detailed Description

Name/Value Pair.

Associates a name (character string) with a value (encoded into a character string) For use in managing properties.

Definition at line 38 of file Name_Value_Pair.h.


Constructor & Destructor Documentation

TAO_Notify::NVP::NVP (  ) 

Construct an undefined name/value (to allow use in collections).

Definition at line 36 of file Name_Value_Pair.cpp.

00037   {
00038   }

TAO_Notify::NVP::NVP ( const TAO_Notify_Property_Short p  )  [explicit]

Construct from a property containing a short value.

Definition at line 40 of file Name_Value_Pair.cpp.

References ACE_OS::sprintf(), value, and TAO_Notify_PropertyBase_T< TYPE >::value().

00041     : name(p.name())
00042   {
00043     char buf[64];
00044     ACE_OS::sprintf (buf, "%d", p.value ());
00045     value = buf;
00046   }

TAO_Notify::NVP::NVP ( const TAO_Notify_Property_Long p  )  [explicit]

Construct from a property containing a long value.

TAO_Notify::NVP::NVP ( const TAO_Notify_Property_Time p  )  [explicit]

Construct from a property containing a time value.

TAO_Notify::NVP::NVP ( const TAO_Notify_Property_Boolean p  )  [explicit]

Construct from a property containing a boolean value.

Definition at line 70 of file Name_Value_Pair.cpp.

References TAO_Notify_Property_Boolean::value(), and value.

00071     : name(p.name())
00072   {
00073     value = p.value() ? "true" : "false";
00074   }

TAO_Notify::NVP::NVP ( const char *  n,
CORBA::Long  v 
)

Construct from name and long value.

Definition at line 76 of file Name_Value_Pair.cpp.

References ACE_OS::sprintf(), and value.

00077     : name(n)
00078   {
00079     char buf[64];
00080     long temp = v;
00081     ACE_OS::sprintf (buf, "%ld", temp);
00082     value = buf;
00083   }

TAO_Notify::NVP::NVP ( const char *  n,
const char *  v 
)

Construct from name and string value.

Definition at line 85 of file Name_Value_Pair.cpp.

00086     : name(n), value(v)
00087   {
00088   }

TAO_Notify::NVP::NVP ( const char *  n,
const ACE_CString v 
)

Construct from name and string value.

Definition at line 90 of file Name_Value_Pair.cpp.

00091     : name(n), value(v)
00092   {
00093   }


Member Function Documentation

bool TAO_Notify::NVP::operator!= ( const NVP rhs  )  const

Comparison operator compares only name (not value).

Definition at line 100 of file Name_Value_Pair.cpp.

00101   {
00102     return ! (rhs == *this);
00103   }

bool TAO_Notify::NVP::operator== ( const NVP rhs  )  const

Assignment operator.

Definition at line 95 of file Name_Value_Pair.cpp.

References name.

00096   {
00097     return (this->name == rhs.name) != 0;
00098   }


Member Data Documentation

ACE_CString TAO_Notify::NVP::name

Definition at line 62 of file Name_Value_Pair.h.

Referenced by operator==(), and TAO_Notify::NVPList::push_back().

ACE_CString TAO_Notify::NVP::value

Definition at line 63 of file Name_Value_Pair.h.

Referenced by NVP(), and TAO_Notify::NVPList::push_back().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:46:42 2010 for TAO_CosNotification by  doxygen 1.4.7