CommandProxy.hpp

00001 /***************************************************************************
00002   tag: Peter Soetens  Mon Jun 26 13:25:59 CEST 2006  CommandProxy.hpp
00003 
00004                         CommandProxy.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_CORBA_COMMANDPROXY_HPP
00040 #define ORO_CORBA_COMMANDPROXY_HPP
00041 
00042 #include "../DispatchInterface.hpp"
00043 #include "OperationsC.h"
00044 
00045 namespace RTT
00046 {namespace Corba
00047 {
00048 
00052     class RTT_CORBA_API CommandProxy
00053         : public DispatchInterface
00054     {
00055     protected:
00060         CommandProxy( ::RTT::Corba::Command_ptr t );
00061 
00062         Corba::Command_var mdata;
00063 
00064     public:
00065         ~CommandProxy();
00066 
00072         static CommandProxy* Create(::RTT::Corba::Command_ptr act);
00073 
00079         Corba::Command_ptr server() const;
00080 
00081         virtual void readArguments() {}
00082 
00083         virtual bool ready() const {
00084             return !CORBA::is_nil(mdata);
00085         }
00086 
00087         virtual bool dispatch() {
00088             return mdata->execute();
00089         }
00090 
00091         virtual bool execute() {
00092             return mdata->execute();
00093         }
00094 
00095         virtual void reset() {
00096             mdata->reset();
00097         }
00098 
00099         virtual bool sent() const {
00100             return mdata->sent();
00101         }
00102 
00103         virtual bool accepted() const {
00104             return mdata->accepted();
00105         }
00106 
00107         virtual bool executed() const {
00108             return mdata->executed();
00109         }
00110 
00111         virtual bool valid() const {
00112             return mdata->valid();
00113         }
00114 
00115         virtual bool done() const {
00116             return mdata->done();
00117         }
00118 
00119         virtual ConditionInterface* createCondition() const;
00120 
00121         virtual CommandProxy* clone() const {
00122             return new CommandProxy( mdata.in() );
00123         }
00124 
00125         virtual CommandProxy* copy( std::map<const DataSourceBase*, DataSourceBase*>& alreadyCloned ) const {
00126             return this->clone();
00127         }
00128 
00129     };
00130 
00131 }}
00132 
00133 #endif
Generated on Thu Dec 23 13:22:36 2010 for Orocos Real-Time Toolkit by  doxygen 1.6.3