Fast RTPS  Version 2.1.0
Fast RTPS
DynamicDataFactory.h
1 // Copyright 2018 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 
15 #ifndef TYPES_DYNAMIC_DATA_FACTORY_H
16 #define TYPES_DYNAMIC_DATA_FACTORY_H
17 
18 #include <fastrtps/types/TypesBase.h>
19 #include <fastrtps/types/DynamicTypePtr.h>
20 #include <fastrtps/types/DynamicTypeBuilder.h>
21 #include <fastrtps/types/DynamicType.h>
22 #include <fastrtps/types/DynamicData.h>
23 #include <mutex>
24 
25 //#define DISABLE_DYNAMIC_MEMORY_CHECK
26 
27 namespace eprosima {
28 namespace fastrtps {
29 namespace types {
30 
32 {
33 protected:
35 
37  DynamicData* pData,
38  DynamicType_ptr pType);
39 
40 #ifndef DISABLE_DYNAMIC_MEMORY_CHECK
41  std::vector<DynamicData*> dynamic_datas_;
42  mutable std::recursive_mutex mutex_;
43 #endif
44 
45 public:
47 
48  RTPS_DllAPI static DynamicDataFactory* get_instance();
49 
50  RTPS_DllAPI static ReturnCode_t delete_instance();
51 
52  RTPS_DllAPI DynamicData* create_data(DynamicTypeBuilder* pBuilder);
53 
55 
56  RTPS_DllAPI DynamicData* create_copy(const DynamicData* pData);
57 
58  RTPS_DllAPI ReturnCode_t delete_data(DynamicData* pData);
59 
60  RTPS_DllAPI bool is_empty() const;
61 };
62 
63 
64 } // namespace types
65 } // namespace fastrtps
66 } // namespace eprosima
67 
68 #endif // TYPES_DYNAMIC_DATA_FACTORY_H
eprosima::fastrtps::types::DynamicDataFactory
Definition: DynamicDataFactory.h:32
eprosima::fastrtps::types::DynamicTypeBuilder
Definition: DynamicTypeBuilder.h:32
eprosima::fastrtps::types::ReturnCode_t
Definition: TypesBase.h:204
eprosima::fastrtps::types::DynamicDataFactory::delete_data
RTPS_DllAPI ReturnCode_t delete_data(DynamicData *pData)
eprosima::fastrtps::types::DynamicDataFactory::~DynamicDataFactory
~DynamicDataFactory()
eprosima::fastrtps::types::DynamicDataFactory::create_data
RTPS_DllAPI DynamicData * create_data(DynamicTypeBuilder *pBuilder)
eprosima::fastrtps::types::DynamicDataFactory::DynamicDataFactory
DynamicDataFactory()
eprosima::fastrtps::types::DynamicDataFactory::create_members
ReturnCode_t create_members(DynamicData *pData, DynamicType_ptr pType)
eprosima::fastrtps::types::DynamicDataFactory::create_copy
RTPS_DllAPI DynamicData * create_copy(const DynamicData *pData)
eprosima::fastrtps::types::DynamicDataFactory::mutex_
std::recursive_mutex mutex_
Definition: DynamicDataFactory.h:42
eprosima::fastrtps::types::DynamicData
Definition: DynamicData.h:32
eprosima::fastrtps::types::DynamicDataFactory::delete_instance
static RTPS_DllAPI ReturnCode_t delete_instance()
eprosima::fastrtps::types::DynamicType_ptr
Definition: DynamicTypePtr.h:27
eprosima
eProsima namespace.
Definition: LibrarySettingsAttributes.h:23
eprosima::fastrtps::types::DynamicDataFactory::is_empty
RTPS_DllAPI bool is_empty() const
eprosima::fastrtps::types::DynamicDataFactory::create_data
RTPS_DllAPI DynamicData * create_data(DynamicType_ptr pType)
eprosima::fastrtps::types::DynamicDataFactory::get_instance
static RTPS_DllAPI DynamicDataFactory * get_instance()
eprosima::fastrtps::types::DynamicDataFactory::dynamic_datas_
std::vector< DynamicData * > dynamic_datas_
Definition: DynamicDataFactory.h:41