00001 #ifndef OMG_DDS_CORE_COND_DETAIL_WAITSET_HPP_ 00002 #define OMG_DDS_CORE_COND_DETAIL_WAITSET_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 <vector> 00023 #include <iostream> 00024 00025 #include <dds/core/corefwd.hpp> 00026 #include <dds/core/cond/Condition.hpp> 00027 00028 00029 namespace dds { namespace core { namespace cond { namespace detail { 00030 00031 class WaitSet { 00032 public: 00033 typedef std::vector<dds::core::cond::Condition> ConditionSeqType; 00034 00035 public: 00036 WaitSet() { } 00037 ~WaitSet() { } 00038 void close(); 00039 00040 public: 00041 const ConditionSeqType wait(const dds::core::Duration& timeout) { 00042 std::cout << "wait(timeout)" << std::endl; 00043 return ConditionSeqType(); 00044 } 00045 00046 const ConditionSeqType wait() { 00047 std::cout << "wait()" << std::endl; 00048 return ConditionSeqType(); 00049 } 00050 00051 ConditionSeqType& wait(ConditionSeqType& triggered, 00052 const dds::core::Duration& timeout) { 00053 std::cout << "wait(triggered, timeout)" << std::endl; 00054 return triggered; 00055 } 00056 00057 ConditionSeqType& wait(ConditionSeqType& triggered) { 00058 std::cout << "wait(triggered)" << std::endl; 00059 return triggered; 00060 } 00061 00062 public: 00063 void dispatch() { 00064 std::cout << "dispatch()" << std::endl; 00065 } 00066 00067 void dispatch(const dds::core::Duration& timeout) { 00068 std::cout << "dispatch(timeout)" << std::endl; 00069 } 00070 00071 public: 00072 void attach_condition(const dds::core::cond::Condition& cond) { 00073 std::cout << "attach_condition(condition)" << std::endl; 00074 } 00075 00076 bool detach_condition(const dds::core::cond::Condition& cond) { 00077 std::cout << "detach_condition(condition)" << std::endl; 00078 return false; 00079 } 00080 00081 const ConditionSeqType conditions() { 00082 std::cout << "conditions()" << std::endl; 00083 return ConditionSeqType(); 00084 } 00085 00086 ConditionSeqType& conditions(ConditionSeqType& conds) const { 00087 std::cout << "conditions(conditions)" << std::endl; 00088 return conds; 00089 } 00090 }; 00091 00092 } } } } 00093 #endif /* OMG_DDS_CORE_DETAIL_WAITSET_HPP_ */
1.7.1