WorkingMemoryExample.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::WorkingMemoryExample
17* @author (kozlov at kit dot edu)
18* @date 2012
19* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20* GNU General Public License
21*/
22
23#pragma once
24
27
28#include <RobotAPI/interface/core/RobotState.h>
29
30#include <MemoryX/interface/components/LongtermMemoryInterface.h>
31#include <MemoryX/interface/components/WorkingMemoryInterface.h>
32
33namespace memoryx
34{
35
37 {
38 public:
41 {
43 "TestToRun", "UpdateNotifications", "Name of test that should be executed");
45 "SnapshotName", "", "Name of WM snapshot to load (if TestToRun=SnapshotLoad)");
47 "CommonPlacesSnapshot",
48 "dataset1_1205",
49 "Name of secondary WM snapshot to load (if TestToRun=CommonPlaces)");
50 }
51 };
52
54 virtual public armarx::Component,
55 virtual public WorkingMemoryListenerInterface
56 {
57 public:
58 /**
59 * @see PropertyUser::createPropertyDefinitions()
60 */
67
68 // inherited from Component
69 std::string
70 getDefaultName() const override
71 {
72 return "WorkingMemoryExample";
73 }
74
75 void onInitComponent() override;
76 void onConnectComponent() override;
77
78 void reportEntityCreated(const std::string& segmentName,
79 const ::memoryx::EntityBasePtr& entity,
80 const ::Ice::Current& = Ice::emptyCurrent) override;
81 void reportEntityUpdated(const std::string& segmentName,
82 const ::memoryx::EntityBasePtr& entityOld,
83 const ::memoryx::EntityBasePtr& entityNew,
84 const ::Ice::Current& = Ice::emptyCurrent) override;
85 void reportEntityRemoved(const std::string& segmentName,
86 const ::memoryx::EntityBasePtr& entity,
87 const ::Ice::Current& = Ice::emptyCurrent) override;
88 void reportSnapshotLoaded(const std::string& segmentName,
89 const ::Ice::Current& = Ice::emptyCurrent) override;
90 void reportSnapshotCompletelyLoaded(const Ice::Current& c = Ice::emptyCurrent) override;
91 void reportMemoryCleared(const std::string& segmentName,
92 const ::Ice::Current& = Ice::emptyCurrent) override;
93
94 private:
95 WorkingMemoryInterfacePrx memoryPrx;
96 LongtermMemoryInterfacePrx longtermMemoryPrx;
97 armarx::RobotStateComponentInterfacePrx robotStateComponentPrx;
98 std::string testToRun;
99
100 void testFileTransfer();
101 void testUpdateObserver();
102 void testObjectMovement();
103 void testSnapshots();
104 void testCommonPlaces();
105 void testAgent();
106 };
107
108
109} // namespace memoryx
#define ARMARXCOMPONENT_IMPORT_EXPORT
constexpr T c
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.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
std::string getDefaultName() const override
Retrieve default name of component.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
::IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface > RobotStateComponentInterfacePrx
VirtualRobot headers.