OpenDDS  Snapshot(2023/04/07-19:43)
Public Member Functions | Public Attributes | Private Member Functions | List of all members
OpenDDS::XTypes::DynamicDataImpl::SingleValue Struct Reference
Collaboration diagram for OpenDDS::XTypes::DynamicDataImpl::SingleValue:
Collaboration graph
[legend]

Public Member Functions

 SingleValue (CORBA::Long int32)
 
 SingleValue (CORBA::ULong uint32)
 
 SingleValue (ACE_OutputCDR::from_int8 from_int8)
 
 SingleValue (ACE_OutputCDR::from_uint8 from_uint8)
 
 SingleValue (CORBA::Short int16)
 
 SingleValue (CORBA::UShort uint16)
 
 SingleValue (CORBA::LongLong int64)
 
 SingleValue (CORBA::ULongLong uint64)
 
 SingleValue (CORBA::Float float32)
 
 SingleValue (CORBA::Double float64)
 
 SingleValue (CORBA::LongDouble float128)
 
 SingleValue (ACE_OutputCDR::from_char from_char)
 
 SingleValue (ACE_OutputCDR::from_octet from_octet)
 
 SingleValue (ACE_OutputCDR::from_boolean from_bool)
 
 SingleValue (const char *str)
 
 SingleValue (const SingleValue &other)
 
 ~SingleValue ()
 
template<typename T >
const T & get () const
 
char * get_string () const
 
CORBA::WCharget_wstring () const
 
template<>
const CORBA::Longget () const
 
template<>
const CORBA::ULongget () const
 
template<>
const ACE_OutputCDR::from_int8get () const
 
template<>
const ACE_OutputCDR::from_uint8get () const
 
template<>
const CORBA::Shortget () const
 
template<>
const CORBA::UShortget () const
 
template<>
const CORBA::LongLongget () const
 
template<>
const CORBA::ULongLongget () const
 
template<>
const CORBA::Floatget () const
 
template<>
const CORBA::Doubleget () const
 
template<>
const CORBA::LongDoubleget () const
 
template<>
const ACE_OutputCDR::from_charget () const
 
template<>
const ACE_OutputCDR::from_octetget () const
 
template<>
const ACE_OutputCDR::from_booleanget () const
 
template<>
const char *const & get () const
 

Public Attributes

TypeKind kind_
 
void * active_
 
union {
   CORBA::Long   int32_
 
   CORBA::ULong   uint32_
 
   unsigned char   int8_ [sizeof(ACE_OutputCDR::from_int8)]
 
   unsigned char   uint8_ [sizeof(ACE_OutputCDR::from_uint8)]
 
   CORBA::Short   int16_
 
   CORBA::UShort   uint16_
 
   CORBA::LongLong   int64_
 
   CORBA::ULongLong   uint64_
 
   CORBA::Float   float32_
 
   CORBA::Double   float64_
 
   CORBA::LongDouble   float128_
 
   unsigned char   char8_ [sizeof(ACE_OutputCDR::from_char)]
 
   unsigned char   byte_ [sizeof(ACE_OutputCDR::from_octet)]
 
   unsigned char   boolean_ [sizeof(ACE_OutputCDR::from_boolean)]
 
   const char *   str_
 
}; 
 

Private Member Functions

SingleValueoperator= (const SingleValue &)
 

Detailed Description

Definition at line 412 of file DynamicDataImpl.h.

Constructor & Destructor Documentation

◆ SingleValue() [1/16]

OpenDDS::XTypes::DynamicDataImpl::SingleValue::SingleValue ( CORBA::Long  int32)

◆ SingleValue() [2/16]

OpenDDS::XTypes::DynamicDataImpl::SingleValue::SingleValue ( CORBA::ULong  uint32)

◆ SingleValue() [3/16]

OpenDDS::XTypes::DynamicDataImpl::SingleValue::SingleValue ( ACE_OutputCDR::from_int8  from_int8)

Definition at line 809 of file DynamicDataImpl.cpp.

◆ SingleValue() [4/16]

OpenDDS::XTypes::DynamicDataImpl::SingleValue::SingleValue ( ACE_OutputCDR::from_uint8  from_uint8)

Definition at line 813 of file DynamicDataImpl.cpp.

◆ SingleValue() [5/16]

OpenDDS::XTypes::DynamicDataImpl::SingleValue::SingleValue ( CORBA::Short  int16)

