SemanticGraphStorageComponentPlugin.cpp
Go to the documentation of this file.
1
#include "
SemanticGraphStorageComponentPlugin.h
"
2
3
#include <VirtualRobot/VirtualRobot.h>
4
5
#include <
ArmarXCore/core/Component.h
>
6
7
#include <
VisionX/libraries/SemanticObjectRelations/ice_serialization.h
>
8
9
namespace
armarx
10
{
11
namespace
plugins
12
{
13
14
void
15
SemanticGraphStorageComponentPlugin::preOnInitComponent
()
16
{
17
parent<Component>().offeringTopicFromProperty(
PROPERTY_NAME
);
18
}
19
20
void
21
SemanticGraphStorageComponentPlugin::preOnConnectComponent
()
22
{
23
parent<Component>().getTopicFromProperty(
topic
,
PROPERTY_NAME
);
24
}
25
26
void
27
SemanticGraphStorageComponentPlugin::postCreatePropertyDefinitions
(
28
PropertyDefinitionsPtr
& properties)
29
{
30
if
(!properties->hasDefinition(
PROPERTY_NAME
))
31
{
32
properties->defineOptionalProperty<std::string>(
33
PROPERTY_NAME
,
"SemanticGraphTopic"
,
"Name of the SemanticGraphTopic"
);
34
}
35
}
36
37
}
// namespace plugins
38
39
SemanticGraphStorageComponentPluginUser::SemanticGraphStorageComponentPluginUser
()
40
{
41
addPlugin
(plugin);
42
}
43
44
const
semantic::GraphStorageTopicPrx&
45
SemanticGraphStorageComponentPluginUser::getGraphStorageTopic
()
46
{
47
return
plugin->
topic
;
48
}
49
50
void
51
armarx::SemanticGraphStorageComponentPluginUser::storeGraph
(
52
std::string
const
& name,
53
const
semrel::AttributedGraph& graph)
54
{
55
armarx::semantic::data::Graph
iceGraph =
armarx::semantic::toIce
(graph);
56
getGraphStorageTopic()->reportGraph(name, iceGraph);
57
}
58
59
}
// namespace armarx
armarx::ManagedIceObject::addPlugin
PluginT * addPlugin(const std::string prefix="", ParamsT &&... params)
Definition:
ManagedIceObject.h:186
armarx::plugins::SemanticGraphStorageComponentPlugin::PROPERTY_NAME
static constexpr const char * PROPERTY_NAME
Definition:
SemanticGraphStorageComponentPlugin.h:25
armarx::SemanticGraphStorageComponentPluginUser::storeGraph
void storeGraph(std::string const &name, semrel::AttributedGraph const &graph)
Definition:
SemanticGraphStorageComponentPlugin.cpp:51
plugins
armarx::semantic::toIce
data::Graph toIce(const semrel::AttributedGraph &input)
Definition:
graph.cpp:15
armarx::plugins::SemanticGraphStorageComponentPlugin::preOnInitComponent
void preOnInitComponent() override
Definition:
SemanticGraphStorageComponentPlugin.cpp:15
armarx::SemanticGraphStorageComponentPluginUser::getGraphStorageTopic
armarx::semantic::GraphStorageTopicPrx const & getGraphStorageTopic()
Definition:
SemanticGraphStorageComponentPlugin.cpp:45
armarx::Graph
boost::subgraph< CloudGraph > Graph
Definition:
Common.h:58
Component.h
armarx::SemanticGraphStorageComponentPluginUser::SemanticGraphStorageComponentPluginUser
SemanticGraphStorageComponentPluginUser()
Definition:
SemanticGraphStorageComponentPlugin.cpp:39
armarx::plugins::SemanticGraphStorageComponentPlugin::topic
armarx::semantic::GraphStorageTopicPrx topic
Definition:
SemanticGraphStorageComponentPlugin.h:27
armarx::plugins::SemanticGraphStorageComponentPlugin::postCreatePropertyDefinitions
void postCreatePropertyDefinitions(PropertyDefinitionsPtr &properties) override
Definition:
SemanticGraphStorageComponentPlugin.cpp:27
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::plugins::SemanticGraphStorageComponentPlugin::preOnConnectComponent
void preOnConnectComponent() override
Definition:
SemanticGraphStorageComponentPlugin.cpp:21
SemanticGraphStorageComponentPlugin.h
ice_serialization.h
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition:
ArmarXTimeserver.cpp:27
VisionX
libraries
VisionXComponentPlugins
SemanticGraphStorageComponentPlugin.cpp
Generated on Sat Mar 29 2025 09:17:38 for armarx_documentation by
1.8.17