#include <ConditionImpl.h>
Inheritance diagram for OpenDDS::DCPS::ConditionImpl:
Public Member Functions | |
DDS::ReturnCode_t | attach_to_ws (DDS::WaitSet_ptr ws) |
DDS::ReturnCode_t | detach_from_ws (DDS::WaitSet_ptr ws) |
void | signal_all () |
Protected Member Functions | |
ConditionImpl () | |
virtual | ~ConditionImpl () |
typedef | OPENDDS_SET_CMP (DDS::WaitSet_var, VarLess< DDS::WaitSet >) WaitSetSet |
Protected Attributes | |
WaitSetSet | waitsets_ |
ACE_Recursive_Thread_Mutex | lock_ |
Definition at line 25 of file ConditionImpl.h.
OpenDDS::DCPS::ConditionImpl::ConditionImpl | ( | ) | [inline, protected] |
virtual OpenDDS::DCPS::ConditionImpl::~ConditionImpl | ( | ) | [inline, protected, virtual] |
DDS::ReturnCode_t OpenDDS::DCPS::ConditionImpl::attach_to_ws | ( | DDS::WaitSet_ptr | ws | ) |
Definition at line 43 of file ConditionImpl.cpp.
References DDS::WaitSet::_duplicate(), lock_, DDS::RETCODE_OK, DDS::RETCODE_OUT_OF_RESOURCES, DDS::RETCODE_PRECONDITION_NOT_MET, and waitsets_.
00044 { 00045 DDS::WaitSet_var wsv(DDS::WaitSet::_duplicate(ws)); 00046 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, g, lock_, 00047 DDS::RETCODE_OUT_OF_RESOURCES); 00048 return waitsets_.insert(wsv).second 00049 ? DDS::RETCODE_OK : DDS::RETCODE_PRECONDITION_NOT_MET; 00050 }
DDS::ReturnCode_t OpenDDS::DCPS::ConditionImpl::detach_from_ws | ( | DDS::WaitSet_ptr | ws | ) |
Definition at line 52 of file ConditionImpl.cpp.
References DDS::WaitSet::_duplicate(), lock_, DDS::RETCODE_OK, DDS::RETCODE_OUT_OF_RESOURCES, DDS::RETCODE_PRECONDITION_NOT_MET, and waitsets_.
00053 { 00054 DDS::WaitSet_var wsv(DDS::WaitSet::_duplicate(ws)); 00055 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, g, lock_, 00056 DDS::RETCODE_OUT_OF_RESOURCES); 00057 return waitsets_.erase(wsv) 00058 ? DDS::RETCODE_OK : DDS::RETCODE_PRECONDITION_NOT_MET; 00059 }
typedef OpenDDS::DCPS::ConditionImpl::OPENDDS_SET_CMP | ( | DDS::WaitSet_var | , | |
VarLess< DDS::WaitSet > | ||||
) | [protected] |
void OpenDDS::DCPS::ConditionImpl::signal_all | ( | ) |
Definition at line 14 of file ConditionImpl.cpp.
References OpenDDS::DCPS::DCPS_debug_level, DDS::Condition::get_trigger_value(), lock_, and waitsets_.
Referenced by OpenDDS::DCPS::StatusConditionImpl::set_enabled_statuses(), and DDS::GuardCondition::set_trigger_value().
00015 { 00016 if (DCPS_debug_level > 9) { 00017 ACE_DEBUG((LM_DEBUG, 00018 ACE_TEXT("(%P|%t) ConditionImpl::signal_all()\n"))); 00019 } 00020 00021 if (!get_trigger_value()) return; 00022 00023 WaitSetSet local_ws; 00024 { 00025 ACE_GUARD(ACE_Recursive_Thread_Mutex, g, lock_); 00026 local_ws = waitsets_; 00027 } 00028 00029 if (DCPS_debug_level > 9) { 00030 ACE_DEBUG((LM_DEBUG, 00031 ACE_TEXT("(%P|%t) ConditionImpl::signal_all() - ") 00032 ACE_TEXT("number of sets: %d, locally: %d.\n"), 00033 this->waitsets_.size(), 00034 local_ws.size())); 00035 } 00036 00037 for (WaitSetSet::iterator it = local_ws.begin(), end = local_ws.end(); 00038 it != end; ++it) { 00039 (*it)->signal(this); 00040 } 00041 }
ACE_Recursive_Thread_Mutex OpenDDS::DCPS::ConditionImpl::lock_ [protected] |
Reimplemented in OpenDDS::DCPS::QueryConditionImpl.
Definition at line 38 of file ConditionImpl.h.
Referenced by attach_to_ws(), detach_from_ws(), OpenDDS::DCPS::StatusConditionImpl::get_enabled_statuses(), OpenDDS::DCPS::StatusConditionImpl::get_trigger_value(), OpenDDS::DCPS::StatusConditionImpl::set_enabled_statuses(), and signal_all().
WaitSetSet OpenDDS::DCPS::ConditionImpl::waitsets_ [protected] |
Definition at line 37 of file ConditionImpl.h.
Referenced by attach_to_ws(), detach_from_ws(), and signal_all().