RTI Connext DDS Micro C++ API  Version 3.0.3
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
FooTypeSupport Struct Reference

<<interface>> <<generic>> User data type specific interface. More...

#include <dds_cpp_data.hxx>

List of all members.

Static Public Member Functions

static bool initialize_data (Foo *sample)
 <<eXtension>> Initialize data type.
static bool finalize_data (Foo *sample)
 <<eXtension>> Finalize data type.
static Foo * create_data ()
 <<eXtension>> Create a data type and initialize it.
static void delete_data (Foo *sample)
 <<eXtension>> Destroy a user data type instance.
static bool copy_data (Foo *dst_data, Foo *src_data)
 <<eXtension>> Copy data type.
static DDS_ReturnCode_t register_type (DDSDomainParticipant *participant, const char *type_name)
 Allows an application to communicate to RTI Connext DDS Micro the existence of a data type.
static DDS_ReturnCode_t unregister_type (DDSDomainParticipant *participant, const char *type_name)
 Allows an application to unregister a data type from RTI Connext DDS Micro. After calling unregister_type, no further communication using that type is possible.
static DDS_ReturnCode_t serialize_data_to_cdr_buffer_ex (char *buffer, unsigned int &length, const TData *a_data, DDS_DataRepresentationId_t representation)
 <<eXtension>> Serializes the input sample into a buffer of octets.
static DDS_ReturnCode_t serialize_data_to_cdr_buffer (char *buffer, unsigned int &length, const TData *a_data)
 <<eXtension>> Serializes the input sample into a CDR buffer of octets.
static DDS_ReturnCode_t deserialize_data_from_cdr_buffer (TData *a_data, const char *buffer, unsigned int length)
 <<eXtension>> Deserializes a sample from a buffer of octets.

Detailed Description

<<interface>> <<generic>> User data type specific interface.


Member Function Documentation

static bool FooTypeSupport::initialize_data ( Foo *  sample)
static

<<eXtension>> Initialize data type.

The generated implementation of the operation knows how to initialize a data type. This method is typically called to initialize a data type that is allocated on the stack.

Parameters:
sample<<inout>> Cannot be NULL.
Returns:
One of the Standard Return Codes
See also:
FooTypeSupport::finalize_data
static bool FooTypeSupport::finalize_data ( Foo *  sample)
static

<<eXtension>> Finalize data type.

The generated implementation of the operation knows how to finalize a data type. This method is typically called to finalize a data type that has previouslly been initialized.

Parameters:
sample<<in>> Cannot be NULL.
Returns:
One of the Standard Return Codes
See also:
FooTypeSupport::initialize_data
static Foo* FooTypeSupport::create_data ( )
static

<<eXtension>> Create a data type and initialize it.

The generated implementation of the operation knows how to instantiate a data type and initialize it properly.

All memory for the type is deeply allocated.

Returns:
newly created data type
See also:
FooTypeSupport::delete_data
static void FooTypeSupport::delete_data ( Foo *  sample)
static

<<eXtension>> Destroy a user data type instance.

The generated implementation of the operation knows how to destroy a data type and return all resources.

Parameters:
sample<<in>> Cannot be NULL.
Returns:
One of the Standard Return Codes
See also:
FooTypeSupport::create_data
static bool FooTypeSupport::copy_data ( Foo *  dst_data,
Foo *  src_data 
)
static

<<eXtension>> Copy data type.

The generated implementation of the operation knows how to copy value of a data type.

Parameters:
dst_data<<inout>> Data type to copy value to. Cannot be NULL.
src_data<<in>> Data type to copy value from. Cannot be NULL.
Returns:
One of the Standard Return Codes
static DDS_ReturnCode_t FooTypeSupport::register_type ( DDSDomainParticipant participant,
const char *  type_name 
)
static

Allows an application to communicate to RTI Connext DDS Micro the existence of a data type.

The generated implementation of the operation embeds all the knowledge that has to be communicated to the middleware in order to make it able to manage the contents of data of that type. This includes in particular the key definition that will allow RTI Connext DDS Micro to distinguish different instances of the same type.

The same DDS_TYPESUPPORT_CPP can be registered multiple times with a DDSDomainParticipant using the same or different values for the type_name. If register_type is called multiple times on the same DDS_TYPESUPPORT_CPP with the same DDSDomainParticipant and type_name, the second (and subsequent) registrations are ignored by the operation fails with DDS_RETCODE_OK.

