RTI Connext DDS Micro  Version 2.4.9
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cdr_encapsulation.h
1 /*
2  * FILE: cdr_log.h CDR Log definitions
3  *
4  * (c) Copyright, Real-Time Innovations, 2012-2015.
5  * All rights reserved.
6  *
7  * No duplications, whole or partial, manual or electronic, may be made
8  * without express written permission. Any such copies, or
9  * revisions thereof, must display this notice unaltered.
10  * This code contains trade secrets of Real-Time Innovations, Inc.
11  *
12  * Modification History
13  * --------------------
14  * 23feb2015,eh MICRO-1075: remove and replace macros
15  * 15sep2014,eh Updated documentation
16  * 24mar2012,tk Cleanup
17  * 14aug2012,kaj Written
18  */
19 
20  /*ci
21  * \file
22  * \defgroup CDREncapsulationClass CDR Data Encapsulation
23  * \ingroup CDRModule
24  * \brief CDR Data Encapsulation
25  *
26  * \details
27  * Data encapsulation headers defined by and for RTPS data payloads.
28  *
29  */
30 
31 /*ci \addtogroup CDREncapsulationClass
32  * @{
33  */
34 #ifndef cdr_encapsulation_h
35 #define cdr_encapsulation_h
36 
37 #ifndef osapi_types_h
38 #include "osapi/osapi_types.h"
39 #endif
40 
41 #ifndef cdr_serialize_h
42 #include "cdr/cdr_serialize.h"
43 #endif
44 
45 #ifdef __cplusplus
46 extern "C"
47 {
48 #endif
49 
50 /*ci \brief OMG CDR Big Endian encapsulation ID */
51 #define RTI_CDR_ENCAPSULATION_ID_CDR_BE ((RTI_UINT16)0x0000)
52 
53 /*ci \brief OMG CDR Little Endian encapsulation ID */
54 #define RTI_CDR_ENCAPSULATION_ID_CDR_LE ((RTI_UINT16)0x0001)
55 
56 /*ci \brief Parameter List OMG CDR Big Endian encapsulation ID */
57 #define RTI_CDR_ENCAPSULATION_ID_PL_CDR_BE ((RTI_UINT16)0x0002)
58 
59 /*ci \brief Parameter List OMG CDR Little Endian encapsulation ID */
60 #define RTI_CDR_ENCAPSULATION_ID_PL_CDR_LE ((RTI_UINT16)0x0003)
61 
62 /*ci \brief Empty encapsulation options */
63 #define RTI_CDR_ENCAPSULATION_OPTIONS_NONE ((RTI_UINT16)0x0000)
64 
65 /*ci \brief Encapsulation header size */
66 #define RTI_CDR_ENCAPSULATION_HEADER_SIZE 4
67 
68 /*ci \brief Encapsulation ID */
69 typedef RTI_UINT16 NDDSCDREncapsulationId;
70 
71 /*ci \brief Encapsulation options */
72 typedef RTI_UINT16 NDDSCDREncapsulationOptions;
73 
74 /*ci \brief CDR Encapsulation */
75 typedef struct NDDSCDREncapsulation
76 {
77  /*ci \brief Encapsulation ID */
78  NDDSCDREncapsulationId identifier;
79 
80  /*ci \brief Encapsulation options */
81  NDDSCDREncapsulationOptions options;
82 } NDDSCDREncapsulation;
83 
84 /*ci
85  * \brief
86  * Deserialize a CDR data encapsulation header from a stream
87  *
88  * \param[inout] stream Deserialization stream
89  *
90  * \return RTI_TRUE on success with stream set according to deserialized
91  * data encapsulation header. RTI_FALSE on failure
92  */
93 MUST_CHECK_RETURN CDRDllExport RTI_BOOL
94 CDR_Stream_deserialize_header(struct CDR_Stream_t *stream);
95 
96 /*ci
97  * \brief
98  * Serialize a CDR data encapsulation header into a stream
99  *
100  * \param[inout] stream Serialization stream
101  * \param[in] is_guid Flag whether to use parameter/GUID data encapsulation
102  *
103  * \return RTI_TRUE on success, RTI_FALSE on failure
104  */
105 MUST_CHECK_RETURN CDRDllExport RTI_BOOL
106 CDR_Stream_serialize_header(struct CDR_Stream_t * stream,RTI_BOOL is_guid);
107 
108 #ifdef __cplusplus
109 } /* extern "C" */
110 #endif
111 
112 
113 #endif /* cdr_encapsulation_h */
114 
115 /*ci @} */

RTI Connext DDS Micro Version 2.4.9 Copyright © Thu Dec 15 2016 Real-Time Innovations, Inc