00001 /*************************************************************************** 00002 tag: Peter Soetens Mon Jun 26 13:25:57 CEST 2006 DispatchInterface.hpp 00003 00004 DispatchInterface.hpp - description 00005 ------------------- 00006 begin : Mon June 26 2006 00007 copyright : (C) 2006 Peter Soetens 00008 email : peter.soetens@fmtc.be 00009 00010 *************************************************************************** 00011 * This library is free software; you can redistribute it and/or * 00012 * modify it under the terms of the GNU General Public * 00013 * License as published by the Free Software Foundation; * 00014 * version 2 of the License. * 00015 * * 00016 * As a special exception, you may use this file as part of a free * 00017 * software library without restriction. Specifically, if other files * 00018 * instantiate templates or use macros or inline functions from this * 00019 * file, or you compile this file and link it with other files to * 00020 * produce an executable, this file does not by itself cause the * 00021 * resulting executable to be covered by the GNU General Public * 00022 * License. This exception does not however invalidate any other * 00023 * reasons why the executable file might be covered by the GNU General * 00024 * Public License. * 00025 * * 00026 * This library is distributed in the hope that it will be useful, * 00027 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00028 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00029 * Lesser General Public License for more details. * 00030 * * 00031 * You should have received a copy of the GNU General Public * 00032 * License along with this library; if not, write to the Free Software * 00033 * Foundation, Inc., 59 Temple Place, * 00034 * Suite 330, Boston, MA 02111-1307 USA * 00035 * * 00036 ***************************************************************************/ 00037 00038 00039 #ifndef ORO_EXECUTION_DISPATCHINTERFACE_HPP 00040 #define ORO_EXECUTION_DISPATCHINTERFACE_HPP 00041 00042 #include "CommandInterface.hpp" 00043 #include "ConditionInterface.hpp" 00044 #include <boost/shared_ptr.hpp> 00045 00046 namespace RTT 00047 { 00051 class RTT_API DispatchInterface 00052 : public CommandInterface 00053 { 00054 public: 00059 typedef boost::shared_ptr<DispatchInterface> shared_ptr; 00060 00065 enum Status { NotReady, 00066 Ready, 00067 Sent, 00068 NotAccepted, 00069 Accepted, 00070 Executed, 00071 NotValid, 00072 Valid, 00073 Done }; 00074 00080 virtual bool ready() const = 0; 00081 00086 virtual bool dispatch() = 0; 00087 00092 virtual void reset() = 0; 00093 00098 virtual bool sent() const = 0; 00099 00105 virtual bool accepted() const = 0; 00106 00111 virtual bool executed() const = 0; 00112 00117 virtual bool valid() const = 0; 00118 00122 virtual bool done() const = 0; 00123 00124 virtual ConditionInterface* createCondition() const = 0; 00125 00126 virtual DispatchInterface* clone() const = 0; 00127 00128 virtual DispatchInterface* copy( std::map<const DataSourceBase*, DataSourceBase*>& alreadyCloned ) const { 00129 return this->clone(); 00130 } 00131 }; 00132 } 00133 00134 #endif