Writer.h
Go to the documentation of this file.
1 /**
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @author Fabian Reister ( fabian dot reister at kit dot edu )
17  * @date 2021
18  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19  * GNU General Public License
20  */
21 
22 #pragma once
23 
24 #include <mutex>
25 #include <string>
26 
29 
31 
33 {
34 
36  {
37  public:
39 
40  bool store(const core::GoalReachedEvent& event, const std::string& clientID);
41  bool store(const core::WaypointReachedEvent& event, const std::string& clientID);
42  bool store(const core::InternalErrorEvent& event, const std::string& clientID);
43  bool store(const core::UserAbortTriggeredEvent& event, const std::string& clientID);
44  bool store(const core::GlobalPlanningFailedEvent& event, const std::string& clientID);
45  bool store(const core::LocalPlanningFailedEvent& event, const std::string& clientID);
46  bool store(const core::MovementStartedEvent& event, const std::string& clientID);
47  bool store(const core::SafetyThrottlingTriggeredEvent& event, const std::string& clientID);
48  bool store(const core::SafetyStopTriggeredEvent& event, const std::string& clientID);
49  bool store(const core::GlobalTrajectoryUpdatedEvent& event, const std::string& clientID);
50  bool store(const core::LocalTrajectoryUpdatedEvent& event, const std::string& clientID);
51 
52  std::string propertyPrefix() const override;
53  Properties defaultProperties() const override;
54 
55  protected:
56  private:
57  std::mutex writeMutex;
58 
59  bool store(const armem::Commit& commit);
60  bool store(const armem::EntityUpdate& commit);
61 
62  template <typename AronEventT, typename EventT>
63  bool
64  storeImpl(const EventT& event, const std::string& eventName, const std::string& clientID);
65  };
66 } // namespace armarx::navigation::memory::client::events
armarx::armem::Commit
A bundle of updates to be sent to the memory.
Definition: Commit.h:89
armarx::navigation::core::InternalErrorEvent
Event describing the occurance of an internal unhandled error.
Definition: events.h:104
armarx::navigation::core::SafetyThrottlingTriggeredEvent
Event desciribing that a significant safety throttling factor was reached.
Definition: events.h:71
armarx::armem::client::util::SimpleWriterBase::Properties
Definition: SimpleWriterBase.h:47
armarx::navigation::memory::client::events::Writer::store
bool store(const core::GoalReachedEvent &event, const std::string &clientID)
Definition: Writer.cpp:84
armarx::armem::client::util::SimpleWriterBase::SimpleWriterBase
SimpleWriterBase()
Definition: SimpleWriterBase.cpp:8
events.h
armarx::navigation::core::SafetyStopTriggeredEvent
Event describing that for security reasons, the robot was stopped completely.
Definition: events.h:87
armarx::armem::EntityUpdate
An update of an entity for a specific point in time.
Definition: Commit.h:25
armarx::navigation::core::UserAbortTriggeredEvent
Event describing that the user aborted the current execution.
Definition: events.h:96
armarx::armem::client::util::SimpleWriterBase
Definition: SimpleWriterBase.h:36
armarx::navigation::core::LocalTrajectoryUpdatedEvent
Event describing that the local trajectory was updated.
Definition: events.h:121
armarx::navigation::core::GlobalPlanningFailedEvent
Definition: events.h:34
armarx::navigation::core::GoalReachedEvent
Event describing that the targeted goal was successfully reached.
Definition: events.h:52
armarx::navigation::memory::client::events::Writer::defaultProperties
Properties defaultProperties() const override
Definition: Writer.cpp:30
Commit.h
armarx::navigation::memory::client::events::Writer::propertyPrefix
std::string propertyPrefix() const override
Definition: Writer.cpp:24
armarx::navigation::core::GlobalTrajectoryUpdatedEvent
Event describing that the global trajectory was updated.
Definition: events.h:113
armarx::navigation::core::WaypointReachedEvent
Event describing that a user-defined waypoint was successfully reached.
Definition: events.h:60
armarx::navigation::memory::client::events
This file is part of ArmarX.
Definition: Writer.cpp:20
armarx::navigation::memory::client::events::Writer
Definition: Writer.h:35
SimpleWriterBase.h
armarx::navigation::core::LocalPlanningFailedEvent
Definition: events.h:39
armarx::navigation::core::MovementStartedEvent
Definition: events.h:44