MemoryPolling.h
Go to the documentation of this file.
1 #pragma once
2 
3 
4 #include <mutex>
5 #include <string>
6 #include <vector>
7 
9 
14 
16 
17 namespace armarx::armem::client
18 {
19  class MemoryNameSystem;
20 }
21 
23 {
24 
25  class MemoryPolling : virtual public SimpleEventHandler
26  {
27 
28  public:
29  MemoryPolling(const std::string& callerId, armem::client::MemoryNameSystem& mns);
30 
31  void handleEvent(const armem::wm::EntityInstance& memoryEntity);
32 
33  // Non-API.
34  public:
35  ~MemoryPolling() override;
36 
37 
38  protected:
39  void runPollMemoryEvents();
41 
42 
43  void onEntityUpdate(const std::vector<armem::MemoryID>& snapshotIDs);
44 
45  private:
46  const std::string callerId;
47  armem::client::MemoryNameSystem& memoryNameSystem;
48 
49  armem::Time lastMemoryEventReceived;
50 
51  armem::client::Reader memoryReader;
52 
53  std::mutex eventHandlingMtx;
54 
56  };
57 
58 } // namespace armarx::navigation::client
armarx::navigation::client::MemoryPolling::handleEvent
void handleEvent(const armem::wm::EntityInstance &memoryEntity)
Definition: MemoryPolling.cpp:88
armarx::armem::client::Reader
Reads data from a memory server.
Definition: Reader.h:23
Reader.h
armarx::armem::wm::EntityInstance
Client-side working entity instance.
Definition: memory_definitions.h:32
armarx::navigation::client::SimpleEventHandler
Definition: SimpleEventHandler.h:11
MemoryID.h
forward_declarations.h
armarx::navigation::client::MemoryPolling::MemoryPolling
MemoryPolling(const std::string &callerId, armem::client::MemoryNameSystem &mns)
Definition: MemoryPolling.cpp:30
armarx::armem::client
This file is part of ArmarX.
Definition: forward_declarations.h:6
PeriodicTask.h
armarx::navigation::client::MemoryPolling::handleEvents
void handleEvents(const armem::wm::Memory &memory)
Definition: MemoryPolling.cpp:203
armarx::navigation::client
This file is part of ArmarX.
Definition: ComponentPlugin.cpp:21
armarx::memory
Brief description of class memory.
Definition: memory.h:38
armarx::navigation::client::MemoryPolling::~MemoryPolling
~MemoryPolling() override
Definition: MemoryPolling.cpp:163
armarx::armem::wm::Memory
Client-side working memory.
Definition: memory_definitions.h:133
SimpleEventHandler.h
armarx::navigation::client::MemoryPolling::runPollMemoryEvents
void runPollMemoryEvents()
Definition: MemoryPolling.cpp:171
armarx::navigation::client::MemoryPolling::onEntityUpdate
void onEntityUpdate(const std::vector< armem::MemoryID > &snapshotIDs)
Definition: MemoryPolling.cpp:55
memory_definitions.h
armarx::core::time::DateTime
Represents a point in time.
Definition: DateTime.h:24
armarx::navigation::client::MemoryPolling
Definition: MemoryPolling.h:25
IceUtil::Handle
Definition: forward_declarations.h:30
armarx::armem::client::MemoryNameSystem
The memory name system (MNS) client.
Definition: MemoryNameSystem.h:68