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