StatusConditionImpl.cpp

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 #include "DCPS/DdsDcps_pch.h" //Only the _pch include should start with DCPS/
00009 #include "StatusConditionImpl.h"
00010 #include "EntityImpl.h"
00011 
00012 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
00013 
00014 namespace OpenDDS {
00015 namespace DCPS {
00016 
00017 CORBA::Boolean StatusConditionImpl::get_trigger_value()
00018 {
00019   ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, g, lock_, false);
00020 
00021   if (DCPS_debug_level > 9) {
00022     ACE_DEBUG((LM_DEBUG,
00023                ACE_TEXT("(%P|%t) StatusConditionImpl::get_trigger_value() - ")
00024                ACE_TEXT("mask==0x%x, changes==0x%x.\n"),
00025                this->mask_,
00026                this->parent_->get_status_changes()));
00027   }
00028 
00029   return (parent_->get_status_changes() & mask_) > 0;
00030 }
00031 
00032 DDS::StatusMask StatusConditionImpl::get_enabled_statuses()
00033 {
00034   ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, g, lock_, 0);
00035   return mask_;
00036 }
00037 
00038 DDS::ReturnCode_t
00039 StatusConditionImpl::set_enabled_statuses(DDS::StatusMask mask)
00040 {
00041   ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, g, lock_,
00042                    DDS::RETCODE_OUT_OF_RESOURCES);
00043   mask_ = mask;
00044   signal_all();
00045   return DDS::RETCODE_OK;
00046 }
00047 
00048 DDS::Entity_ptr StatusConditionImpl::get_entity()
00049 {
00050   return DDS::Entity::_duplicate(parent_);
00051 }
00052 
00053 } // namespace DCPS
00054 } // namespace OpenDDS
00055 
00056 OPENDDS_END_VERSIONED_NAMESPACE_DECL
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1