WorkingMemoryUpdater.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* @package MemoryX::Core
17* @author Kai Welke <welke@kit.edu>
18* @copyright 2012 Kai Welke
19* @license http://www.gnu.org/licenses/gpl-2.0.txt
20* GNU General Public License
21*/
22
23#pragma once
24
25#include <Ice/Handle.h>
26
29
30#include <MemoryX/interface/workingmemory/AbstractWorkingMemoryInterface.h>
33
34namespace memoryx
35{
38
46
47 /**
48 * @class WorkingMemoryUpdater
49 * @brief Base class for all working memory updater processes
50 * @ingroup WorkingMemory
51 *
52 * WorkingMemoryUpdater can be registered to a memoryx::WorkingMemory. They have access to all WorkingMemorySegments and can thus read and manipulate data
53 * within these segments without the use of Ice communication. Further, they can have an Ice interface, which can be retrieved via the getUpdater method
54 * form the WorkingMemory.
55 */
57 virtual public armarx::Component,
58 virtual public WorkingMemoryUpdaterBase
59 {
61
62 public:
63 /**
64 * Constructs a new working memory updater method
65 *
66 * @param name of the fusion method
67 */
71
73 {
74 }
75
82
83 protected:
84 void
85 onInitComponent() override
86 {
87 }
88
89 void
91 {
92 }
93
94 void
96 {
97 }
98
99 void
101 {
102 }
103
104 template <class T>
106 getSegment(std::string segmentName)
107 {
108 AbstractMemorySegmentPtr segment = workingMemory->getSegmentPtr(segmentName);
110 }
111
114 {
115 return workingMemory;
116 }
117
118 private:
119 // only accessible from friend WorkingMemory
120 void
121 setWorkingMemory(AbstractWorkingMemoryPtr workingMemory)
122 {
123 this->workingMemory = workingMemory;
124 }
125
126 AbstractWorkingMemoryPtr workingMemory;
127 };
128} // namespace memoryx
#define ARMARXCORE_IMPORT_EXPORT
Default component property definition container.
Definition Component.h:70
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
Definition Component.cpp:46
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition Component.h:94
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition Component.cpp:90
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Base class for all working memory updater processes.
void onInitComponent() override
Pure virtual hook for the subclass.
void onDisconnectComponent() override
Hook for subclass.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
WorkingMemoryUpdater()
Constructs a new working memory updater method.
void onConnectComponent() override
Pure virtual hook for the subclass.
IceInternal::Handle< T > getSegment(std::string segmentName)
void onExitComponent() override
Hook for subclass.
AbstractWorkingMemoryPtr getWorkingMemory()
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
VirtualRobot headers.
IceUtil::Handle< AbstractWorkingMemory > AbstractWorkingMemoryPtr
IceInternal::Handle< WorkingMemoryUpdater > WorkingMemoryUpdaterPtr