| Fast DDS Version 3.3.0 Fast DDS

Loading...
Searching...
No Matches
DynamicDataFactory.hpp
1// Copyright 2023 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 FASTDDS_DDS_XTYPES_DYNAMIC_TYPES__DYNAMICDATAFACTORY_HPP
16#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES__DYNAMICDATAFACTORY_HPP
17
18#include <memory>
19
20#include <fastdds/dds/core/ReturnCode.hpp>
21#include <fastdds/dds/xtypes/dynamic_types/DynamicData.hpp>
22#include <fastdds/fastdds_dll.hpp>
23
24 namespace eprosima {
25 namespace fastdds {
26 namespace dds {
27
28 class DynamicDataFactory : public std::enable_shared_from_this<DynamicDataFactory>
29{
30 public:
31
32 using _ref_type = typename traits<DynamicDataFactory>::ref_type;
33
39 FASTDDS_EXPORTED_API static traits<DynamicDataFactory>::ref_type get_instance();
40
47 FASTDDS_EXPORTED_API static ReturnCode_t delete_instance();
48
55 FASTDDS_EXPORTED_API virtual traits<DynamicData>::ref_type create_data(
56 traits<DynamicType>::ref_type type) = 0;
57
65 FASTDDS_EXPORTED_API virtual ReturnCode_t delete_data(
66 traits<DynamicData>::ref_type& data) = 0;
67
68 protected:
69
70 virtual ~DynamicDataFactory() = default;
71
72};
73
74} // namespace dds
75} // namespace fastdds
76} // namespace eprosima
77
78#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES__DYNAMICDATAFACTORY_HPP
eprosima::fastdds::dds::DynamicDataFactory
Definition DynamicDataFactory.hpp:29
eprosima::fastdds::dds::DynamicDataFactory::_ref_type
typename traits< DynamicDataFactory >::ref_type _ref_type
Definition DynamicDataFactory.hpp:32
eprosima::fastdds::dds::DynamicDataFactory::delete_data
virtual FASTDDS_EXPORTED_API ReturnCode_t delete_data(traits< DynamicData >::ref_type &data)=0
Resets the internal reference if it is cached.
eprosima::fastdds::dds::DynamicDataFactory::get_instance
static FASTDDS_EXPORTED_API traits< DynamicDataFactory >::ref_type get_instance()
Returns the singleton factory object.
eprosima::fastdds::dds::DynamicDataFactory::delete_instance
static FASTDDS_EXPORTED_API ReturnCode_t delete_instance()
Resets the singleton reference.
eprosima::fastdds::dds::DynamicDataFactory::~DynamicDataFactory
virtual ~DynamicDataFactory()=default
eprosima::fastdds::dds::DynamicDataFactory::create_data
virtual FASTDDS_EXPORTED_API traits< DynamicData >::ref_type create_data(traits< DynamicType >::ref_type type)=0
Creates a new DynamicData reference based on the given DynamicType reference.
eprosima::fastdds::dds
Definition BuiltinTopicKey.hpp:26
eprosima::fastdds::dds::ReturnCode_t
int32_t ReturnCode_t
Definition DDSReturnCode.hpp:59
eprosima::fastdds
eprosima
eProsima namespace.
eprosima::fastdds::dds::traits::ref_type
typename ::std::shared_ptr< T > ref_type
Definition type_traits.hpp:29