OpenDDS  Snapshot(2023/04/07-19:43)
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
DDS::DynamicTypeSupport Class Reference

#include <DynamicTypeSupport.h>

Inheritance diagram for DDS::DynamicTypeSupport:
Inheritance graph
[legend]
Collaboration diagram for DDS::DynamicTypeSupport:
Collaboration graph
[legend]

Public Types

typedef DynamicTypeSupport_ptr _ptr_type
 
typedef DynamicTypeSupport_var _var_type
 
- Public Types inherited from OpenDDS::DCPS::LocalObject< TypeSupport >
typedef TypeSupport ::_ptr_type _ptr_type
 
typedef TypeSupport ::_var_type _var_type
 
- Public Types inherited from CORBA::LocalObject
typedef LocalObject_ptr _ptr_type
 
typedef LocalObject_var _var_type
 
typedef LocalObject_out _out_type
 
- Public Types inherited from CORBA::Object
typedef Object_ptr _ptr_type
 
typedef Object_var _var_type
 
typedef Object_out _out_type
 

Public Member Functions

 DynamicTypeSupport (DynamicType_ptr type)
 
virtual ~DynamicTypeSupport ()
 
const char * name () const
 
size_t key_count () const
 
bool is_dcps_key (const char *field) const
 
void representations_allowed_by_type (DataRepresentationIdSeq &seq)
 
OpenDDS::DCPS::Extensibility base_extensibility () const
 Returns the extensibility of just the topic type. More...
 
OpenDDS::DCPS::Extensibility max_extensibility () const
 
OpenDDS::DCPS::SerializedSizeBound serialized_size_bound (const OpenDDS::DCPS::Encoding &) const
 
OpenDDS::DCPS::SerializedSizeBound key_only_serialized_size_bound (const OpenDDS::DCPS::Encoding &) const
 
DataWriter_ptr create_datawriter ()
 
DataReader_ptr create_datareader ()
 
DataReader_ptr create_multitopic_datareader ()
 
const OpenDDS::XTypes::TypeIdentifiergetMinimalTypeIdentifier () const
 
const OpenDDS::XTypes::TypeMap & getMinimalTypeMap () const
 
const OpenDDS::XTypes::TypeIdentifiergetCompleteTypeIdentifier () const
 
const OpenDDS::XTypes::TypeMap & getCompleteTypeMap () const
 
const OpenDDS::XTypes::TypeInformationpreset_type_info () const
 
DynamicType_ptr get_type ()
 
const OpenDDS::DCPS::MetaStructgetMetaStructForType () const
 
CORBA::Boolean _is_a (const char *type_id)
 
const char * _interface_repository_id () const
 
CORBA::Boolean marshal (TAO_OutputCDR &)
 
- Public Member Functions inherited from OpenDDS::DCPS::TypeSupportImpl
 TypeSupportImpl ()
 
 TypeSupportImpl (DDS::DynamicType_ptr type)
 
virtual ~TypeSupportImpl ()
 
virtual DDS::ReturnCode_t register_type (DDS::DomainParticipant_ptr participant, const char *type_name)
 
virtual DDS::ReturnCode_t unregister_type (DDS::DomainParticipant_ptr participant, const char *type_name)
 
virtual char * get_type_name ()
 
virtual DDS::DynamicType_ptr get_type () const
 
DDS::DynamicType_ptr get_type ()
 
bool has_dcps_key ()
 
void to_type_info (XTypes::TypeInformation &type_info) const
 
void add_types (const XTypes::TypeLookupService_rch &tls) const
 
- Public Member Functions inherited from OpenDDS::DCPS::TypeSupport
::DDS::ReturnCode_t unregister_type (in ::DDS::DomainParticipant domain, in string type_name)
 
void representations_allowed_by_type (inout ::DDS::DataRepresentationIdSeq seq)
 Get allowed representations defined by IDL annotations. More...
 
- Public Member Functions inherited from DDS::TypeSupport
ReturnCode_t register_type (in DomainParticipant domain, in string type_name)
 
 OpenDDS::hidden_op_in_java ("return 0;") DynamicType get_type()
 
- Public Member Functions inherited from OpenDDS::DCPS::LocalObjectBase
virtual void _add_ref ()
 
virtual void _remove_ref ()
 
virtual CORBA::ULong _refcount_value () const
 
- Public Member Functions inherited from CORBA::LocalObject
virtual ~LocalObject (void)
 
virtual CORBA::Boolean _non_existent (void)
 
virtual char * _repository_id (void)
 
virtual CORBA::InterfaceDef_ptr _get_interface (void)
 
virtual CORBA::Object_ptr _get_component (void)
 
