EEROS  1.0.0.0
API for the EEROS Real-Time Robotics Framework
Mul.hpp
Go to the documentation of this file.
1 #ifndef ORG_EEROS_CONTROL_MUL_HPP_
2 #define ORG_EEROS_CONTROL_MUL_HPP_
3 
6 
7 namespace eeros {
8  namespace control {
9 
10  template < typename In1T = double, typename In2T = double, typename OutT = double >
11  class Mul : public Block1o<OutT> {
12 
13  public:
14  Mul() : in1(this), in2(this) { }
15 
16  virtual void run() {
17  OutT prod;
18  prod = in1.getSignal().getValue() * in2.getSignal().getValue();
19  this->out.getSignal().setValue(prod);
21  }
22 
23  virtual Input<In1T>& getIn1() {
24  return in1;
25  }
26 
27  virtual Input<In2T>& getIn2() {
28  return in2;
29  }
30 
31  protected:
34  };
35 
36  /********** Print functions **********/
37  template <typename In1T = double, typename In2T = double, typename OutT = double>
38  std::ostream& operator<<(std::ostream& os, Mul<In1T,In2T,OutT>& mul) {
39  os << "Block multiplier: '" << mul.getName() << "'";
40  }
41 
42  };
43 };
44 
45 #endif /* ORG_EEROS_CONTROL_MUL_HPP_ */
Input< In2T > in2
Definition: Mul.hpp:33
virtual Signal< T > & getSignal()
Definition: Output.hpp:16
virtual T getValue() const
Definition: Signal.hpp:49
Definition: Block1o.hpp:12
Definition: Config.hpp:14
virtual void setValue(T newValue)
Definition: Signal.hpp:53
Output< OutT > out
Definition: Block1o.hpp:23
virtual void run()
Definition: Mul.hpp:16
virtual void setTimestamp(timestamp_t newTimestamp)
Definition: Signal.hpp:66
Input< In1T > in1
Definition: Mul.hpp:32
Mul()
Definition: Mul.hpp:14
virtual Signal< T > & getSignal()
Definition: Input.hpp:38
virtual timestamp_t getTimestamp() const
Definition: Signal.hpp:62
virtual Input< In1T > & getIn1()
Definition: Mul.hpp:23
Definition: Mul.hpp:11
virtual Input< In2T > & getIn2()
Definition: Mul.hpp:27