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