RefleX
Build DDS Applications in Modern C++ without IDL
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
safe_dynamicdata.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 RTI_REFLEX_SAFE_DYNAMIC_DATA_H
12 #define RTI_REFLEX_SAFE_DYNAMIC_DATA_H
13 
14 #include "reflex/auto_dd.h"
15 
16 namespace reflex {
29  template <class T>
30  class SafeDynamicData : public AutoDynamicData
31  {
32  public:
33 
44  DDSDynamicDataTypeSupport *type_support,
45  const T & src)
46  : AutoDynamicData(type_support)
47  {
49  }
50 
54  void swap(SafeDynamicData<T> & rhs) throw()
55  {
56  this->AutoDynamicData::swap(rhs);
57  }
58  };
59 
62  template <class T>
63  void swap(SafeDynamicData<T> & lhs, SafeDynamicData<T> & rhs) throw()
64  {
65  lhs.swap(rhs);
66  }
67 
68 } // namespace reflex
69 
70 #endif // RTI_REFLEX_SAFE_DYNAMIC_DATA_H
void write_dynamicdata(DDS_DynamicData &dest, const T &src)
Copies source data into the destination DDS_DynamicData instance.
Definition: reflex.h:157
Typesafe, exception-safe, poulated DynamicData.
Definition: reflex_fwd.h:24
DDS_DynamicData * get()
Return the underlying DynamicData instance.
Definition: auto_dd.cxx:98
void swap(SafeDynamicData< T > &rhs)
Swap two SafeDynamicData objects. Does not throw.
Definition: safe_dynamicdata.h:54
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
void swap(AutoDynamicData &)
Swap two AutoDynamicData objects. Does not throw.
Definition: auto_dd.cxx:78
SafeDynamicData(DDSDynamicDataTypeSupport *type_support, const T &src)
Create a new SafeDynamicData object from a source object of type T.
Definition: safe_dynamicdata.h:43