IndexMemory.cpp
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 RobotAPI::ArmarXObjects::IndexMemory
17
* @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
18
* @date 2022
19
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20
* GNU General Public License
21
*/
22
23
#include "
IndexMemory.h
"
24
25
#include <
ArmarXCore/core/exceptions/local/ExpressionException.h
>
26
#include <
ArmarXCore/core/ice_conversions/ice_conversions_templates.h
>
27
28
#include <
RobotAPI/libraries/armem/server/wm/memory_definitions.h
>
29
#include <RobotAPI/libraries/armem_index/aron/Named.aron.generated.h>
30
#include <RobotAPI/libraries/armem_index/aron/Spatial.aron.generated.h>
31
#include <
RobotAPI/libraries/armem_index/memory_ids.h
>
32
33
namespace
armarx
34
{
35
36
armarx::PropertyDefinitionsPtr
37
IndexMemory::createPropertyDefinitions
()
38
{
39
armarx::PropertyDefinitionsPtr
defs =
40
new
ComponentPropertyDefinitions
(
getConfigIdentifier
());
41
42
setMemoryName
(
armem::index::memoryID
.
memoryName
);
43
44
defs->optional(properties.maxHistorySize,
45
"p.maxHistorySize"
,
46
"The maximum size of entity histories."
)
47
.setMin(1);
48
49
return
defs;
50
}
51
52
std::string
53
IndexMemory::getDefaultName
()
const
54
{
55
return
"IndexMemory"
;
56
}
57
58
void
59
IndexMemory::onInitComponent
()
60
{
61
size_t
maxHistorySize =
static_cast<
size_t
>
(
std::max
(1, properties.maxHistorySize));
62
workingMemory
()
63
.
addCoreSegment
(
armem::index::namedSegmentID
.coreSegmentName,
64
armem::index::arondto::Named::ToAronType())
65
.
setMaxHistorySize
(maxHistorySize);
66
67
workingMemory
()
68
.
addCoreSegment
(
armem::index::spatialSegmentID
.coreSegmentName,
69
armem::index::arondto::Spatial::ToAronType())
70
.
setMaxHistorySize
(maxHistorySize);
71
}
72
73
void
74
IndexMemory::onConnectComponent
()
75
{
76
{
77
createRemoteGuiTab
();
78
RemoteGui_startRunningTask
();
79
}
80
}
81
82
void
83
IndexMemory::onDisconnectComponent
()
84
{
85
}
86
87
void
88
IndexMemory::onExitComponent
()
89
{
90
}
91
92
void
93
IndexMemory::createRemoteGuiTab
()
94
{
95
using namespace
armarx::RemoteGui::Client
;
96
97
{
98
}
99
100
VBoxLayout
root = {
VSpacer
()};
101
RemoteGui_createTab
(
getName
(), root, &tab);
102
}
103
104
void
105
IndexMemory::RemoteGui_update
()
106
{
107
}
108
109
}
// namespace armarx
armarx::IndexMemory::onDisconnectComponent
void onDisconnectComponent() override
Hook for subclass.
Definition:
IndexMemory.cpp:83
armarx::armem::server::wm::detail::MaxHistorySizeParent::setMaxHistorySize
void setMaxHistorySize(long maxSize)
Sets the maximum history size of entities in this container.
Definition:
MaxHistorySize.h:41
armarx::IndexMemory::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition:
IndexMemory.cpp:74
armarx::RemoteGui::Client::VBoxLayout
Definition:
Widgets.h:167
IndexMemory.h
armarx::armem::server::plugins::ReadWritePluginUser::setMemoryName
void setMemoryName(const std::string &memoryName)
Definition:
ReadWritePluginUser.cpp:29
armarx::armem::server::plugins::ReadWritePluginUser::workingMemory
server::wm::Memory & workingMemory()
Definition:
ReadWritePluginUser.cpp:128
armarx::RemoteGui::Client::VSpacer
Definition:
Widgets.h:204
armarx::IndexMemory::createRemoteGuiTab
void createRemoteGuiTab()
Definition:
IndexMemory.cpp:93
memory_definitions.h
armarx::IndexMemory::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition:
IndexMemory.cpp:37
armarx::IndexMemory::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition:
IndexMemory.cpp:59
armarx::armem::index::spatialSegmentID
const MemoryID spatialSegmentID
Definition:
memory_ids.cpp:31
max
T max(T t1, T t2)
Definition:
gdiam.h:51
armarx::armem::index::namedSegmentID
const MemoryID namedSegmentID
Definition:
memory_ids.cpp:30
armarx::IndexMemory::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition:
IndexMemory.cpp:53
armarx::LightweightRemoteGuiComponentPluginUser::RemoteGui_startRunningTask
void RemoteGui_startRunningTask()
Definition:
LightweightRemoteGuiComponentPlugin.cpp:119
ExpressionException.h
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition:
Component.cpp:79
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition:
Component.h:69
armarx::LightweightRemoteGuiComponentPluginUser::RemoteGui_createTab
void RemoteGui_createTab(std::string const &name, RemoteGui::Client::Widget const &rootWidget, RemoteGui::Client::Tab *tab)
Definition:
LightweightRemoteGuiComponentPlugin.cpp:103
armarx::armem::laser_scans::constants::memoryName
const std::string memoryName
Definition:
constants.h:28
IceUtil::Handle
Definition:
forward_declarations.h:30
armarx::armem::index::memoryID
const MemoryID memoryID
Definition:
memory_ids.cpp:28
armarx::IndexMemory::onExitComponent
void onExitComponent() override
Hook for subclass.
Definition:
IndexMemory.cpp:88
ice_conversions_templates.h
armarx::ManagedIceObject::getName
std::string getName() const
Retrieve name of object.
Definition:
ManagedIceObject.cpp:108
armarx::IndexMemory::RemoteGui_update
void RemoteGui_update() override
Definition:
IndexMemory.cpp:105
armarx::RemoteGui::Client
Definition:
EigenWidgets.cpp:8
armarx::armem::server::wm::Memory::addCoreSegment
CoreSegment & addCoreSegment(const std::string &name, Args... args)
Definition:
memory_definitions.h:151
memory_ids.h
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition:
ArmarXTimeserver.cpp:27
RobotAPI
components
armem
server
IndexMemory
IndexMemory.cpp
Generated by
1.8.17