◆ SingleValue() [6/16]

OpenDDS::XTypes::DynamicDataImpl::SingleValue::SingleValue ( CORBA::UShort  uint16)

◆ SingleValue() [7/16]

OpenDDS::XTypes::DynamicDataImpl::SingleValue::SingleValue ( CORBA::LongLong  int64)

◆ SingleValue() [8/16]

OpenDDS::XTypes::DynamicDataImpl::SingleValue::SingleValue ( CORBA::ULongLong  uint64)

◆ SingleValue() [9/16]

OpenDDS::XTypes::DynamicDataImpl::SingleValue::SingleValue ( CORBA::Float  float32)

◆ SingleValue() [10/16]

OpenDDS::XTypes::DynamicDataImpl::SingleValue::SingleValue ( CORBA::Double  float64)

◆ SingleValue() [11/16]

OpenDDS::XTypes::DynamicDataImpl::SingleValue::SingleValue ( CORBA::LongDouble  float128)

◆ SingleValue() [12/16]

OpenDDS::XTypes::DynamicDataImpl::SingleValue::SingleValue ( ACE_OutputCDR::from_char  from_char)

Definition at line 845 of file DynamicDataImpl.cpp.

◆ SingleValue() [13/16]

OpenDDS::XTypes::DynamicDataImpl::SingleValue::SingleValue ( ACE_OutputCDR::from_octet  from_octet)

Definition at line 849 of file DynamicDataImpl.cpp.

◆ SingleValue() [14/16]

OpenDDS::XTypes::DynamicDataImpl::SingleValue::SingleValue ( ACE_OutputCDR::from_boolean  from_bool)

Definition at line 853 of file DynamicDataImpl.cpp.

◆ SingleValue() [15/16]

OpenDDS::XTypes::DynamicDataImpl::SingleValue::SingleValue ( const char *  str)

◆ SingleValue() [16/16]

OpenDDS::XTypes::DynamicDataImpl::SingleValue::SingleValue ( const SingleValue other)

Definition at line 950 of file DynamicDataImpl.cpp.

References active_, boolean_, byte_, char8_, float128_, float32_, float64_, get(), int16_, int32_, int64_, int8_, kind_, str_, CORBA::string_dup(), OpenDDS::XTypes::TK_BOOLEAN, OpenDDS::XTypes::TK_BYTE, OpenDDS::XTypes::TK_CHAR16, OpenDDS::XTypes::TK_CHAR8, OpenDDS::XTypes::TK_FLOAT128, OpenDDS::XTypes::TK_FLOAT32, OpenDDS::XTypes::TK_FLOAT64, OpenDDS::XTypes::TK_INT16, OpenDDS::XTypes::TK_INT32, OpenDDS::XTypes::TK_INT64, OpenDDS::XTypes::TK_INT8, OpenDDS::XTypes::TK_STRING16, OpenDDS::XTypes::TK_STRING8, OpenDDS::XTypes::TK_UINT16, OpenDDS::XTypes::TK_UINT32, OpenDDS::XTypes::TK_UINT64, OpenDDS::XTypes::TK_UINT8, uint16_, uint32_, uint64_, uint8_, and CORBA::wstring_dup().

