30#include <Ice/Initialize.h>
62 if (impl->propertyDefinitions.get() ==
nullptr)
68 impl->propertyDefinitions->setProperties(properties);
72 throw LocalException(
"Property prefix contains '..'. Did you call 'getProperty' in "
73 "a Component constructor?");
77 return impl->propertyDefinitions;
91 std::set<std::string> changedPropertyNames;
92 for (
auto& prop : properties->getPropertiesForPrefix(
""))
94 auto propName = prop.first;
95 auto index = propName.find_last_of(
'.');
96 std::string name = propName.substr(
index + 1);
97 changedPropertyNames.insert(name);
99 this->properties = properties->clone();
100 if (impl->propertyDefinitions)
102 impl->propertyDefinitions->setProperties(this->properties);
114 std::unique_lock lock(impl->mutex);
116 std::set<std::string> changedPropertyNames;
117 for (
auto& prop : changes)
119 std::string propName = prop.first;
122 auto index = propName.find_last_of(
'.');
123 std::string name = propName.substr(
index + 1);
124 std::string prefix = propName.substr(0,
index + 1);
125 if (prefix != definitions->getPrefix())
129 if (!definitions->getDefinitionBase(name)->isConstant())
131 this->properties->setProperty(propName, prop.second);
132 changedPropertyNames.insert(name);
133 ARMARX_VERBOSE <<
"Updating MUTABLE Property: " << prop.first <<
" with value '"
134 << prop.second <<
"'";
141 catch (
const armarx::LocalException& e)
162 std::vector<std::string>
165 std::vector<std::string> proxy_names;
176 std::vector<std::string>
179 std::vector<std::string> proxy_names;
190 std::vector<std::string>
193 std::vector<std::string> topic_names;
194 for (
const std::string& prop_name :
205 if (properties->getProperty(propertyName).empty())
207 properties->setProperty(propertyName, value);
217 (void)changedProperties;
225 return properties->clone();
Ice::PropertiesPtr getIceProperties() const
Returns the set of Ice properties.
bool tryAddProperty(const std::string &propertyName, const std::string &value)
PropertyDefinitionsPtr getPropertyDefinitions()
Returns the component's property definition container.
bool hasProperty(const std::string &name)
std::vector< std::string > getComponentProxyNames()
virtual void updateIceProperties(const std::map< std::string, std::string > &changes)
void updateProxies(IceManagerPtr)
virtual void setIceProperties(Ice::PropertiesPtr properties)
Sets the Ice properties.
std::vector< std::string > getSubscribedTopicNames()
virtual PropertyDefinitionsPtr createPropertyDefinitions()=0
Creates the property definition container.
virtual void injectPropertyDefinitions(PropertyDefinitionsPtr &)
Called after createPropertyDefinitions by Component to inject propertes of ComponentPlugin.
Property< PropertyType > getProperty(const std::string &name)
Property creation and retrieval.
virtual void icePropertiesUpdated(const std::set< std::string > &changedProperties)
This method is called when new Properties are set via setIceProperties().
std::vector< std::string > getTopicProxyNames()
#define ARMARX_IMPORTANT
The logging level for always important information, but expected behaviour (in contrast to ARMARX_WAR...
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
#define ARMARX_VERBOSE
The logging level for verbose information.
Ice::PropertiesPtr createProperties()
::IceInternal::Handle<::Ice::Properties > PropertiesPtr
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
bool Contains(const ContainerType &container, const ElementType &searchElement)
IceUtil::Handle< IceManager > IceManagerPtr
IceManager smart pointer.
PropertyDefinitionsPtr propertyDefinitions
Component property definitions pointer.