ArVizComponentPlugin.cpp
Go to the documentation of this file.
2
4
5namespace armarx::plugins
6{
7 static const std::string ARVIZ_TOPIC_PROPERTY_NAME = "ArVizTopicName";
8 static const std::string ARVIZ_TOPIC_PROPERTY_DEFAULT = "ArVizTopic";
9
10 static const std::string ARVIZ_STORAGE_PROPERTY_NAME = "ArVizStorageName";
11 static const std::string ARVIZ_STORAGE_PROPERTY_DEFAULT = "ArVizStorage";
12
13 static const std::string EVENT_TOPIC_PROPERTY_NAME = "VisManEventTopicName";
14 static const std::string EVENT_TOPIC_PROPERTY_DEFAULT = "VisManEvents";
15
16 std::string
18 {
19 return parentDerives<Component>() ? parent<Component>().getProperty<std::string>(
20 makePropertyName(ARVIZ_TOPIC_PROPERTY_NAME))
21 : ARVIZ_TOPIC_PROPERTY_DEFAULT;
22 }
23
24 std::string
26 {
27 return parentDerives<Component>() ? parent<Component>().getProperty<std::string>(
28 makePropertyName(ARVIZ_STORAGE_PROPERTY_NAME))
29 : ARVIZ_STORAGE_PROPERTY_DEFAULT;
30 }
31
33 {
34 return parentDerives<Component>() ? parent<Component>().getProperty<std::string>(
35 makePropertyName(EVENT_TOPIC_PROPERTY_NAME))
36 : EVENT_TOPIC_PROPERTY_DEFAULT;
37 }
38
39 void
45
46 void
55
56 void
58 {
59 if (!properties->hasDefinition(makePropertyName(ARVIZ_TOPIC_PROPERTY_NAME)))
60 {
61 properties->defineOptionalProperty<std::string>(
62 makePropertyName(ARVIZ_TOPIC_PROPERTY_NAME),
63 ARVIZ_TOPIC_PROPERTY_DEFAULT,
64 "Name of the ArViz topic");
65 }
66 if (!properties->hasDefinition(makePropertyName(ARVIZ_STORAGE_PROPERTY_NAME)))
67 {
68 properties->defineOptionalProperty<std::string>(
69 makePropertyName(ARVIZ_STORAGE_PROPERTY_NAME),
70 ARVIZ_STORAGE_PROPERTY_DEFAULT,
71 "Name of the ArViz storage");
72 }
73 if (!properties->hasDefinition(makePropertyName(EVENT_TOPIC_PROPERTY_NAME)))
74 {
75 properties->topic(eventTopicPrx, EVENT_TOPIC_PROPERTY_DEFAULT, EVENT_TOPIC_PROPERTY_NAME, "Name of the Event Topic to publish events to");
76 }
77 }
78
84
85} // namespace armarx::plugins
86
87namespace armarx
88{
93
96 {
97 return plugin->createClient();
98 }
99
100 void ArVizComponentPluginUser::publishEvent(std::string eventName)
101 {
102 plugin->eventTopicPrx->reportEvent(eventName);
103 }
104} // namespace armarx
void publishEvent(std::string eventName)
std::string makePropertyName(const std::string &name)
void offeringTopic(const std::string &name)
Registers a topic for retrival after initialization.
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
PluginT * addPlugin(const std::string prefix="", ParamsT &&... params)
void postCreatePropertyDefinitions(PropertyDefinitionsPtr &properties) override
visman::components::visman_core::VISManEventTopicListenerPrx eventTopicPrx
This file is part of ArmarX.
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.