951  : kind_(other.kind_)
952  , active_(0)
953 {
954  switch (kind_) {
955  case TK_INT8:
957  break;
958  case TK_UINT8:
960  break;
961  case TK_INT16:
962  int16_ = other.int16_;
963  break;
964  case TK_UINT16:
965  uint16_ = other.uint16_;
966  break;
967  case TK_INT32:
968  int32_ = other.int32_;
969  break;
970  case TK_UINT32:
971  uint32_ = other.uint32_;
972  break;
973  case TK_INT64:
974  int64_ = other.int64_;
975  break;
976  case TK_UINT64:
977  uint64_ = other.uint64_;
978  break;
979  case TK_FLOAT32:
980  float32_ = other.float32_;
981  break;
982  case TK_FLOAT64:
983  float64_ = other.float64_;
984  break;
985  case TK_FLOAT128:
986  float128_ = other.float128_;
987  break;
988  case TK_BOOLEAN:
990  break;
991  case TK_BYTE:
993  break;
994  case TK_CHAR8:
996  break;
997  case TK_STRING8:
998  str_ = CORBA::string_dup(other.str_);
999  break;
1000 #ifdef DDS_HAS_WCHAR
1001  case TK_CHAR16:
1002  active_ = new(char16_) ACE_OutputCDR::from_wchar(other.get<ACE_OutputCDR::from_wchar>());
1003  break;
1004  case TK_STRING16:
1005  wstr_ = CORBA::wstring_dup(other.wstr_);
1006  break;
1007 #endif
1008  }
1009 }
const TypeKind TK_INT8
Definition: TypeObject.h:225
const TypeKind TK_FLOAT128
Definition: TypeObject.h:224
const TypeKind TK_CHAR16
Definition: TypeObject.h:228
unsigned char uint8_[sizeof(ACE_OutputCDR::from_uint8)]
const TypeKind TK_INT32
Definition: TypeObject.h:217
const TypeKind TK_CHAR8
Definition: TypeObject.h:227
const TypeKind TK_STRING16
Definition: TypeObject.h:232
const TypeKind TK_UINT16
Definition: TypeObject.h:219
unsigned char boolean_[sizeof(ACE_OutputCDR::from_boolean)]
unsigned char char8_[sizeof(ACE_OutputCDR::from_char)]
char * string_dup(const char *)
const TypeKind TK_INT64
Definition: TypeObject.h:218
const TypeKind TK_UINT8
Definition: TypeObject.h:226
const TypeKind TK_FLOAT32
Definition: TypeObject.h:222
const TypeKind TK_BOOLEAN
Definition: TypeObject.h:214
WChar * wstring_dup(const WChar *const)
const TypeKind TK_INT16
Definition: TypeObject.h:216
const TypeKind TK_FLOAT64
Definition: TypeObject.h:223
unsigned char int8_[sizeof(ACE_OutputCDR::from_int8)]
const TypeKind TK_STRING8
Definition: TypeObject.h:231
const TypeKind TK_UINT32
Definition: TypeObject.h:220
const TypeKind TK_BYTE
Definition: TypeObject.h:215
const TypeKind TK_UINT64
Definition: TypeObject.h:221
unsigned char byte_[sizeof(ACE_OutputCDR::from_octet)]

◆ ~SingleValue()

OpenDDS::XTypes::DynamicDataImpl::SingleValue::~SingleValue ( )

Definition at line 871 of file DynamicDataImpl.cpp.

References kind_, SINGLE_VALUE_DESTRUCT, str_, CORBA::string_free(), OpenDDS::XTypes::TK_BOOLEAN, OpenDDS::XTypes::TK_BYTE, OpenDDS::XTypes::TK_CHAR16, OpenDDS::XTypes::TK_CHAR8, OpenDDS::XTypes::TK_INT8, OpenDDS::XTypes::TK_STRING16, OpenDDS::XTypes::TK_STRING8, OpenDDS::XTypes::TK_UINT8, and CORBA::wstring_free().

872 {
873 #define SINGLE_VALUE_DESTRUCT(T) static_cast<ACE_OutputCDR::T*>(active_)->~T(); break
874  switch (kind_) {
875  case TK_INT8:
876  SINGLE_VALUE_DESTRUCT(from_int8);
877  case TK_UINT8:
878  SINGLE_VALUE_DESTRUCT(from_uint8);
879  case TK_CHAR8:
880  SINGLE_VALUE_DESTRUCT(from_char);
881  case TK_BYTE:
882  SINGLE_VALUE_DESTRUCT(from_octet);
883  case TK_BOOLEAN:
884  SINGLE_VALUE_DESTRUCT(from_boolean);
885  case TK_STRING8:
886  CORBA::string_free((char*)str_);
887  break;
888 #ifdef DDS_HAS_WCHAR
889  case TK_CHAR16:
890  SINGLE_VALUE_DESTRUCT(from_wchar);
891  case TK_STRING16:
893  break;
894 #endif
895  }
896 #undef SINGLE_VALUE_DESTRUCT
897 }
const TypeKind TK_INT8
Definition: TypeObject.h:225
void wstring_free(WChar *const)
const TypeKind TK_CHAR16
Definition: TypeObject.h:228
const TypeKind TK_CHAR8
Definition: TypeObject.h:227
const TypeKind TK_STRING16
Definition: TypeObject.h:232
const TypeKind TK_UINT8
Definition: TypeObject.h:226
const TypeKind TK_BOOLEAN
Definition: TypeObject.h:214
void string_free(char *)
const TypeKind TK_STRING8
Definition: TypeObject.h:231
const TypeKind TK_BYTE
Definition: TypeObject.h:215
ACE_CDR::WChar WChar
#define SINGLE_VALUE_DESTRUCT(T)

