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