EEROS  0.4.1.0
API for the EEROS Real-Time Robotics Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
DeMux.hpp
Go to the documentation of this file.
1 #ifndef ORG_EEROS_CONTROL_DEMUX_HPP_
2 #define ORG_EEROS_CONTROL_DEMUX_HPP_
3 
5 #include <eeros/math/Matrix.hpp>
8 
9 namespace eeros {
10  namespace control {
11 
12  template < uint32_t N, typename T = double, typename C = eeros::math::Matrix<N,1,T> >
13  class DeMux: public Block {
14  public:
15  DeMux() { }
16 
17  virtual void run() {
18  for(int i = 0; i < N; i++) {
19  out[i].getSignal().setValue(in.getSignal().getValue()(i));
20  out[i].getSignal().setTimestamp(in.getSignal().getTimestamp());
21  }
22  }
23 
24  virtual Input<C>& getIn() {
25  return in;
26  }
27 
28  virtual Output<T>& getOut(uint32_t index) {
29  return out[index];
30  }
31 
32  protected:
35  };
36 
37  };
38 };
39 
40 #endif /* ORG_EEROS_CONTROL_DEMUX_HPP_ */
virtual void run()
Definition: DeMux.hpp:17
Output< T > out[N]
Definition: DeMux.hpp:34
virtual T getValue() const
Definition: Signal.hpp:46
virtual Input< C > & getIn()
Definition: DeMux.hpp:24
Input< C > in
Definition: DeMux.hpp:33
Definition: Block.hpp:10
Definition: DeMux.hpp:13
Definition: Output.hpp:10
virtual Output< T > & getOut(uint32_t index)
Definition: DeMux.hpp:28
DeMux()
Definition: DeMux.hpp:15
virtual Signal< T > & getSignal()
Definition: Input.hpp:35
virtual timestamp_t getTimestamp() const
Definition: Signal.hpp:59
int i
Definition: RingBufferTest.cpp:12