203 const std::string &name,
const std::string &type,
const std::string &info,
const std::string &value,
204 int volatileness,
const std::string &tooltip):configurable(parent),name(name),type(type),info(info),value(value),
205 volatileness(volatileness), tooltip(tooltip){}
215 bool operator==(
const std::string &name)
const {
return this->name == name; }
258 void addProperty(
const std::string &name,
const std::string &type,
259 const std::string &info,
const Any &value=
Any(),
260 const int volatileness=0,
const std::string &tooltip=std::string()) ;
268 void addChildConfigurable(
Configurable *configurable,
const std::string &childPrefix=
"");
271 void removeChildConfigurable(
Configurable *configurable);
275 Property &prop(
const std::string &propertyName) ;
279 const Property &prop(
const std::string &propertyName)
const ;
286 Configurable(
const std::string &ID=
"",
bool ordered=
true) ;
303 void setConfigurableID(
const std::string &ID) ;
328 void deactivateProperty(
const std::string &pattern);
333 void deleteDeactivationPattern(
const std::string &pattern);
336 std::vector<std::string> getPropertyListWithoutDeactivated()
const;
345 virtual void adaptProperty(
const std::string &name,
const std::string &newType,
346 const std::string &newInfo,
const std::string &newToolTip) ;
352 static std::string create_default_ID(
const std::string &prefix);
360 callbacks.push_back(cb);
364 void removedCallback(
const Callback &cb);
379 void call_callbacks(
const std::string &propertyName,
const Configurable* caller)
const;
396 virtual void setPropertyValue(
const std::string &propertyName,
const Any &value) ;
401 virtual std::vector<std::string> getPropertyList()
const;
406 virtual bool supportsProperty(
const std::string &propertyName)
const;
412 virtual void saveProperties(
const std::string &filename,
const std::vector<std::string> &propertiesToSkip=EMPTY_VEC)
const;
416 virtual void loadProperties(
const std::string &filename,
const std::vector<std::string> &propertiesToSkip=EMPTY_VEC);
444 return prop(propertyName).type;
463 return prop(propertyName).info;
469 virtual Any getPropertyValue(
const std::string &propertyName)
const;
473 return prop(propertyName).tooltip;
486 return prop(propertyName).volatileness;
495 static std::vector<std::string> get_registered_configurables();
499 static Configurable *create_configurable(
const std::string &classname) ;
504 #define REGISTER_CONFIGURABLE(NAME,CREATE) \ 505 struct StaticConfigurableRegistrationFor_##NAME{ \ 506 typedef StaticConfigurableRegistrationFor_##NAME This; \ 507 static Configurable *create(){ \ 510 StaticConfigurableRegistrationFor_##NAME(){ \ 511 Configurable::register_configurable_type(#NAME, &This::create); \ 513 } staticConfigurableRegistrationFor_##NAME; 518 #define REGISTER_CONFIGURABLE_DEFAULT(NAME) REGISTER_CONFIGURABLE(NAME,return new NAME) int volatileness
volatileness of a this property (0= no-volatileness, X=expected update every X msec)
Definition: Configurable.h:211
The General Function Template.
Definition: Function.h:284
std::map< std::string, Property > PropertyMap
by default internally use property list
Definition: Configurable.h:221
std::string childPrefix
Definition: Configurable.h:213
UncopiedInstance< Mutex > m_mutex
locks all accesses to property values
Definition: Configurable.h:248
undocument this line if you encounter any issues!
Definition: Any.h:37
static const std::vector< std::string > EMPTY_VEC
used as shortcut – just an empty vector of std::strings
Definition: Configurable.h:384
virtual std::string getPropertyInfo(const std::string &propertyName) const
get information of a properties valid values
Definition: Configurable.h:462
std::string type
property-type (menu, range,....);
Definition: Configurable.h:208
const std::string & getConfigurableID() const
returns the configurables static ID
Definition: Configurable.h:306
std::string info
property-information (depends on type)
Definition: Configurable.h:209
#define ICLUtils_API
this macros are important for creating dll's
Definition: CompatMacros.h:171
virtual std::string getPropertyType(const std::string &propertyName) const
get type of property
Definition: Configurable.h:443
Property()
Definition: Configurable.h:201
std::map< int, std::string > m_ordering
ordering of the properties
Definition: Configurable.h:229
std::map< const Configurable *, std::string > m_childConfigurables
internal list of child configurables
Definition: Configurable.h:232
virtual ~Configurable()
virtual destructor
Definition: Configurable.h:291
PropertyMap m_properties
list of all properties
Definition: Configurable.h:224
Configurable * configurable
corresponding Configurable
Definition: Configurable.h:206
This class provides the getter and setter methods of an internally set Configurable.
Definition: ConfigurableProxy.h:40
Configurable * m_elderConfigurable
internal pointer to elder configurable
Definition: Configurable.h:235
bool operator==(const std::string &name) const
for more efficient find
Definition: Configurable.h:215
std::string tooltip
property description, that is also used as tooltip
Definition: Configurable.h:212
void registerCallback(const Callback &cb)
add a callback for changed properties
Definition: Configurable.h:359
Function< void, const Property & > Callback
Function type for changed properties.
Definition: Configurable.h:356
std::string value
(optional) property-value this can be use to store current property value
Definition: Configurable.h:210
bool isOrderedFlagSet() const
returns whether the ordered flag is set
Definition: Configurable.h:311
std::string name
property-ID
Definition: Configurable.h:207
std::string m_ID
internal ID, that is used to provide global access to all instantiated configurables at runtime by gi...
Definition: Configurable.h:238
Interface for classes that can be configured from configuration-files and GUI-Components.
Definition: Configurable.h:194
static std::map< std::string, Configurable * > m_instances
static list of all instantiated Configurables
Definition: Configurable.h:241
virtual int getPropertyVolatileness(const std::string &propertyName) const
Returns whether this property may be changed internally.
Definition: Configurable.h:485
std::vector< std::string > m_deactivated
list of patterns for deactiavted properties
Definition: Configurable.h:244
virtual std::string getPropertyToolTip(const std::string &propertyName) const
returns the tooltip description for a given property
Definition: Configurable.h:472
Property(Configurable *parent, const std::string &name, const std::string &type, const std::string &info, const std::string &value, int volatileness, const std::string &tooltip)
Definition: Configurable.h:202
std::vector< Callback > callbacks
internally managed list of callbacks
Definition: Configurable.h:372
Represents a single property.
Definition: Configurable.h:200
bool m_isOrdered
whether to use property ordering
Definition: Configurable.h:227
Simple generic data type implementation that uses a string based data representation.
Definition: Any.h:109
Utility class for class instances that are created brand new on copy.
Definition: UncopiedInstance.h:72