RTI Connext CORBA Compatibility Kit  Version 6.0.1
 All Groups Pages
MessagePlugin.cxx

[$(NDDSHOME)/example/CPP/corba/MessagePlugin.h]

/*
WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY.
This file was generated from Message.idl using "rtiddsgen".
The rtiddsgen tool is part of the RTI Connext distribution.
For more information, type 'rtiddsgen -help' at a command shell
or consult the RTI Connext manual.
*/
#ifndef MessagePlugin_793628338_h
#define MessagePlugin_793628338_h
#include "Message.h"
struct RTICdrStream;
#ifndef pres_typePlugin_h
#include "pres/pres_typePlugin.h"
#endif
#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT)
/* If the code is building on Windows, start exporting symbols.
*/
#undef NDDSUSERDllExport
#define NDDSUSERDllExport __declspec(dllexport)
#endif
#define DateTimePlugin_get_sample PRESTypePluginDefaultEndpointData_getSample
#define DateTimePlugin_return_sample PRESTypePluginDefaultEndpointData_returnSample
#define DateTimePlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer
#define DateTimePlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer
#define DateTimePlugin_create_sample PRESTypePluginDefaultEndpointData_createSample
#define DateTimePlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample
/* --------------------------------------------------------------------------------------
Support functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern DateTime*
DateTimePluginSupport_create_data_w_params(
const struct DDS_TypeAllocationParams_t * alloc_params);
NDDSUSERDllExport extern DateTime *
DateTimePluginSupport_create_data_ex(RTIBool allocate_pointers);
NDDSUSERDllExport extern DateTime *
DateTimePluginSupport_create_data();
NDDSUSERDllExport extern RTIBool
DateTimePluginSupport_copy_data(
DateTime *out,
const DateTime *in);
NDDSUSERDllExport extern void
DateTimePluginSupport_destroy_data_w_params(
DateTime *sample,
const struct DDS_TypeDeallocationParams_t * dealloc_params);
NDDSUSERDllExport extern void
DateTimePluginSupport_destroy_data_ex(
DateTime *sample,RTIBool deallocate_pointers);
NDDSUSERDllExport extern void
DateTimePluginSupport_destroy_data(
DateTime *sample);
NDDSUSERDllExport extern void
DateTimePluginSupport_print_data(
const DateTime *sample,
const char *desc,
unsigned int indent);
/* ----------------------------------------------------------------------------
Callback functions:
* ---------------------------------------------------------------------------- */
NDDSUSERDllExport extern PRESTypePluginParticipantData
DateTimePlugin_on_participant_attached(
void *registration_data,
const struct PRESTypePluginParticipantInfo *participant_info,
RTIBool top_level_registration,
void *container_plugin_context,
RTICdrTypeCode *typeCode);
NDDSUSERDllExport extern void
DateTimePlugin_on_participant_detached(
PRESTypePluginParticipantData participant_data);
NDDSUSERDllExport extern PRESTypePluginEndpointData
DateTimePlugin_on_endpoint_attached(
PRESTypePluginParticipantData participant_data,
const struct PRESTypePluginEndpointInfo *endpoint_info,
RTIBool top_level_registration,
void *container_plugin_context);
NDDSUSERDllExport extern void
DateTimePlugin_on_endpoint_detached(
PRESTypePluginEndpointData endpoint_data);
NDDSUSERDllExport extern RTIBool
DateTimePlugin_copy_sample(
PRESTypePluginEndpointData endpoint_data,
DateTime *out,
const DateTime *in);
/* --------------------------------------------------------------------------------------
(De)Serialize functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern RTIBool
DateTimePlugin_serialize(
PRESTypePluginEndpointData endpoint_data,
const DateTime *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
DateTimePlugin_deserialize_sample(
PRESTypePluginEndpointData endpoint_data,
DateTime *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
DateTimePlugin_deserialize(
PRESTypePluginEndpointData endpoint_data,
DateTime **sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool DateTimePlugin_skip(
PRESTypePluginEndpointData endpoint_data,
struct RTICdrStream *stream,
RTIBool skip_encapsulation,
RTIBool skip_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern unsigned int
DateTimePlugin_get_serialized_sample_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int size);
NDDSUSERDllExport extern unsigned int
DateTimePlugin_get_serialized_sample_min_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int size);
NDDSUSERDllExport extern unsigned int DateTimePlugin_get_serialized_sample_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int size,
const DateTime * sample);
/* --------------------------------------------------------------------------------------
Key Management functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern PRESTypePluginKeyKind
DateTimePlugin_get_key_kind();
NDDSUSERDllExport extern unsigned int
DateTimePlugin_get_serialized_key_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern RTIBool
DateTimePlugin_serialize_key(
PRESTypePluginEndpointData endpoint_data,
const DateTime *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
DateTimePlugin_deserialize_key_sample(
PRESTypePluginEndpointData endpoint_data,
DateTime * sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
DateTimePlugin_deserialize_key(
PRESTypePluginEndpointData endpoint_data,
DateTime ** sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
DateTimePlugin_serialized_sample_to_key(
PRESTypePluginEndpointData endpoint_data,
DateTime *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
/* Plugin Functions */
NDDSUSERDllExport extern struct PRESTypePlugin*
DateTimePlugin_new();
NDDSUSERDllExport extern void
DateTimePlugin_delete(struct PRESTypePlugin *);
#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT)
/* If the code is building on Windows, stop exporting symbols.
*/
#undef NDDSUSERDllExport
#define NDDSUSERDllExport
#endif
#define MessageTextPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample
#define MessageTextPlugin_return_sample PRESTypePluginDefaultEndpointData_returnSample
#define MessageTextPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer
#define MessageTextPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer
#define MessageTextPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample
#define MessageTextPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample
/* --------------------------------------------------------------------------------------
Support functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern MessageText*
MessageTextPluginSupport_create_data_w_params(
const struct DDS_TypeAllocationParams_t * alloc_params);
NDDSUSERDllExport extern MessageText *
MessageTextPluginSupport_create_data_ex(RTIBool allocate_pointers);
NDDSUSERDllExport extern MessageText *
MessageTextPluginSupport_create_data();
NDDSUSERDllExport extern RTIBool
MessageTextPluginSupport_copy_data(
MessageText *out,
const MessageText *in);
NDDSUSERDllExport extern void
MessageTextPluginSupport_destroy_data_w_params(
MessageText *sample,
const struct DDS_TypeDeallocationParams_t * dealloc_params);
NDDSUSERDllExport extern void
MessageTextPluginSupport_destroy_data_ex(
MessageText *sample,RTIBool deallocate_pointers);
NDDSUSERDllExport extern void
MessageTextPluginSupport_destroy_data(
MessageText *sample);
NDDSUSERDllExport extern void
MessageTextPluginSupport_print_data(
const MessageText *sample,
const char *desc,
unsigned int indent);
/* ----------------------------------------------------------------------------
Callback functions:
* ---------------------------------------------------------------------------- */
NDDSUSERDllExport extern PRESTypePluginParticipantData
MessageTextPlugin_on_participant_attached(
void *registration_data,
const struct PRESTypePluginParticipantInfo *participant_info,
RTIBool top_level_registration,
void *container_plugin_context,
RTICdrTypeCode *typeCode);
NDDSUSERDllExport extern void
MessageTextPlugin_on_participant_detached(
PRESTypePluginParticipantData participant_data);
NDDSUSERDllExport extern PRESTypePluginEndpointData
MessageTextPlugin_on_endpoint_attached(
PRESTypePluginParticipantData participant_data,
const struct PRESTypePluginEndpointInfo *endpoint_info,
RTIBool top_level_registration,
void *container_plugin_context);
NDDSUSERDllExport extern void
MessageTextPlugin_on_endpoint_detached(
PRESTypePluginEndpointData endpoint_data);
NDDSUSERDllExport extern RTIBool
MessageTextPlugin_copy_sample(
PRESTypePluginEndpointData endpoint_data,
MessageText *out,
const MessageText *in);
/* --------------------------------------------------------------------------------------
(De)Serialize functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern RTIBool
MessageTextPlugin_serialize(
PRESTypePluginEndpointData endpoint_data,
const MessageText *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
MessageTextPlugin_deserialize_sample(
PRESTypePluginEndpointData endpoint_data,
MessageText *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool MessageTextPlugin_skip(
PRESTypePluginEndpointData endpoint_data,
struct RTICdrStream *stream,
RTIBool skip_encapsulation,
RTIBool skip_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern unsigned int
MessageTextPlugin_get_serialized_sample_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int size);
NDDSUSERDllExport extern unsigned int
MessageTextPlugin_get_serialized_sample_min_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int size);
NDDSUSERDllExport extern unsigned int MessageTextPlugin_get_serialized_sample_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int size,
const MessageText * sample);
/* --------------------------------------------------------------------------------------
Key Management functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern PRESTypePluginKeyKind
MessageTextPlugin_get_key_kind();
NDDSUSERDllExport extern unsigned int
MessageTextPlugin_get_serialized_key_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern RTIBool
MessageTextPlugin_serialize_key(
PRESTypePluginEndpointData endpoint_data,
const MessageText *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
MessageTextPlugin_deserialize_key_sample(
PRESTypePluginEndpointData endpoint_data,
MessageText * sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
MessageTextPlugin_serialized_sample_to_key(
PRESTypePluginEndpointData endpoint_data,
MessageText *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT)
/* If the code is building on Windows, stop exporting symbols.
*/
#undef NDDSUSERDllExport
#define NDDSUSERDllExport
#endif
#define MessagePlugin_get_sample PRESTypePluginDefaultEndpointData_getSample
#define MessagePlugin_return_sample PRESTypePluginDefaultEndpointData_returnSample
#define MessagePlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer
#define MessagePlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer
#define MessagePlugin_create_sample PRESTypePluginDefaultEndpointData_createSample
#define MessagePlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample
/* --------------------------------------------------------------------------------------
Support functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern Message*
MessagePluginSupport_create_data_w_params(
const struct DDS_TypeAllocationParams_t * alloc_params);
NDDSUSERDllExport extern Message *
MessagePluginSupport_create_data_ex(RTIBool allocate_pointers);
NDDSUSERDllExport extern Message *
MessagePluginSupport_create_data();
NDDSUSERDllExport extern RTIBool
MessagePluginSupport_copy_data(
Message *out,
const Message *in);
NDDSUSERDllExport extern void
MessagePluginSupport_destroy_data_w_params(
Message *sample,
const struct DDS_TypeDeallocationParams_t * dealloc_params);
NDDSUSERDllExport extern void
MessagePluginSupport_destroy_data_ex(
Message *sample,RTIBool deallocate_pointers);
NDDSUSERDllExport extern void
MessagePluginSupport_destroy_data(
Message *sample);
NDDSUSERDllExport extern void
MessagePluginSupport_print_data(
const Message *sample,
const char *desc,
unsigned int indent);
/* ----------------------------------------------------------------------------
Callback functions:
* ---------------------------------------------------------------------------- */
NDDSUSERDllExport extern PRESTypePluginParticipantData
MessagePlugin_on_participant_attached(
void *registration_data,
const struct PRESTypePluginParticipantInfo *participant_info,
RTIBool top_level_registration,
void *container_plugin_context,
RTICdrTypeCode *typeCode);
NDDSUSERDllExport extern void
MessagePlugin_on_participant_detached(
PRESTypePluginParticipantData participant_data);
NDDSUSERDllExport extern PRESTypePluginEndpointData
MessagePlugin_on_endpoint_attached(
PRESTypePluginParticipantData participant_data,
const struct PRESTypePluginEndpointInfo *endpoint_info,
RTIBool top_level_registration,
void *container_plugin_context);
NDDSUSERDllExport extern void
MessagePlugin_on_endpoint_detached(
PRESTypePluginEndpointData endpoint_data);
NDDSUSERDllExport extern RTIBool
MessagePlugin_copy_sample(
PRESTypePluginEndpointData endpoint_data,
Message *out,
const Message *in);
/* --------------------------------------------------------------------------------------
(De)Serialize functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern RTIBool
MessagePlugin_serialize(
PRESTypePluginEndpointData endpoint_data,
const Message *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
MessagePlugin_deserialize_sample(
PRESTypePluginEndpointData endpoint_data,
Message *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
MessagePlugin_deserialize(
PRESTypePluginEndpointData endpoint_data,
Message **sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool MessagePlugin_skip(
PRESTypePluginEndpointData endpoint_data,
struct RTICdrStream *stream,
RTIBool skip_encapsulation,
RTIBool skip_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern unsigned int
MessagePlugin_get_serialized_sample_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int size);
NDDSUSERDllExport extern unsigned int
MessagePlugin_get_serialized_sample_min_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int size);
NDDSUSERDllExport extern unsigned int MessagePlugin_get_serialized_sample_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int size,
const Message * sample);
/* --------------------------------------------------------------------------------------
Key Management functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern PRESTypePluginKeyKind
MessagePlugin_get_key_kind();
NDDSUSERDllExport extern unsigned int
MessagePlugin_get_serialized_key_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern RTIBool
MessagePlugin_serialize_key(
PRESTypePluginEndpointData endpoint_data,
const Message *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
MessagePlugin_deserialize_key_sample(
PRESTypePluginEndpointData endpoint_data,
Message * sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
MessagePlugin_deserialize_key(
PRESTypePluginEndpointData endpoint_data,
Message ** sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
MessagePlugin_serialized_sample_to_key(
PRESTypePluginEndpointData endpoint_data,
Message *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
/* Plugin Functions */
NDDSUSERDllExport extern struct PRESTypePlugin*
MessagePlugin_new();
NDDSUSERDllExport extern void
MessagePlugin_delete(struct PRESTypePlugin *);
#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT)
/* If the code is building on Windows, stop exporting symbols.
*/
#undef NDDSUSERDllExport
#define NDDSUSERDllExport
#endif
#endif /* MessagePlugin_793628338_h */