Precondition:
Cannot use the same type_name to register two different DDS_TYPESUPPORT_CPP with the same DDSDomainParticipant, or else the operation will fail and DDS_RETCODE_PRECONDITION_NOT_MET will be returned.
Parameters:
participant<<in>> the DDSDomainParticipant to register the data type Foo with. Cannot be NULL.
type_name<<in>> the type name under with the data type Foo is registered with the participant; this type name is used when creating a new DDSTopic. (See DDSDomainParticipant::create_topic.) The name may not be NULL or longer than 255 characters.
Returns:
One of the Standard Return Codes, DDS_RETCODE_PRECONDITION_NOT_MET or DDS_RETCODE_OUT_OF_RESOURCES.
MT Safety:
UNSAFE on the FIRST call. It is not safe for two threads to simultaneously make the first call to register a type. Subsequent calls are thread safe.
See also:
DDSDomainParticipant::create_topic
static DDS_ReturnCode_t FooTypeSupport::unregister_type ( DDSDomainParticipant participant,
const char *  type_name 
)
static

Allows an application to unregister a data type from RTI Connext DDS Micro. After calling unregister_type, no further communication using that type is possible.

The generated implementation of the operation removes all the information about a type from RTI Connext DDS Micro. No further communication using that type is possible.

Precondition:
A type with type_name is registered with the participant and all DDSTopic objects referencing the type have been destroyed. If the type is not registered with the participant, or if any DDSTopic is associated with the type, the operation will fail with DDS_RETCODE_ERROR.
Postcondition:
All information about the type is removed from RTI Connext DDS Micro. No further communication using this type is possible.
Parameters:
participant<<in>> the DDSDomainParticipant to unregister the data type Foo from. Cannot be NULL.
type_name<<in>> the type name under with the data type Foo is registered with the participant. The name should match a name that has been previously used to register a type with the participant. Cannot be NULL.
Returns:
One of the Standard Return Codes, DDS_RETCODE_BAD_PARAMETER or DDS_RETCODE_ERROR
MT Safety:
SAFE.
See also:
DDSDomainParticipant::register_type
static DDS_ReturnCode_t FooTypeSupport::serialize_data_to_cdr_buffer_ex ( char *  buffer,
unsigned int &  length,
const TData *  a_data,
DDS_DataRepresentationId_t  representation 
)
static

<<eXtension>> Serializes the input sample into a buffer of octets.

This method serializes a sample into a buffer of octets using the input data representation. See FooTypeSupport::serialize_data_to_cdr_buffer for details.

Parameters:
a_data<<in>>. Input sample. Cannot be NULL.
buffer<<out>>. Serialization buffer.
length<<inout>>. Serialization buffer length.
representation<<in>>. Representation used to serialize the data.
Returns:
One of the Standard Return Codes
static DDS_ReturnCode_t FooTypeSupport::serialize_data_to_cdr_buffer ( char *  buffer,
unsigned int &  length,
const TData *  a_data 
)
static

<<eXtension>> Serializes the input sample into a CDR buffer of octets.

This method serializes a sample into a buffer of octets and it uses CDR as the data representation. Calling this method is equivalent to calling FooTypeSupport::serialize_data_to_cdr_buffer_ex with DDS_AUTO_DATA_REPRESENTATION as the representation.

The input buffer must be big enough to store the serialized representation of the sample. Otherwise, the method will return an error.

To determine the minimum size of the input buffer, the user must call this method with the buffer set to NULL.

Parameters:
a_data<<in>>. Input sample. Cannot be NULL.
buffer<<out>>. Serialization buffer.
length<<inout>>. When buffer is set to NULL, after the method executes, length will contain a buffer size big enough to hold the serialized data. When buffer is not NULL, length must contain the size of the input buffer when the method is invoked. After the method executes, length will be updated to contain the actual size of the serialized content, which may be smaller than the size obtained when buffer is set to NULL.
Returns:
One of the Standard Return Codes
static DDS_ReturnCode_t FooTypeSupport::deserialize_data_from_cdr_buffer ( TData *  a_data,
const char *  buffer,
unsigned int  length 
)
static

<<eXtension>> Deserializes a sample from a buffer of octets.

This method deserializes a sample from a CDR buffer of octets.

The content of the buffer generated by the method FooTypeSupport::serialize_data_to_cdr_buffer can be provided to this method to get the sample back.

Parameters:
a_data<<in>>. Output sample. Cannot be NULL.
buffer<<in>>. Deserialization buffer. Cannot be NULL.
length<<in>>. Length of the serialized representation of the sample in the buffer.
Returns:
One of the Standard Return Codes

RTI Connext DDS Micro C++ API Version 3.0.3 Copyright © Wed Jun 24 2020 Real-Time Innovations, Inc