RefleX
Build DDS Applications in Modern C++ without IDL
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
auto_dd.h
Go to the documentation of this file.
1 /*********************************************************************************************
2 (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved.
3 RTI grants Licensee a license to use, modify, compile, and create derivative works
4 of the Software. Licensee has the right to distribute object form only for use with RTI
5 products. The Software is provided "as is", with no warranty of any type, including
6 any warranty for fitness for any purpose. RTI is under no obligation to maintain or
7 support the Software. RTI shall not be liable for any incidental or consequential
8 damages arising out of the use or inability to use the software.
9 **********************************************************************************************/
10 
11 #ifndef RTIREFLEX_AUTO_DD_H
12 #define RTIREFLEX_AUTO_DD_H
13 
14 #include "reflex/dllexport.h"
15 
16 class DDSDynamicDataTypeSupport;
17 struct DDS_DynamicData;
18 
19 namespace reflex {
20 
34  {
35  private:
36  DDSDynamicDataTypeSupport * type_support_;
37  DDS_DynamicData * instance_;
38 
42  static DDS_DynamicData * init(DDSDynamicDataTypeSupport * ts);
43 
44  public:
51  AutoDynamicData(DDSDynamicDataTypeSupport * typeSupport);
52 
57 
61  AutoDynamicData & operator = (const AutoDynamicData &src);
62 
66  ~AutoDynamicData();
67 
68 #ifdef REFLEX_HAS_RVALUE_REF
69 
75 
80  AutoDynamicData & operator = (AutoDynamicData && src);
81 #endif
82 
86  void swap(AutoDynamicData &) throw();
87 
91  DDS_DynamicData * get();
92 
96  const DDS_DynamicData * get() const;
97  };
98 
102  void swap(AutoDynamicData & lhs, AutoDynamicData & rhs) throw();
103 
104 } // namespace reflex
105 
106 #ifndef REFLEX_NO_HEADER_ONLY
107 #include "reflex/../../src/auto_dd.cxx"
108 #endif
109 
110 #endif // RTIREFLEX_AUTO_DD_H
111 
Automatically manages the memory of a DynamicData instance.
Definition: auto_dd.h:33
void swap(AutoDynamicData &lhs, AutoDynamicData &rhs)
Swap the contents of two AutoDynamicData instances. Never throws.
Definition: auto_dd.cxx:106
#define REFLEX_DLL_EXPORT
Definition: dllexport.h:35