EEROS  1.0.0.0
API for the EEROS Real-Time Robotics Framework
Input.hpp
Go to the documentation of this file.
1 #ifndef ORG_EEROS_HAL_INPUT_HPP_
2 #define ORG_EEROS_HAL_INPUT_HPP_
3 #include <string>
4 #include <eeros/core/System.hpp>
5 
6 namespace eeros {
7  namespace hal {
8 
9  class InputInterface {
10  public:
11  virtual ~InputInterface() { }
12  virtual std::string getId() const = 0;
13  virtual void* getLibHandle() = 0;
14  };
15 
16  template <typename T>
17  class Input : public InputInterface {
18  public:
19  explicit Input(std::string id, void* libHandle) : id(id), libHandle(libHandle) { }
20  virtual ~Input() { }
21  virtual inline std::string getId() const { return id; }
22  virtual T get() = 0;
23  virtual uint64_t getTimestamp() { return System::getTimeNs(); }
24  virtual void *getLibHandle() { return libHandle; }
25  private:
26  std::string id;
27  void* libHandle;
28  };
29 
30  };
31 };
32 
33 #endif /* ORG_EEROS_HAL_INPUT_HPP_ */
virtual void * getLibHandle()=0
virtual ~Input()
Definition: Input.hpp:20
virtual std::string getId() const =0
Definition: Input.hpp:17
Definition: Config.hpp:14
static uint64_t getTimeNs()
Definition: System_POSIX.cpp:41
virtual ~InputInterface()
Definition: Input.hpp:11
virtual void * getLibHandle()
Definition: Input.hpp:24
Input(std::string id, void *libHandle)
Definition: Input.hpp:19
virtual uint64_t getTimestamp()
Definition: Input.hpp:23
virtual std::string getId() const
Definition: Input.hpp:21
Definition: Input.hpp:9