OpenDDS  Snapshot(2023/04/28-20:55)
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 402 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 766 of file DynamicDataImpl.cpp.

◆ SingleValue() [4/16]

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

Definition at line 770 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 802 of file DynamicDataImpl.cpp.

◆ SingleValue() [13/16]

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

Definition at line 806 of file DynamicDataImpl.cpp.

◆ SingleValue() [14/16]

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

Definition at line 810 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 907 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().

908  : kind_(other.kind_)
909  , active_(0)
910 {
911  switch (kind_) {
912  case TK_INT8:
914  break;
915  case TK_UINT8:
917  break;
918  case TK_INT16:
919  int16_ = other.int16_;
920  break;
921  case TK_UINT16:
922  uint16_ = other.uint16_;
923  break;
924  case TK_INT32:
925  int32_ = other.int32_;
926  break;
927  case TK_UINT32:
928  uint32_ = other.uint32_;
929  break;
930  case TK_INT64:
931  int64_ = other.int64_;
932  break;
933  case TK_UINT64:
934  uint64_ = other.uint64_;
935  break;
936  case TK_FLOAT32:
937  float32_ = other.float32_;
938  break;
939  case TK_FLOAT64:
940  float64_ = other.float64_;
941  break;
942  case TK_FLOAT128:
943  float128_ = other.float128_;
944  break;
945  case TK_BOOLEAN:
947  break;
948  case TK_BYTE:
950  break;
951  case TK_CHAR8:
953  break;
954  case TK_STRING8:
955  str_ = CORBA::string_dup(other.str_);
956  break;
957 #ifdef DDS_HAS_WCHAR
958  case TK_CHAR16:
959  active_ = new(char16_) ACE_OutputCDR::from_wchar(other.get<ACE_OutputCDR::from_wchar>());
960  break;
961  case TK_STRING16:
962  wstr_ = CORBA::wstring_dup(other.wstr_);
963  break;
964 #endif
965  }
966 }
const TypeKind TK_INT32
Definition: TypeObject.h:217
const TypeKind TK_STRING16
Definition: TypeObject.h:232
const TypeKind TK_FLOAT128
Definition: TypeObject.h:224
const TypeKind TK_BYTE
Definition: TypeObject.h:215
const TypeKind TK_INT16
Definition: TypeObject.h:216
unsigned char uint8_[sizeof(ACE_OutputCDR::from_uint8)]
const TypeKind TK_UINT16
Definition: TypeObject.h:219
const TypeKind TK_INT8
Definition: TypeObject.h:225
char * string_dup(const char *)
const TypeKind TK_BOOLEAN
Definition: TypeObject.h:214
WChar * wstring_dup(const WChar *const)
unsigned char char8_[sizeof(ACE_OutputCDR::from_char)]
const TypeKind TK_CHAR8
Definition: TypeObject.h:227
unsigned char boolean_[sizeof(ACE_OutputCDR::from_boolean)]
const TypeKind TK_FLOAT32
Definition: TypeObject.h:222
const TypeKind TK_STRING8
Definition: TypeObject.h:231
const TypeKind TK_UINT64
Definition: TypeObject.h:221
unsigned char byte_[sizeof(ACE_OutputCDR::from_octet)]
const TypeKind TK_INT64
Definition: TypeObject.h:218
const TypeKind TK_UINT32
Definition: TypeObject.h:220
unsigned char int8_[sizeof(ACE_OutputCDR::from_int8)]
const TypeKind TK_UINT8
Definition: TypeObject.h:226
const TypeKind TK_CHAR16
Definition: TypeObject.h:228
const TypeKind TK_FLOAT64
Definition: TypeObject.h:223

◆ ~SingleValue()

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

Definition at line 828 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().

