SimpleWriterBase.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 
27 
29 
30 namespace armarx::armem::client
31 {
32  class MemoryNameSystem;
33 }
34 
36 {
37 
39  {
40  public:
42  virtual ~SimpleWriterBase() = default;
43 
46 
47 
48  protected:
49  struct Properties
50  {
51  std::string memoryName = "";
52  std::string coreSegmentName = "";
53  std::string providerName = ""; // required property
54  };
55 
56  const Properties& properties() const;
57  void setProperties(const Properties& p);
58 
59  virtual std::string propertyPrefix() const = 0;
60  virtual Properties defaultProperties() const = 0;
61 
63 
64 
65  private:
66  std::optional<Properties> props;
67 
68  armem::client::Writer memoryWriterClient;
69  };
70 
71 } // namespace armarx::armem::client::util
armarx::armem::client::util::SimpleWriterBase::Properties::providerName
std::string providerName
Definition: SimpleWriterBase.h:53
Writer.h
armarx::armem::client::util::SimpleWriterBase::setProperties
void setProperties(const Properties &p)
Definition: SimpleWriterBase.cpp:67
armarx::armem::client::util::SimpleWriterBase::defaultProperties
virtual Properties defaultProperties() const =0
armarx::armem::client::util::SimpleWriterBase::Properties::coreSegmentName
std::string coreSegmentName
Definition: SimpleWriterBase.h:52
armarx::armem::client::util::SimpleWriterBase::Properties
Definition: SimpleWriterBase.h:49
armarx::armem::client
This file is part of ArmarX.
Definition: forward_declarations.h:7
armarx::armem::client::util::SimpleWriterBase::SimpleWriterBase
SimpleWriterBase()
Definition: SimpleWriterBase.cpp:8
armarx::armem::client::util::SimpleWriterBase::registerPropertyDefinitions
void registerPropertyDefinitions(armarx::PropertyDefinitionsPtr &def)
Definition: SimpleWriterBase.cpp:13
armarx::armem::client::util::SimpleWriterBase::memoryWriter
armem::client::Writer & memoryWriter()
Definition: SimpleWriterBase.cpp:51
armarx::armem::client::util::SimpleWriterBase::Properties::memoryName
std::string memoryName
Definition: SimpleWriterBase.h:51
armarx::armem::client::util::SimpleWriterBase::connect
void connect(armarx::armem::client::MemoryNameSystem &mns)
Definition: SimpleWriterBase.cpp:33
armarx::armem::client::Writer
Helps a memory client sending data to a memory.
Definition: Writer.h:22
armarx::armem::client::util::SimpleWriterBase
Definition: SimpleWriterBase.h:38
PropertyDefinitionContainer.h
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::armem::client::util
Definition: MemoryListener.cpp:13
armarx::armem::client::util::SimpleWriterBase::properties
const Properties & properties() const
Definition: SimpleWriterBase.cpp:57
armarx::armem::client::util::SimpleWriterBase::propertyPrefix
virtual std::string propertyPrefix() const =0
armarx::armem::client::MemoryNameSystem
The memory name system (MNS) client.
Definition: MemoryNameSystem.h:69
armarx::armem::client::util::SimpleWriterBase::~SimpleWriterBase
virtual ~SimpleWriterBase()=default