Member Function Documentation

◆ get() [1/16]

template<typename T >
const T& OpenDDS::XTypes::DynamicDataImpl::SingleValue::get ( ) const

◆ get() [2/16]

template<>
const CORBA::Long& OpenDDS::XTypes::DynamicDataImpl::SingleValue::get ( void  ) const

Definition at line 899 of file DynamicDataImpl.cpp.

References int32_.

◆ get() [3/16]

template<>
const CORBA::ULong& OpenDDS::XTypes::DynamicDataImpl::SingleValue::get ( void  ) const

Definition at line 900 of file DynamicDataImpl.cpp.

References uint32_.

◆ get() [4/16]

template<>
const ACE_OutputCDR::from_int8& OpenDDS::XTypes::DynamicDataImpl::SingleValue::get ( void  ) const

Definition at line 902 of file DynamicDataImpl.cpp.

References active_.

◆ get() [5/16]

template<>
const ACE_OutputCDR::from_uint8& OpenDDS::XTypes::DynamicDataImpl::SingleValue::get ( void  ) const

Definition at line 907 of file DynamicDataImpl.cpp.

References active_.

◆ get() [6/16]

template<>
const CORBA::Short& OpenDDS::XTypes::DynamicDataImpl::SingleValue::get ( void  ) const

Definition at line 912 of file DynamicDataImpl.cpp.

References int16_.

◆ get() [7/16]

template<>
const CORBA::UShort& OpenDDS::XTypes::DynamicDataImpl::SingleValue::get ( void  ) const

Definition at line 913 of file DynamicDataImpl.cpp.

References uint16_.

◆ get() [8/16]

template<>
const CORBA::LongLong& OpenDDS::XTypes::DynamicDataImpl::SingleValue::get ( void  ) const

Definition at line 914 of file DynamicDataImpl.cpp.

References int64_.

◆ get() [9/16]

template<>
const CORBA::ULongLong& OpenDDS::XTypes::DynamicDataImpl::SingleValue::get ( void  ) const

Definition at line 915 of file DynamicDataImpl.cpp.

References uint64_.

915 { return uint64_; }

◆ get() [10/16]

template<>
const CORBA::Float& OpenDDS::XTypes::DynamicDataImpl::SingleValue::get ( void  ) const

Definition at line 916 of file DynamicDataImpl.cpp.

References float32_.

◆ get() [11/16]

template<>
const CORBA::Double& OpenDDS::XTypes::DynamicDataImpl::SingleValue::get ( void  ) const

Definition at line 917 of file DynamicDataImpl.cpp.

References float64_.

◆ get() [12/16]

template<>
const CORBA::LongDouble& OpenDDS::XTypes::DynamicDataImpl::SingleValue::get ( void  ) const

Definition at line 918 of file DynamicDataImpl.cpp.

References float128_.

918 { return float128_; }

◆ get() [13/16]

template<>
const ACE_OutputCDR::from_char& OpenDDS::XTypes::DynamicDataImpl::SingleValue::get ( void  ) const

Definition at line 920 of file DynamicDataImpl.cpp.

References active_.

◆ get() [14/16]

template<>
const ACE_OutputCDR::from_octet& OpenDDS::XTypes::DynamicDataImpl::SingleValue::get ( void  ) const

Definition at line 925 of file DynamicDataImpl.cpp.

References active_.

◆ get() [15/16]

template<>
const ACE_OutputCDR::from_boolean& OpenDDS::XTypes::DynamicDataImpl::SingleValue::get ( void  ) const

Definition at line 930 of file DynamicDataImpl.cpp.

References active_.

◆ get() [16/16]

template<>
const char* const& OpenDDS::XTypes::DynamicDataImpl::SingleValue::get ( void  ) const

Definition at line 935 of file DynamicDataImpl.cpp.

References active_, get(), and str_.

◆ get_string()

char * OpenDDS::XTypes::DynamicDataImpl::SingleValue::get_string ( void  ) const

Definition at line 946 of file DynamicDataImpl.cpp.

References str_, and CORBA::string_dup().

