Transient_Kludge.h

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Distributed under the OpenDDS License.
00005  * See: http://www.opendds.org/license.html
00006  */
00007 
00008 #ifndef OPENDDS_DCPS_TRANSIENT_KLUDGE_H
00009 #define OPENDDS_DCPS_TRANSIENT_KLUDGE_H
00010 
00011 #include "dcps_export.h"
00012 
00013 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00014 #pragma once
00015 #endif /* ACE_LACKS_PRAGMA_ONCE */
00016 
00017 namespace OpenDDS {
00018 namespace DCPS {
00019 
00020 /**
00021 * @class TransientKludge
00022 *
00023 * @brief Simply turn on and off the transient kludge enable flag.
00024 *
00025 * This class provides the methods to set/get transient kludge
00026 * enable flag.
00027 * Only the repository should set/enable the kludge!!!
00028 */
00029 class OpenDDS_Dcps_Export Transient_Kludge {
00030 public:
00031 
00032   Transient_Kludge();
00033   ~Transient_Kludge();
00034 
00035   /// Return a singleton instance of this class.
00036   static Transient_Kludge* instance();
00037 
00038   /// Turn on enabled_ flag.
00039   void enable();
00040 
00041   /// Turn off enabled_ flag.
00042   void disable();
00043 
00044   /// Accessor of enable flag.
00045   bool is_enabled();
00046 
00047 private:
00048   /// The flag.
00049   bool  enabled_;
00050 };
00051 
00052 #define TheTransientKludge OpenDDS::DCPS::Transient_Kludge::instance()
00053 
00054 } // namespace DCPS
00055 } // namespace OpenDDS
00056 
00057 #if defined(__ACE_INLINE__)
00058 #include "Transient_Kludge.inl"
00059 #endif /* __ACE_INLINE__ */
00060 
00061 #endif /* OPENDDS_DCPS_TRANSIENT_KLUDGE_H */

Generated on Fri Feb 12 20:05:28 2016 for OpenDDS by  doxygen 1.4.7