X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FInterface%2FParameters.h;h=dbcf98c68a16c4c62073e95f19026f745dff582f;hb=6df7b3a0946edcecfe55509d0b77d757d76a35ab;hp=9ad706ec36572a2b6a37344703dcd846b3130135;hpb=e286ff49ea3582a5f4fad437dd133ec6c05c34dc;p=cpPlugins.git diff --git a/lib/cpPlugins/Interface/Parameters.h b/lib/cpPlugins/Interface/Parameters.h index 9ad706e..dbcf98c 100644 --- a/lib/cpPlugins/Interface/Parameters.h +++ b/lib/cpPlugins/Interface/Parameters.h @@ -4,6 +4,7 @@ #include #include #include +#include namespace cpPlugins { @@ -11,7 +12,7 @@ namespace cpPlugins { /** */ - class Parameters + class cpPlugins_Interface_EXPORT Parameters { public: typedef Parameters Self; @@ -19,12 +20,14 @@ namespace cpPlugins enum Type { String = 0, + Bool, Int, Uint, Real, Index, Point, StringList, + BoolList, IntList, UintList, RealList, @@ -33,6 +36,7 @@ namespace cpPlugins NoType }; + typedef bool TBool; typedef long TInt; typedef unsigned long TUint; typedef double TReal; @@ -51,45 +55,34 @@ namespace cpPlugins void Clear( ); void Configure( const Self::Type& type, const TString& name ); void SetValueAsString( const TString& name, const TString& v ); + void SetValueAsBool( const TString& name, const TBool& v ); void SetValueAsInt( const TString& name, const TInt& v ); void SetValueAsUint( const TString& name, const TUint& v ); void SetValueAsReal( const TString& name, const TReal& v ); void SetValueAsIndex( const TString& name, const TUint& n, ... ); void SetValueAsPoint( const TString& name, const TUint& n, ... ); - template< class I > - void SetValueAsStringList( - const TString& name, const I& b, const I& e - ); - - template< class I > - void SetValueAsIntList( - const TString& name, const I& b, const I& e - ); - - template< class I > - void SetValueAsUintList( - const TString& name, const I& b, const I& e - ); - - template< class I > - void SetValueAsRealList( - const TString& name, const I& b, const I& e - ); - - template< class I > - void SetValueAsIndexList( - const TString& name, const I& b, const I& e - ); - - template< class I > - void SetValueAsPointList( - const TString& name, const I& b, const I& e - ); - + void AddValueToStringList( const TString& name, const TString& v ); + void AddValueToBoolList( const TString& name, const TBool& v ); + void AddValueToIntList( const TString& name, const TInt& v ); + void AddValueToUintList( const TString& name, const TUint& v ); + void AddValueToRealList( const TString& name, const TReal& v ); + void AddValueToIndexList( const TString& name, const TUint& n, ... ); + void AddValueToPointList( const TString& name, const TUint& n, ... ); + + void ClearStringList( const TString& name ); + void ClearBoolList( const TString& name ); + void ClearIntList( const TString& name ); + void ClearUintList( const TString& name ); + void ClearRealList( const TString& name ); + void ClearIndexList( const TString& name ); + void ClearPointList( const TString& name ); + std::vector< TString > GetParameters( ) const; Self::Type GetParameterType( const TString& name ) const; + const TString& GetRawValue( const TString& name ) const; const TString& GetValueAsString( const TString& name ) const; + TBool GetValueAsBool( const TString& name ) const; TInt GetValueAsInt( const TString& name ) const; TUint GetValueAsUint( const TString& name ) const; TReal GetValueAsReal( const TString& name ) const; @@ -103,6 +96,9 @@ namespace cpPlugins void GetValueAsStringList( std::vector< TString >& lst, const TString& name ) const; + void GetValueAsBoolList( + std::vector< TBool >& lst, const TString& name + ) const; void GetValueAsIntList( std::vector< TInt >& lst, const TString& name ) const; @@ -123,6 +119,20 @@ namespace cpPlugins std::vector< P >& lst, const TString& name ) const; + bool HasStringValue( const TString& name ) const; + bool HasBoolValue( const TString& name ) const; + bool HasIntValue( const TString& name ) const; + bool HasUintValue( const TString& name ) const; + bool HasRealValue( const TString& name ) const; + bool HasIndexValue( const TString& name ) const; + bool HasPointValue( const TString& name ) const; + bool HasStringListValue( const TString& name ) const; + bool HasBoolListValue( const TString& name ) const; + bool HasIntListValue( const TString& name ) const; + bool HasUintListValue( const TString& name ) const; + bool HasRealListValue( const TString& name ) const; + bool HasIndexListValue( const TString& name ) const; + bool HasPointListValue( const TString& name ) const; protected: TParameters m_Parameters;