RTI Connext C API  Version 5.1.0
HelloWorld.c

Programming Language Type Description

The following programming language specific type representation is generated by rtiddsgen for use in application code, where:

HelloWorld.h

[$(NDDSHOME)/example/C/helloWorld/HelloWorld.h]

/*
WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY.
This file was generated from HelloWorld.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 HelloWorld_1436885487_h
#define HelloWorld_1436885487_h
#ifndef NDDS_STANDALONE_TYPE
#ifndef ndds_c_h
#include "ndds/ndds_c.h"
#endif
#else
#include "ndds_standalone_type.h"
#endif
extern const char *HelloWorldTYPENAME;
typedef struct HelloWorld {
DDS_Char * msg ;
} HelloWorld ;
#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
NDDSUSERDllExport DDS_TypeCode* HelloWorld_get_typecode(void); /* Type code */
DDS_SEQUENCE(HelloWorldSeq, HelloWorld);
NDDSUSERDllExport
RTIBool HelloWorld_initialize(
HelloWorld* self);
NDDSUSERDllExport
RTIBool HelloWorld_initialize_ex(
HelloWorld* self,RTIBool allocatePointers,RTIBool allocateMemory);
NDDSUSERDllExport
RTIBool HelloWorld_initialize_w_params(
HelloWorld* self,
const struct DDS_TypeAllocationParams_t * allocParams);
NDDSUSERDllExport
void HelloWorld_finalize(
HelloWorld* self);
NDDSUSERDllExport
void HelloWorld_finalize_ex(
HelloWorld* self,RTIBool deletePointers);
NDDSUSERDllExport
void HelloWorld_finalize_w_params(
HelloWorld* self,
const struct DDS_TypeDeallocationParams_t * deallocParams);
NDDSUSERDllExport
void HelloWorld_finalize_optional_members(
HelloWorld* self, RTIBool deletePointers);
NDDSUSERDllExport
RTIBool HelloWorld_copy(
HelloWorld* dst,
const HelloWorld* src);
#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 /* HelloWorld */

HelloWorld.c

[$(NDDSHOME)/example/C/helloWorld/HelloWorld.c]

