AbstractLongtermMemory.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::LongtermMemory
17 * @author Alexey Kozlov ( 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 
30 #include <MemoryX/interface/components/CommonStorageInterface.h>
31 #include <MemoryX/interface/components/LongtermMemoryInterface.h>
32 
33 namespace memoryx
34 {
35 
37  {
38  public:
41  {
42  defineRequiredProperty<std::string>("DatabaseName", "Mongo database to store LTM data");
43  }
44  };
45 
47  virtual public LongtermMemoryInterface,
48  virtual public SegmentedMemory,
49  virtual public armarx::Component
50  {
51  public:
52  // inherited from Component
53  std::string
54  getDefaultName() const override
55  {
56  return "AbstractLongtermMemory";
57  }
58 
59  void onInitComponent() override;
60  void onConnectComponent() override;
61 
62  void clear(const ::Ice::Current& = Ice::emptyCurrent) override;
63 
65  getObjectAdapter() const override
66  {
67  return Component::getObjectAdapter();
68  }
69 
70  /**
71  * @see PropertyUser::createPropertyDefinitions()
72  */
75  {
77  new AbstractLongtermMemoryPropertyDefinitions(getConfigIdentifier()));
78  }
79 
80  protected:
81  CommonStorageInterfacePrx storagePrx;
84 
85  std::string dbName;
86 
87  // subclass hooks
88  virtual void onInitLongtermMemory() = 0;
89  virtual void onConnectLongtermMemory() = 0;
90  };
91 
93 } // namespace memoryx
SegmentedMemory.h
memoryx::AbstractLongtermMemory::storagePrx
CommonStorageInterfacePrx storagePrx
Definition: AbstractLongtermMemory.h:81
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:345
memoryx::AbstractLongtermMemory::dbName
std::string dbName
Definition: AbstractLongtermMemory.h:85
MongoSerializer.h
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
memoryx::AbstractLongtermMemoryPropertyDefinitions::AbstractLongtermMemoryPropertyDefinitions
AbstractLongtermMemoryPropertyDefinitions(std::string prefix)
Definition: AbstractLongtermMemory.h:39
memoryx::AbstractLongtermMemory::dbSerializer
MongoSerializerPtr dbSerializer
Definition: AbstractLongtermMemory.h:83
memoryx::SegmentedMemory
The SegmentedMemory class provides an interface for organizing memories with segmented data structure...
Definition: SegmentedMemory.h:46
IceInternal::Handle<::Ice::ObjectAdapter >
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
memoryx::AbstractLongtermMemory::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: AbstractLongtermMemory.h:54
memoryx::AbstractLongtermMemory
Definition: AbstractLongtermMemory.h:46
memoryx::AbstractLongtermMemoryPropertyDefinitions
Definition: AbstractLongtermMemory.h:36
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:91
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:69
IceUtil::Handle< class PropertyDefinitionContainer >
memoryx::AbstractLongtermMemory::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: AbstractLongtermMemory.h:74
armarx::ComponentPropertyDefinitions::ComponentPropertyDefinitions
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
Definition: Component.cpp:35
memoryx::AbstractLongtermMemory::ic
Ice::CommunicatorPtr ic
Definition: AbstractLongtermMemory.h:82
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:35
memoryx::AbstractLongtermMemory::getObjectAdapter
Ice::ObjectAdapterPtr getObjectAdapter() const override
Definition: AbstractLongtermMemory.h:65
ImportExportComponent.h