|
RTI Connext C# API Version 7.7.0
|
A data sample of any complex data type, which can be inspected and manipulated reflectively. More...
Inherits IDisposable, and IEquatable< DynamicData >.
Public Member Functions | |
| DynamicData (DynamicType type) | |
| Create a new DynamicData object for a given type More... | |
| DynamicData (DynamicType type, DynamicDataProperty property) | |
| Create a new DynamicData object for a given type and custom configuration More... | |
| DynamicData | Clone () |
| Creates a deep copy of this object More... | |
| void | CopyFrom (DynamicData source) |
| Copies the sample into this one, overwritting it. Both samples must have the same type. More... | |
| T | GetValue< T > (string memberName) |
| Gets value of type T using the name of the member. More... | |
| T | GetValue< T > (int memberId) |
| Gets value of type T using the id of the member. More... | |
| DynamicData | SetValue< T > (string memberName, T value) |
| Sets value of type T using the name of the member. More... | |
| DynamicData | SetValue< T > (int memberId, T value) |
| Sets value of type T using the id of the member. More... | |
| DynamicData | SetAnyValue (string memberName, object value) |
| Sets a member value from any object More... | |
| DynamicData | SetAnyValue (int memberId, object value) |
| Sets a member value from an object More... | |
| object | GetAnyValue (string memberName) |
| Gets a member value without specifying its expected type at compilation time More... | |
| object | GetAnyValue (int memberId) |
| Gets a member value without specifying its expected type at compilation time More... | |
| int | GetDiscriminatorValue () |
| Deprecated. Use GetDiscriminator() instead. Obtains the value of the union discriminator (only for unions) More... | |
| LoanedDynamicData | LoanValue (string memberName) |
| Returns a loaned object to provide access to a complex field of this DynamicData object. More... | |
| LoanedDynamicData | LoanValue (int memberId) |
| Returns a loaned object to provide access to a complex field of this DynamicData object. More... | |
| void | ClearAllMembers () |
| Clear the contents of all data members of this object. More... | |
| void | ClearMember (string memberName) |
| Clear the contents of a single data member of this object. More... | |
| void | ClearMember (int memberId) |
| Clear the contents of a single data member of this object. More... | |
| void | ClearOptionalMember (string memberName) |
| Clear the contents of a single optional data member of this object. More... | |
| void | ClearOptionalMember (int memberId) |
| Clear the contents of a single optional data member of this object. More... | |
| bool | MemberExists (string memberName) |
| Indicates whether a member exists in this sample More... | |
| bool | MemberExists (int memberId) |
| Indicates whether a member exists in this sample More... | |
| bool | MemberExistsInType (string memberName) |
| Indicates whether a member is defined in this data sample's type. More... | |
| bool | MemberExistsInType (int memberId) |
| Indicates whether a member is defined in this data sample's type. More... | |
| bool | IsMemberKey (string memberName) |
| Indicates whether a given member forms part of the key of this sample's data type. More... | |
| bool | IsMemberKey (int memberId) |
| Indicates whether a given member forms part of the key of this sample's data type. More... | |
| DynamicType | GetMemberType (string memberName) |
| Returns the type of a member More... | |
| DynamicType | GetMemberType (int memberId) |
| Returns the type of a member More... | |
| MemberInfo | GetMemberInfo (string memberName) |
| Gets information about a member of this DynamicData sample. More... | |
| MemberInfo | GetMemberInfo (int memberId) |
| Gets information about a member of this DynamicData sample. More... | |
| MemberInfo | GetMemberInfoByIndex (uint index) |
| Gets information about a member (identified by its position) of this DynamicData sample. More... | |
| int | GetDiscriminator () |
| Obtains the value of the union discriminator (only for unions) More... | |
| void | SetDiscriminator (int discriminator) |
| Sets the value of the union discriminator (only for unions) More... | |
| void | Dispose () |
| Releases the native resources (a finalizer is provided as well) More... | |
| byte[] | ToCdrBuffer () |
| Serializes a DynamicData as a CDR buffer of octets into a new array. More... | |
| int | ToCdrBuffer (byte[] buffer) |
| Serializes a DynamicData as a CDR buffer of octets into an existing array More... | |
| void | FromCdrBuffer (byte[] buffer) |
| Populates this DynamicData object from the serialized CDR data in a buffer More... | |
| override int | GetHashCode () |
| Returns a simple hash code. More... | |
| string | ToString (PrintFormatProperty format) |
| Get a string representation of this DynamicData object. More... | |
| override string | ToString () |
| Get a string representation of this DynamicData object with the default format More... | |
| void | FromString (string str, PrintFormatKind formatKind=PrintFormatKind.Json) |
| Populates this DynamicData object from a JSON string representation More... | |
| override bool | Equals (object other) |
| Indicate whether two data samples are equal More... | |
| bool | Equals (DynamicData other) |
| Indicate whether two data samples are equal More... | |
Properties | |
| bool | Disposed [get] |
| Indicates whether this object has been disposed More... | |
| DynamicType | Type [get] |
| Get the data type, of which this DynamicData represents an instance. More... | |
| TypeKind | TypeKind [get] |
| Get the kind of this object's data type. More... | |
| uint | MemberCount [get] |
| The number of data members in this DynamicData sample. More... | |
| DynamicDataInfo | Info [get] |
| Gets information about this DynamicData sample. More... | |
A data sample of any complex data type, which can be inspected and manipulated reflectively.
| Rti.Types.Dynamic.DynamicData.DynamicData | ( | DynamicType | type | ) |
Create a new DynamicData object for a given type
| type | The type definition for this data sample |
| Rti.Types.Dynamic.DynamicData.DynamicData | ( | DynamicType | type, |
| DynamicDataProperty | property | ||
| ) |
Create a new DynamicData object for a given type and custom configuration
| type | The type definition for this data sample |
| property | Configures this object's behavior |
|
inline |
Creates a deep copy of this object
| void Rti.Types.Dynamic.DynamicData.CopyFrom | ( | DynamicData | source | ) |
Copies the sample into this one, overwritting it. Both samples must have the same type.
| T Rti.Types.Dynamic.DynamicData.GetValue< T > | ( | string | memberName | ) |
Gets value of type T using the name of the member.
| T | The type of the value to retrieve. Supported types are: byte, short, ushort, int, uint, float, double, LongDouble, decimal, bool, char, long, ulong,string, DynamicData, byte[], short[], ushort[], int[], uint[], float[], double[], LongDouble[], bool[], char[], long[], ulong[]. |
| T Rti.Types.Dynamic.DynamicData.GetValue< T > | ( | int | memberId | ) |
Gets value of type T using the id of the member.
| T | The type of the value to retrieve. Supported types are: byte, short, ushort, int, uint, float, double, LongDouble, decimal, bool, char, long, ulong,string, DynamicData, byte[], short[], ushort[], int[], uint[], float[], double[], LongDouble[], bool[], char[], long[], ulong[]. |
|
inline |
Sets value of type T using the name of the member.
| T | The type of the value to retrieve. Supported types are: byte, short, ushort, int, uint, float, double, LongDouble, decimal, bool, char, long, ulong,string, DynamicData, byte[], short[], ushort[], int[], uint[], float[], double[], LongDouble[], bool[], char[], long[], ulong[]. |
The type of the value, T, must coincide with the declared type of the member. T is string for both regular IDL string and IDL wstring. If the member is an aggregation or a collection, T is DynamicData. SetAnyValue(string, object) can be used to perform conversion from T to the declared type of the member.
|
inline |
Sets value of type T using the id of the member.
| T | The type of the value to retrieve. Supported types are: byte, short, ushort, int, uint, float, double, LongDouble, decimal, bool, char, long, ulong, string, DynamicData, byte[], short[], ushort[], int[], uint[], float[], double[], LongDouble[], bool[], char[], long[], ulong[]. |
|
inline |
Sets a member value from any object
| memberName | The name of the member to set |
| value | The value to set. This method will try to convert it to the type of the member |
This method allows setting a member value without knowing the type of the value at compilation time. If the runtime type of value doesn't coincide with the type of the member type, this method uses System.Convert to attempt to convert it. If the conversion is not possible, any of the exceptions thrown by System.Convert may be thrown by this method as well.
This method provides great flexibility, but is less efficient than the concrete setters.
The following example shows how to set an integer from a string:
|
inline |
Sets a member value from an object
| memberId | The id of the member to set |
| value | The value to set. This method will try to convert it to the type of the member |
|
inline |
Gets a member value without specifying its expected type at compilation time
| memberName | The name of the member to set |
This function allows getting the value of member without knowing its type at compilation time. If the type is known, use the specific getter, such as GetValue<int> for ints.
|
inline |
Gets a member value without specifying its expected type at compilation time
| memberId | The id of the member to set |
|
inline |
Deprecated. Use GetDiscriminator() instead. Obtains the value of the union discriminator (only for unions)
| LoanedDynamicData Rti.Types.Dynamic.DynamicData.LoanValue | ( | string | memberName | ) |
Returns a loaned object to provide access to a complex field of this DynamicData object.
The full documentation is available in the C API: DDS_DynamicData_bind_complex_member
| LoanedDynamicData Rti.Types.Dynamic.DynamicData.LoanValue | ( | int | memberId | ) |
Returns a loaned object to provide access to a complex field of this DynamicData object.
The full documentation is available in the C API: DDS_DynamicData_bind_complex_member
| void Rti.Types.Dynamic.DynamicData.ClearAllMembers | ( | ) |
Clear the contents of all data members of this object.
The full documentation is available in the C API: DDS_DynamicData_clear_all_members
| void Rti.Types.Dynamic.DynamicData.ClearMember | ( | string | memberName | ) |
Clear the contents of a single data member of this object.
The full documentation is available in the C API: DDS_DynamicData_clear_member
| void Rti.Types.Dynamic.DynamicData.ClearMember | ( | int | memberId | ) |
Clear the contents of a single data member of this object.
The full documentation is available in the C API: DDS_DynamicData_clear_member
| void Rti.Types.Dynamic.DynamicData.ClearOptionalMember | ( | string | memberName | ) |
Clear the contents of a single optional data member of this object.
The full documentation is available in the C API: DDS_DynamicData_clear_optional_member
| void Rti.Types.Dynamic.DynamicData.ClearOptionalMember | ( | int | memberId | ) |
Clear the contents of a single optional data member of this object.
The full documentation is available in the C API: DDS_DynamicData_clear_optional_member
| bool Rti.Types.Dynamic.DynamicData.MemberExists | ( | string | memberName | ) |
Indicates whether a member exists in this sample
The full documentation is available in the C API: DDS_DynamicData_member_exists
| bool Rti.Types.Dynamic.DynamicData.MemberExists | ( | int | memberId | ) |
Indicates whether a member exists in this sample
The full documentation is available in the C API: DDS_DynamicData_member_exists
| bool Rti.Types.Dynamic.DynamicData.MemberExistsInType | ( | string | memberName | ) |
Indicates whether a member is defined in this data sample's type.
The full documentation is available in the C API: DDS_DynamicData_member_exists_in_type
| bool Rti.Types.Dynamic.DynamicData.MemberExistsInType | ( | int | memberId | ) |
Indicates whether a member is defined in this data sample's type.
The full documentation is available in the C API: DDS_DynamicData_member_exists_in_type
| bool Rti.Types.Dynamic.DynamicData.IsMemberKey | ( | string | memberName | ) |
Indicates whether a given member forms part of the key of this sample's data type.
The full documentation is available in the C API: DDS_DynamicData_is_member_key
| bool Rti.Types.Dynamic.DynamicData.IsMemberKey | ( | int | memberId | ) |
Indicates whether a given member forms part of the key of this sample's data type.
The full documentation is available in the C API: DDS_DynamicData_is_member_key
| DynamicType Rti.Types.Dynamic.DynamicData.GetMemberType | ( | string | memberName | ) |
Returns the type of a member
| memberName | The member name |
| DynamicType Rti.Types.Dynamic.DynamicData.GetMemberType | ( | int | memberId | ) |
Returns the type of a member
| memberId | The member ID |
| MemberInfo Rti.Types.Dynamic.DynamicData.GetMemberInfo | ( | string | memberName | ) |
Gets information about a member of this DynamicData sample.
The full documentation is available in the C API: DDS_DynamicData_get_member_info
| MemberInfo Rti.Types.Dynamic.DynamicData.GetMemberInfo | ( | int | memberId | ) |
Gets information about a member of this DynamicData sample.
The full documentation is available in the C API: DDS_DynamicData_get_member_info
| MemberInfo Rti.Types.Dynamic.DynamicData.GetMemberInfoByIndex | ( | uint | index | ) |
Gets information about a member (identified by its position) of this DynamicData sample.
The full documentation is available in the C API: DDS_DynamicData_get_member_info
| int Rti.Types.Dynamic.DynamicData.GetDiscriminator | ( | ) |
Obtains the value of the union discriminator (only for unions)
The full documentation is available in the C API: DDS_DynamicData_get_discriminator
| void Rti.Types.Dynamic.DynamicData.SetDiscriminator | ( | int | discriminator | ) |
Sets the value of the union discriminator (only for unions)
The full documentation is available in the C API: DDS_DynamicData_set_discriminator
|
inline |
Releases the native resources (a finalizer is provided as well)
| byte[] Rti.Types.Dynamic.DynamicData.ToCdrBuffer | ( | ) |
Serializes a DynamicData as a CDR buffer of octets into a new array.
The full documentation is available in the C API: DDS_DynamicData_to_cdr_buffer
| int Rti.Types.Dynamic.DynamicData.ToCdrBuffer | ( | byte[] | buffer | ) |
Serializes a DynamicData as a CDR buffer of octets into an existing array
| buffer | An existing buffer where to write the serialized data. It needs to have enough space to include the data or the operation will fail. You can use StructType.GetCdrSerializedSampleMaxSize to get the max possible size |
The full documentation is available in the C API: DDS_DynamicData_to_cdr_buffer
| void Rti.Types.Dynamic.DynamicData.FromCdrBuffer | ( | byte[] | buffer | ) |
Populates this DynamicData object from the serialized CDR data in a buffer
| buffer | Contains the serialized data |
The full documentation is available in the C API: DDS_DynamicData_from_cdr_buffer
| override int Rti.Types.Dynamic.DynamicData.GetHashCode | ( | ) |
Returns a simple hash code.
| string Rti.Types.Dynamic.DynamicData.ToString | ( | PrintFormatProperty | format | ) |
Get a string representation of this DynamicData object.
| format | Allows changing the print format |
| override string Rti.Types.Dynamic.DynamicData.ToString | ( | ) |
Get a string representation of this DynamicData object with the default format
| void Rti.Types.Dynamic.DynamicData.FromString | ( | string | str, |
| PrintFormatKind | formatKind = PrintFormatKind.Json |
||
| ) |
Populates this DynamicData object from a JSON string representation
| override bool Rti.Types.Dynamic.DynamicData.Equals | ( | object | other | ) |
Indicate whether two data samples are equal
|
inline |
Indicate whether two data samples are equal
|
get |
Indicates whether this object has been disposed
|
get |
Get the data type, of which this DynamicData represents an instance.
The full documentation is available in the C API: DDS_DynamicData_get_type
|
get |
Get the kind of this object's data type.
The full documentation is available in the C API: DDS_DynamicData_get_type_kind
|
get |
The number of data members in this DynamicData sample.
The full documentation is available in the C API: DDS_DynamicDataInfo_member_count
|
get |
Gets information about this DynamicData sample.
The full documentation is available in the C API: DDS_DynamicData_get_info