/*
WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY.
This file was generated from HelloWorld.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 NDDS_STANDALONE_TYPE
#ifndef ndds_c_h
#include "ndds/ndds_c.h"
#endif
#ifndef cdr_type_h
#include "cdr/cdr_type.h"
#endif
#ifndef osapi_heap_h
#include "osapi/osapi_heap.h"
#endif
#else
#include "ndds_standalone_type.h"
#endif
#include "HelloWorld.h"
/* ========================================================================= */
const char *HelloWorldTYPENAME = "HelloWorld";
DDS_TypeCode* HelloWorld_get_typecode()
{
static RTIBool is_initialized = RTI_FALSE;
static DDS_TypeCode HelloWorld_g_tc_msg_string = DDS_INITIALIZE_STRING_TYPECODE(128);
static DDS_TypeCode_Member HelloWorld_g_tc_members[1]=
{
{
(char *)"msg",/* Member name */
{
0,/* Representation ID */
DDS_BOOLEAN_FALSE,/* Is a pointer? */
-1, /* Bitfield bits */
NULL/* Member type code is assigned later */
},
0, /* Ignored */
0, /* Ignored */
0, /* Ignored */
NULL, /* Ignored */
RTI_CDR_REQUIRED_MEMBER, /* Is a key? */
DDS_PUBLIC_MEMBER,/* Member visibility */
1,
NULL/* Ignored */
}
};
static DDS_TypeCode HelloWorld_g_tc =
{{
DDS_TK_STRUCT,/* Kind */
DDS_BOOLEAN_FALSE, /* Ignored */
-1, /*Ignored*/
(char *)"HelloWorld", /* Name */
NULL, /* Ignored */
0, /* Ignored */
0, /* Ignored */
NULL, /* Ignored */
1, /* Number of members */
HelloWorld_g_tc_members, /* Members */
DDS_VM_NONE /* Ignored */
}}; /* Type code for HelloWorld*/
if (is_initialized) {
return &HelloWorld_g_tc;
}
HelloWorld_g_tc_members[0]._representation._typeCode = (RTICdrTypeCode *)&HelloWorld_g_tc_msg_string;
is_initialized = RTI_TRUE;
return &HelloWorld_g_tc;
}
RTIBool HelloWorld_initialize(
HelloWorld* sample) {
return HelloWorld_initialize_ex(sample,RTI_TRUE,RTI_TRUE);
}
RTIBool HelloWorld_initialize_ex(
HelloWorld* sample,RTIBool allocatePointers, RTIBool allocateMemory)
{
struct DDS_TypeAllocationParams_t allocParams =
DDS_TYPE_ALLOCATION_PARAMS_DEFAULT;
allocParams.allocate_pointers = (DDS_Boolean)allocatePointers;
allocParams.allocate_memory = (DDS_Boolean)allocateMemory;
return HelloWorld_initialize_w_params(
sample,&allocParams);
}
RTIBool HelloWorld_initialize_w_params(
HelloWorld* sample, const struct DDS_TypeAllocationParams_t * allocParams)
{
if (allocParams) {} /* To avoid warnings */
if (allocParams->allocate_memory){
sample->msg= DDS_String_alloc ((128));
if (sample->msg == NULL) {
return RTI_FALSE;
}
} else {
if (sample->msg!= NULL) {
sample->msg[0] = '\0';
}
}
return RTI_TRUE;
}
void HelloWorld_finalize(
HelloWorld* sample)
{
HelloWorld_finalize_ex(sample,RTI_TRUE);
}
void HelloWorld_finalize_ex(
HelloWorld* sample,RTIBool deletePointers)
{
struct DDS_TypeDeallocationParams_t deallocParams =
DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT;
if (sample) { } /* To avoid warnings */
deallocParams.delete_pointers = (DDS_Boolean)deletePointers;
HelloWorld_finalize_w_params(
sample,&deallocParams);
}
void HelloWorld_finalize_w_params(
HelloWorld* sample,const struct DDS_TypeDeallocationParams_t * deallocParams)
{
if (sample) {} /* To avoid warnings */
if (deallocParams) {} /* To avoid warnings */
if (sample->msg != NULL) {
DDS_String_free(sample->msg);
sample->msg=NULL;
}
}
void HelloWorld_finalize_optional_members(
HelloWorld* sample, RTIBool deletePointers)
{
struct DDS_TypeDeallocationParams_t deallocParamsTmp =
DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT;
struct DDS_TypeDeallocationParams_t * deallocParams =
&deallocParamsTmp;
if (sample) { } /* To avoid warnings */
if (deallocParams) {} /* To avoid warnings */
deallocParamsTmp.delete_pointers = (DDS_Boolean)deletePointers;
}
RTIBool HelloWorld_copy(
HelloWorld* dst,
const HelloWorld* src)
{
if (!RTICdrType_copyString (
dst->msg, src->msg, (128) + 1)) {
return RTI_FALSE;
}
return RTI_TRUE;
}
#define T HelloWorld
#define TSeq HelloWorldSeq
#define T_initialize_w_params HelloWorld_initialize_w_params
#define T_finalize_w_params HelloWorld_finalize_w_params
#define T_copy HelloWorld_copy
#ifndef NDDS_STANDALONE_TYPE
#include "dds_c/generic/dds_c_sequence_TSeq.gen"
#else
#include "dds_c_sequence_TSeq.gen"
#endif
#undef T_copy
#undef T_finalize_w_params
#undef T_initialize_w_params
#undef TSeq
#undef T

RTI Connext C API Version 5.1.0 Copyright © Tue Jul 1 2014 Real-Time Innovations, Inc