virtual void _create_request (CORBA::Context_ptr ctx, const char *operation, CORBA::NVList_ptr arg_list, CORBA::NamedValue_ptr result, CORBA::Request_ptr &request, CORBA::Flags req_flags)
 
virtual void _create_request (CORBA::Context_ptr ctx, const char *operation, CORBA::NVList_ptr arg_list, CORBA::NamedValue_ptr result, CORBA::ExceptionList_ptr exclist, CORBA::ContextList_ptr ctxtlist, CORBA::Request_ptr &request, CORBA::Flags req_flags)
 
virtual CORBA::Request_ptr _request (const char *operation)
 
CORBA::Policy_ptr _get_policy (CORBA::PolicyType type)
 
CORBA::Policy_ptr _get_cached_policy (TAO_Cached_Policy_Type type)
 
CORBA::Object_ptr _set_policy_overrides (const CORBA::PolicyList &policies, CORBA::SetOverrideType set_add)
 
CORBA::PolicyList_get_policy_overrides (const CORBA::PolicyTypeSeq &types)
 
CORBA::Boolean _validate_connection (CORBA::PolicyList_out inconsistent_policies)
 
virtual CORBA::ULong _hash (CORBA::ULong maximum)
 
virtual CORBA::Boolean _is_equivalent (CORBA::Object_ptr other_obj)
 
virtual CORBA::ORB_ptr _get_orb (void)
 
virtual TAO::ObjectKey_key (void)
 
- Public Member Functions inherited from CORBA::Object
virtual ~Object (void)
 
virtual TAO_Abstract_ServantBase_servant (void) const
 
virtual CORBA::Boolean _is_collocated (void) const
 
virtual CORBA::Boolean _is_local (void) const
 
 Object (TAO_Stub *p, CORBA::Boolean collocated=false, TAO_Abstract_ServantBase *servant=0, TAO_ORB_Core *orb_core=0)
 
 Object (IOP::IOR *ior, TAO_ORB_Core *orb_core)
 
virtual TAO_Stub_stubobj (void) const
 
virtual TAO_Stub_stubobj (void)
 
virtual void _proxy_broker (TAO::Object_Proxy_Broker *proxy_broker)
 
CORBA::Boolean is_evaluated (void) const
 
TAO_ORB_Coreorb_core (void) const
 
IOP::IORsteal_ior (void)
 
const IOP::IORior (void) const
 
virtual bool can_convert_to_ior (void) const
 
virtual char * convert_to_ior (bool use_omg_ior_format, const char *ior_prefix) const
 
void _decr_refcount (void)
 
CORBA::Policy_ptr _get_policy (CORBA::PolicyType type)
 
CORBA::Policy_ptr _get_cached_policy (TAO_Cached_Policy_Type type)
 
CORBA::Object_ptr _set_policy_overrides (const CORBA::PolicyList &policies, CORBA::SetOverrideType set_add)
 
CORBA::PolicyList_get_policy_overrides (const CORBA::PolicyTypeSeq &types)
 
CORBA::Boolean _validate_connection (CORBA::PolicyList_out inconsistent_policies)
 
- Public Member Functions inherited from OpenDDS::DCPS::RcObject
virtual ~RcObject ()
 
long ref_count () const
 
WeakObject_get_weak_object () const
 

Static Public Member Functions

static DynamicTypeSupport_ptr _duplicate (DynamicTypeSupport_ptr obj)
 
- Static Public Member Functions inherited from OpenDDS::DCPS::LocalObject< TypeSupport >
static _ptr_type _narrow (CORBA::Object_ptr obj)
 
- Static Public Member Functions inherited from CORBA::LocalObject
static LocalObject_ptr _duplicate (LocalObject_ptr obj)
 
static LocalObject_ptr _nil (void)
 
static LocalObject_ptr _narrow (CORBA::Object_ptr obj)
 
- Static Public Member Functions inherited from CORBA::Object
static CORBA::Boolean marshal (const Object_ptr x, TAO_OutputCDR &cdr)
 
static void _tao_any_destructor (void *)
 
static CORBA::Boolean is_nil_i (CORBA::Object_ptr obj)
 
static void tao_object_initialize (Object *)
 
static CORBA::Object_ptr _duplicate (CORBA::Object_ptr obj)
 
static CORBA::Object_ptr _nil (void)
 
static CORBA::Object_ptr _narrow (CORBA::Object_ptr obj)
 

Protected Attributes

CORBA::String_var name_
 
- Protected Attributes inherited from OpenDDS::DCPS::TypeSupportImpl
DDS::DynamicType_var type_
 
