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_CONDITIONIMPL_H 9 : #define OPENDDS_DCPS_CONDITIONIMPL_H 10 : 11 : #include "dds/DdsDcpsInfrastructureC.h" 12 : #include "Definitions.h" 13 : #include "PoolAllocator.h" 14 : #include "WaitSet.h" 15 : 16 : #include "ace/Recursive_Thread_Mutex.h" 17 : 18 : #if !defined (ACE_LACKS_PRAGMA_ONCE) 19 : #pragma once 20 : #endif /* ACE_LACKS_PRAGMA_ONCE */ 21 : 22 : OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 23 : 24 : namespace OpenDDS { 25 : namespace DCPS { 26 : 27 : class ConditionImpl 28 : : public virtual OpenDDS::DCPS::LocalObject<DDS::Condition> { 29 : public: 30 : DDS::ReturnCode_t attach_to_ws(DDS::WaitSet_ptr ws); 31 : DDS::ReturnCode_t detach_from_ws(DDS::WaitSet_ptr ws); 32 : void signal_all(); 33 : 34 : protected: 35 29 : ConditionImpl() {} 36 29 : virtual ~ConditionImpl() {} 37 : 38 : typedef OPENDDS_SET(OpenDDS::DCPS::WeakRcHandle<DDS::WaitSet>) WaitSetSet; 39 : WaitSetSet waitsets_; 40 : /// Use a recursive mutex because we have derived classes that 41 : /// need the recursive behavior 42 : ACE_Recursive_Thread_Mutex lock_; 43 : }; 44 : 45 : } // namespace DCPS 46 : } // namespace OpenDDS 47 : 48 : OPENDDS_END_VERSIONED_NAMESPACE_DECL 49 : 50 : #endif