Public Member Functions | Public Attributes

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.

  {
  }

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.

    : name(p.name())
  {
    char buf[64];
    ACE_OS::sprintf (buf, "%d", p.value ());
    value = buf;
  }

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.

    : name(p.name())
  {
    char buf[64];
    long temp = static_cast<long> (p.value ());
    ACE_OS::sprintf (buf, "%ld", temp);
    value = buf;
  }

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.

    : name(p.name())
  {
    ACE_TCHAR buf[128];
    ACE_UINT64 us = p.value();
#ifdef ACE_LACKS_LONGLONG_T
    us.as_string(buf);
#else
    ACE_OS::sprintf(buf, ACE_UINT64_FORMAT_SPECIFIER, us);
#endif /* ACE_LACKS_LONGLONG_T */
    value = ACE_TEXT_ALWAYS_CHAR (buf);
  }

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.

    : name(p.name())
  {
    value = p.value() ? "true" : "false";
  }

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.

    : name(n)
  {
    char buf[64];
    long temp = v;
    ACE_OS::sprintf (buf, "%ld", temp);
    value = buf;
  }

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.

    : name(n), value(v)
  {
  }

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.

    : name(n), value(v)
  {
  }


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.

  {
    return ! (rhs == *this);
  }

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

Assignment operator.

Definition at line 95 of file Name_Value_Pair.cpp.

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


Member Data Documentation

Definition at line 62 of file Name_Value_Pair.h.

Definition at line 63 of file Name_Value_Pair.h.


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