- Protected Attributes inherited from CORBA::Object
ACE_Atomic_Op< TAO_SYNCH_MUTEX, unsigned long > refcount_
 

Additional Inherited Members

- Protected Member Functions inherited from OpenDDS::DCPS::TypeSupportImpl
void get_type_from_type_lookup_service ()
 
- Protected Member Functions inherited from CORBA::LocalObject
 LocalObject (void)
 
- Protected Member Functions inherited from CORBA::Object
 Object (int dummy=0)
 
TAO::Object_Proxy_Brokerproxy_broker () const
 
- Protected Member Functions inherited from OpenDDS::DCPS::RcObject
 RcObject ()
 

Detailed Description

Definition at line 83 of file DynamicTypeSupport.h.

Member Typedef Documentation

◆ _ptr_type

Definition at line 88 of file DynamicTypeSupport.h.

◆ _var_type

Definition at line 89 of file DynamicTypeSupport.h.

Constructor & Destructor Documentation

◆ DynamicTypeSupport()

DDS::DynamicTypeSupport::DynamicTypeSupport ( DynamicType_ptr  type)
inlineexplicit

Definition at line 91 of file DynamicTypeSupport.h.

92  : TypeSupportImpl(type)
93  , name_(type->get_name())
94  {
95  }

◆ ~DynamicTypeSupport()

virtual DDS::DynamicTypeSupport::~DynamicTypeSupport ( )
inlinevirtual

Definition at line 97 of file DynamicTypeSupport.h.

97 {}

Member Function Documentation

◆ _duplicate()

DynamicTypeSupport_ptr DDS::DynamicTypeSupport::_duplicate ( DynamicTypeSupport_ptr  obj)
static

Definition at line 320 of file DynamicTypeSupport.cpp.

References OpenDDS::DCPS::LocalObjectBase::_add_ref(), OPENDDS_END_VERSIONED_NAMESPACE_DECL, and TAO_BEGIN_VERSIONED_NAMESPACE_DECL.

Referenced by TAO::Objref_Traits< DDS::DynamicTypeSupport >::duplicate().

321  {
322  if (obj) {
323  obj->_add_ref();
324  }
325  return obj;
326  }

◆ _interface_repository_id()

const char* DDS::DynamicTypeSupport::_interface_repository_id ( void  ) const
inlinevirtual

Reimplemented from CORBA::Object.

Definition at line 150 of file DynamicTypeSupport.h.

151  {
152  return DynamicTypeSupportInterf::_interface_repository_id();
153  }

◆ _is_a()

CORBA::Boolean DDS::DynamicTypeSupport::_is_a ( const char *  type_id)
inlinevirtual

Reimplemented from CORBA::Object.

Definition at line 145 of file DynamicTypeSupport.h.

146  {
147  return DynamicTypeSupportInterf::_is_a(type_id);
148  }

◆ base_extensibility()

Extensibility DDS::DynamicTypeSupport::base_extensibility ( ) const
virtual

Returns the extensibility of just the topic type.

Implements OpenDDS::DCPS::TypeSupportImpl.

Definition at line 241 of file DynamicTypeSupport.cpp.

References ACE_ERROR, OpenDDS::DCPS::LogLevel::Error, OpenDDS::XTypes::extensibility(), OpenDDS::DCPS::FINAL, LM_ERROR, OpenDDS::DCPS::log_level, name, DDS::RETCODE_OK, and OpenDDS::DCPS::retcode_to_string().

242  {
244  const ReturnCode_t rc = extensibility(type_, ext);
245  if (rc != RETCODE_OK && log_level >= LogLevel::Error) {
246  ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: DynamicTypeSupport::base_extensibility: "
247  "could not get correct extensibility for DynamicType %C: %C\n",
248  name(), retcode_to_string(rc)));
249  }
250  return ext;
251  }
OpenDDS_Dcps_Export LogLevel log_level
#define ACE_ERROR(X)
const char * retcode_to_string(DDS::ReturnCode_t value)
Definition: DCPS_Utils.cpp:29
const ReturnCode_t RETCODE_OK
const char * name() const
extensibility(MUTABLE) struct TypeLookup_getTypes_In
Definition: TypeLookup.idl:29

◆ create_datareader()

DataReader_ptr DDS::DynamicTypeSupport::create_datareader ( )

create and activate a FooDataReader. Implemented by FooTypeSupportImpl. Subscriber::create_datareader() will set the topic, listener, qos and other initialization so the implementation of this method is as small and simple as possible.

Implements OpenDDS::DCPS::TypeSupport.

Definition at line 270 of file DynamicTypeSupport.cpp.

◆ create_datawriter()

