RTC Toolkit  0.1.0-alpha
runtimeRepoApiIf.hpp
Go to the documentation of this file.
1 
9 #ifndef RTCTK_COMPONENTFRAMEWORK_RUNTIMEREPOAPIIF_HPP
10 #define RTCTK_COMPONENTFRAMEWORK_RUNTIMEREPOAPIIF_HPP
11 
12 #include <utility>
13 #include <exception>
15 
16 namespace rtctk::componentFramework {
17 
21 class Subscription {
22 public:
23  using BufferList = std::vector<std::pair<std::string, void*>>;
24 
25  enum Mode {
27  INVOKE_ON_EACH = 1
28  };
29 
30  void OnNewValues(const BufferList& buffers, bool multiple_updates) {
31  throw std::logic_error("Method not implemented.");
32  }
33 
34  void OnTimeout(const BufferList& buffers, bool multiple_updates) {
35  throw std::logic_error("Method not implemented.");
36  }
37 
38  void OnDpRemoved(const std::vector<std::string>& path) {
39  throw std::logic_error("Method not implemented.");
40  }
41 
42  void AddPath(const std::string& path) {
43  throw std::logic_error("Method not implemented.");
44  }
45 
46  void SetMaxWaitTime(std::chrono::seconds timeout) {
47  throw std::logic_error("Method not implemented.");
48  }
49 
50  void SetMode(Mode mode) {
51  throw std::logic_error("Method not implemented.");
52  }
53 
54  void AddAllocator(const std::string& path, std::function<void*(size_t)> allocator) {
55  throw std::logic_error("Method not implemented.");
56  }
57 };
58 
59 class RuntimeRepoApiIf : virtual public RepositoryIf {
60 public:
61  virtual ~RuntimeRepoApiIf();
62  virtual void Subscribe(const Subscription& subscription) const = 0;
63  virtual void Unsubscribe(const Subscription& subscription) const = 0;
64 };
65 
66 } // namespace rtctk::componentFramework
67 
68 #endif // RTCTK_COMPONENTFRAMEWORK_RUNTIMEREPOAPIIF_HPP
rtctk::componentFramework::RuntimeRepoApiIf::~RuntimeRepoApiIf
virtual ~RuntimeRepoApiIf()
Definition: runtimeRepoApiIf.cpp:16
rtctk::componentFramework::Subscription::Mode
Mode
Definition: runtimeRepoApiIf.hpp:25
rtctk::componentFramework
Definition: rtcComponent.hpp:17
rtctk::componentFramework::Subscription
Definition: runtimeRepoApiIf.hpp:21
rtctk::componentFramework::Subscription::OnTimeout
void OnTimeout(const BufferList &buffers, bool multiple_updates)
Definition: runtimeRepoApiIf.hpp:34
rtctk::componentFramework::Subscription::AddPath
void AddPath(const std::string &path)
Definition: runtimeRepoApiIf.hpp:42
rtctkExampleDataTaskRobotTest.path
string path
Definition: rtctkExampleDataTaskRobotTest.py:228
rtctk::componentFramework::Subscription::AddAllocator
void AddAllocator(const std::string &path, std::function< void *(size_t)> allocator)
Definition: runtimeRepoApiIf.hpp:54
rtctk::componentFramework::Subscription::SetMode
void SetMode(Mode mode)
Definition: runtimeRepoApiIf.hpp:50
rtctk::componentFramework::Subscription::OnNewValues
void OnNewValues(const BufferList &buffers, bool multiple_updates)
Definition: runtimeRepoApiIf.hpp:30
repositoryIf.hpp
Header file for RepositoryIf and related base classes.
rtctk::componentFramework::Subscription::INVOKE_ON_EACH
@ INVOKE_ON_EACH
Definition: runtimeRepoApiIf.hpp:27
rtctk::componentFramework::RuntimeRepoApiIf::Subscribe
virtual void Subscribe(const Subscription &subscription) const =0
rtctk::componentFramework::RepositoryIf
Abstract interface providing basic read and write facilities to a repository.
Definition: repositoryIf.hpp:28
rtctk::componentFramework::Subscription::SetMaxWaitTime
void SetMaxWaitTime(std::chrono::seconds timeout)
Definition: runtimeRepoApiIf.hpp:46
rtctk::componentFramework::RuntimeRepoApiIf
Definition: runtimeRepoApiIf.hpp:59
rtctk::componentFramework::Subscription::INVOKE_ON_ALL
@ INVOKE_ON_ALL
Definition: runtimeRepoApiIf.hpp:26
rtctk::componentFramework::Subscription::BufferList
std::vector< std::pair< std::string, void * > > BufferList
Definition: runtimeRepoApiIf.hpp:23
rtctk::componentFramework::RuntimeRepoApiIf::Unsubscribe
virtual void Unsubscribe(const Subscription &subscription) const =0
rtctk::componentFramework::Subscription::OnDpRemoved
void OnDpRemoved(const std::vector< std::string > &path)
Definition: runtimeRepoApiIf.hpp:38