00001 #ifndef OMG_TDDS_CORE_COND_GUARD_CONDITION_HPP_ 00002 #define OMG_TDDS_CORE_COND_GUARD_CONDITION_HPP_ 00003 00004 /* Copyright 2010, Object Management Group, Inc. 00005 * Copyright 2010, PrismTech, Corp. 00006 * Copyright 2010, Real-Time Innovations, Inc. 00007 * All rights reserved. 00008 * 00009 * Licensed under the Apache License, Version 2.0 (the "License"); 00010 * you may not use this file except in compliance with the License. 00011 * You may obtain a copy of the License at 00012 * 00013 * http://www.apache.org/licenses/LICENSE-2.0 00014 * 00015 * Unless required by applicable law or agreed to in writing, software 00016 * distributed under the License is distributed on an "AS IS" BASIS, 00017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00018 * See the License for the specific language governing permissions and 00019 * limitations under the License. 00020 */ 00021 00022 #include <tdds/core/corefwd.hpp> 00023 #include <tdds/core/cond/Condition.hpp> 00024 00025 00026 namespace tdds { namespace core { namespace cond { 00027 00037 template <typename DELEGATE> 00038 class GuardCondition : public Condition<DELEGATE> { 00039 public: 00040 OMG_DDS_REF_TYPE_NODC(GuardCondition, Condition, DELEGATE) 00041 00042 static GuardCondition newGuardCondition(); 00043 00044 ~GuardCondition() { } 00045 00046 public: 00047 00048 template <typename Functor> 00049 void handler(const Functor& func) { 00050 this->delegate()->set_handler(func); 00051 } 00052 00057 void reset_handler() { 00058 this->delegate()->reset_handler(); 00059 } 00060 00061 00062 public: 00063 using Condition<DELEGATE>::trigger_value; 00064 00065 void trigger_value(bool value) { 00066 this->delegate()->trigger_value(value); 00067 } 00068 00069 }; 00070 00071 } } } 00072 #endif /* OMG_TDDS_CORE_GUARD_CONDITION_HPP_ */
1.7.1