DataWriter_ptr DDS::DynamicTypeSupport::create_datawriter ( )

create and activate a FooDataWriter. Implemented by FooTypeSupportImpl. Publisher::create_datawriter() will set the topic, listener, qos and other initialization so the implementation of this method is as small and simple as possible.

Implements OpenDDS::DCPS::TypeSupport.

Definition at line 265 of file DynamicTypeSupport.cpp.

◆ create_multitopic_datareader()

DataReader_ptr DDS::DynamicTypeSupport::create_multitopic_datareader ( )

Implements OpenDDS::DCPS::TypeSupport.

Definition at line 276 of file DynamicTypeSupport.cpp.

277  {
278  // TODO
279  return 0;
280  }

◆ get_type()

DynamicType_ptr DDS::DynamicTypeSupport::get_type ( void  )
inline

Definition at line 136 of file DynamicTypeSupport.h.

137  {
138  return DynamicType::_duplicate(type_);
139  }

◆ getCompleteTypeIdentifier()

const TypeIdentifier & DDS::DynamicTypeSupport::getCompleteTypeIdentifier ( ) const
virtual

Implements OpenDDS::DCPS::TypeSupportImpl.

Definition at line 295 of file DynamicTypeSupport.cpp.

References OpenDDS::XTypes::DynamicTypeImpl::get_complete_type_identifier().

296  {
297  DynamicTypeImpl* const dti = dynamic_cast<DynamicTypeImpl*>(type_.in());
298  return dti->get_complete_type_identifier();
299  }
const TypeIdentifier & get_complete_type_identifier() const

◆ getCompleteTypeMap()

const TypeMap & DDS::DynamicTypeSupport::getCompleteTypeMap ( ) const
virtual

Implements OpenDDS::DCPS::TypeSupportImpl.

Definition at line 301 of file DynamicTypeSupport.cpp.

References OpenDDS::XTypes::DynamicTypeImpl::get_complete_type_map().

302  {
303  DynamicTypeImpl* const dti = dynamic_cast<DynamicTypeImpl*>(type_.in());
304  return dti->get_complete_type_map();
305  }
const TypeMap & get_complete_type_map() const

◆ getMetaStructForType()

const OpenDDS::DCPS::MetaStruct & DDS::DynamicTypeSupport::getMetaStructForType ( ) const
virtual

Implements OpenDDS::DCPS::TypeSupportImpl.

Definition at line 314 of file DynamicTypeSupport.cpp.

315  {
316  return getMetaStruct<OpenDDS::XTypes::DynamicSample>();
317  }

◆ getMinimalTypeIdentifier()

const TypeIdentifier & DDS::DynamicTypeSupport::getMinimalTypeIdentifier ( ) const
virtual

Implements OpenDDS::DCPS::TypeSupportImpl.

Definition at line 283 of file DynamicTypeSupport.cpp.

References OpenDDS::XTypes::DynamicTypeImpl::get_minimal_type_identifier().

284  {
285  DynamicTypeImpl* const dti = dynamic_cast<DynamicTypeImpl*>(type_.in());
286  return dti->get_minimal_type_identifier();
287  }
const TypeIdentifier & get_minimal_type_identifier() const

◆ getMinimalTypeMap()

const TypeMap & DDS::DynamicTypeSupport::getMinimalTypeMap ( ) const
virtual

Implements OpenDDS::DCPS::TypeSupportImpl.

Definition at line 289 of file DynamicTypeSupport.cpp.

References OpenDDS::XTypes::DynamicTypeImpl::get_minimal_type_map().

290  {
291  DynamicTypeImpl* const dti = dynamic_cast<DynamicTypeImpl*>(type_.in());
292  return dti->get_minimal_type_map();
293  }
const TypeMap & get_minimal_type_map() const

◆ is_dcps_key()

bool DDS::DynamicTypeSupport::is_dcps_key ( const char *  field) const
virtual

Implements OpenDDS::DCPS::TypeSupportImpl.

Definition at line 236 of file DynamicTypeSupport.cpp.

References OpenDDS::XTypes::is_key().

237  {
238  return OpenDDS::XTypes::is_key(type_, field);
239  }
bool is_key(DDS::DynamicType_ptr type, const char *field)

◆ key_count()

size_t DDS::DynamicTypeSupport::key_count ( ) const
virtual

Implements OpenDDS::DCPS::TypeSupportImpl.

Definition at line 224 of file DynamicTypeSupport.cpp.

References ACE_ERROR, OpenDDS::DCPS::LogLevel::Error, OpenDDS::XTypes::key_count(), LM_ERROR, OpenDDS::DCPS::log_level, name, DDS::RETCODE_OK, and OpenDDS::DCPS::retcode_to_string().

