SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
CNonControlTaskBase.hpp
1 /* This file is part of scl, a control and simulation library
2 for robots and biomechanical models.
3 
4 scl is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 3 of the License, or (at your option) any later version.
8 
9 Alternatively, you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of
12 the License, or (at your option) any later version.
13 
14 scl is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU Lesser General Public
20 License and a copy of the GNU General Public License along with
21 scl. If not, see <http://www.gnu.org/licenses/>.
22 */
23 /* \file CNonControlTaskBase.hpp
24  * Encapsulates a task servo and a task model
25  *
26  * Created on: Jul 30, 2012
27  *
28  * Copyright (C) 2012
29  *
30  * Author: Samir Menon <smenon@stanford.edu>
31  */
32 
33 #ifndef CNONCONTROLTASKBASE_HPP_
34 #define CNONCONTROLTASKBASE_HPP_
35 
36 #include <scl/DataTypes.hpp>
37 
38 #include <scl/control/task/data_structs/SNonControlTaskBase.hpp>
39 
40 namespace scl {
41 
50 public:
51  // ***************** Initialization functions *****************
53  virtual bool computeTask()=0;
54 
61  virtual bool init(SNonControlTaskBase* arg_task_data)=0;
62 
67  virtual SNonControlTaskBase* getTaskData()=0;
68 
70  virtual void reset()=0;
71 
72  // ***************** Accessor functions *****************
74  virtual void setActivation(sBool arg_act) { getTaskData()->has_been_activated_ = arg_act; }
75 
77  virtual sBool hasBeenInit() { return has_been_init_; }
78 
80  virtual bool hasBeenActivated() { return getTaskData()->has_been_activated_; }
81 
82  // ***************** Constructor/Destructor functions *****************
85 
88 
89 protected:
93 };
94 
95 }
96 
97 #endif /* CNONCONTROLTASKBASE_HPP_ */
CNonControlTaskBase()
Definition: CNonControlTaskBase.hpp:84
virtual sBool hasBeenInit()
Definition: CNonControlTaskBase.hpp:77
virtual bool init(SNonControlTaskBase *arg_task_data)=0
virtual void setActivation(sBool arg_act)
Definition: CNonControlTaskBase.hpp:74
virtual void reset()=0
scl::sBool has_been_activated_
Definition: SNonControlTaskBase.hpp:76
virtual SNonControlTaskBase * getTaskData()=0
Definition: CNonControlTaskBase.hpp:49
Definition: SNonControlTaskBase.hpp:64
bool sBool
Definition: DataTypes.hpp:54
virtual bool hasBeenActivated()
Definition: CNonControlTaskBase.hpp:80
virtual bool computeTask()=0
sBool has_been_init_
Definition: CNonControlTaskBase.hpp:92
virtual ~CNonControlTaskBase()
Definition: CNonControlTaskBase.hpp:87