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 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 00018 00019 namespace OpenDDS { 00020 namespace DCPS { 00021 00022 /** 00023 * @class TransientKludge 00024 * 00025 * @brief Simply turn on and off the transient kludge enable flag. 00026 * 00027 * This class provides the methods to set/get transient kludge 00028 * enable flag. 00029 * Only the repository should set/enable the kludge!!! 00030 */ 00031 class OpenDDS_Dcps_Export Transient_Kludge { 00032 public: 00033 00034 Transient_Kludge(); 00035 ~Transient_Kludge(); 00036 00037 /// Return a singleton instance of this class. 00038 static Transient_Kludge* instance(); 00039 00040 /// Turn on enabled_ flag. 00041 void enable(); 00042 00043 /// Turn off enabled_ flag. 00044 void disable(); 00045 00046 /// Accessor of enable flag. 00047 bool is_enabled(); 00048 00049 private: 00050 /// The flag. 00051 bool enabled_; 00052 }; 00053 00054 #define TheTransientKludge OpenDDS::DCPS::Transient_Kludge::instance() 00055 00056 } // namespace DCPS 00057 } // namespace OpenDDS 00058 00059 OPENDDS_END_VERSIONED_NAMESPACE_DECL 00060 00061 #if defined(__ACE_INLINE__) 00062 #include "Transient_Kludge.inl" 00063 #endif /* __ACE_INLINE__ */ 00064 00065 #endif /* OPENDDS_DCPS_TRANSIENT_KLUDGE_H */