225  {
226  size_t count = 0;
227  const ReturnCode_t rc = OpenDDS::XTypes::key_count(type_, count);
228  if (rc != RETCODE_OK && log_level >= LogLevel::Error) {
229  ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: DynamicTypeSupport::key_count: "
230  "could not get correct key count for DynamicType %C: %C\n",
231  name(), retcode_to_string(rc)));
232  }
233  return count;
234  }
OpenDDS_Dcps_Export LogLevel log_level
#define ACE_ERROR(X)
const char * retcode_to_string(DDS::ReturnCode_t value)
Definition: DCPS_Utils.cpp:29
const ReturnCode_t RETCODE_OK
DDS::ReturnCode_t key_count(DDS::DynamicType_ptr type, size_t &count)
const char * name() const

◆ key_only_serialized_size_bound()

OpenDDS::DCPS::SerializedSizeBound DDS::DynamicTypeSupport::key_only_serialized_size_bound ( const OpenDDS::DCPS::Encoding ) const
inlinevirtual

◆ marshal()

CORBA::Boolean DDS::DynamicTypeSupport::marshal ( TAO_OutputCDR )
inlinevirtual

Reimplemented from CORBA::Object.

Definition at line 155 of file DynamicTypeSupport.h.

References _duplicate().

156  {
157  return false;
158  }

◆ max_extensibility()

Extensibility DDS::DynamicTypeSupport::max_extensibility ( ) const
virtual

Between the topic type and its nested types, return the extensibility that is furthest right in (final, appenable, mutable).

Implements OpenDDS::DCPS::TypeSupportImpl.

Definition at line 253 of file DynamicTypeSupport.cpp.

References ACE_ERROR, OpenDDS::DCPS::LogLevel::Error, OpenDDS::DCPS::FINAL, LM_ERROR, OpenDDS::DCPS::log_level, OpenDDS::XTypes::max_extensibility(), name, DDS::RETCODE_OK, and OpenDDS::DCPS::retcode_to_string().

254  {
257  if (rc != RETCODE_OK && log_level >= LogLevel::Error) {
258  ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: DynamicTypeSupport::max_extensibility: "
259  "could not get correct max extensibility for DynamicType %C: %C\n",
260  name(), retcode_to_string(rc)));
261  }
262  return ext;
263  }
OpenDDS_Dcps_Export LogLevel log_level
#define ACE_ERROR(X)
const char * retcode_to_string(DDS::ReturnCode_t value)
Definition: DCPS_Utils.cpp:29
const ReturnCode_t RETCODE_OK
DDS::ReturnCode_t max_extensibility(DDS::DynamicType_ptr type, DCPS::Extensibility &ext)
const char * name() const

◆ name()

const char* DDS::DynamicTypeSupport::name ( void  ) const
inlinevirtual

Implements OpenDDS::DCPS::TypeSupportImpl.

Definition at line 99 of file DynamicTypeSupport.h.

References OpenDDS::XTypes::key_count(), and OpenDDS::XTypes::max_extensibility().

100  {
101  return name_.in();
102  }
const character_type * in(void) const

◆ preset_type_info()

const OpenDDS::XTypes::TypeInformation * DDS::DynamicTypeSupport::preset_type_info ( ) const
virtual

Reimplemented from OpenDDS::DCPS::TypeSupportImpl.

Definition at line 307 of file DynamicTypeSupport.cpp.

References OpenDDS::XTypes::DynamicTypeImpl::get_preset_type_info().

308  {
309  DynamicTypeImpl* dti = dynamic_cast<DynamicTypeImpl*>(type_.in());
310  return dti->get_preset_type_info();
311  }
const TypeInformation * get_preset_type_info() const

◆ representations_allowed_by_type()

void DDS::DynamicTypeSupport::representations_allowed_by_type ( DataRepresentationIdSeq seq)

Definition at line 217 of file DynamicTypeSupport.cpp.

References DDS::XCDR2_DATA_REPRESENTATION.

218  {
219  // TODO: Need to be able to read annotations?
220  seq.length(1);
221  seq[0] = XCDR2_DATA_REPRESENTATION;
222  }
const DataRepresentationId_t XCDR2_DATA_REPRESENTATION

◆ serialized_size_bound()

OpenDDS::DCPS::SerializedSizeBound DDS::DynamicTypeSupport::serialized_size_bound ( const OpenDDS::DCPS::Encoding ) const
inlinevirtual

Member Data Documentation

◆ name_

CORBA::String_var DDS::DynamicTypeSupport::name_
protected

Definition at line 163 of file DynamicTypeSupport.h.


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