829 {
830 #define SINGLE_VALUE_DESTRUCT(T) static_cast<ACE_OutputCDR::T*>(active_)->~T(); break
831  switch (kind_) {
832  case TK_INT8:
833  SINGLE_VALUE_DESTRUCT(from_int8);
834  case TK_UINT8:
835  SINGLE_VALUE_DESTRUCT(from_uint8);
836  case TK_CHAR8:
837  SINGLE_VALUE_DESTRUCT(from_char);
838  case TK_BYTE:
839  SINGLE_VALUE_DESTRUCT(from_octet);
840  case TK_BOOLEAN:
841  SINGLE_VALUE_DESTRUCT(from_boolean);
842  case TK_STRING8:
843  CORBA::string_free((char*)str_);
844  break;
845 #ifdef DDS_HAS_WCHAR
846  case TK_CHAR16:
847  SINGLE_VALUE_DESTRUCT(from_wchar);
848  case TK_STRING16:
850  break;
851 #endif
852  }
853 #undef SINGLE_VALUE_DESTRUCT
854 }
const TypeKind TK_STRING16
Definition: TypeObject.h:232
const TypeKind TK_BYTE
Definition: TypeObject.h:215
void wstring_free(WChar *const)
const TypeKind TK_INT8
Definition: TypeObject.h:225
const TypeKind TK_BOOLEAN
Definition: TypeObject.h:214
const TypeKind TK_CHAR8
Definition: TypeObject.h:227
void string_free(char *)
#define SINGLE_VALUE_DESTRUCT(T)
const TypeKind TK_STRING8
Definition: TypeObject.h:231
ACE_CDR::WChar WChar
const TypeKind TK_UINT8
Definition: TypeObject.h:226
const TypeKind TK_CHAR16
Definition: TypeObject.h:228

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 856 of file DynamicDataImpl.cpp.

References int32_.

◆ get() [3/16]

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

Definition at line 857 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 859 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 864 of file DynamicDataImpl.cpp.

References active_.

◆ get() [6/16]

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

Definition at line 869 of file DynamicDataImpl.cpp.

References int16_.

◆ get() [7/16]

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

Definition at line 870 of file DynamicDataImpl.cpp.

References uint16_.

◆ get() [8/16]

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

Definition at line 871 of file DynamicDataImpl.cpp.

References int64_.

◆ get() [9/16]

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

Definition at line 872 of file DynamicDataImpl.cpp.

References uint64_.

872 { return uint64_; }

◆ get() [10/16]

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

Definition at line 873 of file DynamicDataImpl.cpp.

References float32_.

◆ get() [11/16]

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

Definition at line 874 of file DynamicDataImpl.cpp.

References float64_.

◆ get() [12/16]

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

Definition at line 875 of file DynamicDataImpl.cpp.

References float128_.

875 { return float128_; }

◆ get() [13/16]

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

Definition at line 877 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 882 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 887 of file DynamicDataImpl.cpp.

References active_.

◆ get() [16/16]

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

Definition at line 892 of file DynamicDataImpl.cpp.

References active_, get(), and str_.

◆ get_string()

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

Definition at line 903 of file DynamicDataImpl.cpp.

References str_, and CORBA::string_dup().

903 { 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 904 of file DynamicDataImpl.cpp.

References CORBA::wstring_dup().

904 { 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 437 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 452 of file DynamicDataImpl.h.

Referenced by SingleValue().

◆ byte_

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

Definition at line 451 of file DynamicDataImpl.h.

Referenced by SingleValue().

◆ char8_

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

Definition at line 450 of file DynamicDataImpl.h.

Referenced by SingleValue().

◆ float128_

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

Definition at line 449 of file DynamicDataImpl.h.

Referenced by get(), and SingleValue().

◆ float32_

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

Definition at line 447 of file DynamicDataImpl.h.

Referenced by get(), and SingleValue().

◆ float64_

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

Definition at line 448 of file DynamicDataImpl.h.

Referenced by get(), and SingleValue().

◆ int16_

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

Definition at line 443 of file DynamicDataImpl.h.

Referenced by get(), and SingleValue().

◆ int32_

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

Definition at line 439 of file DynamicDataImpl.h.

Referenced by get(), and SingleValue().

◆ int64_

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

Definition at line 445 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 441 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 444 of file DynamicDataImpl.h.

Referenced by get(), and SingleValue().

◆ uint32_

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

Definition at line 440 of file DynamicDataImpl.h.

Referenced by get(), and SingleValue().

◆ uint64_

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

Definition at line 446 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 442 of file DynamicDataImpl.h.

Referenced by SingleValue().


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