RTI Connext Java API
Version 6.1.1
|
A sample of any complex data type, which can be inspected and manipulated reflectively. More...
Public Member Functions | |
void | delete () |
Finalize and deallocate this com.rti.dds.dynamicdata.DynamicData sample. More... | |
boolean | equals (Object o) |
Indicate whether the contents of another com.rti.dds.dynamicdata.DynamicData sample are the same as those of this one. More... | |
Object | copy_from (Object src) |
Deeply copy from the given object to this object. More... | |
void | clear_all_members () |
Clear the contents of all data members of this object. More... | |
void | clear_member (String member_name, int member_id) |
Clear the contents of a single data member of this object. More... | |
void | clear_optional_member (String member_name, int member_id) |
Clear the contents of a single optional data member of this object. More... | |
void | print (File fp, int indent) |
Output a textual representation of this object and its contents to the given file. More... | |
void | get_info (DynamicDataInfo info_out) |
Fill in the given descriptor with information about this com.rti.dds.dynamicdata.DynamicData. More... | |
void | bind_type (TypeCode type) |
If this com.rti.dds.dynamicdata.DynamicData object is not yet associated with a data type, set that type now to the given com.rti.dds.typecode.TypeCode. More... | |
void | unbind_type () |
Dissociate this com.rti.dds.dynamicdata.DynamicData object from any particular data type. More... | |
void | bind_complex_member (DynamicData value_out, String member_name, int member_id) |
Use another com.rti.dds.dynamicdata.DynamicData object to provide access to a complex field of this com.rti.dds.dynamicdata.DynamicData object. More... | |
void | unbind_complex_member (DynamicData value) |
Tear down the association created by a com.rti.dds.dynamicdata.DynamicData.bind_complex_member operation, committing any changes to the outer object since then. More... | |
synchronized TypeCode | get_type () |
Get the data type, of which this com.rti.dds.dynamicdata.DynamicData represents an instance. More... | |
TCKind | get_type_kind () |
Get the kind of this object's data type. More... | |
int | get_member_count () |
Get the number of members in the type. More... | |
boolean | member_exists (String member_name, int member_id) |
Indicates whether a member exists in this sample. More... | |
boolean | member_exists_in_type (String member_name, int member_id) |
Indicates whether a member of a particular name/ID exists in this data sample's type. More... | |
void | get_member_info (DynamicDataMemberInfo info, String member_name, int member_id) |
Fill in the given descriptor with information about the identified member of this com.rti.dds.dynamicdata.DynamicData sample. More... | |
void | get_member_info_by_index (DynamicDataMemberInfo info, int index) |
Fill in the given descriptor with information about the identified member of this com.rti.dds.dynamicdata.DynamicData sample. More... | |
TypeCode | get_member_type (String member_name, int member_id) |
Get the type of the given member of this sample. More... | |
boolean | is_member_key (String member_name, int member_id) |
Indicates whether a given member forms part of the key of this sample's data type. More... | |
int | get_int (String member_name, int member_id) |
Get the value of the given field, which is of type com.rti.dds.infrastructure.int or another type implicitly convertible to it (byte, char, short, com.rti.dds.infrastructure.short, or com.rti.dds.util.Enum). More... | |
int | get_int_array (int[] array, String member_name, int member_id) |
Get a copy of the given array member. The array may contain members of type com.rti.dds.infrastructure.int or com.rti.dds.util.Enum. More... | |
void | get_int_seq (IntSeq seq, String member_name, int member_id) |
Get a copy of the given sequence member. More... | |
short | get_short (String member_name, int member_id) |
Get the value of the given field, which is of type short or another type implicitly convertible to it (byte or char). More... | |
int | get_short_array (short[] array, String member_name, int member_id) |
Get a copy of the given array member. More... | |
void | get_short_seq (ShortSeq seq, String member_name, int member_id) |
Get a copy of the given sequence member. More... | |
float | get_float (String member_name, int member_id) |
Get the value of the given field, which is of type float. More... | |
int | get_float_array (float[] array, String member_name, int member_id) |
Get a copy of the given array member. More... | |
void | get_float_seq (FloatSeq seq, String member_name, int member_id) |
Get a copy of the given sequence member. More... | |
double | get_double (String member_name, int member_id) |
Get the value of the given field, which is of type double or another type implicitly convertible to it (float). More... | |
int | get_double_array (double[] array, String member_name, int member_id) |
Get a copy of the given array member. More... | |
void | get_double_seq (DoubleSeq seq, String member_name, int member_id) |
Get a copy of the given sequence member. More... | |
boolean | get_boolean (String member_name, int member_id) |
Get the value of the given field, which is of type boolean. More... | |
int | get_boolean_array (boolean[] array, String member_name, int member_id) |
Get a copy of the given array member. More... | |
void | get_boolean_seq (BooleanSeq seq, String member_name, int member_id) |
Get a copy of the given sequence member. More... | |
char | get_char (String member_name, int member_id) |
Get the value of the given field, which is of type char. More... | |
int | get_char_array (char[] array, String member_name, int member_id) |
Get a copy of the given array member. More... | |
void | get_char_seq (CharSeq seq, String member_name, int member_id) |
Get a copy of the given sequence member. More... | |
byte | get_byte (String member_name, int member_id) |
Get the value of the given field, which is of type byte. More... | |
int | get_byte_array (byte[] array, String member_name, int member_id) |
Get a copy of the given array member. More... | |
void | get_byte_seq (ByteSeq seq, String member_name, int member_id) |
Get a copy of the given sequence member. More... | |
long | get_long (String member_name, int member_id) |
Get the value of the given field, which is of type long or another type implicitly convertible to it (byte, char, short, com.rti.dds.infrastructure.short, com.rti.dds.infrastructure.int, com.rti.dds.infrastructure.long, or com.rti.dds.util.Enum). More... | |
int | get_long_array (long[] array, String member_name, int member_id) |
Get a copy of the given array member. More... | |
void | get_long_seq (LongSeq seq, String member_name, int member_id) |
Get a copy of the given sequence member. More... | |
String | get_string (String member_name, int member_id) |
Get the value of the given field, which is of type com.rti.dds.infrastructure.String. More... | |
void | get_complex_member (DynamicData value_out, String member_name, int member_id) |
Get a copy of the value of the given field, which is of some composed type. More... | |
void | set_int (String member_name, int member_id, int value) |
Set the value of the given field, which is of type com.rti.dds.infrastructure.int. More... | |
void | set_int_array (String member_name, int member_id, int[] array) |
Set the contents of the given array member. The array may contain members of type com.rti.dds.infrastructure.int or com.rti.dds.util.Enum. More... | |
void | set_int_seq (String member_name, int member_id, IntSeq value) |
Set the contents of the given sequence member. More... | |
void | set_short (String member_name, int member_id, short value) |
Set the value of the given field, which is of type short. More... | |
void | set_short_array (String member_name, int member_id, short[] array) |
Set the contents of the given array member. More... | |
void | set_short_seq (String member_name, int member_id, ShortSeq value) |
Set the contents of the given sequence member. More... | |
void | set_float (String member_name, int member_id, float value) |
Set the value of the given field, which is of type float. More... | |
void | set_float_array (String member_name, int member_id, float[] array) |
Set the contents of the given array member. More... | |
void | set_float_seq (String member_name, int member_id, FloatSeq value) |
Set the contents of the given sequence member. More... | |
void | set_double (String member_name, int member_id, double value) |
Set the value of the given field, which is of type double. More... | |
void | set_double_array (String member_name, int member_id, double[] array) |
Set the contents of the given array member. More... | |
void | set_double_seq (String member_name, int member_id, DoubleSeq value) |
Set the contents of the given sequence member. More... | |
void | set_boolean (String member_name, int member_id, boolean value) |
Set the value of the given field, which is of type boolean. More... | |
void | set_boolean_array (String member_name, int member_id, boolean[] array) |
Set the contents of the given array member. More... | |
void | set_boolean_seq (String member_name, int member_id, BooleanSeq value) |
Set the contents of the given sequence member. More... | |
void | set_char (String member_name, int member_id, char value) |
Set the value of the given field, which is of type char. More... | |
void | set_char_array (String member_name, int member_id, char[] array) |
Set the contents of the given array member. More... | |
void | set_char_seq (String member_name, int member_id, CharSeq value) |
Set the contents of the given sequence member. More... | |
void | set_byte (String member_name, int member_id, byte value) |
Set the value of the given field, which is of type byte. More... | |
void | set_byte_array (String member_name, int member_id, byte[] array) |
Set the contents of the given array member. More... | |
void | set_byte_seq (String member_name, int member_id, ByteSeq value) |
Set the contents of the given sequence member. More... | |
void | set_long (String member_name, int member_id, long value) |
Set the value of the given field, which is of type long. More... | |
void | set_long_array (String member_name, int member_id, long[] array) |
Set the contents of the given array member. More... | |
void | set_long_seq (String member_name, int member_id, LongSeq value) |
Set the contents of the given sequence member. More... | |
void | set_string (String member_name, int member_id, String value) |
Set the value of the given field of type com.rti.dds.infrastructure.String. More... | |
void | set_complex_member (String member_name, int member_id, DynamicData value) |
Copy the state of the given com.rti.dds.dynamicdata.DynamicData object into a member of this object. More... | |
int | to_cdr_buffer (byte[] buffer, short representation) |
Serializes a DynamicData object into a buffer of octets. More... | |
int | to_cdr_buffer (byte[] buffer) |
Serializes a DynamicData object into a CDR buffer of octets. More... | |
void | from_cdr_buffer (byte[] buffer) |
Deserializes a DynamicData object from a buffer of octets. More... | |
void | to_cdr_buffer (ByteSeq sequence, short representation) |
Serializes a DynamicData object into a sequence of octets. More... | |
void | to_cdr_buffer (ByteSeq sequence) |
Serializes a DynamicData object into a CDR sequence of octets. More... | |
void | from_cdr_buffer (ByteSeq sequence) |
Deserializes a DynamicData object from a sequence octets. More... | |
String | to_string (PrintFormatProperty property) |
Get a string representation of a DynamicData object. More... | |
String | to_string () |
Get a string representation of a DynamicData object using the default values for com.rti.dds.topic.PrintFormatProperty. More... | |
DynamicData (TypeCode type, DynamicDataProperty_t property) | |
The constructor for new com.rti.dds.dynamicdata.DynamicData objects. More... | |
Static Public Attributes | |
static final int | MEMBER_ID_UNSPECIFIED |
A sentinel value that indicates that no member ID is needed in order to perform some operation. More... | |
static final DynamicDataProperty_t | PROPERTY_DEFAULT |
Sentinel constant indicating default values for com.rti.dds.dynamicdata.DynamicDataProperty_t. More... | |
A sample of any complex data type, which can be inspected and manipulated reflectively.
Objects of type com.rti.dds.dynamicdata.DynamicData represent corresponding objects of the type identified by their com.rti.dds.typecode.TypeCode. Because the definition of these types may not have existed at compile time on the system on which the application is running, you will interact with the data using an API of reflective getters and setters.
For example, if you had access to your data types at compile time, you could do this:
Instead, you will do something like this:
com.rti.dds.dynamicdata.DynamicData objects can represent any complex data type, including those of type kinds com.rti.dds.typecode.TCKind.TK_ARRAY, com.rti.dds.typecode.TCKind.TK_SEQUENCE, com.rti.dds.typecode.TCKind.TK_STRUCT, com.rti.dds.typecode.TCKind.TK_UNION, and com.rti.dds.typecode.TCKind.TK_VALUE. They cannot represent objects of basic types (e.g., integers and strings). Since those type definitions always exist on every system, you can examine their objects directly.
The members of a data type can be identified in one of two ways: by their name or by their numeric ID. The former is often more transparent to human users; the latter is typically faster.
You define the name and ID of a type member when you add that member to that type. If you define your type in IDL or XML, the name will be the field name that appears in the type definition; the ID will be the one-based index of the field in declaration order. For example, in the following IDL structure, the ID of theLong
is 2.
For unions (com.rti.dds.typecode.TCKind.TK_UNION), the ID of a member is the discriminator value corresponding to that member. To access the current discriminator of a union, you must use the com.rti.dds.dynamicdata.DynamicData.get_member_info_by_index operation on the DynamicData object using an index value of 0. This operation fills in a com.rti.dds.dynamicdata.DynamicDataMemberInfo, then you can access the populated com.rti.dds.dynamicdata.DynamicDataMemberInfo.member_id field to get the current discriminator. Once you know the value of the discriminator, you can use it in the proper get/set_xxx() operations to access and set the member's value. Here is an example of accessing the discriminator:
It is possible to refer to a nested member in a type without first having to use the com.rti.dds.dynamicdata.DynamicData.bind_complex_member API. You can do this by using a hierarchical name. A hierarchical member name is a concatenation of member names separated by the '.' character. The hierarchical name describes the complete path from a top-level type to the nested member. For example, in the above type, any DynamicData API that receives a member name will accept "theNestedType.theChar" to refer to the char member in MyNestedType:
In order to access the value of theChar
without using a hierarchical name, you would have to first bind to theNestedType and then get the value:
As you can see, using a hierarchical member name removes the need to call the com.rti.dds.dynamicdata.DynamicData.bind_complex_member and com.rti.dds.dynamicdata.DynamicData.unbind_complex_member APIs, and allows for access to nested members at any depth directly from the top-level type.
The member name can also contain indexes to address members in arrays and sequences. For example, to set the third member in the array theOctetArray
, you can pass in "theNestedType.theOctetArray[2]" as the member name to the com.rti.dds.dynamicdata.DynamicData.DynamicData.set_byte API. The index values when used as part of the member name are 0-based.
For multi-dimensional arrays, the indexes for each dimension should be listed comma-separated in between brackets. For example, to address a member of theMultidimensionalArray
, the member name should be something like "theNestedType.theMultidimensionalArray[3,2,5]".
In complex types with arrays and sequences that contain other arrays and sequences, the hierarchical name may include multiple index values, one right after another. For example, in MyNestedType, myArrayOfSeq
is an array of sequences. In order to set the third member of the sequence in the fourth member of the array, the member name would be "myNestedType.myArrayOfSeq[3][2]".
The "members" of array and sequence types, unlike those of structure and union types, don't have names or explicit member IDs. However, they may nevertheless be accessed by "ID": the ID is one more than the index. (The first element has ID 1, the second 2, etc.)
Multi-dimensional arrays are effectively flattened by this pattern. For example, for an array theArray
[4][5], accessing ID 7 is equivalent to index 6, or the second element of the second group of 5.
To determine the length of a collection-typed member of a structure or union, you have two choices:
The Dynamic Data API is large when measured by the number of methods it contains. But each method falls into one of a very small number of categories. You will find it easier to navigate this documentation if you understand these categories.
Managing the lifecycle of com.rti.dds.dynamicdata.DynamicData objects is simple. You have two choices:
com.rti.dds.dynamicdata.DynamicDataTypeSupport | com.rti.dds.dynamicdata.DynamicData |
---|---|
com.rti.dds.dynamicdata.DynamicDataTypeSupport.create_data | com.rti.dds.dynamicdata.DynamicData.DynamicData.DynamicData |
You can also copy com.rti.dds.dynamicdata.DynamicData objects:
You can test them for equality:
And you can print their contents:
Most methods get or set the value of some field. These methods are named according to the type of the field they access.
The names of types vary across languages. The programming API for each language reflects that programming language. However, if your chosen language does not use the same names as the language that you used to define your types (e.g., IDL), or if you need to interoperate among programming languages, you will need to understand these differences. They are explained the following table. (Note: for modern C++, see the RTI Connext Modern C++ API reference.)
Type | IDL | C, Traditional C++ | C++/CLI (C#) | Java | Ada |
---|---|---|---|---|---|
16-bit integer | short | DDS_Short | System::Int16 | short | Standard.DDS.Short |
32-bit integer | long | DDS_Long | System::Int32 | int | Standard.DDS.Long |
64-bit integer | long long | DDS_LongLong | System::Int64 | long | Standard.DDS.Long_Long |
Unsigned 16-bit integer | unsigned short | DDS_UnsignedShort | System::UInt16 | short | Standard.DDS.Unsigned_Short |
Unsigned 32-bit integer | unsigned long | DDS_UnsignedLong | System::UInt32 | int | Standard.DDS.Long |
Unsigned 64-bit integer | unsigned long long | DDS_UnsignedLongLong | System::UInt64 | long | Standard.DDS.Unsigned_Long_Long |
float | float | DDS_Float | System::Single | float | Standard.DDS.Float |
double | double | DDS_Double | System::Double | double | Standard.DDS.Double |
long double | long double | DDS_LongDouble | DDS::LongDouble | double | Standard.DDS.Long_Double |
character | char | DDS_Char | System::Char | char | Standard.DDS.Char |
wide character | wchar | DDS_Wchar | System::Char | N/A (use short) | Standard.DDS.Wchar |
octet | octet | DDS_Octet | System::Byte | byte | Standard.DDS.Octet |
boolean | boolean | DDS_Boolean | System::Boolean | boolean | Standard.DDS.Boolean |
string | string | DDS_Char* | System::String | String | Standard.DDS.String |
wstring | wstring | DDS_Wchar* | System::String | String | Standard.DDS.Wide_String |
When working with a com.rti.dds.dynamicdata.DynamicData object representing an array or sequence, calling one of the "get" methods below for an index that is out of bounds will result in com.rti.dds.infrastructure.RETCODE_NO_DATA. Calling "set" for an index that is past the end of a sequence will cause that sequence to automatically lengthen (filling with default contents).
When working with a com.rti.dds.dynamicdata.DynamicData object whose type contains optional members, calling one of the "get" methods below on an unset optional member or any member that is part of an unset complex optional member will result in com.rti.dds.infrastructure.RETCODE_NO_DATA.
Get | Set |
---|---|
com.rti.dds.dynamicdata.DynamicData.DynamicData.get_int | com.rti.dds.dynamicdata.DynamicData.DynamicData.set_int |
com.rti.dds.dynamicdata.DynamicData.get_short | com.rti.dds.dynamicdata.DynamicData.set_short |
com.rti.dds.dynamicdata.DynamicData.DynamicData.get_long | com.rti.dds.dynamicdata.DynamicData.DynamicData.set_long |
com.rti.dds.dynamicdata.DynamicData.get_float | com.rti.dds.dynamicdata.DynamicData.set_float |
com.rti.dds.dynamicdata.DynamicData.get_double | com.rti.dds.dynamicdata.DynamicData.set_double |
com.rti.dds.dynamicdata.DynamicData.get_boolean | com.rti.dds.dynamicdata.DynamicData.set_boolean |
com.rti.dds.dynamicdata.DynamicData.DynamicData.get_byte | com.rti.dds.dynamicdata.DynamicData.DynamicData.set_byte |
com.rti.dds.dynamicdata.DynamicData.get_char | com.rti.dds.dynamicdata.DynamicData.set_char |
com.rti.dds.dynamicdata.DynamicData.get_string | com.rti.dds.dynamicdata.DynamicData.set_string |
Get | Set |
---|---|
com.rti.dds.dynamicdata.DynamicData.get_complex_member | com.rti.dds.dynamicdata.DynamicData.set_complex_member |
Get | Set |
---|---|
com.rti.dds.dynamicdata.DynamicData.DynamicData.get_int_array | com.rti.dds.dynamicdata.DynamicData.DynamicData.set_int_array |
com.rti.dds.dynamicdata.DynamicData.get_short_array | com.rti.dds.dynamicdata.DynamicData.set_short_array |
com.rti.dds.dynamicdata.DynamicData.DynamicData.get_long_array | com.rti.dds.dynamicdata.DynamicData.DynamicData.set_long_array |
com.rti.dds.dynamicdata.DynamicData.get_float_array | com.rti.dds.dynamicdata.DynamicData.set_float_array |
com.rti.dds.dynamicdata.DynamicData.get_double_array | com.rti.dds.dynamicdata.DynamicData.set_double_array |
com.rti.dds.dynamicdata.DynamicData.get_boolean_array | com.rti.dds.dynamicdata.DynamicData.set_boolean |
com.rti.dds.dynamicdata.DynamicData.DynamicData.get_byte_array | com.rti.dds.dynamicdata.DynamicData.DynamicData.set_byte_array |
com.rti.dds.dynamicdata.DynamicData.get_char_array | com.rti.dds.dynamicdata.DynamicData.set_char_array |
Get | Set |
---|---|
com.rti.dds.dynamicdata.DynamicData.DynamicData.get_int_seq | com.rti.dds.dynamicdata.DynamicData.DynamicData.set_int_seq |
com.rti.dds.dynamicdata.DynamicData.get_short_seq | com.rti.dds.dynamicdata.DynamicData.set_short_seq |
com.rti.dds.dynamicdata.DynamicData.DynamicData.get_long_seq | com.rti.dds.dynamicdata.DynamicData.DynamicData.set_long_seq |
com.rti.dds.dynamicdata.DynamicData.get_float_seq | com.rti.dds.dynamicdata.DynamicData.set_float_seq |
com.rti.dds.dynamicdata.DynamicData.get_double_seq | com.rti.dds.dynamicdata.DynamicData.set_double_seq |
com.rti.dds.dynamicdata.DynamicData.get_boolean_seq | com.rti.dds.dynamicdata.DynamicData.set_boolean_seq |
com.rti.dds.dynamicdata.DynamicData.DynamicData.get_byte_seq | com.rti.dds.dynamicdata.DynamicData.DynamicData.set_byte_seq |
com.rti.dds.dynamicdata.DynamicData.get_char_seq | com.rti.dds.dynamicdata.DynamicData.set_char_seq |
In addition to getting or setting a field, you can "clear" its value; that is, set it to a default zero value.
Not all components of your application will have static knowledge of all of the fields of your type. Sometimes, you will want to query meta-data about the fields that appear in a given data sample.
Sometimes, you may want to change the association between a data object and its type. This is not something you can do with a typical object, but with com.rti.dds.dynamicdata.DynamicData objects, it is a powerful capability. It allows you to, for example, examine nested structures without copying them by using a "bound" com.rti.dds.dynamicdata.DynamicData object as a view into an enclosing com.rti.dds.dynamicdata.DynamicData object.
Keys can be specified in dynamically defined types just as they can in types defined in generated code.
DynamicData | ( | TypeCode | type, |
DynamicDataProperty_t | property | ||
) |
The constructor for new com.rti.dds.dynamicdata.DynamicData objects.
The type parameter may be null. In that case, this com.rti.dds.dynamicdata.DynamicData must be bound with com.rti.dds.dynamicdata.DynamicData.bind_type or com.rti.dds.dynamicdata.DynamicData.bind_complex_member before it can be used.
If the com.rti.dds.typecode.TypeCode is not null, the newly constructed com.rti.dds.dynamicdata.DynamicData object will retain a reference to it. It is not safe to delete the com.rti.dds.typecode.TypeCode until all samples that use it have themselves been deleted. You have two options:
In most cases, it is not necessary to call this constructor explicitly. Instead, use com.rti.dds.dynamicdata.DynamicDataTypeSupport.create_data, and the com.rti.dds.typecode.TypeCode and properties will be specified for you. Using the factory method also ensures that the memory management contract documented above is followed correctly, because the com.rti.dds.dynamicdata.DynamicDataTypeSupport object maintains the com.rti.dds.typecode.TypeCode used by the samples it creates.
type | <<in>> The type of which the new object will represent an object. |
property | <<in>> Properties that configure the behavior of the new object. Most users can simply use com.rti.dds.dynamicdata.DYNAMIC_DATA_PROPERTY_DEFAULT. |
References DynamicDataProperty_t.buffer_initial_size, DynamicDataProperty_t.buffer_max_size, DynamicData.copy_from(), DynamicData.get_type(), and DynamicData.PROPERTY_DEFAULT.
void delete | ( | ) |
Finalize and deallocate this com.rti.dds.dynamicdata.DynamicData sample.
Referenced by DynamicDataTypeSupport.destroy_data(), DynamicDataWriter.lookup_instance(), and DynamicDataReader.read().
boolean equals | ( | Object | o | ) |
Indicate whether the contents of another com.rti.dds.dynamicdata.DynamicData sample are the same as those of this one.
This operation compares the data and type of existing members.
Object copy_from | ( | Object | src | ) |
Deeply copy from the given object to this object.
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
Implements Copyable.
Referenced by DynamicData.DynamicData().
void clear_all_members | ( | ) |
Clear the contents of all data members of this object.
One | of the Standard Return Codes |
void clear_member | ( | String | member_name, |
int | member_id | ||
) |
Clear the contents of a single data member of this object.
This method can be used to clear both optional and non-optional members.
member_name | <<in>> The name of the member to clear or null to look up the member by its ID. |
member_id | <<in>> The ID of the member to clear or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
One | of the Standard Return Codes |
void clear_optional_member | ( | String | member_name, |
int | member_id | ||
) |
Clear the contents of a single optional data member of this object.
This method is only applicable to optional members. Members of unions, sequences, and arrays are not considered optional.
member_name | <<in>> The name of the member (to look up the member by name), or null (to look up the member by its ID). |
member_id | <<in>> The ID of the member (to look up the member by its ID), or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED (to look up the member by name). See Member Names and IDs. |
One | of the Standard Return Codes |
void print | ( | File | fp, |
int | indent | ||
) |
Output a textual representation of this object and its contents to the given file.
This method is equivalent to com.rti.dds.dynamicdata.DynamicDataTypeSupport.print_data.
fp | <<in>> The file into which the object should be printed (to print to standard output, provide the stream pointer 'stdout') |
indent | <<in>> The output of this method will be pretty-printed. This argument indicates the amount of initial indentation of the output. |
One | of the Standard Return Codes |
void get_info | ( | DynamicDataInfo | info_out | ) |
Fill in the given descriptor with information about this com.rti.dds.dynamicdata.DynamicData.
info_out | <<out>> The descriptor object whose contents will be overwritten by this operation. |
void bind_type | ( | TypeCode | type | ) |
If this com.rti.dds.dynamicdata.DynamicData object is not yet associated with a data type, set that type now to the given com.rti.dds.typecode.TypeCode.
This advanced operation allows you to reuse a single com.rti.dds.dynamicdata.DynamicData object with multiple data types.
Note that the com.rti.dds.dynamicdata.DynamicData object will retain a reference to the com.rti.dds.typecode.TypeCode object you provide. It is not safe to delete the com.rti.dds.typecode.TypeCode until after it is unbound. You have two options:
type | <<in>> The type to associate with this com.rti.dds.dynamicdata.DynamicData object. |
One | of the Standard Return Codes |
void unbind_type | ( | ) |
Dissociate this com.rti.dds.dynamicdata.DynamicData object from any particular data type.
This step is necessary before the object can be associated with a new data type.
This operation clears all members as a side effect.
One | of the Standard Return Codes |
void bind_complex_member | ( | DynamicData | value_out, |
String | member_name, | ||
int | member_id | ||
) |
Use another com.rti.dds.dynamicdata.DynamicData object to provide access to a complex field of this com.rti.dds.dynamicdata.DynamicData object.
For example, consider the following data types:
Suppose you have an instance of MyOuterType
, and you would like to examine the contents of its member complexMember
. To do this, you must bind another com.rti.dds.dynamicdata.DynamicData object to that member. This operation will bind the type code of the member to the provided com.rti.dds.dynamicdata.DynamicData object and perform additional initialization.
The following example demonstrates the usage pattern. Note that error handling has been omitted for brevity.
This operation is only permitted when the object toBeBound
(named as in the example above) is not currently associated with any type, including already being bound to another member. You can see in the example that this object is created directly with the constructer and is not provided with a com.rti.dds.typecode.TypeCode.
Only a single member of a given com.rti.dds.dynamicdata.DynamicData object may be bound at one time – however, members of members may be recursively bound to any depth. Furthermore, while the outer object has a bound member, it may only be modified through that bound member. That is, after calling this member, all "set" operations on the outer object will be disabled until com.rti.dds.dynamicdata.DynamicData.unbind_complex_member has been called. Furthermore, any bound member must be unbound before a sample can be written or deleted.
This method is logically related to com.rti.dds.dynamicdata.DynamicData.get_complex_member in that both allow you to examine the state of nested objects. They are different in an important way: this method provides a view into an outer object, such that any change made to the inner object will be reflected in the outer. But the com.rti.dds.dynamicdata.DynamicData.get_complex_member operation copies the state of the nested object; changes to it will not be reflected in the source object.
Note that you can bind to a member of a sequence at an index that is past the current length of that sequence. In that case, this method behaves like a "set" method: it automatically lengthens the sequence (filling in default elements) to allow the bind to take place. See Getters and Setters.
value_out | <<out>> The object that you wish to bind to the field. |
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
One | of the Standard Return Codes |
void unbind_complex_member | ( | DynamicData | value | ) |
Tear down the association created by a com.rti.dds.dynamicdata.DynamicData.bind_complex_member operation, committing any changes to the outer object since then.
Some changes to the outer object will not be observable until after you have performed this operation.
If you have called com.rti.dds.dynamicdata.DynamicData.bind_complex_member on a data sample, you must unbind before writing or deleting the sample.
value | <<in>> The same object you passed to com.rti.dds.dynamicdata.DynamicData.bind_complex_member. This argument is used for error checking purposes. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
synchronized TypeCode get_type | ( | ) |
Get the data type, of which this com.rti.dds.dynamicdata.DynamicData represents an instance.
Referenced by DynamicData.DynamicData().
TCKind get_type_kind | ( | ) |
Get the kind of this object's data type.
This is a convenience method. It's equivalent to calling com.rti.dds.dynamicdata.DynamicData.get_type followed by com.rti.dds.typecode.TypeCode.kind.
int get_member_count | ( | ) |
Get the number of members in the type.
For objects of type kind com.rti.dds.typecode.TCKind.TK_ARRAY or com.rti.dds.typecode.TCKind.TK_SEQUENCE, this method returns the number of elements in the collection.
For objects of type kind com.rti.dds.typecode.TCKind.TK_STRUCT or com.rti.dds.typecode.TCKind.TK_VALUE, it returns the number of fields in the type.
boolean member_exists | ( | String | member_name, |
int | member_id | ||
) |
Indicates whether a member exists in this sample.
You only need to specify the name OR the ID (not both).
If the member doesn't exist in the type, this function returns false. In all other cases, it provides the same result as com.rti.dds.dynamicdata.DynamicDataMemberInfo.member_exists, which is retrieved with idref_DynamicDataMember_get_member_info.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
boolean member_exists_in_type | ( | String | member_name, |
int | member_id | ||
) |
Indicates whether a member of a particular name/ID exists in this data sample's type.
You only need to specify the name OR the ID (not both).
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
void get_member_info | ( | DynamicDataMemberInfo | info, |
String | member_name, | ||
int | member_id | ||
) |
Fill in the given descriptor with information about the identified member of this com.rti.dds.dynamicdata.DynamicData sample.
This operation is valid for objects of com.rti.dds.typecode.TCKind com.rti.dds.typecode.TCKind.TK_ARRAY, com.rti.dds.typecode.TCKind.TK_SEQUENCE, com.rti.dds.typecode.TCKind.TK_STRUCT, com.rti.dds.typecode.TCKind.TK_UNION, and com.rti.dds.typecode.TCKind.TK_VALUE.
When this sample represents a struct, a value type, or a union:
When this sample represents a sequence and member_id
is the 1-based element index:
member_id
is greater than the sequence's maximum length, this function fails with com.rti.dds.infrastructure.RETCODE_NO_DATA. member_id
is greater than the sequence's current length but smaller than or equal to its maximum length, this function returns an object with com.rti.dds.dynamicdata.DynamicDataMemberInfo.member_exists set to false. member_id
is smaller than or equal to the current length, com.rti.dds.dynamicdata.DynamicDataMemberInfo.member_exists is true. When this sample represents an array, this function either fails with with com.rti.dds.infrastructure.RETCODE_NO_DATA when the index is out of bounds or else returns an object with com.rti.dds.dynamicdata.DynamicDataMemberInfo.member_exists set to true.
info | <<out>> The descriptor object whose contents will be overwritten by this operations. |
member_name | <<in>> The name of the member for which to get the info or null to look up the member by its ID. Only one of the name and the ID may be unspecified. |
member_id | <<in>> The ID of the member for which to get the info, or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
One | of the Standard Return Codes |
void get_member_info_by_index | ( | DynamicDataMemberInfo | info, |
int | index | ||
) |
Fill in the given descriptor with information about the identified member of this com.rti.dds.dynamicdata.DynamicData sample.
This operation is valid for objects of com.rti.dds.typecode.TCKind com.rti.dds.typecode.TCKind.TK_ARRAY, com.rti.dds.typecode.TCKind.TK_SEQUENCE, com.rti.dds.typecode.TCKind.TK_STRUCT, com.rti.dds.typecode.TCKind.TK_VALUE, and com.rti.dds.typecode.TCKind.TK_UNION.
info | <<out>> The descriptor object whose contents will be overwritten by this operations. |
index | <<in>> The zero-base of the member for which to get the info. |
One | of the Standard Return Codes |
TypeCode get_member_type | ( | String | member_name, |
int | member_id | ||
) |
Get the type of the given member of this sample.
The member can be looked up either by name or by ID.
This operation is valid for objects of com.rti.dds.typecode.TCKind com.rti.dds.typecode.TCKind.TK_ARRAY, com.rti.dds.typecode.TCKind.TK_SEQUENCE, com.rti.dds.typecode.TCKind.TK_STRUCT, and com.rti.dds.typecode.TCKind.TK_VALUE. For type kinds com.rti.dds.typecode.TCKind.TK_ARRAY and com.rti.dds.typecode.TCKind.TK_SEQUENCE, the index into the collection is taken to be one less than the ID, if specified. If this index is valid, this operation will return the content type of this collection.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
One | of the Standard Return Codes |
Referenced by DynamicData.get_string(), and DynamicData.set_string().
boolean is_member_key | ( | String | member_name, |
int | member_id | ||
) |
Indicates whether a given member forms part of the key of this sample's data type.
This operation is only valid for samples of types of kind com.rti.dds.typecode.TCKind.TK_STRUCT or com.rti.dds.typecode.TCKind.TK_VALUE.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
One | of the Standard Return Codes |
int get_int | ( | String | member_name, |
int | member_id | ||
) |
Get the value of the given field, which is of type com.rti.dds.infrastructure.int or another type implicitly convertible to it (byte, char, short, com.rti.dds.infrastructure.short, or com.rti.dds.util.Enum).
The member may be specified by name or by ID.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
One | of the Standard Return Codes. If the member is optional and not set, this operation will return com.rti.dds.infrastructure.RETCODE_NO_DATA |
int get_int_array | ( | int [] | array, |
String | member_name, | ||
int | member_id | ||
) |
Get a copy of the given array member. The array may contain members of type com.rti.dds.infrastructure.int or com.rti.dds.util.Enum.
This method will perform an automatic conversion from com.rti.dds.infrastructure.IntSeq.
If the destination array is insufficiently long to store the data, this operation will fail without copying anything.
array | <<out>> An already-allocated array, into which the elements will be copied. |
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
void get_int_seq | ( | IntSeq | seq, |
String | member_name, | ||
int | member_id | ||
) |
Get a copy of the given sequence member.
The provided sequence will be automatically resized as necessary.
This method will perform an automatic conversion from an array of com.rti.dds.infrastructure.int.
seq | <<out>> A sequence, into which the elements will be copied. |
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
One | of the Standard Return Codes. If the member is optional and not set, this operation will return com.rti.dds.infrastructure.RETCODE_NO_DATA. This operation may also return com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES. |
References IntSeq.getMaximum(), and AbstractPrimitiveSequence.size().
short get_short | ( | String | member_name, |
int | member_id | ||
) |
Get the value of the given field, which is of type short or another type implicitly convertible to it (byte or char).
The member may be specified by name or by ID.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
One | of the Standard Return Codes. If the member is optional and not set, this operation will return com.rti.dds.infrastructure.RETCODE_NO_DATA |
int get_short_array | ( | short [] | array, |
String | member_name, | ||
int | member_id | ||
) |
Get a copy of the given array member.
This method will perform an automatic conversion from com.rti.dds.infrastructure.ShortSeq.
If the destination array is insufficiently long to store the data, this operation will fail without copying anything.
array | <<out>> An already-allocated array, into which the elements will be copied. |
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
void get_short_seq | ( | ShortSeq | seq, |
String | member_name, | ||
int | member_id | ||
) |
Get a copy of the given sequence member.
The provided sequence will be automatically resized as necessary.
This method will perform an automatic conversion from an array of short.
seq | <<out>> A sequence, into which the elements will be copied. |
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
One | of the Standard Return Codes. If the member is optional and not set, this operation will return com.rti.dds.infrastructure.RETCODE_NO_DATA. This operation may also return com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES. |
References ShortSeq.getMaximum(), and AbstractPrimitiveSequence.size().
float get_float | ( | String | member_name, |
int | member_id | ||
) |
Get the value of the given field, which is of type float.
The member may be specified by name or by ID.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
One | of the Standard Return Codes. If the member is optional and not set, this operation will return com.rti.dds.infrastructure.RETCODE_NO_DATA |
int get_float_array | ( | float [] | array, |
String | member_name, | ||
int | member_id | ||
) |
Get a copy of the given array member.
This method will perform an automatic conversion from com.rti.dds.infrastructure.FloatSeq.
If the destination array is insufficiently long to store the data, this operation will fail without copying anything.
array | <<out>> An already-allocated array, into which the elements will be copied. |
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
void get_float_seq | ( | FloatSeq | seq, |
String | member_name, | ||
int | member_id | ||
) |
Get a copy of the given sequence member.
The provided sequence will be automatically resized as necessary.
This method will perform an automatic conversion from an array of float.
seq | <<out>> A sequence, into which the elements will be copied. |
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
One | of the Standard Return Codes. If the member is optional and not set, this operation will return com.rti.dds.infrastructure.RETCODE_NO_DATA. This operation may also return com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES. |
References FloatSeq.getMaximum(), and AbstractPrimitiveSequence.size().
double get_double | ( | String | member_name, |
int | member_id | ||
) |
Get the value of the given field, which is of type double or another type implicitly convertible to it (float).
The member may be specified by name or by ID.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
One | of the Standard Return Codes. If the member is optional and not set, this operation will return com.rti.dds.infrastructure.RETCODE_NO_DATA |
int get_double_array | ( | double [] | array, |
String | member_name, | ||
int | member_id | ||
) |
Get a copy of the given array member.
This method will perform an automatic conversion from com.rti.dds.infrastructure.DoubleSeq.
If the destination array is insufficiently long to store the data, this operation will fail without copying anything.
array | <<out>> An already-allocated array, into which the elements will be copied. |
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
void get_double_seq | ( | DoubleSeq | seq, |
String | member_name, | ||
int | member_id | ||
) |
Get a copy of the given sequence member.
The provided sequence will be automatically resized as necessary.
This method will perform an automatic conversion from an array of double.
seq | <<out>> A sequence, into which the elements will be copied. |
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
One | of the Standard Return Codes. If the member is optional and not set, this operation will return com.rti.dds.infrastructure.RETCODE_NO_DATA. This operation may also return com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES. |
References DoubleSeq.getMaximum(), and AbstractPrimitiveSequence.size().
boolean get_boolean | ( | String | member_name, |
int | member_id | ||
) |
Get the value of the given field, which is of type boolean.
The member may be specified by name or by ID.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
One | of the Standard Return Codes. If the member is optional and not set, this operation will return com.rti.dds.infrastructure.RETCODE_NO_DATA |
int get_boolean_array | ( | boolean [] | array, |
String | member_name, | ||
int | member_id | ||
) |
Get a copy of the given array member.
This method will perform an automatic conversion from com.rti.dds.infrastructure.BooleanSeq.
If the destination array is insufficiently long to store the data, this operation will fail without copying anything.
array | <<out>> An already-allocated array, into which the elements will be copied. |
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
void get_boolean_seq | ( | BooleanSeq | seq, |
String | member_name, | ||
int | member_id | ||
) |
Get a copy of the given sequence member.
The provided sequence will be automatically resized as necessary.
This method will perform an automatic conversion from an array of boolean.
seq | <<out>> A sequence, into which the elements will be copied. |
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
One | of the Standard Return Codes. If the member is optional and not set, this operation will return com.rti.dds.infrastructure.RETCODE_NO_DATA. This operation may also return com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES. |
References BooleanSeq.getMaximum(), and AbstractPrimitiveSequence.size().
char get_char | ( | String | member_name, |
int | member_id | ||
) |
Get the value of the given field, which is of type char.
The member may be specified by name or by ID.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
One | of the Standard Return Codes. If the member is optional and not set, this operation will return com.rti.dds.infrastructure.RETCODE_NO_DATA |
int get_char_array | ( | char [] | array, |
String | member_name, | ||
int | member_id | ||
) |
Get a copy of the given array member.
This method will perform an automatic conversion from com.rti.dds.infrastructure.CharSeq.
If the destination array is insufficiently long to store the data, this operation will fail without copying anything.
array | <<out>> An already-allocated array, into which the elements will be copied. |
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
void get_char_seq | ( | CharSeq | seq, |
String | member_name, | ||
int | member_id | ||
) |
Get a copy of the given sequence member.
The provided sequence will be automatically resized as necessary.
This method will perform an automatic conversion from an array of char.
seq | <<out>> A sequence, into which the elements will be copied. |
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
One | of the Standard Return Codes. If the member is optional and not set, this operation will return com.rti.dds.infrastructure.RETCODE_NO_DATA. This operation may also return com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES. |
References CharSeq.getMaximum(), and AbstractPrimitiveSequence.size().
byte get_byte | ( | String | member_name, |
int | member_id | ||
) |
Get the value of the given field, which is of type byte.
The member may be specified by name or by ID.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
One | of the Standard Return Codes. If the member is optional and not set, this operation will return com.rti.dds.infrastructure.RETCODE_NO_DATA |
int get_byte_array | ( | byte [] | array, |
String | member_name, | ||
int | member_id | ||
) |
Get a copy of the given array member.
This method will perform an automatic conversion from com.rti.dds.infrastructure.ByteSeq.
If the destination array is insufficiently long to store the data, this operation will fail without copying anything.
array | <<out>> An already-allocated array, into which the elements will be copied. |
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
void get_byte_seq | ( | ByteSeq | seq, |
String | member_name, | ||
int | member_id | ||
) |
Get a copy of the given sequence member.
The provided sequence will be automatically resized as necessary.
This method will perform an automatic conversion from an array of byte.
seq | <<out>> A sequence, into which the elements will be copied. |
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
One | of the Standard Return Codes. If the member is optional and not set, this operation will return com.rti.dds.infrastructure.RETCODE_NO_DATA. This operation may also return com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES. |
References ByteSeq.getMaximum(), and AbstractPrimitiveSequence.size().
long get_long | ( | String | member_name, |
int | member_id | ||
) |
Get the value of the given field, which is of type long or another type implicitly convertible to it (byte, char, short, com.rti.dds.infrastructure.short, com.rti.dds.infrastructure.int, com.rti.dds.infrastructure.long, or com.rti.dds.util.Enum).
The member may be specified by name or by ID.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
One | of the Standard Return Codes. If the member is optional and not set, this operation will return com.rti.dds.infrastructure.RETCODE_NO_DATA |
int get_long_array | ( | long [] | array, |
String | member_name, | ||
int | member_id | ||
) |
Get a copy of the given array member.
This method will perform an automatic conversion from com.rti.dds.infrastructure.LongSeq.
If the destination array is insufficiently long to store the data, this operation will fail without copying anything.
array | <<out>> An already-allocated array, into which the elements will be copied. |
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
void get_long_seq | ( | LongSeq | seq, |
String | member_name, | ||
int | member_id | ||
) |
Get a copy of the given sequence member.
The provided sequence will be automatically resized as necessary.
This method will perform an automatic conversion from an array of long.
seq | <<out>> A sequence, into which the elements will be copied. |
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
One | of the Standard Return Codes. If the member is optional and not set, this operation will return com.rti.dds.infrastructure.RETCODE_NO_DATA. This operation may also return com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES. |
References LongSeq.getMaximum(), and AbstractPrimitiveSequence.size().
String get_string | ( | String | member_name, |
int | member_id | ||
) |
Get the value of the given field, which is of type com.rti.dds.infrastructure.String.
The member may be specified by name or by ID.
This operation is also valid for members of kind com.rti.dds.typecode.TCKind.TK_WSTRING. In this case, each wide character is truncated into a String character. This may cause loss of information for wide strings that are encoded using more bytes per character than String does.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
One | of the Standard Return Codes. If the member is optional and not set, this operation will return com.rti.dds.infrastructure.RETCODE_NO_DATA. This operation may also return com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES. |
References DynamicData.get_member_type(), TypeCode.kind(), and TCKind.TK_WSTRING.
void get_complex_member | ( | DynamicData | value_out, |
String | member_name, | ||
int | member_id | ||
) |
Get a copy of the value of the given field, which is of some composed type.
The member may be of type kind com.rti.dds.typecode.TCKind.TK_ARRAY, com.rti.dds.typecode.TCKind.TK_SEQUENCE, com.rti.dds.typecode.TCKind.TK_STRUCT, com.rti.dds.typecode.TCKind.TK_VALUE, or com.rti.dds.typecode.TCKind.TK_UNION. It may be specified by name or by ID.
This method is logically related to com.rti.dds.dynamicdata.DynamicData.bind_complex_member in that both allow you to examine the state of nested objects. They are different in an important way: this method provides a copy of the data; changes to it will not be reflected in the source object.
value_out | <<out>> The com.rti.dds.dynamicdata.DynamicData sample whose contents will be overwritten by this operation. This object must not be a bound member of another com.rti.dds.dynamicdata.DynamicData sample. |
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
One | of the Standard Return Codes. If the member is optional and not set, this operation will return com.rti.dds.infrastructure.RETCODE_NO_DATA. This operation may also return com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES. |
void set_int | ( | String | member_name, |
int | member_id, | ||
int | value | ||
) |
Set the value of the given field, which is of type com.rti.dds.infrastructure.int.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
value | <<in>> The value to which to set the member. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
void set_int_array | ( | String | member_name, |
int | member_id, | ||
int [] | array | ||
) |
Set the contents of the given array member. The array may contain members of type com.rti.dds.infrastructure.int or com.rti.dds.util.Enum.
This method will perform an automatic conversion to com.rti.dds.infrastructure.IntSeq.
If the destination array is insufficiently long to store the data, this operation will fail without copying anything.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
array | <<in>> The elements to copy. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
void set_int_seq | ( | String | member_name, |
int | member_id, | ||
IntSeq | value | ||
) |
Set the contents of the given sequence member.
This method will perform an automatic conversion to an array of com.rti.dds.infrastructure.int.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
value | <<in>> A sequence, from which the elements will be copied. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
References IntSeq.getMaximum(), and AbstractPrimitiveSequence.size().
void set_short | ( | String | member_name, |
int | member_id, | ||
short | value | ||
) |
Set the value of the given field, which is of type short.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
value | <<in>> The value to which to set the member. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
void set_short_array | ( | String | member_name, |
int | member_id, | ||
short [] | array | ||
) |
Set the contents of the given array member.
This method will perform an automatic conversion to com.rti.dds.infrastructure.ShortSeq.
If the destination array is insufficiently long to store the data, this operation will fail without copying anything.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
array | <<in>> The elements to copy. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
void set_short_seq | ( | String | member_name, |
int | member_id, | ||
ShortSeq | value | ||
) |
Set the contents of the given sequence member.
This method will perform an automatic conversion to an array of short.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
value | <<in>> A sequence, from which the elements will be copied. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
References ShortSeq.getMaximum(), and AbstractPrimitiveSequence.size().
void set_float | ( | String | member_name, |
int | member_id, | ||
float | value | ||
) |
Set the value of the given field, which is of type float.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
value | <<in>> The value to which to set the member. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
void set_float_array | ( | String | member_name, |
int | member_id, | ||
float [] | array | ||
) |
Set the contents of the given array member.
This method will perform an automatic conversion to com.rti.dds.infrastructure.FloatSeq.
If the destination array is insufficiently long to store the data, this operation will fail without copying anything.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
array | <<in>> The elements to copy. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
void set_float_seq | ( | String | member_name, |
int | member_id, | ||
FloatSeq | value | ||
) |
Set the contents of the given sequence member.
This method will perform an automatic conversion to an array of float.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
value | <<in>> A sequence, from which the elements will be copied. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
References FloatSeq.getMaximum(), and AbstractPrimitiveSequence.size().
void set_double | ( | String | member_name, |
int | member_id, | ||
double | value | ||
) |
Set the value of the given field, which is of type double.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
value | <<in>> The value to which to set the member. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
void set_double_array | ( | String | member_name, |
int | member_id, | ||
double [] | array | ||
) |
Set the contents of the given array member.
This method will perform an automatic conversion to com.rti.dds.infrastructure.DoubleSeq.
If the destination array is insufficiently long to store the data, this operation will fail without copying anything.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
array | <<in>> The elements to copy. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
void set_double_seq | ( | String | member_name, |
int | member_id, | ||
DoubleSeq | value | ||
) |
Set the contents of the given sequence member.
This method will perform an automatic conversion to an array of double.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
value | <<in>> A sequence, from which the elements will be copied. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
References DoubleSeq.getMaximum(), and AbstractPrimitiveSequence.size().
void set_boolean | ( | String | member_name, |
int | member_id, | ||
boolean | value | ||
) |
Set the value of the given field, which is of type boolean.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
value | <<in>> The value to which to set the member. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
void set_boolean_array | ( | String | member_name, |
int | member_id, | ||
boolean [] | array | ||
) |
Set the contents of the given array member.
This method will perform an automatic conversion to com.rti.dds.infrastructure.BooleanSeq.
If the destination array is insufficiently long to store the data, this operation will fail without copying anything.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
array | <<in>> The elements to copy. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
void set_boolean_seq | ( | String | member_name, |
int | member_id, | ||
BooleanSeq | value | ||
) |
Set the contents of the given sequence member.
This method will perform an automatic conversion to an array of boolean.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
value | <<in>> A sequence, from which the elements will be copied. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
References BooleanSeq.getMaximum(), and AbstractPrimitiveSequence.size().
void set_char | ( | String | member_name, |
int | member_id, | ||
char | value | ||
) |
Set the value of the given field, which is of type char.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
value | <<in>> The value to which to set the member. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
void set_char_array | ( | String | member_name, |
int | member_id, | ||
char [] | array | ||
) |
Set the contents of the given array member.
This method will perform an automatic conversion to com.rti.dds.infrastructure.CharSeq.
If the destination array is insufficiently long to store the data, this operation will fail without copying anything.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
array | <<in>> The elements to copy. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
void set_char_seq | ( | String | member_name, |
int | member_id, | ||
CharSeq | value | ||
) |
Set the contents of the given sequence member.
This method will perform an automatic conversion to an array of char.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
value | <<in>> A sequence, from which the elements will be copied. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
References CharSeq.getMaximum(), and AbstractPrimitiveSequence.size().
void set_byte | ( | String | member_name, |
int | member_id, | ||
byte | value | ||
) |
Set the value of the given field, which is of type byte.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
value | <<in>> The value to which to set the member. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
void set_byte_array | ( | String | member_name, |
int | member_id, | ||
byte [] | array | ||
) |
Set the contents of the given array member.
This method will perform an automatic conversion to com.rti.dds.infrastructure.ByteSeq.
If the destination array is insufficiently long to store the data, this operation will fail without copying anything.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
array | <<in>> The elements to copy. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
void set_byte_seq | ( | String | member_name, |
int | member_id, | ||
ByteSeq | value | ||
) |
Set the contents of the given sequence member.
This method will perform an automatic conversion to an array of byte.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
value | <<in>> A sequence, from which the elements will be copied. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
References ByteSeq.getMaximum(), and AbstractPrimitiveSequence.size().
void set_long | ( | String | member_name, |
int | member_id, | ||
long | value | ||
) |
Set the value of the given field, which is of type long.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
value | <<in>> The value to which to set the member. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
void set_long_array | ( | String | member_name, |
int | member_id, | ||
long [] | array | ||
) |
Set the contents of the given array member.
This method will perform an automatic conversion to com.rti.dds.infrastructure.LongSeq.
If the destination array is insufficiently long to store the data, this operation will fail without copying anything.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
array | <<in>> The elements to copy. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
void set_long_seq | ( | String | member_name, |
int | member_id, | ||
LongSeq | value | ||
) |
Set the contents of the given sequence member.
This method will perform an automatic conversion to an array of long.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
value | <<in>> A sequence, from which the elements will be copied. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
References LongSeq.getMaximum(), and AbstractPrimitiveSequence.size().
void set_string | ( | String | member_name, |
int | member_id, | ||
String | value | ||
) |
Set the value of the given field of type com.rti.dds.infrastructure.String.
This operation is also valid for members of kind com.rti.dds.typecode.TCKind.TK_WSTRING. In this case, each String character is encoded in a wide char.
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
value | <<in>> The value to which to set the member. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
References DynamicData.get_member_type(), TypeCode.kind(), and TCKind.TK_WSTRING.
void set_complex_member | ( | String | member_name, |
int | member_id, | ||
DynamicData | value | ||
) |
Copy the state of the given com.rti.dds.dynamicdata.DynamicData object into a member of this object.
The member may be of type kind com.rti.dds.typecode.TCKind.TK_ARRAY, com.rti.dds.typecode.TCKind.TK_SEQUENCE, com.rti.dds.typecode.TCKind.TK_STRUCT, com.rti.dds.typecode.TCKind.TK_VALUE, or com.rti.dds.typecode.TCKind.TK_UNION. It may be specified by name or by ID.
Example: Copying Data
This method can be used with com.rti.dds.dynamicdata.DynamicData.bind_complex_member to copy from one com.rti.dds.dynamicdata.DynamicData object to another efficiently. Suppose the following data structure:
Suppose we have two instances of Foo
, foo_dst
and foo_src
, and we want to replace the contents of foo_dst.theBar
with the contents of foo_src.theBar
. The following example shows how to do this (error handling has been omitted for the sake of brevity).
member_name | <<in>> The name of the member or null to look up the member by its ID. |
member_id | <<in>> The ID of the member or com.rti.dds.dynamicdata.DynamicData.MEMBER_ID_UNSPECIFIED to look up by name. See Member Names and IDs. |
value | <<in>> The source com.rti.dds.dynamicdata.DynamicData object whose contents will be copied. |
One | of the Standard Return Codes or com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES |
int to_cdr_buffer | ( | byte [] | buffer, |
short | representation | ||
) |
Serializes a DynamicData object into a buffer of octets.
This method serializes a DynamicData object into a buffer of octets using the input data representation. See com.rti.dds.dynamicdata.DynamicData.to_cdr_buffer for details.
buffer | <<out>>. Serialization buffer. |
representation | <<in>>. Representation used to serialize the data |
Referenced by DynamicDataTypeSupport.to_cdr_buffer(), and DynamicData.to_cdr_buffer().
int to_cdr_buffer | ( | byte [] | buffer | ) |
Serializes a DynamicData object into a CDR buffer of octets.
This method serializes a DynamicData object into a buffer of octets, using CDR as the data representation. Calling this method is equivalent to calling com.rti.dds.dynamicdata.DynamicData.to_cdr_buffer with com.rti.dds.infrastructure.DataRepresentationQosPolicy.AUTO_DATA_REPRESENTATION as the representation.
The input buffer must be large enough to store the serialized representation of the DynamicData object. Otherwise, the method will return an error code.
To determine the minimum size of the input buffer, you must call this method with the buffer set to null.
buffer | <<out>>. Serialization buffer. |
One | of the Standard Return Codes |
References DataRepresentationQosPolicy.AUTO_DATA_REPRESENTATION, and DynamicData.to_cdr_buffer().
void from_cdr_buffer | ( | byte [] | buffer | ) |
Deserializes a DynamicData object from a buffer of octets.
This method deserializes a DynamicData object from a CDR buffer of octets.
The content of the buffer generated by the method com.rti.dds.dynamicdata.DynamicData.to_cdr_buffer can be provided to this method to get the DynamicData object back.
buffer | <<in>>. Deserialization buffer. |
One | of the Standard Return Codes |
Referenced by BytesTypeSupport.data_to_string(), KeyedStringTypeSupport.data_to_string(), StringTypeSupport.data_to_string(), KeyedBytesTypeSupport.data_to_string(), DynamicDataTypeSupport.from_cdr_buffer(), and DynamicData.from_cdr_buffer().
void to_cdr_buffer | ( | ByteSeq | sequence, |
short | representation | ||
) |
Serializes a DynamicData object into a sequence of octets.
This method serializes a DynamicData object into a sequence of octets using the input data representation.
The behavior of this method is the same as that of the com.rti.dds.dynamicdata.DynamicData.to_cdr_buffer method, except that it receives a com.rti.dds.infrastructure.ByteSeq as a serialization output.
This method may resize sequence
as needed to fit the serialized DynamicData object.
sequence | <<out>>. Serialization byte sequence. |
representation | <<in>>. Representation used to serialize the data. |
One | of the Standard Return Codes |
References ByteSeq.getMaximum(), AbstractSequence.setMaximum(), AbstractPrimitiveSequence.setSize(), and DynamicData.to_cdr_buffer().
void to_cdr_buffer | ( | ByteSeq | sequence | ) |
Serializes a DynamicData object into a CDR sequence of octets.
This method serializes a DynamicData object into a sequence of octets, using CDR as the data representation.
The behavior of this method is the same as that of the com.rti.dds.dynamicdata.DynamicData.to_cdr_buffer method, except that it receives a com.rti.dds.infrastructure.ByteSeq as a serialization output.
This method may resize sequence
as needed to fit the serialized DynamicData object.
sequence | <<out>>. Serialization byte sequence. |
One | of the Standard Return Codes |
References DataRepresentationQosPolicy.AUTO_DATA_REPRESENTATION, and DynamicData.to_cdr_buffer().
void from_cdr_buffer | ( | ByteSeq | sequence | ) |
Deserializes a DynamicData object from a sequence octets.
This method deserializes the a DynamicData object from a CDR sequence of octets.
The behavior of this method is the same as that of the com.rti.dds.dynamicdata.DynamicData.from_cdr_buffer method, except that it receives a com.rti.dds.infrastructure.ByteSeq as deserialization input.
sequence | <<in>>. Deserialization octet sequence. Cannot be ull. |
One | of the Standard Return Codes |
References DynamicData.from_cdr_buffer().
String to_string | ( | PrintFormatProperty | property | ) |
Get a string representation of a DynamicData object.
This method takes a dynamic data sample and creates a string representation of the data.
If the size of the output string is longer than the size of an unsigned 32-bit integer, this operation will fail with com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES.
property | <<in>>. Properties describing what the format of the output string should be. Cannot be ull. |
One | of the Standard Return Codes, com.rti.dds.infrastructure.RETCODE_OUT_OF_RESOURCES , java.lang.IllegalStateException |
References PrintFormatProperty.kind, and Enum.ordinal().
Referenced by BytesTypeSupport.data_to_string(), KeyedStringTypeSupport.data_to_string(), StringTypeSupport.data_to_string(), and KeyedBytesTypeSupport.data_to_string().
String to_string | ( | ) |
Get a string representation of a DynamicData object using the default values for com.rti.dds.topic.PrintFormatProperty.
References DynamicData.PROPERTY_DEFAULT.
|
static |
A sentinel value that indicates that no member ID is needed in order to perform some operation.
Most commonly, this constant will be used in "get" operations to indicate that a lookup should be performed based on a name, not on an ID.