946 { return CORBA::string_dup(str_); }
char * string_dup(const char *)

◆ get_wstring()

CORBA::WChar * OpenDDS::XTypes::DynamicDataImpl::SingleValue::get_wstring ( void  ) const

Definition at line 947 of file DynamicDataImpl.cpp.

References CORBA::wstring_dup().

947 { return CORBA::wstring_dup(wstr_); }
WChar * wstring_dup(const WChar *const)

◆ operator=()

SingleValue& OpenDDS::XTypes::DynamicDataImpl::SingleValue::operator= ( const SingleValue )
private

Member Data Documentation

◆ @19

union { ... }

◆ active_

void* OpenDDS::XTypes::DynamicDataImpl::SingleValue::active_

Definition at line 447 of file DynamicDataImpl.h.

Referenced by get(), and SingleValue().

◆ boolean_

unsigned char OpenDDS::XTypes::DynamicDataImpl::SingleValue::boolean_[sizeof(ACE_OutputCDR::from_boolean)]

Definition at line 462 of file DynamicDataImpl.h.

Referenced by SingleValue().

◆ byte_

unsigned char OpenDDS::XTypes::DynamicDataImpl::SingleValue::byte_[sizeof(ACE_OutputCDR::from_octet)]

Definition at line 461 of file DynamicDataImpl.h.

Referenced by SingleValue().

◆ char8_

unsigned char OpenDDS::XTypes::DynamicDataImpl::SingleValue::char8_[sizeof(ACE_OutputCDR::from_char)]

Definition at line 460 of file DynamicDataImpl.h.

Referenced by SingleValue().

◆ float128_

CORBA::LongDouble OpenDDS::XTypes::DynamicDataImpl::SingleValue::float128_

Definition at line 459 of file DynamicDataImpl.h.

Referenced by get(), and SingleValue().

◆ float32_

CORBA::Float OpenDDS::XTypes::DynamicDataImpl::SingleValue::float32_

Definition at line 457 of file DynamicDataImpl.h.

Referenced by get(), and SingleValue().

◆ float64_

CORBA::Double OpenDDS::XTypes::DynamicDataImpl::SingleValue::float64_

Definition at line 458 of file DynamicDataImpl.h.

Referenced by get(), and SingleValue().

◆ int16_

CORBA::Short OpenDDS::XTypes::DynamicDataImpl::SingleValue::int16_

Definition at line 453 of file DynamicDataImpl.h.

Referenced by get(), and SingleValue().

◆ int32_

CORBA::Long OpenDDS::XTypes::DynamicDataImpl::SingleValue::int32_

Definition at line 449 of file DynamicDataImpl.h.

Referenced by get(), and SingleValue().

◆ int64_

CORBA::LongLong OpenDDS::XTypes::DynamicDataImpl::SingleValue::int64_

Definition at line 455 of file DynamicDataImpl.h.

Referenced by get(), and SingleValue().

◆ int8_

unsigned char OpenDDS::XTypes::DynamicDataImpl::SingleValue::int8_[sizeof(ACE_OutputCDR::from_int8)]

Definition at line 451 of file DynamicDataImpl.h.

Referenced by SingleValue().

◆ kind_

TypeKind OpenDDS::XTypes::DynamicDataImpl::SingleValue::kind_

◆ str_

const char* OpenDDS::XTypes::DynamicDataImpl::SingleValue::str_

◆ uint16_

CORBA::UShort OpenDDS::XTypes::DynamicDataImpl::SingleValue::uint16_

Definition at line 454 of file DynamicDataImpl.h.

Referenced by get(), and SingleValue().

◆ uint32_

CORBA::ULong OpenDDS::XTypes::DynamicDataImpl::SingleValue::uint32_

Definition at line 450 of file DynamicDataImpl.h.

Referenced by get(), and SingleValue().

◆ uint64_

CORBA::ULongLong OpenDDS::XTypes::DynamicDataImpl::SingleValue::uint64_

Definition at line 456 of file DynamicDataImpl.h.

Referenced by get(), and SingleValue().

◆ uint8_

unsigned char OpenDDS::XTypes::DynamicDataImpl::SingleValue::uint8_[sizeof(ACE_OutputCDR::from_uint8)]

Definition at line 452 of file DynamicDataImpl.h.

Referenced by SingleValue().


The documentation for this struct was generated from the following files: