PropertyDefinitionContainer.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * @package ArmarXCore::core
19 * @author Jan Issac (jan dot issac at gmx dot de)
20 * @date 2012
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24
25
26#pragma once
27
28#include <functional>
29#include <map>
30#include <string>
31#include <typeinfo>
32#include <vector>
33
34#include <Ice/Proxy.h>
35#include <Ice/ProxyHandle.h>
36
43
44namespace armarx
45{
47
48 /**
49 * @ingroup properties
50 *
51 * @class PropertyDefinitionContainer
52 * @brief PropertyDefinitionContainer
53 */
54 class PropertyDefinitionContainer : public virtual IceUtil::Shared
55 {
56 public:
57 typedef std::map<std::string, PropertyDefinitionBase*> DefinitionContainer;
58
59 PropertyDefinitionContainer(const std::string& prefix);
60
62
64
66
67 void writeValues();
69 std::map<std::string, ProxyPropertyDefinitionBase*> getProxyDefinitions();
70 std::vector<std::string> getSubscribedTopicDefinitions();
71
72 template <typename PropertyType>
73 decltype(auto)
75 PropertyType& setter,
76 const std::string& name,
77 const std::string& description = "",
79 {
80 return requiredOrOptional(true, setter, name, description, constness);
81 }
82
83 template <typename PropertyType>
84 decltype(auto)
86 PropertyType& setter,
87 const std::string& name,
88 const std::string& description = "",
90 {
91 return requiredOrOptional(false, setter, name, description, constness);
92 }
93
94 template <typename PropertyType>
95 decltype(auto)
97 const PropertyType& getter, // for default value
98 std::function<void(const PropertyType&)> setter,
99 const std::string& name,
100 const std::string& description = "",
102 {
103 return requiredOrOptional(false, getter, setter, name, description, constness);
104 }
105
106 template <typename PropertyType>
107 decltype(auto) requiredOrOptional(bool isRequired,
108 PropertyType& setter,
109 const std::string& name,
110 const std::string& description = "",
113
114 template <typename PropertyType>
115 decltype(auto) requiredOrOptional(bool isRequired,
116 const PropertyType& getter, // for default value
117 std::function<void(const PropertyType&)> setter,
118 const std::string& name,
119 const std::string& description = "",
122
123 public:
124 template <typename PropertyType>
126 const std::string& default_name = "",
127 const std::string& property_name = "",
128 const std::string& description = "");
129
130 /**
131 * Define a property to set the name of a topic which is subscribed to.
132 *
133 * This defines property to set the name of a topic of the given type from setter. Before
134 * `Component::onInitComponent()`, the component will subscribe to this topic, and before
135 * `Component::onConnectComponent()`, the topic proxy will be written into `setter`.
136 */
137 template <typename PropertyType>
139 const std::string& default_name = "",
140 const std::string& property_name = "",
141 const std::string& description = "");
142
143 /**
144 * Define a topic which is offered from the component via the template parameter.
145 *
146 * Sane defaults will be chosen for the property name and the default values depending on
147 * the template parameter, but these values can all be overridden with the parameters.
148 */
149 template <typename PropertyType>
150 void topic(std::string default_name = "",
151 std::string property_name = "",
152 std::string description = "");
153
154 template <typename PropertyType>
156 defineRequiredProperty(const std::string& name,
157 const std::string& description = "",
160
161 template <typename PropertyType>
163 defineOptionalProperty(const std::string& name,
164 PropertyType defaultValue,
165 const std::string& description = "",
168
169 /**
170 * @brief Define a required property for an Eigen vector type.
171 * The EigenVectorType can be any Eigen::Vector type, (Vector3f, VectorXd, ...).
172 *
173 * @param delimiter the delimiter between vector coefficients in the string representation
174 *
175 * Usage example:
176 * @code
177 * // Definition
178 * // accepts e.g. "1.0 2.0 3.0" and "1.0 -.3 .5"
179 * defineRequiredPropertyVector<Eigen::Vector3f>("Position", "The position.");
180 * // accepts e.g. "640x480" and "1920x1080"
181 * defineRequiredPropertyVector<Eigen::Vector2i>("Resolution", "The resolution.", 'x');
182 * // accepts e.g. "0,1,2,3,4,5,6,7,8,9" and "1"
183 * defineRequiredPropertyVector<Eigen::VectorXd>("Values", "The values.", ',');
184 *
185 * // Usage:
186 * Eigen::Vector3f position = getProperty<Eigen::Vector3f>("Position");
187 * Eigen::Vector2i resolution = getProperty<Eigen::Vector2i>("Resolution");
188 * Eigen::VectorXd values = getProperty<Eigen::VectorXd>("Values");
189 * // .getValue() can trigger Eigen's implicit conversion
190 * Eigen::VectorXf positionX = getProperty<Eigen::VectorXf>("Position").getValue();
191 *
192 * // Specification on command line:
193 * ./<binary> --ArmarX.<ComponentName>.Position="1 2 3"
194 * @endcode
195 */
196 template <typename EigenVectorType>
198 defineRequiredPropertyVector(const std::string& name,
199 const std::string& description = "",
200 const std::string& delimiter = " ",
203
204 // Legacy overloads taking char as delimiter.
205 template <typename EigenVectorType>
207 defineRequiredPropertyVector(const std::string& name,
208 const std::string& description,
209 char delimiter,
211 {
213 name, description, std::string(1, delimiter), constness);
214 }
215
216 template <typename EigenVectorType>
218 defineRequiredPropertyVector(const std::string& name,
219 const std::string& description,
220 char delimiter)
221 {
224 }
225
226 /**
227 * @brief Define a required property for an Eigen vector type.
228 * The EigenVectorType can be any Eigen::Vector type, (Vector3f, VectorXd, ...).
229 * @param delimiter the delimiter between vector coefficients in the string representation
230 *
231 * Usage example:
232 * @code
233 * // Definition
234 * // defaults to "0 0 0", accepts e.g. "1.0 2.0 3.0" and "1.0 -.3 .5"
235 * defineOptionalPropertyVector<Eigen::Vector3f>(
236 * "Position", Eigen::Vector3f::Zero(), "The position.");
237 * // defaults to "640x480", accepts e.g. "1920x1080"
238 * defineOptionalPropertyVector<Eigen::Vector2i>(
239 * "Resolution", Eigen::Vector2f(640, 480), "The resolution.", 'x');
240 * // defaults to "0,1,2,3,4,5,6,7,8,9", accepts e.g. "1" or "1,2,3"
241 * Eigen::VectorXd valuesDefault(10);
242 * valuesDefault << 0, 1, 2, 3, 4, 5, 6, 7, 8, 9;
243 * defineOptionalPropertyVector<Eigen::VectorXd>(
244 * "Values", valuesDefault, "The values.", ',');
245 *
246 * // Usage:
247 * Eigen::Vector3f position = getProperty<Eigen::Vector3f>("Position");
248 * Eigen::Vector2i resolution = getProperty<Eigen::Vector2i>("Resolution");
249 * Eigen::VectorXd values = getProperty<Eigen::VectorXd>("Values");
250 * // .getValue() can trigger Eigen's implicit conversion
251 * Eigen::VectorXf positionX = getProperty<Eigen::VectorXf>("Position").getValue();
252 *
253 * // Specification on command line:
254 * ./<binary> --ArmarX.<ComponentName>.Position="1 2 3"
255 * @endcode
256 */
257 template <typename EigenVectorType>
259 defineOptionalPropertyVector(const std::string& name,
260 EigenVectorType defaultValue,
261 const std::string& description = "",
262 const std::string& delimiter = " ",
265
266 // Legacy overloads taking char as delimiter.
267 template <typename EigenVectorType>
269 defineOptionalPropertyVector(const std::string& name,
270 EigenVectorType defaultValue,
271 const std::string& description,
272 char delimiter,
274 {
276 name, defaultValue, description, std::string(1, delimiter), constness);
277 }
278
279 template <typename EigenVectorType>
281 defineOptionalPropertyVector(const std::string& name,
282 EigenVectorType defaultValue,
283 const std::string& description,
284 char delimiter)
285 {
287 name, defaultValue, description, delimiter, PropertyDefinitionBase::eConstant);
288 }
289
290 PropertyDefinitionBase* getDefinitionBase(const std::string& name);
291
292 template <typename PropertyType>
293 PropertyDefinition<PropertyType>& getDefintion(const std::string& name);
294
295 bool
296 hasDefinition(const std::string& name) const
297 {
298 return (definitions.find(name) != definitions.end());
299 }
300
301 std::string toString(PropertyDefinitionFormatter& formatter);
302
303 /**
304 * Returns the detailed description of the property user
305 *
306 * @return detailed description text
307 */
308 std::string getDescription() const;
309
310 /**
311 * Sets the detailed description of the property user
312 *
313 * @param description detailed description text
314 */
315 void setDescription(const std::string& description);
316
317 void setPrefix(std::string prefix);
318
319 std::string getPrefix();
320
321 bool isPropertySet(const std::string& name);
322
323 std::string getValue(const std::string& name);
324
325 std::map<std::string, std::string> getPropertyValues(const std::string& prefix = "") const;
326
327 /**
328 * @brief Parses `string` to an Eigen vector of type `EigenVectorType`.
329 * @param delim The delimiter between coefficients.
330 * @throw std::bad_cast If parsing `string` fails.
331 */
332 template <typename EigenVectorType>
333 static EigenVectorType eigenVectorFactoryFunction(std::string string, std::string delim);
334 template <typename EigenVectorType>
335 static std::string eigenVectorToString(const EigenVectorType& vector, std::string delim);
336
337 static std::string eigenVectorPropertyDescription(const std::string& description,
338 long size,
339 std::string delim);
340
341 private:
342 template <typename PropertyType>
343 std::string ice_class_name();
344
345 template <typename PropertyType>
347 const ProxyType proxy_type,
348 std::string default_name,
349 std::string property_name,
350 std::string description);
351
352
353 protected:
354 /**
355 * Property definitions container
356 */
358
359 std::map<std::string, ProxyPropertyDefinitionBase*> proxies;
360
361 std::vector<std::string> subscribedTopics;
362
363 /**
364 * Prefix of the properties such as namespace, domain, component name,
365 * etc.
366 */
367 std::string prefix;
368
369 /**
370 * Property User description
371 */
372 std::string description;
373
374 /**
375 * PropertyUser brief description
376 */
377 std::string briefDescription;
378
380 };
381
382 /**
383 * PropertyDefinitions smart pointer type
384 */
386
387 /* ====================================================================== */
388 /* === Property Definition Container Implementation ===================== */
389 /* ====================================================================== */
390
391 std::string PropertyDefinitionContainer_ice_class_name(std::string const& full_type_name);
392
393 template <typename PropertyType>
394 std::string
395 PropertyDefinitionContainer::ice_class_name()
396 {
397 const std::string full_type_name = PropertyType::ice_staticId();
398 return PropertyDefinitionContainer_ice_class_name(full_type_name);
399 }
400
401 template <typename PropertyType>
402 inline decltype(auto)
404 bool isRequired,
405 PropertyType& setter,
406 const std::string& name,
407 const std::string& description,
409 {
411 if constexpr (plugin::value)
412 {
413 plugin::Define(*this, isRequired, setter, name, description, constness);
414 }
415 else
416 {
418 if (isRequired)
419 {
420 def = new PropertyDefinition<PropertyType>(&setter, name, description, constness);
421 }
422 else
423 {
425 &setter, name, setter, description, constness);
426 }
427
428 def->setTypeIdName(typeid(PropertyType).name());
429 definitions[name] = static_cast<PropertyDefinitionBase*>(def);
430 return *def;
431 }
432 }
433
434 template <typename PropertyType>
435 inline decltype(auto)
437 bool isRequired,
438 const PropertyType& getter,
439 std::function<void(const PropertyType&)> setter,
440 const std::string& name,
441 const std::string& description,
443 {
445 if constexpr (plugin::value)
446 {
447 plugin::Define(*this, isRequired, getter, setter, name, description, constness);
448 }
449 else
450 {
451 auto* def =
452 new PropertyDefinition<PropertyType>(setter, name, getter, description, constness);
453
454
455 def->setTypeIdName(typeid(PropertyType).name());
456 definitions[name] = static_cast<PropertyDefinitionBase*>(def);
457 return *def;
458 }
459 }
460
461 template <typename PropertyType>
462 void
464 const std::string& default_name,
465 const std::string& property_name,
466 const std::string& description)
467 {
468 proxy(setter, ProxyType::component, default_name, property_name, description);
469 }
470
471 template <typename PropertyType>
472 void
474 const std::string& default_name,
475 const std::string& property_name,
476 const std::string& description)
477 {
478 proxy(setter, ProxyType::topic, default_name, property_name, description);
479 }
480
481 template <typename PropertyType>
482 void
483 PropertyDefinitionContainer::topic(std::string default_name,
484 std::string property_name,
485 std::string description)
486 {
487 const std::string class_name = ice_class_name<PropertyType>();
488
489 if (default_name.empty())
490 {
491 default_name = class_name;
492 }
493 if (property_name.empty())
494 {
495 property_name = "tpc.sub." + class_name;
496 }
497 if (description.empty())
498 {
499 description = "Name of the `" + class_name + "` topic to subscribe to.";
500 }
501
502 // Append property definition for the proxy name.
504 nullptr, property_name, default_name, description, PropertyDefinitionBase::eConstant);
505 def_name->setTypeIdName(typeid(std::string).name());
506 definitions[property_name] = static_cast<PropertyDefinitionBase*>(def_name);
507 subscribedTopics.push_back(property_name);
508 }
509
510 template <typename PropertyType>
511 void
512 PropertyDefinitionContainer::proxy(IceInternal::ProxyHandle<PropertyType>& setter,
513 const ProxyType proxy_type,
514 std::string default_name,
515 std::string property_name,
516 std::string description)
517 {
518 using PropertyTypePrx = IceInternal::ProxyHandle<PropertyType>;
519
520 const std::string class_name = ice_class_name<PropertyType>();
521
522 if (default_name.empty())
523 {
524 default_name = class_name;
525 }
526 if (property_name.empty())
527 {
528 switch (proxy_type)
529 {
531 property_name = "cmp." + class_name;
532 break;
533 case ProxyType::topic:
534 property_name = "tpc.pub." + class_name;
535 break;
536 }
537 }
538 if (description.empty())
539 {
540 switch (proxy_type)
541 {
543 description = "Ice object name of the `" + class_name + "` component.";
544 break;
545 case ProxyType::topic:
546 description = "Name of the `" + class_name + "` topic to publish data to.";
547 break;
548 }
549 }
550
551 // Append property definition for the proxy name.
552 PropertyDefinition<std::string>* def_name = new PropertyDefinition<std::string>(
553 nullptr, property_name, default_name, description, PropertyDefinitionBase::eConstant);
554 def_name->setTypeIdName(typeid(std::string).name());
555 definitions[property_name] = static_cast<PropertyDefinitionBase*>(def_name);
556
557 // Append proxy definition.
558 ProxyPropertyDefinition<PropertyTypePrx>* def =
559 new ProxyPropertyDefinition<PropertyTypePrx>(&setter, proxy_type);
560 proxies[property_name] = static_cast<ProxyPropertyDefinitionBase*>(def);
561 }
562
563 template <typename PropertyType>
566 const std::string& name,
567 const std::string& description,
569 {
571 new PropertyDefinition<PropertyType>(nullptr, name, description, constness);
572
573 def->setTypeIdName(typeid(PropertyType).name());
574
575 definitions[name] = static_cast<PropertyDefinitionBase*>(def);
576
577 return *def;
578 }
579
580 template <typename PropertyType>
583 const std::string& name,
584 PropertyType defaultValue,
585 const std::string& description,
587 {
589 nullptr, name, defaultValue, description, constness);
590
591 def->setTypeIdName(typeid(PropertyType).name());
592
593 definitions[name] = static_cast<PropertyDefinitionBase*>(def);
594
595 return *def;
596 }
597
598 template <typename EigenVectorType>
601 const std::string& name,
602 const std::string& description,
603 const std::string& delimiter,
605 {
606 std::string appendedDescription = eigenVectorPropertyDescription(
607 description, EigenVectorType::SizeAtCompileTime, delimiter);
608
610 defineRequiredProperty<EigenVectorType>(name, appendedDescription, constness);
611
612 // set a factory
613 def.setFactory([delimiter](std::string string) -> EigenVectorType
614 { return eigenVectorFactoryFunction<EigenVectorType>(string, delimiter); });
615 def.setCaseInsensitive(true);
616
617 return def;
618 }
619
620 template <typename EigenVectorType>
623 const std::string& name,
624 EigenVectorType defaultValue,
625 const std::string& description,
626 const std::string& delimiter,
628 {
629 std::string appendedDescription = eigenVectorPropertyDescription(
630 description, EigenVectorType::SizeAtCompileTime, delimiter);
631
633 name, defaultValue, appendedDescription, constness);
634
635 // set a factory
636 def.setFactory([delimiter](std::string string) -> EigenVectorType
637 { return eigenVectorFactoryFunction<EigenVectorType>(string, delimiter); });
638 // map the default value
639 def.map(eigenVectorToString<EigenVectorType>(defaultValue, delimiter), defaultValue);
640 def.setCaseInsensitive(true);
641
642 return def;
643 }
644
645 template <typename PropertyType>
648 {
649 // check definition existance
650 if (definitions.find(name) == definitions.end())
651 {
652 std::stringstream ss;
653 ss << name + " property is not defined. Defined are ";
654 for (typename DefinitionContainer::iterator it = definitions.begin();
655 it != definitions.end();
656 ++it)
657 {
658 ss << "\n" << it->first;
659 }
660 throw armarx::LocalException(ss.str());
661 }
662
664
665 // check definition type
666 if (def->getTypeIdName().compare(typeid(PropertyType).name()) != 0)
667 {
668 throw armarx::LocalException(
669 std::string("Calling getProperty<T>() for the property '") + name +
670 "' with wrong property type [note: " + typeid(PropertyType).name() +
671 " instead of " + def->getTypeIdName() + "]");
672 }
673
674 // retrieve and down cast the requested definition
675 return *dynamic_cast<PropertyDefinition<PropertyType>*>(def);
676 }
677
678 template <typename EigenVectorType>
679 EigenVectorType
680 PropertyDefinitionContainer::eigenVectorFactoryFunction(std::string string, std::string delim)
681 {
682 using Scalar = typename EigenVectorType::Scalar;
683
684 long size = EigenVectorType::SizeAtCompileTime;
685 bool isFixedSize = size >= 0; // Eigen::Dynamic is -1.
686
687 const std::vector<std::string> stringScalars = split(string, delim, true);
688
689 std::vector<Scalar> scalars;
690 if (isFixedSize)
691 {
692 if (stringScalars.size() != static_cast<std::size_t>(size))
693 {
694 throw std::bad_cast();
695 }
696 scalars.reserve(size);
697 }
698 for (const auto& scalarStr : stringScalars)
699 {
700 // May throw boost::bad_lexical_cast (derives from std::bad_cast).
702 scalars.push_back(value);
703 }
704
705 EigenVectorType vector;
706 if (!isFixedSize)
707 {
708 vector.resize(scalars.size());
709 }
710 // Write values.
711 for (std::size_t i = 0; i < scalars.size(); ++i)
712 {
713 vector(i) = scalars[i];
714 }
715 return vector;
716 }
717
718 template <typename EigenVectorType>
719 std::string
721 std::string delim)
722 {
723 std::stringstream ss;
724 long size = vector.size();
725
726 ss << vector(0);
727 for (int i = 1; i < size; ++i)
728 {
729 ss << delim << vector(i);
730 }
731
732 return ss.str();
733 }
734
735
736} // namespace armarx
float Scalar
Definition basic.h:15
Common interface of any property definition.
PropertyDefinition< EigenVectorType > & defineOptionalPropertyVector(const std::string &name, EigenVectorType defaultValue, const std::string &description="", const std::string &delimiter=" ", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
Define a required property for an Eigen vector type.
PropertyDefinition< EigenVectorType > & defineRequiredPropertyVector(const std::string &name, const std::string &description="", const std::string &delimiter=" ", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
Define a required property for an Eigen vector type.
void component(IceInternal::ProxyHandle< PropertyType > &setter, const std::string &default_name="", const std::string &property_name="", const std::string &description="")
static std::string eigenVectorToString(const EigenVectorType &vector, std::string delim)
std::string description
Property User description.
void setDescription(const std::string &description)
Sets the detailed description of the property user.
PropertyDefinition< PropertyType > & getDefintion(const std::string &name)
std::map< std::string, PropertyDefinitionBase * > DefinitionContainer
static std::string eigenVectorPropertyDescription(const std::string &description, long size, std::string delim)
std::map< std::string, ProxyPropertyDefinitionBase * > proxies
std::vector< std::string > getSubscribedTopicDefinitions()
decltype(auto) optional(const PropertyType &getter, std::function< void(const PropertyType &)> setter, const std::string &name, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
DefinitionContainer definitions
Property definitions container.
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
void setProperties(Ice::PropertiesPtr properties)
decltype(auto) optional(PropertyType &setter, const std::string &name, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
decltype(auto) requiredOrOptional(bool isRequired, PropertyType &setter, const std::string &name, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
void topic(IceInternal::ProxyHandle< PropertyType > &setter, const std::string &default_name="", const std::string &property_name="", const std::string &description="")
Define a property to set the name of a topic which is subscribed to.
PropertyDefinition< EigenVectorType > & defineOptionalPropertyVector(const std::string &name, EigenVectorType defaultValue, const std::string &description, char delimiter, PropertyDefinitionBase::PropertyConstness constness)
static EigenVectorType eigenVectorFactoryFunction(std::string string, std::string delim)
Parses string to an Eigen vector of type EigenVectorType.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
std::map< std::string, std::string > getPropertyValues(const std::string &prefix="") const
PropertyDefinition< EigenVectorType > & defineOptionalPropertyVector(const std::string &name, EigenVectorType defaultValue, const std::string &description, char delimiter)
PropertyDefinition< PropertyType > & defineRequiredProperty(const std::string &name, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
bool hasDefinition(const std::string &name) const
PropertyDefinitionBase * getDefinitionBase(const std::string &name)
std::string getValue(const std::string &name)
PropertyDefinition< EigenVectorType > & defineRequiredPropertyVector(const std::string &name, const std::string &description, char delimiter)
decltype(auto) required(PropertyType &setter, const std::string &name, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
std::string toString(PropertyDefinitionFormatter &formatter)
std::map< std::string, ProxyPropertyDefinitionBase * > getProxyDefinitions()
std::string briefDescription
PropertyUser brief description.
std::string getDescription() const
Returns the detailed description of the property user.
PropertyDefinition< EigenVectorType > & defineRequiredPropertyVector(const std::string &name, const std::string &description, char delimiter, PropertyDefinitionBase::PropertyConstness constness)
PropertyDefinitionFormatter is the base class for all formatters of PropertyDefinitions.
PropertyDefinition defines a property that will be available within the PropertyUser.
PropertyDefinition< PropertyType > & setCaseInsensitive(bool isCaseInsensitive)
Sets whether the property value matching is case insensitive.
PropertyDefinition< PropertyType > & map(const std::string &valueString, PropertyType value)
Maps a string value onto a value of the specified template type.
PropertyDefinition< PropertyType > & setFactory(const PropertyFactoryFunction &func)
Sets the factory function that creates the specified template type from the actual string value.
::IceInternal::Handle<::Ice::Properties > PropertiesPtr
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::vector< std::string > split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)
T PropertyDefinition_lexicalCastTo(std::string const &input)
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
IceUtil::Handle< IceManager > IceManagerPtr
IceManager smart pointer.
Definition ArmarXFwd.h:39
std::string PropertyDefinitionContainer_ice_class_name(std::string const &full_type_name)