[$(NDDSHOME)/example/CPP/corba/MessagePlugin.cxx]

/*
WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY.
This file was generated from Message.idl using "rtiddsgen".
The rtiddsgen tool is part of the RTI Connext distribution.
For more information, type 'rtiddsgen -help' at a command shell
or consult the RTI Connext manual.
*/
#include "MessagePlugin.h"
#include <string.h>
#ifdef __cplusplus
#ifndef ndds_cpp_h
#include "ndds/ndds_cpp.h"
#endif
#else
#ifndef ndds_c_h
#include "ndds/ndds_c.h"
#endif
#endif
#ifndef osapi_type_h
#include "osapi/osapi_type.h"
#endif
#ifndef osapi_heap_h
#include "osapi/osapi_heap.h"
#endif
#ifndef osapi_utility_h
#include "osapi/osapi_utility.h"
#endif
#ifndef cdr_type_h
#include "cdr/cdr_type.h"
#endif
#ifndef cdr_type_h
#include "cdr/cdr_encapsulation.h"
#endif
#ifndef cdr_stream_h
#include "cdr/cdr_stream.h"
#endif
#ifndef pres_typePlugin_h
#include "pres/pres_typePlugin.h"
#endif
/* --------------------------------------------------------------------------------------
* Type DateTime
* -------------------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------------------
Support functions:
* -------------------------------------------------------------------------------------- */
DateTime *
DateTimePluginSupport_create_data_ex(RTIBool allocate_pointers){
DateTime *sample = NULL;
sample = (DateTime *) new DateTime;
if (sample != NULL) {
if (!::DateTime_initialize_ex(sample,allocate_pointers,RTI_TRUE)) {
delete sample;
return NULL;
}
}
return sample;
}
DateTime*
DateTimePluginSupport_create_data_w_params(
const struct DDS_TypeAllocationParams_t * alloc_params)
{
return ::DateTimePluginSupport_create_data_ex(
(RTIBool)alloc_params->allocate_pointers);
}
DateTime *
DateTimePluginSupport_create_data()
{
return ::DateTimePluginSupport_create_data_ex(RTI_TRUE);
}
void
DateTimePluginSupport_destroy_data_ex(
DateTime *sample,RTIBool deallocate_pointers) {
::DateTime_finalize_ex(sample,deallocate_pointers);
delete sample;
}
void
DateTimePluginSupport_destroy_data(
DateTime *sample) {
::DateTimePluginSupport_destroy_data_ex(sample,RTI_TRUE);
}
void
DateTimePluginSupport_destroy_data_w_params(
DateTime *sample,
const struct DDS_TypeDeallocationParams_t * dealloc_params) {
::DateTimePluginSupport_destroy_data_ex(
sample, (RTIBool)dealloc_params->delete_pointers);
}
RTIBool
DateTimePluginSupport_copy_data(
DateTime *dst,
const DateTime *src)
{
return ::DateTime_copy(dst,src);
}
void
DateTimePluginSupport_print_data(
const DateTime *sample,
const char *desc,
unsigned int indent_level)
{
RTICdrType_printIndent(indent_level);
if (desc != NULL) {
RTILog_debug("%s:\n", desc);
} else {
RTILog_debug("\n");
}
if (sample == NULL) {
RTILog_debug("NULL\n");
return;
}
RTICdrType_printLong(
&sample->year, "year", indent_level + 1);
RTICdrType_printLong(
&sample->month, "month", indent_level + 1);
RTICdrType_printLong(
&sample->day, "day", indent_level + 1);
RTICdrType_printLong(
&sample->hour, "hour", indent_level + 1);
RTICdrType_printLong(
&sample->minute, "minute", indent_level + 1);
RTICdrType_printLong(
&sample->second, "second", indent_level + 1);
}
/* ----------------------------------------------------------------------------
Callback functions:
* ---------------------------------------------------------------------------- */
PRESTypePluginParticipantData
DateTimePlugin_on_participant_attached(
void *registration_data,
const struct PRESTypePluginParticipantInfo *participant_info,
RTIBool top_level_registration,
void *container_plugin_context,
RTICdrTypeCode *type_code)
{
if (registration_data == NULL) {};
if (top_level_registration == RTI_FALSE) {};
if (container_plugin_context == NULL) {};
if (type_code == NULL) {};
return PRESTypePluginDefaultParticipantData_new(participant_info);
}
void
DateTimePlugin_on_participant_detached(
PRESTypePluginParticipantData participant_data)
{
PRESTypePluginDefaultParticipantData_delete(participant_data);
}
PRESTypePluginEndpointData
DateTimePlugin_on_endpoint_attached(
PRESTypePluginParticipantData participant_data,
const struct PRESTypePluginEndpointInfo *endpoint_info,
RTIBool top_level_registration,
void *containerPluginContext)
{
PRESTypePluginEndpointData epd = NULL;
if (top_level_registration == RTI_FALSE) {};
if (containerPluginContext == NULL) {};
epd = PRESTypePluginDefaultEndpointData_new(
participant_data,
endpoint_info,
(PRESTypePluginDefaultEndpointDataCreateSampleFunction)
::DateTimePluginSupport_create_data,
(PRESTypePluginDefaultEndpointDataDestroySampleFunction)
::DateTimePluginSupport_destroy_data,
NULL, NULL);
if (epd == NULL) {
return NULL;
}
if (endpoint_info->endpointKind == PRES_TYPEPLUGIN_ENDPOINT_WRITER) {
if (PRESTypePluginDefaultEndpointData_createWriterPool(
epd,
endpoint_info,
(PRESTypePluginGetSerializedSampleMaxSizeFunction)
::DateTimePlugin_get_serialized_sample_max_size, epd,
(PRESTypePluginGetSerializedSampleSizeFunction)
::DateTimePlugin_get_serialized_sample_size,
epd) == RTI_FALSE) {
PRESTypePluginDefaultEndpointData_delete(epd);
return NULL;
}
}
return epd;
}
void
DateTimePlugin_on_endpoint_detached(
PRESTypePluginEndpointData endpoint_data)
{
PRESTypePluginDefaultEndpointData_delete(endpoint_data);
}
RTIBool
DateTimePlugin_copy_sample(
PRESTypePluginEndpointData endpoint_data,
DateTime *dst,
const DateTime *src)
{
if (endpoint_data == NULL) {};
return ::DateTimePluginSupport_copy_data(dst,src);
}
/* --------------------------------------------------------------------------------------
(De)Serialize functions:
* -------------------------------------------------------------------------------------- */
RTIBool
DateTimePlugin_serialize(
PRESTypePluginEndpointData endpoint_data,
const DateTime *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_sample,
void *endpoint_plugin_qos)
{
char * position = NULL;
RTIBool retval = RTI_TRUE;
if (endpoint_data == NULL) {};
if (endpoint_plugin_qos == NULL) {};
if(serialize_encapsulation) {
if (!RTICdrStream_serializeAndSetCdrEncapsulation(stream, encapsulation_id)) {
return RTI_FALSE;
}
position = RTICdrStream_resetAlignment(stream);
}
if(serialize_sample) {
if (!RTICdrStream_serializeLong(
stream, &sample->year)) {
return RTI_FALSE;
}
if (!RTICdrStream_serializeLong(
stream, &sample->month)) {
return RTI_FALSE;
}
if (!RTICdrStream_serializeLong(
stream, &sample->day)) {
return RTI_FALSE;
}
if (!RTICdrStream_serializeLong(
stream, &sample->hour)) {
return RTI_FALSE;
}
if (!RTICdrStream_serializeLong(
stream, &sample->minute)) {
return RTI_FALSE;
}
if (!RTICdrStream_serializeLong(
stream, &sample->second)) {
return RTI_FALSE;
}
}
if(serialize_encapsulation) {
RTICdrStream_restoreAlignment(stream,position);
}
return retval;
}
RTIBool
DateTimePlugin_deserialize_sample(
PRESTypePluginEndpointData endpoint_data,
DateTime *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos)
{
char * position = NULL;
if (endpoint_data == NULL) {};
if (endpoint_plugin_qos == NULL) {};
if(deserialize_encapsulation) {
if (!RTICdrStream_deserializeAndSetCdrEncapsulation(stream)) {
return RTI_FALSE;
}
position = RTICdrStream_resetAlignment(stream);
}
if(deserialize_sample) {
if (!RTICdrStream_deserializeLong(
stream, &sample->year)) {
return RTI_FALSE;
}
if (!RTICdrStream_deserializeLong(
stream, &sample->month)) {
return RTI_FALSE;
}
if (!RTICdrStream_deserializeLong(
stream, &sample->day)) {
return RTI_FALSE;
}
if (!RTICdrStream_deserializeLong(
stream, &sample->hour)) {
return RTI_FALSE;
}
if (!RTICdrStream_deserializeLong(
stream, &sample->minute)) {
return RTI_FALSE;
}
if (!RTICdrStream_deserializeLong(
stream, &sample->second)) {
return RTI_FALSE;
}
}
if(deserialize_encapsulation) {
RTICdrStream_restoreAlignment(stream,position);
}
return RTI_TRUE;
}
RTIBool
DateTimePlugin_deserialize(
PRESTypePluginEndpointData endpoint_data,
DateTime **sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos)
{
if (drop_sample == NULL) {};
return ::DateTimePlugin_deserialize_sample(
endpoint_data, (sample != NULL)?*sample:NULL,
stream, deserialize_encapsulation, deserialize_sample,
endpoint_plugin_qos);
}
RTIBool DateTimePlugin_skip(
PRESTypePluginEndpointData endpoint_data,
struct RTICdrStream *stream,
RTIBool skip_encapsulation,
RTIBool skip_sample,
void *endpoint_plugin_qos)
{
char * position = NULL;
if (endpoint_data == NULL) {};
if (endpoint_plugin_qos == NULL) {};
if(skip_encapsulation) {
if (!RTICdrStream_skipEncapsulation(stream)) {
return RTI_FALSE;
}
position = RTICdrStream_resetAlignment(stream);
}
if (skip_sample) {
if (!RTICdrStream_skipLong(stream)) {
return RTI_FALSE;
}
if (!RTICdrStream_skipLong(stream)) {
return RTI_FALSE;
}
if (!RTICdrStream_skipLong(stream)) {
return RTI_FALSE;
}
if (!RTICdrStream_skipLong(stream)) {
return RTI_FALSE;
}
if (!RTICdrStream_skipLong(stream)) {
return RTI_FALSE;
}
if (!RTICdrStream_skipLong(stream)) {
return RTI_FALSE;
}
}
if(skip_encapsulation) {
RTICdrStream_restoreAlignment(stream,position);
}
return RTI_TRUE;
}
unsigned int
DateTimePlugin_get_serialized_sample_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment)
{
unsigned int initial_alignment = current_alignment;
unsigned int encapsulation_size = current_alignment;
if (endpoint_data == NULL) {};
if (include_encapsulation) {
if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) {
return 1;
}
RTICdrStream_getEncapsulationSize(encapsulation_size);
encapsulation_size -= current_alignment;
current_alignment = 0;
initial_alignment = 0;
}
current_alignment += RTICdrType_getLongMaxSizeSerialized(
current_alignment);
current_alignment += RTICdrType_getLongMaxSizeSerialized(
current_alignment);
current_alignment += RTICdrType_getLongMaxSizeSerialized(
current_alignment);
current_alignment += RTICdrType_getLongMaxSizeSerialized(
current_alignment);
current_alignment += RTICdrType_getLongMaxSizeSerialized(
current_alignment);
current_alignment += RTICdrType_getLongMaxSizeSerialized(
current_alignment);
if (include_encapsulation) {
current_alignment += encapsulation_size;
}
if ((current_alignment - initial_alignment) == 0) {
return 1;
}
return current_alignment - initial_alignment;
}
unsigned int
DateTimePlugin_get_serialized_sample_min_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment)
{
unsigned int initial_alignment = current_alignment;
unsigned int encapsulation_size = current_alignment;
if (endpoint_data == NULL) {};
if (include_encapsulation) {
if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) {
return 1;
}
RTICdrStream_getEncapsulationSize(encapsulation_size);
encapsulation_size -= current_alignment;
current_alignment = 0;
initial_alignment = 0;
}
current_alignment += RTICdrType_getLongMaxSizeSerialized(
current_alignment);
current_alignment += RTICdrType_getLongMaxSizeSerialized(
current_alignment);
current_alignment += RTICdrType_getLongMaxSizeSerialized(
current_alignment);
current_alignment += RTICdrType_getLongMaxSizeSerialized(
current_alignment);
current_alignment += RTICdrType_getLongMaxSizeSerialized(
current_alignment);
current_alignment += RTICdrType_getLongMaxSizeSerialized(
current_alignment);
if (include_encapsulation) {
current_alignment += encapsulation_size;
}
if ((current_alignment - initial_alignment) == 0) {
return 1;
}
return current_alignment - initial_alignment;
}
/* Returns the size of the sample in its serialized form (in bytes).
* It can also be an estimation in excess of the real buffer needed
* during a call to the serialize() function.
* The value reported does not have to include the space for the
* encapsulation flags.
*/
unsigned int
DateTimePlugin_get_serialized_sample_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment,
const DateTime * sample)
{
unsigned int initial_alignment = current_alignment;
unsigned int encapsulation_size = current_alignment;
if (endpoint_data == NULL) {};
if (sample == NULL) {
return 1;
};
if (include_encapsulation) {
if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) {
return 1;
}
RTICdrStream_getEncapsulationSize(encapsulation_size);
encapsulation_size -= current_alignment;
current_alignment = 0;
initial_alignment = 0;
}
current_alignment += RTICdrType_getLongMaxSizeSerialized(
current_alignment);
current_alignment += RTICdrType_getLongMaxSizeSerialized(
current_alignment);
current_alignment += RTICdrType_getLongMaxSizeSerialized(
current_alignment);
current_alignment += RTICdrType_getLongMaxSizeSerialized(
current_alignment);
current_alignment += RTICdrType_getLongMaxSizeSerialized(
current_alignment);
current_alignment += RTICdrType_getLongMaxSizeSerialized(
current_alignment);
if (include_encapsulation) {
current_alignment += encapsulation_size;
}
return current_alignment - initial_alignment;
}
/* --------------------------------------------------------------------------------------
Key Management functions:
* -------------------------------------------------------------------------------------- */
PRESTypePluginKeyKind
DateTimePlugin_get_key_kind()
{
return PRES_TYPEPLUGIN_NO_KEY;
}
RTIBool
DateTimePlugin_serialize_key(
PRESTypePluginEndpointData endpoint_data,
const DateTime *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_key,
void *endpoint_plugin_qos)
{
char * position = NULL;
if (endpoint_plugin_qos == NULL) {};
if (endpoint_data == NULL) {};
if(serialize_encapsulation) {
if (!RTICdrStream_serializeAndSetCdrEncapsulation(stream, encapsulation_id)) {
return RTI_FALSE;
}
position = RTICdrStream_resetAlignment(stream);
}
if(serialize_key) {
if (!::DateTimePlugin_serialize(
endpoint_data,
sample,
stream,
RTI_FALSE, encapsulation_id,
RTI_TRUE,
endpoint_plugin_qos)) {
return RTI_FALSE;
}
}
if(serialize_encapsulation) {
RTICdrStream_restoreAlignment(stream,position);
}
return RTI_TRUE;
}
RTIBool DateTimePlugin_deserialize_key_sample(
PRESTypePluginEndpointData endpoint_data,
DateTime *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos)
{
char * position = NULL;
if (endpoint_plugin_qos == NULL) {};
if (endpoint_data == NULL) {};
if(deserialize_encapsulation) {
if (!RTICdrStream_deserializeAndSetCdrEncapsulation(stream)) {
return RTI_FALSE;
}
position = RTICdrStream_resetAlignment(stream);
}
if (deserialize_key) {
if (!::DateTimePlugin_deserialize_sample(
endpoint_data, sample, stream,
RTI_FALSE, RTI_TRUE,
endpoint_plugin_qos)) {
return RTI_FALSE;
}
}
if(deserialize_encapsulation) {
RTICdrStream_restoreAlignment(stream,position);
}
return RTI_TRUE;
}
RTIBool DateTimePlugin_deserialize_key(
PRESTypePluginEndpointData endpoint_data,
DateTime **sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos)
{
if (drop_sample == NULL) {};
return ::DateTimePlugin_deserialize_key_sample(
endpoint_data, (sample != NULL)?*sample:NULL, stream,
deserialize_encapsulation, deserialize_key, endpoint_plugin_qos);
}
unsigned int
DateTimePlugin_get_serialized_key_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment)
{
unsigned int encapsulation_size = current_alignment;
unsigned int initial_alignment = current_alignment;
if (endpoint_data == NULL) {};
if (include_encapsulation) {
if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) {
return 1;
}
RTICdrStream_getEncapsulationSize(encapsulation_size);
encapsulation_size -= current_alignment;
current_alignment = 0;
initial_alignment = 0;
}
current_alignment += ::DateTimePlugin_get_serialized_sample_max_size(
endpoint_data,RTI_FALSE, encapsulation_id,current_alignment);
if (include_encapsulation) {
current_alignment += encapsulation_size;
}
return current_alignment - initial_alignment;
}
RTIBool
DateTimePlugin_serialized_sample_to_key(
PRESTypePluginEndpointData endpoint_data,
DateTime *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos)
{
char * position = NULL;
if (endpoint_data == NULL) {};
if (endpoint_plugin_qos == NULL) {};
if (sample == NULL) {
return RTI_FALSE;
};
if(deserialize_encapsulation) {
if (!RTICdrStream_deserializeAndSetCdrEncapsulation(stream)) {
return RTI_FALSE;
}
position = RTICdrStream_resetAlignment(stream);
}
if (deserialize_key) {
if (!::DateTimePlugin_deserialize_sample(
endpoint_data, sample, stream, RTI_FALSE,
RTI_TRUE, endpoint_plugin_qos)) {
return RTI_FALSE;
}
}
if(deserialize_encapsulation) {
RTICdrStream_restoreAlignment(stream,position);
}
return RTI_TRUE;
}
/* ------------------------------------------------------------------------
* Plug-in Installation Methods
* ------------------------------------------------------------------------ */
struct PRESTypePlugin *DateTimePlugin_new()
{
struct PRESTypePlugin *plugin = NULL;
struct PRESTypePlugin* *plugin_addr = &plugin;
const struct PRESTypePluginVersion PLUGIN_VERSION =
PRES_TYPE_PLUGIN_VERSION_2_0;
RTIOsapiHeap_allocateStructure(
plugin_addr, struct PRESTypePlugin);
if (plugin == NULL) {
return NULL;
}
plugin->version = PLUGIN_VERSION;
/* set up parent's function pointers */
plugin->onParticipantAttached =
(PRESTypePluginOnParticipantAttachedCallback)
::DateTimePlugin_on_participant_attached;
plugin->onParticipantDetached =
(PRESTypePluginOnParticipantDetachedCallback)
::DateTimePlugin_on_participant_detached;
plugin->onEndpointAttached =
(PRESTypePluginOnEndpointAttachedCallback)
::DateTimePlugin_on_endpoint_attached;
plugin->onEndpointDetached =
(PRESTypePluginOnEndpointDetachedCallback)
::DateTimePlugin_on_endpoint_detached;
plugin->copySampleFnc =
(PRESTypePluginCopySampleFunction)
::DateTimePlugin_copy_sample;
plugin->createSampleFnc =
(PRESTypePluginCreateSampleFunction)
DateTimePlugin_create_sample;
plugin->destroySampleFnc =
(PRESTypePluginDestroySampleFunction)
DateTimePlugin_destroy_sample;
plugin->serializeFnc =
(PRESTypePluginSerializeFunction)
::DateTimePlugin_serialize;
plugin->deserializeFnc =
(PRESTypePluginDeserializeFunction)
::DateTimePlugin_deserialize;
plugin->getSerializedSampleMaxSizeFnc =
(PRESTypePluginGetSerializedSampleMaxSizeFunction)
::DateTimePlugin_get_serialized_sample_max_size;
plugin->getSerializedSampleMinSizeFnc =
(PRESTypePluginGetSerializedSampleMinSizeFunction)
::DateTimePlugin_get_serialized_sample_min_size;
plugin->getSampleFnc =
(PRESTypePluginGetSampleFunction)
DateTimePlugin_get_sample;
plugin->returnSampleFnc =
(PRESTypePluginReturnSampleFunction)
DateTimePlugin_return_sample;
plugin->getKeyKindFnc =
(PRESTypePluginGetKeyKindFunction)
::DateTimePlugin_get_key_kind;
/* These functions are only used for keyed types. As this is not a keyed
type they are all set to NULL
*/
plugin->serializeKeyFnc = NULL;
plugin->deserializeKeyFnc = NULL;
plugin->getKeyFnc = NULL;
plugin->returnKeyFnc = NULL;
plugin->instanceToKeyFnc = NULL;
plugin->keyToInstanceFnc = NULL;
plugin->getSerializedKeyMaxSizeFnc = NULL;
plugin->instanceToKeyHashFnc = NULL;
plugin->serializedSampleToKeyHashFnc = NULL;
plugin->serializedKeyToKeyHashFnc = NULL; /* Not supported yet */
plugin->typeCode = (struct RTICdrTypeCode *)::DateTime_get_typecode();
plugin->languageKind = PRES_TYPEPLUGIN_NON_DDS_TYPE;
plugin->getBuffer =
(PRESTypePluginGetBufferFunction)
DateTimePlugin_get_buffer;
plugin->returnBuffer =
(PRESTypePluginReturnBufferFunction)
DateTimePlugin_return_buffer;
plugin->getSerializedSampleSizeFnc =
(PRESTypePluginGetSerializedSampleSizeFunction)
::DateTimePlugin_get_serialized_sample_size;
plugin->endpointTypeName = DateTimeTYPENAME;
return plugin;
}
void
DateTimePlugin_delete(struct PRESTypePlugin *plugin)
{
RTIOsapiHeap_freeStructure(plugin);
}
/* --------------------------------------------------------------------------------------
* Type MessageText
* -------------------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------------------
Support functions:
* -------------------------------------------------------------------------------------- */
MessageText *
MessageTextPluginSupport_create_data_ex(RTIBool allocate_pointers){
MessageText *sample = NULL;
sample = (MessageText *) new MessageText;
if (sample != NULL) {
if (!::MessageText_initialize_ex(sample,allocate_pointers,RTI_TRUE)) {
delete sample;
return NULL;
}
}
return sample;
}
MessageText*
MessageTextPluginSupport_create_data_w_params(
const struct DDS_TypeAllocationParams_t * alloc_params)
{
return ::MessageTextPluginSupport_create_data_ex(
(RTIBool)alloc_params->allocate_pointers);
}
MessageText *
MessageTextPluginSupport_create_data()
{
return ::MessageTextPluginSupport_create_data_ex(RTI_TRUE);
}
void
MessageTextPluginSupport_destroy_data_ex(
MessageText *sample,RTIBool deallocate_pointers) {
::MessageText_finalize_ex(sample,deallocate_pointers);
delete sample;
}
void
MessageTextPluginSupport_destroy_data(
MessageText *sample) {
::MessageTextPluginSupport_destroy_data_ex(sample,RTI_TRUE);
}
void
MessageTextPluginSupport_destroy_data_w_params(
MessageText *sample,
const struct DDS_TypeDeallocationParams_t * dealloc_params) {
::MessageTextPluginSupport_destroy_data_ex(
sample, (RTIBool)dealloc_params->delete_pointers);
}
RTIBool
MessageTextPluginSupport_copy_data(
MessageText *dst,
const MessageText *src)
{
return ::MessageText_copy(dst,src);
}
void
MessageTextPluginSupport_print_data(
const MessageText *sample,
const char *desc,
unsigned int indent_level)
{
RTICdrType_printIndent(indent_level);
if (desc != NULL) {
RTILog_debug("%s:\n", desc);
} else {
RTILog_debug("\n");
}
if (sample == NULL) {
RTILog_debug("NULL\n");
return;
}
RTICdrType_printString(*sample,"", indent_level + 1);
}
/* ----------------------------------------------------------------------------
Callback functions:
* ---------------------------------------------------------------------------- */
PRESTypePluginParticipantData
MessageTextPlugin_on_participant_attached(
void *registration_data,
const struct PRESTypePluginParticipantInfo *participant_info,
RTIBool top_level_registration,
void *container_plugin_context,
RTICdrTypeCode *type_code)
{
if (registration_data == NULL) {};
if (top_level_registration == RTI_FALSE) {};
if (container_plugin_context == NULL) {};
if (type_code == NULL) {};
return PRESTypePluginDefaultParticipantData_new(participant_info);
}
void
MessageTextPlugin_on_participant_detached(
PRESTypePluginParticipantData participant_data)
{
PRESTypePluginDefaultParticipantData_delete(participant_data);
}
PRESTypePluginEndpointData
MessageTextPlugin_on_endpoint_attached(
PRESTypePluginParticipantData participant_data,
const struct PRESTypePluginEndpointInfo *endpoint_info,
RTIBool top_level_registration,
void *containerPluginContext)
{
PRESTypePluginEndpointData epd = NULL;
if (top_level_registration == RTI_FALSE) {};
if (containerPluginContext == NULL) {};
epd = PRESTypePluginDefaultEndpointData_new(
participant_data,
endpoint_info,
(PRESTypePluginDefaultEndpointDataCreateSampleFunction)
::MessageTextPluginSupport_create_data,
(PRESTypePluginDefaultEndpointDataDestroySampleFunction)
::MessageTextPluginSupport_destroy_data,
NULL, NULL);
if (epd == NULL) {
return NULL;
}
if (endpoint_info->endpointKind == PRES_TYPEPLUGIN_ENDPOINT_WRITER) {
if (PRESTypePluginDefaultEndpointData_createWriterPool(
epd,
endpoint_info,
(PRESTypePluginGetSerializedSampleMaxSizeFunction)
::MessageTextPlugin_get_serialized_sample_max_size, epd,
(PRESTypePluginGetSerializedSampleSizeFunction)
::MessageTextPlugin_get_serialized_sample_size,
epd) == RTI_FALSE) {
PRESTypePluginDefaultEndpointData_delete(epd);
return NULL;
}
}
return epd;
}
void
MessageTextPlugin_on_endpoint_detached(
PRESTypePluginEndpointData endpoint_data)
{
PRESTypePluginDefaultEndpointData_delete(endpoint_data);
}
RTIBool
MessageTextPlugin_copy_sample(
PRESTypePluginEndpointData endpoint_data,
MessageText *dst,
const MessageText *src)
{
if (endpoint_data == NULL) {};
return ::MessageTextPluginSupport_copy_data(dst,src);
}
/* --------------------------------------------------------------------------------------
(De)Serialize functions:
* -------------------------------------------------------------------------------------- */
RTIBool
MessageTextPlugin_serialize(
PRESTypePluginEndpointData endpoint_data,
const MessageText *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_sample,
void *endpoint_plugin_qos)
{
char * position = NULL;
RTIBool retval = RTI_TRUE;
if (endpoint_data == NULL) {};
if (endpoint_plugin_qos == NULL) {};
if(serialize_encapsulation) {
if (!RTICdrStream_serializeAndSetCdrEncapsulation(stream, encapsulation_id)) {
return RTI_FALSE;
}
position = RTICdrStream_resetAlignment(stream);
}
if(serialize_sample) {
if (!RTICdrStream_serializeString(
stream,*sample,((MSG_MAX_LENGTH)) + 1)) {
return RTI_FALSE;
}
}
if(serialize_encapsulation) {
RTICdrStream_restoreAlignment(stream,position);
}
return retval;
}
RTIBool
MessageTextPlugin_deserialize_sample(
PRESTypePluginEndpointData endpoint_data,
MessageText *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos)
{
char * position = NULL;
if (endpoint_data == NULL) {};
if (endpoint_plugin_qos == NULL) {};
if(deserialize_encapsulation) {
if (!RTICdrStream_deserializeAndSetCdrEncapsulation(stream)) {
return RTI_FALSE;
}
position = RTICdrStream_resetAlignment(stream);
}
if(deserialize_sample) {
if (!RTICdrStream_deserializeString(
stream,(CORBA::Char *&)*sample, ((MSG_MAX_LENGTH)) + 1)) {
return RTI_FALSE;
}
}
if(deserialize_encapsulation) {
RTICdrStream_restoreAlignment(stream,position);
}
return RTI_TRUE;
}
RTIBool MessageTextPlugin_skip(
PRESTypePluginEndpointData endpoint_data,
struct RTICdrStream *stream,
RTIBool skip_encapsulation,
RTIBool skip_sample,
void *endpoint_plugin_qos)
{
char * position = NULL;
if (endpoint_data == NULL) {};
if (endpoint_plugin_qos == NULL) {};
if(skip_encapsulation) {
if (!RTICdrStream_skipEncapsulation(stream)) {
return RTI_FALSE;
}
position = RTICdrStream_resetAlignment(stream);
}
if (skip_sample) {
if (!RTICdrStream_skipString(stream, ((MSG_MAX_LENGTH)) + 1)) {
return RTI_FALSE;
}
}
if(skip_encapsulation) {
RTICdrStream_restoreAlignment(stream,position);
}
return RTI_TRUE;
}
unsigned int
MessageTextPlugin_get_serialized_sample_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment)
{
unsigned int initial_alignment = current_alignment;
unsigned int encapsulation_size = current_alignment;
if (endpoint_data == NULL) {};
if (include_encapsulation) {
if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) {
return 1;
}
RTICdrStream_getEncapsulationSize(encapsulation_size);
encapsulation_size -= current_alignment;
current_alignment = 0;
initial_alignment = 0;
}
current_alignment += RTICdrType_getStringMaxSizeSerialized(
current_alignment, ((MSG_MAX_LENGTH)) + 1);
if (include_encapsulation) {
current_alignment += encapsulation_size;
}
if ((current_alignment - initial_alignment) == 0) {
return 1;
}
return current_alignment - initial_alignment;
}
unsigned int
MessageTextPlugin_get_serialized_sample_min_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment)
{
unsigned int initial_alignment = current_alignment;
unsigned int encapsulation_size = current_alignment;
if (endpoint_data == NULL) {};
if (include_encapsulation) {
if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) {
return 1;
}
RTICdrStream_getEncapsulationSize(encapsulation_size);
encapsulation_size -= current_alignment;
current_alignment = 0;
initial_alignment = 0;
}
current_alignment += RTICdrType_getStringMaxSizeSerialized(
current_alignment, 1);
if (include_encapsulation) {
current_alignment += encapsulation_size;
}
if ((current_alignment - initial_alignment) == 0) {
return 1;
}
return current_alignment - initial_alignment;
}
/* Returns the size of the sample in its serialized form (in bytes).
* It can also be an estimation in excess of the real buffer needed
* during a call to the serialize() function.
* The value reported does not have to include the space for the
* encapsulation flags.
*/
unsigned int
MessageTextPlugin_get_serialized_sample_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment,
const MessageText * sample)
{
unsigned int initial_alignment = current_alignment;
unsigned int encapsulation_size = current_alignment;
if (endpoint_data == NULL) {};
if (sample == NULL) {
return 1;
};
if (include_encapsulation) {
if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) {
return 1;
}
RTICdrStream_getEncapsulationSize(encapsulation_size);
encapsulation_size -= current_alignment;
current_alignment = 0;
initial_alignment = 0;
}
current_alignment += RTICdrType_getStringSerializedSize(
current_alignment, *sample);
if (include_encapsulation) {
current_alignment += encapsulation_size;
}
return current_alignment - initial_alignment;
}
/* --------------------------------------------------------------------------------------
Key Management functions:
* -------------------------------------------------------------------------------------- */
PRESTypePluginKeyKind
MessageTextPlugin_get_key_kind()
{
return PRES_TYPEPLUGIN_NO_KEY;
}
RTIBool
MessageTextPlugin_serialize_key(
PRESTypePluginEndpointData endpoint_data,
const MessageText *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_key,
void *endpoint_plugin_qos)
{
char * position = NULL;
if (endpoint_plugin_qos == NULL) {};
if (endpoint_data == NULL) {};
if(serialize_encapsulation) {
if (!RTICdrStream_serializeAndSetCdrEncapsulation(stream, encapsulation_id)) {
return RTI_FALSE;
}
position = RTICdrStream_resetAlignment(stream);
}
if(serialize_key) {
if (!RTICdrStream_serializeString(
stream,*sample,((MSG_MAX_LENGTH)) + 1)) {
return RTI_FALSE;
}
}
if(serialize_encapsulation) {
RTICdrStream_restoreAlignment(stream,position);
}
return RTI_TRUE;
}
RTIBool MessageTextPlugin_deserialize_key_sample(
PRESTypePluginEndpointData endpoint_data,
MessageText *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos)
{
char * position = NULL;
if (endpoint_plugin_qos == NULL) {};
if (endpoint_data == NULL) {};
if(deserialize_encapsulation) {
if (!RTICdrStream_deserializeAndSetCdrEncapsulation(stream)) {
return RTI_FALSE;
}
position = RTICdrStream_resetAlignment(stream);
}
if (deserialize_key) {
if (!RTICdrStream_deserializeString(
stream,(CORBA::Char *&)*sample, ((MSG_MAX_LENGTH)) + 1)) {
return RTI_FALSE;
}
}
if(deserialize_encapsulation) {
RTICdrStream_restoreAlignment(stream,position);
}
return RTI_TRUE;
}
unsigned int
MessageTextPlugin_get_serialized_key_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment)
{
unsigned int encapsulation_size = current_alignment;
unsigned int initial_alignment = current_alignment;
if (endpoint_data == NULL) {};
if (include_encapsulation) {
if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) {
return 1;
}
RTICdrStream_getEncapsulationSize(encapsulation_size);
encapsulation_size -= current_alignment;
current_alignment = 0;
initial_alignment = 0;
}
current_alignment += RTICdrType_getStringMaxSizeSerialized(
current_alignment, ((MSG_MAX_LENGTH)) + 1);
if (include_encapsulation) {
current_alignment += encapsulation_size;
}
return current_alignment - initial_alignment;
}
RTIBool
MessageTextPlugin_serialized_sample_to_key(
PRESTypePluginEndpointData endpoint_data,
MessageText *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos)
{
char * position = NULL;
if (endpoint_data == NULL) {};
if (endpoint_plugin_qos == NULL) {};
if (sample == NULL) {
return RTI_FALSE;
};
if(deserialize_encapsulation) {
if (!RTICdrStream_deserializeAndSetCdrEncapsulation(stream)) {
return RTI_FALSE;
}
position = RTICdrStream_resetAlignment(stream);
}
if (deserialize_key) {
}
if(deserialize_encapsulation) {
RTICdrStream_restoreAlignment(stream,position);
}
return RTI_TRUE;
}
/* ------------------------------------------------------------------------
* Plug-in Installation Methods
* ------------------------------------------------------------------------ */
/* --------------------------------------------------------------------------------------
* Type Message
* -------------------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------------------
Support functions:
* -------------------------------------------------------------------------------------- */
Message *
MessagePluginSupport_create_data_ex(RTIBool allocate_pointers){
Message *sample = NULL;
sample = (Message *) new Message;
if (sample != NULL) {
if (!::Message_initialize_ex(sample,allocate_pointers,RTI_TRUE)) {
delete sample;
return NULL;
}
}
return sample;
}
Message*
MessagePluginSupport_create_data_w_params(
const struct DDS_TypeAllocationParams_t * alloc_params)
{
return ::MessagePluginSupport_create_data_ex(
(RTIBool)alloc_params->allocate_pointers);
}
Message *
MessagePluginSupport_create_data()
{
return ::MessagePluginSupport_create_data_ex(RTI_TRUE);
}
void
MessagePluginSupport_destroy_data_ex(
Message *sample,RTIBool deallocate_pointers) {
::Message_finalize_ex(sample,deallocate_pointers);
delete sample;
}
void
MessagePluginSupport_destroy_data(
Message *sample) {
::MessagePluginSupport_destroy_data_ex(sample,RTI_TRUE);
}
void
MessagePluginSupport_destroy_data_w_params(
Message *sample,
const struct DDS_TypeDeallocationParams_t * dealloc_params) {
::MessagePluginSupport_destroy_data_ex(
sample, (RTIBool)dealloc_params->delete_pointers);
}
RTIBool
MessagePluginSupport_copy_data(
Message *dst,
const Message *src)
{
return ::Message_copy(dst,src);
}
void
MessagePluginSupport_print_data(
const Message *sample,
const char *desc,
unsigned int indent_level)
{
RTICdrType_printIndent(indent_level);
if (desc != NULL) {
RTILog_debug("%s:\n", desc);
} else {
RTILog_debug("\n");
}
if (sample == NULL) {
RTILog_debug("NULL\n");
return;
}
DateTimePluginSupport_print_data(
&(DateTime&)sample->time, "time", indent_level + 1);
RTICdrType_printString(sample->msg,"msg", indent_level + 1);
}
/* ----------------------------------------------------------------------------
Callback functions:
* ---------------------------------------------------------------------------- */
PRESTypePluginParticipantData
MessagePlugin_on_participant_attached(
void *registration_data,
const struct PRESTypePluginParticipantInfo *participant_info,
RTIBool top_level_registration,
void *container_plugin_context,
RTICdrTypeCode *type_code)
{
if (registration_data == NULL) {};
if (top_level_registration == RTI_FALSE) {};
if (container_plugin_context == NULL) {};
if (type_code == NULL) {};
return PRESTypePluginDefaultParticipantData_new(participant_info);
}
void
MessagePlugin_on_participant_detached(
PRESTypePluginParticipantData participant_data)
{
PRESTypePluginDefaultParticipantData_delete(participant_data);
}
PRESTypePluginEndpointData
MessagePlugin_on_endpoint_attached(
PRESTypePluginParticipantData participant_data,
const struct PRESTypePluginEndpointInfo *endpoint_info,
RTIBool top_level_registration,
void *containerPluginContext)
{
PRESTypePluginEndpointData epd = NULL;
if (top_level_registration == RTI_FALSE) {};
if (containerPluginContext == NULL) {};
epd = PRESTypePluginDefaultEndpointData_new(
participant_data,
endpoint_info,
(PRESTypePluginDefaultEndpointDataCreateSampleFunction)
::MessagePluginSupport_create_data,
(PRESTypePluginDefaultEndpointDataDestroySampleFunction)
::MessagePluginSupport_destroy_data,
NULL, NULL);
if (epd == NULL) {
return NULL;
}
if (endpoint_info->endpointKind == PRES_TYPEPLUGIN_ENDPOINT_WRITER) {
if (PRESTypePluginDefaultEndpointData_createWriterPool(
epd,
endpoint_info,
(PRESTypePluginGetSerializedSampleMaxSizeFunction)
::MessagePlugin_get_serialized_sample_max_size, epd,
(PRESTypePluginGetSerializedSampleSizeFunction)
::MessagePlugin_get_serialized_sample_size,
epd) == RTI_FALSE) {
PRESTypePluginDefaultEndpointData_delete(epd);
return NULL;
}
}
return epd;
}
void
MessagePlugin_on_endpoint_detached(
PRESTypePluginEndpointData endpoint_data)
{
PRESTypePluginDefaultEndpointData_delete(endpoint_data);
}
RTIBool
MessagePlugin_copy_sample(
PRESTypePluginEndpointData endpoint_data,
Message *dst,
const Message *src)
{
if (endpoint_data == NULL) {};
return ::MessagePluginSupport_copy_data(dst,src);
}
/* --------------------------------------------------------------------------------------
(De)Serialize functions:
* -------------------------------------------------------------------------------------- */
RTIBool
MessagePlugin_serialize(
PRESTypePluginEndpointData endpoint_data,
const Message *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_sample,
void *endpoint_plugin_qos)
{
char * position = NULL;
RTIBool retval = RTI_TRUE;
if (endpoint_data == NULL) {};
if (endpoint_plugin_qos == NULL) {};
if(serialize_encapsulation) {
if (!RTICdrStream_serializeAndSetCdrEncapsulation(stream, encapsulation_id)) {
return RTI_FALSE;
}
position = RTICdrStream_resetAlignment(stream);
}
if(serialize_sample) {
if (!DateTimePlugin_serialize(endpoint_data,
&(DateTime&)sample->time,
stream,
RTI_FALSE, encapsulation_id, RTI_TRUE,
endpoint_plugin_qos)) {
return RTI_FALSE;
}
if (!RTICdrStream_serializeString(
stream,sample->msg,((MSG_MAX_LENGTH)) + 1)) {
return RTI_FALSE;
}
}
if(serialize_encapsulation) {
RTICdrStream_restoreAlignment(stream,position);
}
return retval;
}
RTIBool
MessagePlugin_deserialize_sample(
PRESTypePluginEndpointData endpoint_data,
Message *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos)
{
char * position = NULL;
if (endpoint_data == NULL) {};
if (endpoint_plugin_qos == NULL) {};
if(deserialize_encapsulation) {
if (!RTICdrStream_deserializeAndSetCdrEncapsulation(stream)) {
return RTI_FALSE;
}
position = RTICdrStream_resetAlignment(stream);
}
if(deserialize_sample) {
if (!DateTimePlugin_deserialize_sample(
endpoint_data,
&(DateTime&)sample->time,
stream,
RTI_FALSE,RTI_TRUE,
endpoint_plugin_qos)) {
return RTI_FALSE;
}
if (!RTICdrStream_deserializeString(
stream,(CORBA::Char *&)sample->msg, ((MSG_MAX_LENGTH)) + 1)) {
return RTI_FALSE;
}
}
if(deserialize_encapsulation) {
RTICdrStream_restoreAlignment(stream,position);
}
return RTI_TRUE;
}
RTIBool
MessagePlugin_deserialize(
PRESTypePluginEndpointData endpoint_data,
Message **sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos)
{
if (drop_sample == NULL) {};
return ::MessagePlugin_deserialize_sample(
endpoint_data, (sample != NULL)?*sample:NULL,
stream, deserialize_encapsulation, deserialize_sample,
endpoint_plugin_qos);
}
RTIBool MessagePlugin_skip(
PRESTypePluginEndpointData endpoint_data,
struct RTICdrStream *stream,
RTIBool skip_encapsulation,
RTIBool skip_sample,
void *endpoint_plugin_qos)
{
char * position = NULL;
if (endpoint_data == NULL) {};
if (endpoint_plugin_qos == NULL) {};
if(skip_encapsulation) {
if (!RTICdrStream_skipEncapsulation(stream)) {
return RTI_FALSE;
}
position = RTICdrStream_resetAlignment(stream);
}
if (skip_sample) {
if (!DateTimePlugin_skip(
endpoint_data,
stream,
RTI_FALSE, RTI_TRUE,
endpoint_plugin_qos)) {
return RTI_FALSE;
}
if (!RTICdrStream_skipString(stream, ((MSG_MAX_LENGTH)) + 1)) {
return RTI_FALSE;
}
}
if(skip_encapsulation) {
RTICdrStream_restoreAlignment(stream,position);
}
return RTI_TRUE;
}
unsigned int
MessagePlugin_get_serialized_sample_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment)
{
unsigned int initial_alignment = current_alignment;
unsigned int encapsulation_size = current_alignment;
if (endpoint_data == NULL) {};
if (include_encapsulation) {
if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) {
return 1;
}
RTICdrStream_getEncapsulationSize(encapsulation_size);
encapsulation_size -= current_alignment;
current_alignment = 0;
initial_alignment = 0;
}
current_alignment += DateTimePlugin_get_serialized_sample_max_size(endpoint_data,RTI_FALSE,
encapsulation_id,current_alignment);
current_alignment += RTICdrType_getStringMaxSizeSerialized(
current_alignment, ((MSG_MAX_LENGTH)) + 1);
if (include_encapsulation) {
current_alignment += encapsulation_size;
}
if ((current_alignment - initial_alignment) == 0) {
return 1;
}
return current_alignment - initial_alignment;
}
unsigned int
MessagePlugin_get_serialized_sample_min_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment)
{
unsigned int initial_alignment = current_alignment;
unsigned int encapsulation_size = current_alignment;
if (endpoint_data == NULL) {};
if (include_encapsulation) {
if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) {
return 1;
}
RTICdrStream_getEncapsulationSize(encapsulation_size);
encapsulation_size -= current_alignment;
current_alignment = 0;
initial_alignment = 0;
}
current_alignment += DateTimePlugin_get_serialized_sample_min_size(endpoint_data,RTI_FALSE,
encapsulation_id,current_alignment);
current_alignment += RTICdrType_getStringMaxSizeSerialized(
current_alignment, 1);
if (include_encapsulation) {
current_alignment += encapsulation_size;
}
if ((current_alignment - initial_alignment) == 0) {
return 1;
}
return current_alignment - initial_alignment;
}
/* Returns the size of the sample in its serialized form (in bytes).
* It can also be an estimation in excess of the real buffer needed
* during a call to the serialize() function.
* The value reported does not have to include the space for the
* encapsulation flags.
*/
unsigned int
MessagePlugin_get_serialized_sample_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment,
const Message * sample)
{
unsigned int initial_alignment = current_alignment;
unsigned int encapsulation_size = current_alignment;
if (endpoint_data == NULL) {};
if (sample == NULL) {
return 1;
};
if (include_encapsulation) {
if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) {
return 1;
}
RTICdrStream_getEncapsulationSize(encapsulation_size);
encapsulation_size -= current_alignment;
current_alignment = 0;
initial_alignment = 0;
}
current_alignment += DateTimePlugin_get_serialized_sample_size(
endpoint_data,RTI_FALSE, encapsulation_id,
current_alignment, &(DateTime&)sample->time);
current_alignment += RTICdrType_getStringSerializedSize(
current_alignment, sample->msg);
if (include_encapsulation) {
current_alignment += encapsulation_size;
}
return current_alignment - initial_alignment;
}
/* --------------------------------------------------------------------------------------
Key Management functions:
* -------------------------------------------------------------------------------------- */
PRESTypePluginKeyKind
MessagePlugin_get_key_kind()
{
return PRES_TYPEPLUGIN_NO_KEY;
}
RTIBool
MessagePlugin_serialize_key(
PRESTypePluginEndpointData endpoint_data,
const Message *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_key,
void *endpoint_plugin_qos)
{
char * position = NULL;
if (endpoint_plugin_qos == NULL) {};
if (endpoint_data == NULL) {};
if(serialize_encapsulation) {
if (!RTICdrStream_serializeAndSetCdrEncapsulation(stream, encapsulation_id)) {
return RTI_FALSE;
}
position = RTICdrStream_resetAlignment(stream);
}
if(serialize_key) {
if (!::MessagePlugin_serialize(
endpoint_data,
sample,
stream,
RTI_FALSE, encapsulation_id,
RTI_TRUE,
endpoint_plugin_qos)) {
return RTI_FALSE;
}
}
if(serialize_encapsulation) {
RTICdrStream_restoreAlignment(stream,position);
}
return RTI_TRUE;
}
RTIBool MessagePlugin_deserialize_key_sample(
PRESTypePluginEndpointData endpoint_data,
Message *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos)
{
char * position = NULL;
if (endpoint_plugin_qos == NULL) {};
if (endpoint_data == NULL) {};
if(deserialize_encapsulation) {
if (!RTICdrStream_deserializeAndSetCdrEncapsulation(stream)) {
return RTI_FALSE;
}
position = RTICdrStream_resetAlignment(stream);
}
if (deserialize_key) {
if (!::MessagePlugin_deserialize_sample(
endpoint_data, sample, stream,
RTI_FALSE, RTI_TRUE,
endpoint_plugin_qos)) {
return RTI_FALSE;
}
}
if(deserialize_encapsulation) {
RTICdrStream_restoreAlignment(stream,position);
}
return RTI_TRUE;
}
RTIBool MessagePlugin_deserialize_key(
PRESTypePluginEndpointData endpoint_data,
Message **sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos)
{
if (drop_sample == NULL) {};
return ::MessagePlugin_deserialize_key_sample(
endpoint_data, (sample != NULL)?*sample:NULL, stream,
deserialize_encapsulation, deserialize_key, endpoint_plugin_qos);
}
unsigned int
MessagePlugin_get_serialized_key_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment)
{
unsigned int encapsulation_size = current_alignment;
unsigned int initial_alignment = current_alignment;
if (endpoint_data == NULL) {};
if (include_encapsulation) {
if (!RTICdrEncapsulation_validEncapsulationId(encapsulation_id)) {
return 1;
}
RTICdrStream_getEncapsulationSize(encapsulation_size);
encapsulation_size -= current_alignment;
current_alignment = 0;
initial_alignment = 0;
}
current_alignment += ::MessagePlugin_get_serialized_sample_max_size(
endpoint_data,RTI_FALSE, encapsulation_id,current_alignment);
if (include_encapsulation) {
current_alignment += encapsulation_size;
}
return current_alignment - initial_alignment;
}
RTIBool
MessagePlugin_serialized_sample_to_key(
PRESTypePluginEndpointData endpoint_data,
Message *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos)
{
char * position = NULL;
if (endpoint_data == NULL) {};
if (endpoint_plugin_qos == NULL) {};
if (sample == NULL) {
return RTI_FALSE;
};
if(deserialize_encapsulation) {
if (!RTICdrStream_deserializeAndSetCdrEncapsulation(stream)) {
return RTI_FALSE;
}
position = RTICdrStream_resetAlignment(stream);
}
if (deserialize_key) {
if (!::MessagePlugin_deserialize_sample(
endpoint_data, sample, stream, RTI_FALSE,
RTI_TRUE, endpoint_plugin_qos)) {
return RTI_FALSE;
}
}
if(deserialize_encapsulation) {
RTICdrStream_restoreAlignment(stream,position);
}
return RTI_TRUE;
}
/* ------------------------------------------------------------------------
* Plug-in Installation Methods
* ------------------------------------------------------------------------ */
struct PRESTypePlugin *MessagePlugin_new()
{
struct PRESTypePlugin *plugin = NULL;
struct PRESTypePlugin* *plugin_addr = &plugin;
const struct PRESTypePluginVersion PLUGIN_VERSION =
PRES_TYPE_PLUGIN_VERSION_2_0;
RTIOsapiHeap_allocateStructure(
plugin_addr, struct PRESTypePlugin);
if (plugin == NULL) {
return NULL;
}
plugin->version = PLUGIN_VERSION;
/* set up parent's function pointers */
plugin->onParticipantAttached =
(PRESTypePluginOnParticipantAttachedCallback)
::MessagePlugin_on_participant_attached;
plugin->onParticipantDetached =
(PRESTypePluginOnParticipantDetachedCallback)
::MessagePlugin_on_participant_detached;
plugin->onEndpointAttached =
(PRESTypePluginOnEndpointAttachedCallback)
::MessagePlugin_on_endpoint_attached;
plugin->onEndpointDetached =
(PRESTypePluginOnEndpointDetachedCallback)
::MessagePlugin_on_endpoint_detached;
plugin->copySampleFnc =
(PRESTypePluginCopySampleFunction)
::MessagePlugin_copy_sample;
plugin->createSampleFnc =
(PRESTypePluginCreateSampleFunction)
MessagePlugin_create_sample;
plugin->destroySampleFnc =
(PRESTypePluginDestroySampleFunction)
MessagePlugin_destroy_sample;
plugin->serializeFnc =
(PRESTypePluginSerializeFunction)
::MessagePlugin_serialize;
plugin->deserializeFnc =
(PRESTypePluginDeserializeFunction)
::MessagePlugin_deserialize;
plugin->getSerializedSampleMaxSizeFnc =
(PRESTypePluginGetSerializedSampleMaxSizeFunction)
::MessagePlugin_get_serialized_sample_max_size;
plugin->getSerializedSampleMinSizeFnc =
(PRESTypePluginGetSerializedSampleMinSizeFunction)
::MessagePlugin_get_serialized_sample_min_size;
plugin->getSampleFnc =
(PRESTypePluginGetSampleFunction)
MessagePlugin_get_sample;
plugin->returnSampleFnc =
(PRESTypePluginReturnSampleFunction)
MessagePlugin_return_sample;
plugin->getKeyKindFnc =
(PRESTypePluginGetKeyKindFunction)
::MessagePlugin_get_key_kind;
/* These functions are only used for keyed types. As this is not a keyed
type they are all set to NULL
*/
plugin->serializeKeyFnc = NULL;
plugin->deserializeKeyFnc = NULL;
plugin->getKeyFnc = NULL;
plugin->returnKeyFnc = NULL;
plugin->instanceToKeyFnc = NULL;
plugin->keyToInstanceFnc = NULL;
plugin->getSerializedKeyMaxSizeFnc = NULL;
plugin->instanceToKeyHashFnc = NULL;
plugin->serializedSampleToKeyHashFnc = NULL;
plugin->serializedKeyToKeyHashFnc = NULL; /* Not supported yet */
plugin->typeCode = (struct RTICdrTypeCode *)::Message_get_typecode();
plugin->languageKind = PRES_TYPEPLUGIN_NON_DDS_TYPE;
plugin->getBuffer =
(PRESTypePluginGetBufferFunction)
MessagePlugin_get_buffer;
plugin->returnBuffer =
(PRESTypePluginReturnBufferFunction)
MessagePlugin_return_buffer;
plugin->getSerializedSampleSizeFnc =
(PRESTypePluginGetSerializedSampleSizeFunction)
::MessagePlugin_get_serialized_sample_size;
plugin->endpointTypeName = MessageTYPENAME;
return plugin;
}
void
MessagePlugin_delete(struct PRESTypePlugin *plugin)
{
RTIOsapiHeap_freeStructure(plugin);
}

RTI Connext CORBA Compatibility Kit Version 6.0.1 Copyright © Sun Nov 17 2019 Real-Time Innovations, Inc