Go to the documentation of this file.
31 #include <ArmarXCore/interface/core/ManagedIceObjectDefinitions.h>
41 if (hasObjectNameParameter)
43 defineOptionalProperty<std::string>(
"ObjectName",
"",
"Name of IceGrid well-known object");
55 configDomain =
"ArmarX";
56 createdByComponentCreate =
false;
77 return configDomain +
"." + configName;
86 this->configDomain = configDomain;
87 this->configName = configName;
110 ARMARX_DEBUG <<
"Subscribing to topic `" << offered_topic_name <<
"`.";
117 ARMARX_DEBUG <<
"Using component proxy `" << proxy_name <<
"`.";
124 ARMARX_DEBUG <<
"Offering topic `" << proxy_name <<
"`.";
143 additionalPropertyUsers.push_back(subPropertyUser);
150 return additionalPropertyUsers;
163 usingTopic(getProperty<std::string>(propertyName), orderedPublishing);
170 return usingProxy(getProperty<std::string>(propertyName), endpoints);
177 this->createdByComponentCreate =
true;
183 ARMARX_DEBUG <<
"call postCreatePropertyDefinitions for all plugins...";
184 foreach_plugin([&](
const auto & typeidx,
const auto & name,
const auto & plugin)
190 <<
") postCreatePropertyDefinitions...";
191 ptr->postCreatePropertyDefinitions(props);
194 <<
") postCreatePropertyDefinitions...done!";
200 <<
") is no ComponentPlugin (not calling postCreatePropertyDefinitions)";
202 }, __LINE__, __FILE__, BOOST_CURRENT_FUNCTION);
203 ARMARX_DEBUG <<
"call postCreatePropertyDefinitions for all plugins...done!";
214 void Component::icePropertiesUpdated(
const std::set<std::string>& changedProperties)
224 if (changedProperties.count(
"MinimumLoggingLevel") && getProperty<MessageTypeT>(
"MinimumLoggingLevel").isSet())
227 getProperty<MessageTypeT>(
"MinimumLoggingLevel").getValue());
232 if (changedProperties.count(
"ObjectName") && getProperty<std::string>(
"ObjectName").isSet())
242 if (changedProperties.count(
"EnableProfiling"))
248 if (
getState() > eManagedIceObjectInitialized)
251 ARMARX_DEBUG <<
"call componentPropertiesUpdated for all plugins...";
252 foreach_plugin([&](
const auto & typeidx,
const auto & name,
const auto & plugin)
254 if (
auto ptr =
dynamic_cast<ComponentPlugin*
>(plugin))
258 <<
") componentPropertiesUpdated...";
259 ptr->componentPropertiesUpdated(changedProperties);
262 <<
") componentPropertiesUpdated...done!";
268 <<
") is no ComponentPlugin (not calling componentPropertiesUpdated)";
270 }, __LINE__, __FILE__, BOOST_CURRENT_FUNCTION);
271 ARMARX_DEBUG <<
"call componentPropertiesUpdated for all plugins...done!";
279 (void) changedProperties;
void setName(std::string name)
Override name of well-known object.
IceManagerPtr getIceManager() const
Returns the IceManager.
virtual void preOnInitComponent() override
void addPropertyUser(const PropertyUserPtr &subPropertyUser)
Add additional property users here that should show up in the application help text.
void updateProxies(IceManagerPtr)
virtual void componentPropertiesUpdated(const std::set< std::string > &changedProperties)
Implement this function if you would like to react to changes in the properties.
int getState() const
Retrieve current state of the ManagedIceObject.
void offeringTopicFromProperty(const std::string &propertyName)
Offer a topic whose name is specified by the given property.
bool usingProxyFromProperty(const std::string &propertyName, const std::string &endpoints="")
Use a proxy whose name is specified by the given property.
void injectPropertyDefinitions(PropertyDefinitionsPtr &props) override
PropertyDefinitionsPtr createPropertyDefinitions() override
bool empty(const std::string &s)
virtual void icePropertiesInitialized()
std::vector< std::string > getComponentProxyNames()
std::vector< std::string > getTopicProxyNames()
Ice::PropertiesPtr createProperties()
std::vector< PropertyUserPtr > getAdditionalPropertyUsers() const
void usingTopicFromProperty(const std::string &propertyName, bool orderedPublishing=false)
Use a topic whose name is specified by the given property.
void setLocalMinimumLoggingLevel(MessageTypeT level)
With setLocalMinimumLoggingLevel the minimum verbosity-level of log-messages can be set.
PropertyDefinitionContainer.
std::string getConfigDomain()
Retrieve config domain for this component as set in constructor.
std::string GetTypeString(const std::type_info &tinf, bool withoutNamespaceSpecifier=false)
T getValue(nlohmann::json &userConfig, nlohmann::json &defaultConfig, const std::string &entryName)
void usingTopic(const std::string &name, bool orderedPublishing=false)
Registers a proxy for subscription after initialization.
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Default component property definition container.
void offeringTopic(const std::string &name)
Registers a topic for retrival after initialization.
void initializeProperties(const std::string &configName, Ice::PropertiesPtr const &properties, const std::string &configDomain)
initializes the properties of this component.
void forceComponentCreatedByComponentCreateFunc()
forces the flag to be set to true that the object instance was created by the Component::create funct...
void enableProfiler(bool enable)
setProfiler allows setting ManagedIceObject::profiler to a new instance (if the new instance is actua...
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
virtual void preOnConnectComponent() override
std::string getName() const
Retrieve name of object.
void setTag(const LogTag &tag)
Component()
Protected default constructor. Used for virtual inheritance. Use createManagedIceObject() instead.
virtual void setIceProperties(Ice::PropertiesPtr properties)
Sets the Ice properties.
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
std::string getConfigName()
Retrieve config name for this component as set in constructor.
std::vector< std::string > getSubscribedTopicNames()
This file offers overloads of toIce() and fromIce() functions for STL container types.