OpenDDS  Snapshot(2023/04/28-20:55)
Transient_Kludge.h
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Distributed under the OpenDDS License.
5  * See: http://www.opendds.org/license.html
6  */
7 
8 #ifndef OPENDDS_DCPS_TRANSIENT_KLUDGE_H
9 #define OPENDDS_DCPS_TRANSIENT_KLUDGE_H
10 
11 #include "dcps_export.h"
12 
13 #if !defined (ACE_LACKS_PRAGMA_ONCE)
14 #pragma once
15 #endif /* ACE_LACKS_PRAGMA_ONCE */
16 
18 
19 namespace OpenDDS {
20 namespace DCPS {
21 
22 /**
23 * @class TransientKludge
24 *
25 * @brief Simply turn on and off the transient kludge enable flag.
26 *
27 * This class provides the methods to set/get transient kludge
28 * enable flag.
29 * Only the repository should set/enable the kludge!!!
30 */
32 public:
35 
36  /// Return a singleton instance of this class.
37  static Transient_Kludge* instance();
38 
39  /// Turn on enabled_ flag.
40  void enable();
41 
42  /// Turn off enabled_ flag.
43  void disable();
44 
45  /// Accessor of enable flag.
46  bool is_enabled() const;
47 
48 private:
49  /// The flag.
50  bool enabled_;
51 };
52 
53 #define TheTransientKludge OpenDDS::DCPS::Transient_Kludge::instance()
54 
55 } // namespace DCPS
56 } // namespace OpenDDS
57 
59 
60 #if defined(__ACE_INLINE__)
61 #include "Transient_Kludge.inl"
62 #endif /* __ACE_INLINE__ */
63 
64 #endif /* OPENDDS_DCPS_TRANSIENT_KLUDGE_H */
#define OpenDDS_Dcps_Export
Definition: dcps_export.h:24
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28