RTC Toolkit  1.0.0
agnostictopicif.h
Go to the documentation of this file.
1 // Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
22 #ifndef _RTCTK_AGNOSTICTOPICIF_H_
23 #define _RTCTK_AGNOSTICTOPICIF_H_
24 
25 
26 #include <stdint.h>
27 #include <array>
28 #include <string>
29 #include <vector>
30 #include <map>
31 #include <bitset>
32 
33 #if defined(_WIN32)
34 #if defined(EPROSIMA_USER_DLL_EXPORT)
35 #define eProsima_user_DllExport __declspec( dllexport )
36 #else
37 #define eProsima_user_DllExport
38 #endif // EPROSIMA_USER_DLL_EXPORT
39 #else
40 #define eProsima_user_DllExport
41 #endif // _WIN32
42 
43 #if defined(_WIN32)
44 #if defined(EPROSIMA_USER_DLL_EXPORT)
45 #if defined(agnostictopicif_SOURCE)
46 #define agnostictopicif_DllAPI __declspec( dllexport )
47 #else
48 #define agnostictopicif_DllAPI __declspec( dllimport )
49 #endif // agnostictopicif_SOURCE
50 #else
51 #define agnostictopicif_DllAPI
52 #endif // EPROSIMA_USER_DLL_EXPORT
53 #else
54 #define agnostictopicif_DllAPI
55 #endif // _WIN32
56 
57 namespace eprosima {
58 namespace fastcdr {
59 class Cdr;
60 } // namespace fastcdr
61 } // namespace eprosima
62 
63 
64 namespace rtctk {
65  typedef double TimeStamp;
66  typedef std::vector<uint8_t> GenPayLoad;
72  {
73  public:
74 
79 
84 
90  const AgnosticTopic& x);
91 
97  AgnosticTopic&& x);
98 
104  const AgnosticTopic& x);
105 
111  AgnosticTopic&& x);
112 
118  uint32_t _sample_id);
119 
125 
131 
137  rtctk::TimeStamp _time_stamp);
138 
144 
150 
156  const rtctk::GenPayLoad& _serialized_data);
157 
163  rtctk::GenPayLoad&& _serialized_data);
164 
170 
176 
184  size_t current_alignment = 0);
185 
193  const rtctk::AgnosticTopic& data,
194  size_t current_alignment = 0);
195 
196 
202  eprosima::fastcdr::Cdr& cdr) const;
203 
209  eprosima::fastcdr::Cdr& cdr);
210 
211 
212 
220  size_t current_alignment = 0);
221 
226 
232  eprosima::fastcdr::Cdr& cdr) const;
233 
234  private:
235 
236  uint32_t m_sample_id;
237  rtctk::TimeStamp m_time_stamp;
238  rtctk::GenPayLoad m_serialized_data;
239  };
240 } // namespace rtctk
241 
242 #endif // _RTCTK_AGNOSTICTOPICIF_H_
rtctk::AgnosticTopic::getKeyMaxCdrSerializedSize
static eProsima_user_DllExport size_t getKeyMaxCdrSerializedSize(size_t current_alignment=0)
This function returns the maximum serialized size of the Key of an object depending on the buffer ali...
Definition: agnostictopicif.cpp:257
rtctk::GenPayLoad
std::vector< uint8_t > GenPayLoad
Definition: agnostictopicif.h:66
rtctk::AgnosticTopic::sample_id
eProsima_user_DllExport uint32_t sample_id() const
This function returns the value of member sample_id.
Definition: agnostictopicif.cpp:177
rtctk::AgnosticTopic::getCdrSerializedSize
static eProsima_user_DllExport size_t getCdrSerializedSize(const rtctk::AgnosticTopic &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
Definition: agnostictopicif.cpp:117
rtctk::AgnosticTopic::isKeyDefined
static eProsima_user_DllExport bool isKeyDefined()
This function tells you if the Key has been defined for this type.
Definition: agnostictopicif.cpp:270
rtctk::AgnosticTopic::deserialize
eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr &cdr)
This function deserializes an object using CDR serialization.
Definition: agnostictopicif.cpp:154
rtctk::AgnosticTopic::~AgnosticTopic
eProsima_user_DllExport ~AgnosticTopic()
Default destructor.
Definition: agnostictopicif.cpp:50
rtctk::TimeStamp
double TimeStamp
Definition: agnostictopicif.h:65
rtctk::AgnosticTopic
This class represents the structure AgnosticTopic defined by the user in the IDL file.
Definition: agnostictopicif.h:72
rtctk::AgnosticTopic::time_stamp
eProsima_user_DllExport rtctk::TimeStamp time_stamp() const
This function returns the value of member time_stamp.
Definition: agnostictopicif.cpp:205
eProsima_user_DllExport
#define eProsima_user_DllExport
Definition: agnostictopicif.h:40
rtctk::AgnosticTopic::serializeKey
eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr &cdr) const
This function serializes the key members of an object using CDR serialization.
Definition: agnostictopicif.cpp:275
mudpi::uint32_t
unsigned int uint32_t
Definition: mudpi.h:16
rtctk::AgnosticTopic::serialized_data
eProsima_user_DllExport const rtctk::GenPayLoad & serialized_data() const
This function returns a constant reference to member serialized_data.
Definition: agnostictopicif.cpp:243
rtctk::AgnosticTopic::AgnosticTopic
eProsima_user_DllExport AgnosticTopic()
Default constructor.
Definition: agnostictopicif.cpp:39
rtctk::AgnosticTopic::getMaxCdrSerializedSize
static eProsima_user_DllExport size_t getMaxCdrSerializedSize(size_t current_alignment=0)
This function returns the maximum serialized size of an object depending on the buffer alignment.
Definition: agnostictopicif.cpp:95
rtctk::AgnosticTopic::operator=
eProsima_user_DllExport AgnosticTopic & operator=(const AgnosticTopic &x)
Copy assignment.
Definition: agnostictopicif.cpp:73
eprosima
Definition: agnostictopicif.h:57
rtctk::AgnosticTopic::serialize
eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr &cdr) const
This function serializes an object using CDR serialization.
Definition: agnostictopicif.cpp:144
rtctk
Definition: agnostictopicifPubSubTypes.cpp:31