TAO_Notify::NVP Class Reference

Name/Value Pair. More...

#include <Name_Value_Pair.h>

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(), TAO_Notify_Property_Short, 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.

Definition at line 48 of file Name_Value_Pair.cpp.

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

00049     : name(p.name())
00050   {
00051     char buf[64];
00052     long temp = static_cast<long> (p.value ());
00053     ACE_OS::sprintf (buf, "%ld", temp);
00054     value = buf;
00055   }

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

Construct from a property containing a time value.

Definition at line 57 of file Name_Value_Pair.cpp.

References ACE_TCHAR, ACE_TEXT_ALWAYS_CHAR, ACE_UINT64, ACE_UINT64_FORMAT_SPECIFIER, ACE_OS::sprintf(), TAO_Notify_Property_Time, and TAO_Notify_PropertyBase_T< TYPE >::value().

00058     : name(p.name())
00059   {
00060     ACE_TCHAR buf[128];
00061     ACE_UINT64 us = p.value();
00062 #ifdef ACE_LACKS_LONGLONG_T
00063     us.as_string(buf);
00064 #else
00065     ACE_OS::sprintf(buf, ACE_UINT64_FORMAT_SPECIFIER, us);
00066 #endif /* ACE_LACKS_LONGLONG_T */
00067     value = ACE_TEXT_ALWAYS_CHAR (buf);
00068   }

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().

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 v.

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.

References v.

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.

References v.

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==().

ACE_CString TAO_Notify::NVP::value
 

Definition at line 63 of file Name_Value_Pair.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 13:34:12 2006 for TAO_CosNotification by doxygen 1.3.6