RTI Connext Java API  Version 5.2.0
 All Classes Namespaces Functions Variables Groups Pages
FooTypeSupport Class Reference

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

Inherits TypeSupportImpl.

Public Member Functions

Object copy_data (Object destination, Object source)
 
long serialize_to_cdr_buffer (byte[] buffer, long length, Foo src)
 <<extension>> Serializes the input sample into a buffer of octets.
 
void deserialize_from_cdr_buffer (Foo dst, byte[] buffer, long length)
 <<extension>> Deserializes a sample from a buffer of octets.
 

Static Public Member Functions

static String get_type_name ()
 Get the default name for this type.
 
static void register_type (DomainParticipant participant, String type_name)
 Allows an application to communicate to RTI Connext the existence of a data type.
 
static TypeCode getTypeCode ()
 <<extension>> Retrieves the TypeCode for the Type.
 

Detailed Description

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

Defines the user data type specific interface generated for each application class.

The concrete user data type automatically generated by the implementation is an incarnation of this class.

See Also
rtiddsgen

Member Function Documentation

static String get_type_name ( )
static

Get the default name for this type.

Can be used for calling com.rti.ndds.example.FooTypeSupport.register_type or creating com.rti.dds.topic.Topic

Returns
default name for this type
See Also
com.rti.ndds.example.FooTypeSupport.register_type
com.rti.dds.domain.DomainParticipant.create_topic
static void register_type ( DomainParticipant  participant,
String  type_name 
)
static

Allows an application to communicate to RTI Connext 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 to distinguish different instances of the same type.

The same com.rti.dds.topic.TypeSupport can be registered multiple times with a com.rti.dds.domain.DomainParticipant using the same or different values for the type_name. If register_type is called multiple times on the same com.rti.dds.topic.TypeSupport with the same com.rti.dds.domain.DomainParticipant and type_name, the second (and subsequent) registrations are ignored but the operation returns com.rti.dds.infrastructure.RETCODE_OK.

Precondition
Cannot use the same type_name to register two different com.rti.dds.topic.TypeSupport with the same com.rti.dds.domain.DomainParticipant, or else the operation will fail and com.rti.dds.infrastructure.RETCODE_PRECONDITION_NOT_MET will be returned.
Parameters
participant<<in>> the com.rti.dds.domain.DomainParticipant 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 com.rti.dds.topic.Topic. (See com.rti.dds.domain.DomainParticipant.create_topic.) The name may not be NULL or longer than 255 characters.
Exceptions
Oneof the Standard Return Codes, com.rti.dds.infrastructure.RETCODE_PRECONDITION_NOT_MET or com.rti.dds.infrastructure.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
com.rti.dds.domain.DomainParticipant.create_topic
static TypeCode getTypeCode ( )
static

<<extension>> Retrieves the TypeCode for the Type.

This method retrieves the com.rti.dds.typecode.TypeCode for the Type. A com.rti.dds.typecode.TypeCode is a mechanism for representing a type at runtime. RTI Connext can use type codes to send type definitions on the network. A com.rti.dds.typecode.TypeCode value consists of a type code kind (represented by the com.rti.dds.typecode.TCKind enumeration) and a list of members (that is, fields). These members are recursive: each one has its own com.rti.dds.typecode.TypeCode, and in the case of complex types (structures, arrays, and so on), these contained type codes contain their own members.

Returns
The TypeCode for this type
Object copy_data ( Object  destination,
Object  source 
)

This is a concrete implementation of this method inherited from the base class. This method will perform a deep copy of source into destination.

Parameters
sourceThe Object which contains the data to be copied.
destinationThe object where data will be copied to.
Returns
Returns destination.
Exceptions
NullPointerExceptionIf destination or source is null.
ClassCastExceptionIf either destination or this is not a Foo type.
long serialize_to_cdr_buffer ( byte[]  buffer,
long  length,
Foo  src 
)

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

This method serializes a sample into a buffer of octets and it uses CDR as the data 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
src<<in>>. Input sample. Cannot be null.
buffer<<out>>. Serialization buffer.
length<<in>>. When buffer is not null, length must contain the size of the input buffer when the method is invoked. This parameter is ignored when buffer is set to null.
Returns
When buffer is set to null, this method will return a buffer size big enough to hold the serialized data. Notice that the size is conservative and it may be greater than the actual size after serialization. When buffer is different than null, this method will return the actual size of the serialized content. This is the size that must be provided to the com.rti.ndds.example.FooTypeSupport.deserialize_from_cdr_buffer.
Exceptions
Oneof the Standard Return Codes , java.lang.IllegalStateException
void deserialize_from_cdr_buffer ( Foo  dst,
byte[]  buffer,
long  length 
)

<<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 com.rti.ndds.example.FooTypeSupport.serialize_to_cdr_buffer can be provided to this method to get the sample back.

Parameters
dst<<out>>. 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.
Exceptions
Oneof the Standard Return Codes , java.lang.IllegalStateException

RTI Connext Java API Version 5.2.0 Copyright © Sun Jun 21 2015 Real-Time Innovations, Inc