1
//---------------------------------------------------------------------------
3
// Project: OpenWalnut ( http://www.openwalnut.org )
5
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6
// For more information see http://www.openwalnut.org/copying
8
// This file is part of OpenWalnut.
10
// OpenWalnut is free software: you can redistribute it and/or modify
11
// it under the terms of the GNU Lesser General Public License as published by
12
// the Free Software Foundation, either version 3 of the License, or
13
// (at your option) any later version.
15
// OpenWalnut is distributed in the hope that it will be useful,
16
// but WITHOUT ANY WARRANTY; without even the implied warranty of
17
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
// GNU Lesser General Public License for more details.
20
// You should have received a copy of the GNU Lesser General Public License
21
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
23
//---------------------------------------------------------------------------
25
#ifndef WPROPERTYGROUP_H
26
#define WPROPERTYGROUP_H
32
#include "WConditionSet.h"
33
#include "WPropertyBase.h"
34
#include "WPropertyGroupBase.h"
35
#include "WPropertyTypes.h"
36
#include "WPropertyVariable.h"
37
#include "WSharedSequenceContainer.h"
38
#include "exceptions/WPropertyNotUnique.h"
43
* Class to manage properties of an object and to provide convenience methods for easy access and manipulation. It also allows
44
* thread safe iteration on its elements. The main purpose of this class is to group properties together and to allow searching properties by a
45
* given name. The name of each property in a group has to be unique and is constructed using the group names containing them: hello/you/property
46
* is the property with the name "property" in the group "you" which against is in the group "hello".
47
* \note The root group of each module does not have a name.
49
class WPropertyGroup: public WPropertyGroupBase
51
friend class WPropertiesTest;
53
// the following typedefs are for convenience.
54
typedef boost::shared_ptr< WPropertyGroup > SPtr; //!< shared pointer to object of this type
55
typedef boost::shared_ptr< const WPropertyGroup > ConstSPtr; //!< const shared pointer to object of this type
56
typedef WPropertyGroup* Ptr; //!< pointer to object of this type
57
typedef const WPropertyGroup* ConstPtr; //!< const pointer to object of this type
58
typedef WPropertyGroup& Ref; //!< ref to object of this type
59
typedef const WPropertyGroup& ConstRef; //!< const ref to object of this type
62
* For shortening: a type defining a shared vector of WSubject pointers.
64
typedef WPropertyGroupBase::PropertyContainerType PropertyContainerType;
67
* The alias for a shared container.
69
typedef WPropertyGroupBase::PropertySharedContainerType PropertySharedContainerType;
72
* The const iterator type of the container.
74
typedef WPropertyGroupBase::PropertyConstIterator PropertyConstIterator;
77
* The iterator type of the container.
79
typedef WPropertyGroupBase::PropertyIterator PropertyIterator;
82
* Constructor. Creates an empty list of properties.
84
* \note WModule::getProperties always returns an unnamed instance.
86
* \param name the name of the property group. The GUI is using this name for naming the tabs/group boxes
87
* \param description the description of the group.
89
WPropertyGroup( std::string name = "unnamed group", std::string description = "an unnamed group of properties" );
92
* Copy constructor. Creates a deep copy of this property. As boost::signals2 and condition variables are non-copyable, new instances get
93
* created. The subscriptions to a signal are LOST as well as all listeners to a condition.
94
* The conditions you can grab using getValueChangeConditon and getCondition are not the same as in the original! This is because
95
* the class corresponds to the observer/observable pattern. You won't expect a clone to fire a condition if a original flag is changed
96
* (which after cloning is completely decoupled from the clone).
98
* \note the properties inside this list are also copied deep
100
* \param from the instance to copy.
102
explicit WPropertyGroup( const WPropertyGroup& from );
107
virtual ~WPropertyGroup();
109
///////////////////////////////////////////////////////////////////////////////////////////////////
110
// The WPropertyBase interface
111
///////////////////////////////////////////////////////////////////////////////////////////////////
114
* This method clones a property and returns the clone. It does a deep copy and, in contrast to a copy constructor, creates property with the
115
* correct type without explicitly requiring the user to specify it. It creates a NEW change condition and change signal. This means, alls
116
* subscribed signal handlers are NOT copied.
118
* \note this simply ensures the copy constructor of the runtime type is issued.
120
* \return the deep clone of this property.
122
virtual boost::shared_ptr< WPropertyBase > clone();
125
* Gets the real type of this instance. In this case, PV_GROUP.
127
* \return the real type.
129
virtual PROPERTY_TYPE getType() const;
132
* This methods allows properties to be set by a string value. This method does nothing here, as groups can not be set in any kind.
134
* \param value the new value to set. IGNORED.
136
* \return always true
138
virtual bool setAsString( std::string value );
141
* Returns the current value as a string. This is useful for debugging or project files. It is not implemented as << operator, since the <<
142
* should also print min/max constraints and so on. This simply is the value.
144
* \return the value as a string.
146
virtual std::string getAsString();
149
* Sets the value from the specified property to this one. This is especially useful to copy a value without explicitly casting/knowing the
150
* dynamic type of the property.
151
* For WPropertyGroup, this tries to set the contained properties to the value of the given group. It does not add/remove properties. It
152
* simply sets the children values to the ones given.
154
* \param value the new value.
155
* \param recommendedOnly if true, property types which support recommended values apply the given value as recommendation.
157
* \return true if the values of the children could be set. If one could not be set, false
159
virtual bool set( boost::shared_ptr< WPropertyBase > value, bool recommendedOnly = false );
161
///////////////////////////////////////////////////////////////////////////////////////////////////
162
// Extend the WPropertyGroupBase to allow the property list to be modified
163
///////////////////////////////////////////////////////////////////////////////////////////////////
166
* Removes all properties from the list.
168
virtual void clear();
171
* Insert the specified property into the list.
173
* \param prop the property to add
175
* \return The given prop.
177
template< typename PropType >
178
PropType addProperty( PropType prop );
181
* Remove the specified property from the list. If the given property is not in the list, nothing happens.
183
* \param prop the property to remove.
185
void removeProperty( boost::shared_ptr< WPropertyBase > prop );
187
///////////////////////////////////////////////////////////////////////////////////////////////////
188
// Convenience methods to create and add properties
189
///////////////////////////////////////////////////////////////////////////////////////////////////
192
* Create and add a new property group. Use these groups to structure your properties.
194
* \param name the name of the group.
195
* \param description the description of the group.
196
* \param hide true if group should be completely hidden.
198
* \return The newly created property group.
200
WPropGroup addPropertyGroup( std::string name, std::string description, bool hide = false );
203
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
205
* \see WPropertyVariable
207
* \param name the property name
208
* \param description the property description
209
* \param initial the initial value
210
* \param hide set to true to set the hide flag directly.
212
* \return the newly created property variable instance.
214
template< typename T>
215
boost::shared_ptr< WPropertyVariable< T > > addProperty( std::string name, std::string description, const T& initial, bool hide = false );
218
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
220
* \see WPropertyVariable
222
* \param name the property name
223
* \param description the property description
224
* \param initial the initial value
225
* \param condition use this external condition for notification.
226
* \param hide set to true to set the hide flag directly.
228
* \return the newly created property variable instance.
230
template< typename T>
231
boost::shared_ptr< WPropertyVariable< T > > addProperty( std::string name, std::string description, const T& initial,
232
boost::shared_ptr< WCondition > condition, bool hide = false );
235
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
237
* \see WPropertyVariable
239
* \param name the property name
240
* \param description the property description
241
* \param initial the initial value
242
* \param notifier use this notifier for change callbacks.
243
* \param hide set to true to set the hide flag directly.
245
* \return the newly created property variable instance.
247
template< typename T>
248
boost::shared_ptr< WPropertyVariable< T > > addProperty( std::string name, std::string description, const T& initial,
249
WPropertyBase::PropertyChangeNotifierType notifier, bool hide = false );
252
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
254
* \see WPropertyVariable
256
* \param name the property name
257
* \param description the property description
258
* \param initial the initial value
259
* \param notifier use this notifier for change callbacks.
260
* \param condition use this external condition for notification
261
* \param hide set to true to set the hide flag directly.
263
* \return the newly created property variable instance.
265
template< typename T>
266
boost::shared_ptr< WPropertyVariable< T > > addProperty( std::string name, std::string description, const T& initial,
267
boost::shared_ptr< WCondition > condition,
268
WPropertyBase::PropertyChangeNotifierType notifier, bool hide = false );
270
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
271
// Convenience methods to create and add properties
272
// NOTE: these methods use the type of the initial parameter to automatically use the proper type.
273
// This works, since the compiler always calls the function with the best matching parameter types.
274
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
277
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
278
// convenience methods for
279
// template< typename T>
280
// boost::shared_ptr< WPropertyVariable< T > > addProperty( std::string name, std::string description, const T& initial, bool hide = false );
281
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
284
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
286
* \see WPropertyVariable
288
* \param name the property name
289
* \param description the property description
290
* \param initial the initial value
291
* \param hide set to true to set the hide flag directly.
293
* \return the newly created property variable instance.
295
WPropBool addProperty( std::string name, std::string description, const WPVBaseTypes::PV_BOOL& initial, bool hide = false );
298
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
299
* It also sets the min and max constraint to [0,100].
301
* \see WPropertyVariable
303
* \param name the property name
304
* \param description the property description
305
* \param initial the initial value
306
* \param hide set to true to set the hide flag directly.
308
* \return the newly created property variable instance.
310
WPropInt addProperty( std::string name, std::string description, const WPVBaseTypes::PV_INT& initial, bool hide = false );
313
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
314
* It also sets the min and max constraint to [0,100].
316
* \see WPropertyVariable
318
* \param name the property name
319
* \param description the property description
320
* \param initial the initial value
321
* \param hide set to true to set the hide flag directly.
323
* \return the newly created property variable instance.
325
WPropDouble addProperty( std::string name, std::string description, const WPVBaseTypes::PV_DOUBLE& initial, bool hide = false );
328
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
330
* \see WPropertyVariable
332
* \param name the property name
333
* \param description the property description
334
* \param initial the initial value
335
* \param hide set to true to set the hide flag directly.
337
* \return the newly created property variable instance.
339
WPropString addProperty( std::string name, std::string description, const WPVBaseTypes::PV_STRING& initial, bool hide = false );
342
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
344
* \see WPropertyVariable
346
* \param name the property name
347
* \param description the property description
348
* \param initial the initial value
349
* \param hide set to true to set the hide flag directly.
351
* \return the newly created property variable instance.
353
WPropFilename addProperty( std::string name, std::string description, const WPVBaseTypes::PV_PATH& initial, bool hide = false );
356
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
358
* \see WPropertyVariable
360
* \param name the property name
361
* \param description the property description
362
* \param initial the initial value
363
* \param hide set to true to set the hide flag directly.
365
* \return the newly created property variable instance.
367
WPropSelection addProperty( std::string name, std::string description, const WPVBaseTypes::PV_SELECTION& initial, bool hide = false );
370
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
372
* \see WPropertyVariable
374
* \param name the property name
375
* \param description the property description
376
* \param initial the initial value
377
* \param hide set to true to set the hide flag directly.
379
* \return the newly created property variable instance.
381
WPropPosition addProperty( std::string name, std::string description, const WPVBaseTypes::PV_POSITION& initial, bool hide = false );
384
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
386
* \see WPropertyVariable
388
* \param name the property name
389
* \param description the property description
390
* \param initial the initial value
391
* \param hide set to true to set the hide flag directly.
393
* \return the newly created property variable instance.
395
WPropColor addProperty( std::string name, std::string description, const WPVBaseTypes::PV_COLOR& initial, bool hide = false );
398
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
400
* \see WPropertyVariable
402
* \param name the property name
403
* \param description the property description
404
* \param initial the initial value
405
* \param hide set to true to set the hide flag directly.
407
* \return the newly created property variable instance.
409
WPropTrigger addProperty( std::string name, std::string description, const WPVBaseTypes::PV_TRIGGER& initial, bool hide = false );
411
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
412
// convenience methods for
413
// template< typename T>
414
// boost::shared_ptr< WPropertyVariable< T > > addProperty( std::string name, std::string description, const T& initial,
415
// boost::shared_ptr< WCondition > condition, bool hide = false );
416
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
419
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
421
* \see WPropertyVariable
423
* \param name the property name
424
* \param description the property description
425
* \param initial the initial value
426
* \param condition use this external condition for notification.
427
* \param hide set to true to set the hide flag directly.
429
* \return the newly created property variable instance.
431
WPropBool addProperty( std::string name, std::string description, const WPVBaseTypes::PV_BOOL& initial,
432
boost::shared_ptr< WCondition > condition, bool hide = false );
435
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
436
* It also sets the min and max constraint to [0,100].
438
* \see WPropertyVariable
440
* \param name the property name
441
* \param description the property description
442
* \param initial the initial value
443
* \param condition use this external condition for notification.
444
* \param hide set to true to set the hide flag directly.
446
* \return the newly created property variable instance.
448
WPropInt addProperty( std::string name, std::string description, const WPVBaseTypes::PV_INT& initial,
449
boost::shared_ptr< WCondition > condition, bool hide = false );
452
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
453
* It also sets the min and max constraint to [0,100].
455
* \see WPropertyVariable
457
* \param name the property name
458
* \param description the property description
459
* \param initial the initial value
460
* \param condition use this external condition for notification.
461
* \param hide set to true to set the hide flag directly.
463
* \return the newly created property variable instance.
465
WPropDouble addProperty( std::string name, std::string description, const WPVBaseTypes::PV_DOUBLE& initial,
466
boost::shared_ptr< WCondition > condition, bool hide = false );
469
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
471
* \see WPropertyVariable
473
* \param name the property name
474
* \param description the property description
475
* \param initial the initial value
476
* \param condition use this external condition for notification.
477
* \param hide set to true to set the hide flag directly.
479
* \return the newly created property variable instance.
481
WPropString addProperty( std::string name, std::string description, const WPVBaseTypes::PV_STRING& initial,
482
boost::shared_ptr< WCondition > condition, bool hide = false );
485
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
487
* \see WPropertyVariable
489
* \param name the property name
490
* \param description the property description
491
* \param initial the initial value
492
* \param condition use this external condition for notification.
493
* \param hide set to true to set the hide flag directly.
495
* \return the newly created property variable instance.
497
WPropFilename addProperty( std::string name, std::string description, const WPVBaseTypes::PV_PATH& initial,
498
boost::shared_ptr< WCondition > condition, bool hide = false );
501
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
503
* \see WPropertyVariable
505
* \param name the property name
506
* \param description the property description
507
* \param initial the initial value
508
* \param condition use this external condition for notification.
509
* \param hide set to true to set the hide flag directly.
511
* \return the newly created property variable instance.
513
WPropSelection addProperty( std::string name, std::string description, const WPVBaseTypes::PV_SELECTION& initial,
514
boost::shared_ptr< WCondition > condition, bool hide = false );
517
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
519
* \see WPropertyVariable
521
* \param name the property name
522
* \param description the property description
523
* \param initial the initial value
524
* \param condition use this external condition for notification.
525
* \param hide set to true to set the hide flag directly.
527
* \return the newly created property variable instance.
529
WPropPosition addProperty( std::string name, std::string description, const WPVBaseTypes::PV_POSITION& initial,
530
boost::shared_ptr< WCondition > condition, bool hide = false );
533
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
535
* \see WPropertyVariable
537
* \param name the property name
538
* \param description the property description
539
* \param initial the initial value
540
* \param condition use this external condition for notification.
541
* \param hide set to true to set the hide flag directly.
543
* \return the newly created property variable instance.
545
WPropColor addProperty( std::string name, std::string description, const WPVBaseTypes::PV_COLOR& initial,
546
boost::shared_ptr< WCondition > condition, bool hide = false );
549
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
551
* \see WPropertyVariable
553
* \param name the property name
554
* \param description the property description
555
* \param initial the initial value
556
* \param condition use this external condition for notification.
557
* \param hide set to true to set the hide flag directly.
559
* \return the newly created property variable instance.
561
WPropTrigger addProperty( std::string name, std::string description, const WPVBaseTypes::PV_TRIGGER& initial,
562
boost::shared_ptr< WCondition > condition, bool hide = false );
564
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
565
// convenience methods for
566
// template< typename T>
567
// boost::shared_ptr< WPropertyVariable< T > > addProperty( std::string name, std::string description, const T& initial,
568
// WPropertyBase::PropertyChangeNotifierType notifier, bool hide = false );
569
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
572
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
574
* \see WPropertyVariable
576
* \param name the property name
577
* \param description the property description
578
* \param initial the initial value
579
* \param notifier use this notifier for change callbacks.
580
* \param hide set to true to set the hide flag directly.
582
* \return the newly created property variable instance.
584
WPropBool addProperty( std::string name, std::string description, const WPVBaseTypes::PV_BOOL& initial,
585
WPropertyBase::PropertyChangeNotifierType notifier, bool hide = false );
588
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
589
* It also sets the min and max constraint to [0,100].
591
* \see WPropertyVariable
593
* \param name the property name
594
* \param description the property description
595
* \param initial the initial value
596
* \param notifier use this notifier for change callbacks.
597
* \param hide set to true to set the hide flag directly.
599
* \return the newly created property variable instance.
601
WPropInt addProperty( std::string name, std::string description, const WPVBaseTypes::PV_INT& initial,
602
WPropertyBase::PropertyChangeNotifierType notifier, bool hide = false );
605
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
606
* It also sets the min and max constraint to [0,100].
608
* \see WPropertyVariable
610
* \param name the property name
611
* \param description the property description
612
* \param initial the initial value
613
* \param notifier use this notifier for change callbacks.
614
* \param hide set to true to set the hide flag directly.
616
* \return the newly created property variable instance.
618
WPropDouble addProperty( std::string name, std::string description, const WPVBaseTypes::PV_DOUBLE& initial,
619
WPropertyBase::PropertyChangeNotifierType notifier, bool hide = false );
622
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
624
* \see WPropertyVariable
626
* \param name the property name
627
* \param description the property description
628
* \param initial the initial value
629
* \param notifier use this notifier for change callbacks.
630
* \param hide set to true to set the hide flag directly.
632
* \return the newly created property variable instance.
634
WPropString addProperty( std::string name, std::string description, const WPVBaseTypes::PV_STRING& initial,
635
WPropertyBase::PropertyChangeNotifierType notifier, bool hide = false );
638
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
640
* \see WPropertyVariable
642
* \param name the property name
643
* \param description the property description
644
* \param initial the initial value
645
* \param notifier use this notifier for change callbacks.
646
* \param hide set to true to set the hide flag directly.
648
* \return the newly created property variable instance.
650
WPropFilename addProperty( std::string name, std::string description, const WPVBaseTypes::PV_PATH& initial,
651
WPropertyBase::PropertyChangeNotifierType notifier, bool hide = false );
654
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
656
* \see WPropertyVariable
658
* \param name the property name
659
* \param description the property description
660
* \param initial the initial value
661
* \param notifier use this notifier for change callbacks.
662
* \param hide set to true to set the hide flag directly.
664
* \return the newly created property variable instance.
666
WPropSelection addProperty( std::string name, std::string description, const WPVBaseTypes::PV_SELECTION& initial,
667
WPropertyBase::PropertyChangeNotifierType notifier, bool hide = false );
670
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
672
* \see WPropertyVariable
674
* \param name the property name
675
* \param description the property description
676
* \param initial the initial value
677
* \param notifier use this notifier for change callbacks.
678
* \param hide set to true to set the hide flag directly.
680
* \return the newly created property variable instance.
682
WPropPosition addProperty( std::string name, std::string description, const WPVBaseTypes::PV_POSITION& initial,
683
WPropertyBase::PropertyChangeNotifierType notifier, bool hide = false );
686
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
688
* \see WPropertyVariable
690
* \param name the property name
691
* \param description the property description
692
* \param initial the initial value
693
* \param notifier use this notifier for change callbacks.
694
* \param hide set to true to set the hide flag directly.
696
* \return the newly created property variable instance.
698
WPropColor addProperty( std::string name, std::string description, const WPVBaseTypes::PV_COLOR& initial,
699
WPropertyBase::PropertyChangeNotifierType notifier, bool hide = false );
702
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
704
* \see WPropertyVariable
706
* \param name the property name
707
* \param description the property description
708
* \param initial the initial value
709
* \param notifier use this notifier for change callbacks.
710
* \param hide set to true to set the hide flag directly.
712
* \return the newly created property variable instance.
714
WPropTrigger addProperty( std::string name, std::string description, const WPVBaseTypes::PV_TRIGGER& initial,
715
WPropertyBase::PropertyChangeNotifierType notifier, bool hide = false );
717
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
718
// convenience methods for
719
// template< typename T>
720
// boost::shared_ptr< WPropertyVariable< T > > addProperty( std::string name, std::string description, const T& initial,
721
// boost::shared_ptr< WCondition > condition,
722
// WPropertyBase::PropertyChangeNotifierType notifier, bool hide = false );
723
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
726
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
728
* \see WPropertyVariable
730
* \param name the property name
731
* \param description the property description
732
* \param initial the initial value
733
* \param notifier use this notifier for change callbacks.
734
* \param condition use this external condition for notification
735
* \param hide set to true to set the hide flag directly.
737
* \return the newly created property variable instance.
739
WPropBool addProperty( std::string name, std::string description, const WPVBaseTypes::PV_BOOL& initial,
740
boost::shared_ptr< WCondition > condition,
741
WPropertyBase::PropertyChangeNotifierType notifier, bool hide = false );
744
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
745
* It also sets the min and max constraint to [0,100].
747
* \see WPropertyVariable
749
* \param name the property name
750
* \param description the property description
751
* \param initial the initial value
752
* \param notifier use this notifier for change callbacks.
753
* \param condition use this external condition for notification
754
* \param hide set to true to set the hide flag directly.
756
* \return the newly created property variable instance.
758
WPropInt addProperty( std::string name, std::string description, const WPVBaseTypes::PV_INT& initial,
759
boost::shared_ptr< WCondition > condition,
760
WPropertyBase::PropertyChangeNotifierType notifier, bool hide = false );
763
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
764
* It also sets the min and max constraint to [0,100].
766
* \see WPropertyVariable
768
* \param name the property name
769
* \param description the property description
770
* \param initial the initial value
771
* \param notifier use this notifier for change callbacks.
772
* \param condition use this external condition for notification
773
* \param hide set to true to set the hide flag directly.
775
* \return the newly created property variable instance.
777
WPropDouble addProperty( std::string name, std::string description, const WPVBaseTypes::PV_DOUBLE& initial,
778
boost::shared_ptr< WCondition > condition,
779
WPropertyBase::PropertyChangeNotifierType notifier, bool hide = false );
783
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
785
* \see WPropertyVariable
787
* \param name the property name
788
* \param description the property description
789
* \param initial the initial value
790
* \param notifier use this notifier for change callbacks.
791
* \param condition use this external condition for notification
792
* \param hide set to true to set the hide flag directly.
794
* \return the newly created property variable instance.
796
WPropString addProperty( std::string name, std::string description, const WPVBaseTypes::PV_STRING& initial,
797
boost::shared_ptr< WCondition > condition,
798
WPropertyBase::PropertyChangeNotifierType notifier, bool hide = false );
801
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
803
* \see WPropertyVariable
805
* \param name the property name
806
* \param description the property description
807
* \param initial the initial value
808
* \param notifier use this notifier for change callbacks.
809
* \param condition use this external condition for notification
810
* \param hide set to true to set the hide flag directly.
812
* \return the newly created property variable instance.
814
WPropFilename addProperty( std::string name, std::string description, const WPVBaseTypes::PV_PATH& initial,
815
boost::shared_ptr< WCondition > condition,
816
WPropertyBase::PropertyChangeNotifierType notifier, bool hide = false );
819
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
821
* \see WPropertyVariable
823
* \param name the property name
824
* \param description the property description
825
* \param initial the initial value
826
* \param notifier use this notifier for change callbacks.
827
* \param condition use this external condition for notification
828
* \param hide set to true to set the hide flag directly.
830
* \return the newly created property variable instance.
832
WPropSelection addProperty( std::string name, std::string description, const WPVBaseTypes::PV_SELECTION& initial,
833
boost::shared_ptr< WCondition > condition,
834
WPropertyBase::PropertyChangeNotifierType notifier, bool hide = false );
837
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
839
* \see WPropertyVariable
841
* \param name the property name
842
* \param description the property description
843
* \param initial the initial value
844
* \param notifier use this notifier for change callbacks.
845
* \param condition use this external condition for notification
846
* \param hide set to true to set the hide flag directly.
848
* \return the newly created property variable instance.
850
WPropPosition addProperty( std::string name, std::string description, const WPVBaseTypes::PV_POSITION& initial,
851
boost::shared_ptr< WCondition > condition,
852
WPropertyBase::PropertyChangeNotifierType notifier, bool hide = false );
855
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
857
* \see WPropertyVariable
859
* \param name the property name
860
* \param description the property description
861
* \param initial the initial value
862
* \param notifier use this notifier for change callbacks.
863
* \param condition use this external condition for notification
864
* \param hide set to true to set the hide flag directly.
866
* \return the newly created property variable instance.
868
WPropColor addProperty( std::string name, std::string description, const WPVBaseTypes::PV_COLOR& initial,
869
boost::shared_ptr< WCondition > condition,
870
WPropertyBase::PropertyChangeNotifierType notifier, bool hide = false );
873
* Create and add a new property of the template type. For more details see appropriate constructor ow WPropertyVariable.
875
* \see WPropertyVariable
877
* \param name the property name
878
* \param description the property description
879
* \param initial the initial value
880
* \param notifier use this notifier for change callbacks.
881
* \param condition use this external condition for notification
882
* \param hide set to true to set the hide flag directly.
884
* \return the newly created property variable instance.
886
WPropTrigger addProperty( std::string name, std::string description, const WPVBaseTypes::PV_TRIGGER& initial,
887
boost::shared_ptr< WCondition > condition,
888
WPropertyBase::PropertyChangeNotifierType notifier, bool hide = false );
894
template< typename PropType >
895
PropType WPropertyGroup::addProperty( PropType prop )
897
addArbitraryProperty( prop );
901
template< typename T>
902
boost::shared_ptr< WPropertyVariable< T > > WPropertyGroup::addProperty( std::string name, std::string description, const T& initial, bool hide )
904
boost::shared_ptr< WPropertyVariable< T > > p = boost::shared_ptr< WPropertyVariable< T > >(
905
new WPropertyVariable< T >( name, description, initial )
907
p->setHidden( hide );
912
template< typename T>
913
boost::shared_ptr< WPropertyVariable< T > > WPropertyGroup::addProperty( std::string name, std::string description, const T& initial,
914
boost::shared_ptr< WCondition > condition, bool hide )
916
boost::shared_ptr< WPropertyVariable< T > > p = boost::shared_ptr< WPropertyVariable< T > >(
917
new WPropertyVariable< T >( name, description, initial, condition )
919
p->setHidden( hide );
924
template< typename T>
925
boost::shared_ptr< WPropertyVariable< T > > WPropertyGroup::addProperty( std::string name, std::string description, const T& initial,
926
WPropertyBase::PropertyChangeNotifierType notifier, bool hide )
928
boost::shared_ptr< WPropertyVariable< T > > p = boost::shared_ptr< WPropertyVariable< T > >(
929
new WPropertyVariable< T >( name, description, initial, notifier )
931
p->setHidden( hide );
936
template< typename T>
937
boost::shared_ptr< WPropertyVariable< T > > WPropertyGroup::addProperty( std::string name, std::string description, const T& initial,
938
boost::shared_ptr< WCondition > condition,
939
WPropertyBase::PropertyChangeNotifierType notifier, bool hide )
941
boost::shared_ptr< WPropertyVariable< T > > p = boost::shared_ptr< WPropertyVariable< T > >(
942
new WPropertyVariable< T >( name, description, initial, condition, notifier )
944
p->setHidden( hide );
949
#endif // WPROPERTYGROUP_H