-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommonDefines.h
130 lines (108 loc) · 3.97 KB
/
CommonDefines.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/*
* CommonDefines.h
*
* Created on: Mar 11, 2012
* Author: knuthelv
*/
#ifndef RTPS_CommonDefines_h_IsIncluded
#define RTPS_CommonDefines_h_IsIncluded
#include"BaseLib/CommonDefines.h"
namespace RTPS
{
/*--------------------------------------------------------------------------------------------
typedef char octet
Alternatives:
typedef int8_t octet
typedef uint8_t octet
//typedef std::vector<char> sequence;
---------------------------------------------------------------------------------------------*/
typedef char octet;
typedef unsigned short SubmessageLength;
typedef std::vector<octet> ByteSeq;
#define OMG_CDR_BE 0x0000 // big-endian
#define OMG_CDR_LE 0x0001 // little-endian
#define OMG_PL_CDR_BE 0x0002 // parameter-list big-endian
#define OMG_PL_CDR_LE 0x0003 // parameter-list little-endian
/*-------------------------------------------------------
Sizes, etc, should be moved to configurable class?
---------------------------------------------------------*/
const unsigned int DATAGRAM_LENGTH = 1024;
/*-------------------------------------------------------
Submessage flags and bit position
---------------------------------------------------------*/
#define SUBMESSAGE_HEADER_ENDIAN_FLAG 0x01 // SubmessageHeader endian flag bit
#define ACKNACK_FINAL_FLAG 0x02 // AckNack submessage: Final flag bit
#define DATA_INLINE_QOS_FLAG 0x02 // Data submessage: Inline QoS Flag bit
#define DATA_SERIALIZED_DATA_FLAG 0x04 // Data submessage: Has serialized data flag bit
#define DATA_KEY_DATA_FLAG 0x08 // Data submessage: Has serialized data key flag bit
#define DATAFRAG_INLINE_QOS_FLAG 0x02 // DataFrag submessage: Inline QoS Flag bit
#define DATAFRAG_SERIALIZED_KEY_FLAG 0x04 // DataFrag submessage: Has serialized data/key flag bit
#define HEARTBEAT_FINAL_FLAG 0x02 // Heartbeat submessage: Final flag bit
#define HEARTBEAT_LIVELINESS_FLAG 0x04 // Heartbeat submessage: Liveliness flag bit
#define INFO_TIMESTAMP_INVALIDATE_FLAG 0x02 // InfoTimestamp submessage: Liveliness flag bit
#define INFO_REPLY_MULTICAST_FLAG 0x02 // InfoReply submessage: Multicast flag bit
#define STATUS_INFO_DISPOSE_FLAG 0x01 // StatusInfo element: Dispose flag bit
#define STATUS_INFO_UNREGISTER_FLAG 0x02 // StatusInfo element: Unregister flag bit
/*-------------------------------------------------------
Enumeration used to determine ReaderKind.
---------------------------------------------------------*/
namespace ReaderKind
{
enum Type
{
Undefined,
Stateless,
Stateful
};
}
/*-------------------------------------------------------
Enumeration used to determine WriterKind.
---------------------------------------------------------*/
namespace WriterKind
{
enum Type
{
Undefined,
Stateless,
Stateful
};
}
/*-------------------------------------------------------
Enumeration used to indicate the status of a ChangeForReader.
---------------------------------------------------------*/
namespace ChangeForReaderStatusKind
{
enum Type
{
UNSENT,
UNACKNOWLEDGED,
REQUESTED,
ACKNOWLEDGED,
UNDERWAY
};
}
/*-------------------------------------------------------
Enumeration used to indicate the status of a ChangeFromWriter.
---------------------------------------------------------*/
namespace ChangeFromWriterStatusKind
{
enum Type
{
LOST,
MISSING,
RECEIVED,
UNKNOWN
};
}
/*-------------------------------------------------------
Type used to represent the identity of a data-object whose changes in value are
communicated by the RTPS protocol.
---------------------------------------------------------*/
// TODO: Implement InstanceHandle
/*-------------------------------------------------------
Type used to hold data exchanged between Participants. The most notable use
of this type is for the Writer Liveliness Protocol.
---------------------------------------------------------*/
// TODO: Implement ParticipantMessageData
} // namespace RTPS
#endif // RTPS_CommonDefines_h_IsIncluded