32 #include <boost/thread/thread.hpp>
33 #include <boost/thread/mutex.hpp>
34 #include <boost/thread/locks.hpp>
35 #include <boost/thread.hpp>
37 #include "WConditionSet.h"
38 #include "WPropertyBase.h"
39 #include "WPropertyTypes.h"
40 #include "WPropertyVariable.h"
41 #include "WSharedSequenceContainer.h"
42 #include "exceptions/WPropertyNotUnique.h"
44 #include "WExportCommon.h"
59 typedef boost::shared_ptr< WProperties >
SPtr;
60 typedef boost::shared_ptr< const WProperties >
ConstSPtr;
94 WProperties( std::string name =
"unnamed group", std::string description =
"an unnamed group of properties" );
123 virtual boost::shared_ptr< WPropertyBase >
clone();
132 template<
typename PropType >
133 PropType addProperty( PropType prop );
140 void removeProperty( boost::shared_ptr< WPropertyBase > prop );
150 bool existsProperty( std::string name );
159 boost::shared_ptr< WPropertyBase > getProperty( std::string name );
183 boost::shared_ptr< WPropertyBase > findProperty( std::string name )
const;
188 virtual void clear();
203 WPropGroup addPropertyGroup( std::string name, std::string description,
bool hide =
false );
217 template<
typename T>
218 boost::shared_ptr< WPropertyVariable< T > > addProperty( std::string name, std::string description,
const T& initial,
bool hide =
false );
233 template<
typename T>
234 boost::shared_ptr< WPropertyVariable< T > > addProperty( std::string name, std::string description,
const T& initial,
235 boost::shared_ptr< WCondition > condition,
bool hide =
false );
250 template<
typename T>
251 boost::shared_ptr< WPropertyVariable< T > > addProperty( std::string name, std::string description,
const T& initial,
268 template<
typename T>
269 boost::shared_ptr< WPropertyVariable< T > > addProperty( std::string name, std::string description,
const T& initial,
270 boost::shared_ptr< WCondition > condition,
278 virtual PROPERTY_TYPE
getType()
const;
307 virtual bool set( boost::shared_ptr< WPropertyBase > value );
334 WPropBool addProperty( std::string name, std::string description,
const WPVBaseTypes::PV_BOOL& initial,
bool hide =
false );
349 WPropInt addProperty( std::string name, std::string description,
const WPVBaseTypes::PV_INT& initial,
bool hide =
false );
364 WPropDouble addProperty( std::string name, std::string description,
const WPVBaseTypes::PV_DOUBLE& initial,
bool hide =
false );
378 WPropString addProperty( std::string name, std::string description,
const WPVBaseTypes::PV_STRING& initial,
bool hide =
false );
392 WPropFilename addProperty( std::string name, std::string description,
const WPVBaseTypes::PV_PATH& initial,
bool hide =
false );
406 WPropSelection addProperty( std::string name, std::string description,
const WPVBaseTypes::PV_SELECTION& initial,
bool hide =
false );
420 WPropPosition addProperty( std::string name, std::string description,
const WPVBaseTypes::PV_POSITION& initial,
bool hide =
false );
434 WPropColor addProperty( std::string name, std::string description,
const WPVBaseTypes::PV_COLOR& initial,
bool hide =
false );
448 WPropTrigger addProperty( std::string name, std::string description,
const WPVBaseTypes::PV_TRIGGER& initial,
bool hide =
false );
470 WPropBool addProperty( std::string name, std::string description,
const WPVBaseTypes::PV_BOOL& initial,
471 boost::shared_ptr< WCondition > condition,
bool hide =
false );
487 WPropInt addProperty( std::string name, std::string description,
const WPVBaseTypes::PV_INT& initial,
488 boost::shared_ptr< WCondition > condition,
bool hide =
false );
505 boost::shared_ptr< WCondition > condition,
bool hide =
false );
521 boost::shared_ptr< WCondition > condition,
bool hide =
false );
536 WPropFilename addProperty( std::string name, std::string description,
const WPVBaseTypes::PV_PATH& initial,
537 boost::shared_ptr< WCondition > condition,
bool hide =
false );
553 boost::shared_ptr< WCondition > condition,
bool hide =
false );
569 boost::shared_ptr< WCondition > condition,
bool hide =
false );
585 boost::shared_ptr< WCondition > condition,
bool hide =
false );
601 boost::shared_ptr< WCondition > condition,
bool hide =
false );
623 WPropBool addProperty( std::string name, std::string description,
const WPVBaseTypes::PV_BOOL& initial,
640 WPropInt addProperty( std::string name, std::string description,
const WPVBaseTypes::PV_INT& initial,
689 WPropFilename addProperty( std::string name, std::string description,
const WPVBaseTypes::PV_PATH& initial,
778 WPropBool addProperty( std::string name, std::string description,
const WPVBaseTypes::PV_BOOL& initial,
779 boost::shared_ptr< WCondition > condition,
797 WPropInt addProperty( std::string name, std::string description,
const WPVBaseTypes::PV_INT& initial,
798 boost::shared_ptr< WCondition > condition,
817 boost::shared_ptr< WCondition > condition,
836 boost::shared_ptr< WCondition > condition,
853 WPropFilename addProperty( std::string name, std::string description,
const WPVBaseTypes::PV_PATH& initial,
854 boost::shared_ptr< WCondition > condition,
872 boost::shared_ptr< WCondition > condition,
890 boost::shared_ptr< WCondition > condition,
908 boost::shared_ptr< WCondition > condition,
926 boost::shared_ptr< WCondition > condition,
934 virtual boost::shared_ptr< WCondition > getChildUpdateCondition()
const;
947 boost::shared_ptr< WPropertyBase > findProperty(
const WProperties*
const props, std::string name )
const;
972 bool propNamePredicate( boost::shared_ptr< WPropertyBase > prop1, boost::shared_ptr< WPropertyBase > prop2 )
const;
975 template<
typename PropType >
984 if( std::count_if( l->get().begin(), l->get().end(),
993 throw WPropertyNotUnique( std::string(
"Property \"" + prop->getName() +
"\" is not unique in this group (\"" +
getName() +
"\")." ) );
997 throw WPropertyNotUnique( std::string(
"Property \"" + prop->getName() +
"\" is not unique in this group (unnamed root)." ) );
1004 prop->setPurpose( PV_PURPOSE_INFORMATION );
1008 l->get().push_back( prop );
1016 template<
typename T>
1017 boost::shared_ptr< WPropertyVariable< T > >
WProperties::addProperty( std::string name, std::string description,
const T& initial,
bool hide )
1019 boost::shared_ptr< WPropertyVariable< T > > p = boost::shared_ptr< WPropertyVariable< T > >(
1022 p->setHidden( hide );
1027 template<
typename T>
1029 boost::shared_ptr< WCondition > condition,
bool hide )
1031 boost::shared_ptr< WPropertyVariable< T > > p = boost::shared_ptr< WPropertyVariable< T > >(
1034 p->setHidden( hide );
1039 template<
typename T>
1043 boost::shared_ptr< WPropertyVariable< T > > p = boost::shared_ptr< WPropertyVariable< T > >(
1046 p->setHidden( hide );
1051 template<
typename T>
1053 boost::shared_ptr< WCondition > condition,
1056 boost::shared_ptr< WPropertyVariable< T > > p = boost::shared_ptr< WPropertyVariable< T > >(
1059 p->setHidden( hide );
1064 #endif // WPROPERTIES_H