Line data Source code
1 : /* 2 : * 3 : * 4 : * Distributed under the OpenDDS License. 5 : * See: http://www.opendds.org/license.html 6 : */ 7 : 8 : #ifndef OPENDDS_DCPS_GUARDCONDITION_H 9 : #define OPENDDS_DCPS_GUARDCONDITION_H 10 : 11 : #include "dds/DdsDcpsInfrastructureC.h" 12 : 13 : #if !defined (ACE_LACKS_PRAGMA_ONCE) 14 : #pragma once 15 : #endif /* ACE_LACKS_PRAGMA_ONCE */ 16 : 17 : #include "Atomic.h" 18 : #include "ConditionImpl.h" 19 : 20 : OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 21 : 22 : namespace DDS { 23 : 24 : class GuardCondition; 25 : typedef GuardCondition* GuardCondition_ptr; 26 : typedef TAO_Objref_Var_T<GuardCondition> GuardCondition_var; 27 : 28 : class OpenDDS_Dcps_Export GuardCondition 29 : : public virtual DDS::GuardConditionInterf 30 : , public virtual OpenDDS::DCPS::ConditionImpl { 31 : public: 32 : typedef GuardCondition* _ptr_type; 33 : typedef GuardCondition_var _var_type; 34 : 35 17 : GuardCondition() 36 17 : : trigger_value_(false) 37 17 : {} 38 : 39 34 : virtual ~GuardCondition() {} 40 : 41 : CORBA::Boolean get_trigger_value(); 42 : 43 : ReturnCode_t set_trigger_value(CORBA::Boolean value); 44 : 45 : static GuardCondition_ptr _duplicate(GuardCondition_ptr obj); 46 : static GuardCondition_ptr _narrow(CORBA::Object_ptr obj); 47 : 48 : private: 49 : OpenDDS::DCPS::Atomic<CORBA::Boolean> trigger_value_; 50 : }; 51 : 52 : } // namespace DDS 53 : 54 : OPENDDS_END_VERSIONED_NAMESPACE_DECL 55 : 56 : TAO_BEGIN_VERSIONED_NAMESPACE_DECL 57 : 58 : namespace TAO { 59 : 60 : template<> 61 : struct OpenDDS_Dcps_Export Objref_Traits<DDS::GuardCondition> { 62 : static DDS::GuardCondition_ptr duplicate(DDS::GuardCondition_ptr p); 63 : static void release(DDS::GuardCondition_ptr p); 64 : static DDS::GuardCondition_ptr nil(); 65 : static CORBA::Boolean marshal(const DDS::GuardCondition_ptr p, 66 : TAO_OutputCDR & cdr); 67 : }; 68 : 69 : } // namespace TAO 70 : 71 : TAO_END_VERSIONED_NAMESPACE_DECL 72 : 73 : #endif