31#include <IceUtil/Handle.h>
32#include <IceUtil/Shared.h>
77 template <
typename PropertyType>
83 template <
typename PropertyType>
87 return const_cast<PropertyUser&
>(*this).getProperty<PropertyType>(name);
94 void getProperty(std::atomic<T>& val,
const std::string& name)
const;
102 template <
class ContainerT>
104 const std::string& name,
105 const std::string& splitBy =
",;",
106 bool trimElements =
true,
107 bool removeEmptyElements =
true);
111 const std::string& splitBy =
",;",
112 bool trimElements =
true,
113 bool removeEmptyElements =
true);
162 bool tryAddProperty(
const std::string& propertyName,
const std::string& value);
171 std::unique_ptr<Impl> impl;
178 template <
typename PropertyType>
194 if constexpr (plugin::value)
196 plugin::Get(*
this, val, name);
212 template <
class ContainerT>
215 const std::string& name,
216 const std::string& splitBy,
218 bool removeEmptyElements)
221 using ValueT =
typename ContainerT::value_type;
223 if constexpr (std::is_same_v<ContainerT, std::vector<std::string>>)
225 val =
Split(csv, splitBy, trimElements, removeEmptyElements);
229 const auto strvec =
Split(csv, splitBy, trimElements, removeEmptyElements);
231 for (
const auto&
str : strvec)
233 if constexpr (std::is_same_v<ValueT, std::string>)
246 inline std::vector<T>
248 const std::string& splitBy,
250 bool removeEmptyElements)
PropertyDefinitionContainer.
Abstract PropertyUser class.
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()
void getPropertyAsCSV(ContainerT &val, const std::string &name, const std::string &splitBy=",;", bool trimElements=true, bool removeEmptyElements=true)
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()
Property< PropertyType > getProperty(const std::string &name) const
Hack to allow using getProperty in const-modified methods.
Provides access to Ice properties with extended capabilities.
::IceInternal::Handle<::Ice::Properties > PropertiesPtr
This file offers overloads of toIce() and fromIce() functions for STL container types.
auto emplace(Cont &cont, Params &&... params) -> decltype(cont.emplace_back(std::forward< Params >(params)...))
std::vector< std::string > Split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)
std::vector< PropertyUserPtr > PropertyUserList
UserProperty list type.
T PropertyDefinition_lexicalCastTo(std::string const &input)
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
IceUtil::Handle< class PropertyUser > PropertyUserPtr
PropertyUser smart pointer type.
IceUtil::Handle< IceManager > IceManagerPtr
IceManager smart pointer.