]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/BaseObjects/Parameters.h
...
[cpPlugins.git] / lib / cpPlugins / BaseObjects / Parameters.h
index 338c8afe44f3842bf81f42acff93e3628ea25425..fd6764bb55fd823a20305efcb3dab26fe0f9f6c6 100644 (file)
@@ -17,13 +17,18 @@ namespace tinyxml2
 }
 
 // -------------------------------------------------------------------------
-#define cpPlugins_BaseObjects_Parameters_Configure( Y )         \
-  void ConfigureAs##Y( const std::string& name );               \
+#define cpPlugins_BaseObjects_Parameters_Configure( Y )                 \
+  void ConfigureAs##Y( const std::string& name, const T##Y& init );     \
   bool Has##Y( const std::string& name ) const
 
 // -------------------------------------------------------------------------
-#define cpPlugins_BaseObjects_Parameters_GetSet( Y )            \
-  T##Y Get##Y( const std::string& name ) const;                 \
+#define cpPlugins_BaseObjects_Parameters_ConfigureList( Y )             \
+  void ConfigureAs##Y##List( const std::string& name );                 \
+  bool Has##Y##List( const std::string& name ) const
+
+// -------------------------------------------------------------------------
+#define cpPlugins_BaseObjects_Parameters_GetSet( Y )    \
+  T##Y Get##Y( const std::string& name ) const;         \
   void Set##Y( const std::string& name, const T##Y& v )
 
 // -------------------------------------------------------------------------
@@ -46,18 +51,18 @@ namespace cpPlugins
       // Frienship with forward declaration to improve Qt dialog execution
       friend class cpPlugins::QT::ParametersDialog;
       friend std::ostream& operator<<( std::ostream& o, const Parameters& p )
-      {
-        for(
-          auto i = p.m_Parameters.begin( );
-          i != p.m_Parameters.end( );
-          ++i
-          )
-          o << i->first << ": ("
-            << i->second.first << " | "
-            << i->second.second << ")"
-            << std::endl;
-        return( o );
-      }
+        {
+          for(
+            auto i = p.m_Parameters.begin( );
+            i != p.m_Parameters.end( );
+            ++i
+            )
+            o << i->first << ": ("
+              << i->second.first << " | "
+              << i->second.second << ")"
+              << std::endl;
+          return( o );
+        }
 
     public:
       typedef Parameters Self;
@@ -93,15 +98,15 @@ namespace cpPlugins
       cpPlugins_BaseObjects_Parameters_Configure( OpenFileName );
       cpPlugins_BaseObjects_Parameters_Configure( SaveFileName );
       cpPlugins_BaseObjects_Parameters_Configure( PathName );
-      cpPlugins_BaseObjects_Parameters_Configure( StringList );
-      cpPlugins_BaseObjects_Parameters_Configure( BoolList );
-      cpPlugins_BaseObjects_Parameters_Configure( IntList );
-      cpPlugins_BaseObjects_Parameters_Configure( UintList );
-      cpPlugins_BaseObjects_Parameters_Configure( RealList );
-      cpPlugins_BaseObjects_Parameters_Configure( OpenFileNameList );
-      cpPlugins_BaseObjects_Parameters_Configure( SaveFileNameList );
-      cpPlugins_BaseObjects_Parameters_Configure( PathNameList );
-      cpPlugins_BaseObjects_Parameters_Configure( Choices );
+
+      cpPlugins_BaseObjects_Parameters_ConfigureList( String );
+      cpPlugins_BaseObjects_Parameters_ConfigureList( Bool );
+      cpPlugins_BaseObjects_Parameters_ConfigureList( Int );
+      cpPlugins_BaseObjects_Parameters_ConfigureList( Uint );
+      cpPlugins_BaseObjects_Parameters_ConfigureList( Real );
+      cpPlugins_BaseObjects_Parameters_ConfigureList( OpenFileName );
+      cpPlugins_BaseObjects_Parameters_ConfigureList( SaveFileName );
+      cpPlugins_BaseObjects_Parameters_ConfigureList( PathName );
 
       cpPlugins_BaseObjects_Parameters_GetSet( Bool );
       cpPlugins_BaseObjects_Parameters_GetSet( Int );
@@ -170,25 +175,25 @@ namespace cpPlugins
       const TParameters& GetRawParameters( ) const;
 
       template< unsigned int _Enum >
-        inline void _Configure( const std::string& name );
+      inline void _Configure( const std::string& name );
 
       template< unsigned int _Enum >
-        inline bool _Has( const std::string& name ) const;
+      inline bool _Has( const std::string& name ) const;
 
       template< class _Type, unsigned int _Enum >
-        inline _Type _Get( const std::string& name ) const;
+      inline _Type _Get( const std::string& name ) const;
 
       template< class _Type, unsigned int _Enum >
-        inline void _Set( const std::string& name, const _Type& v );
+      inline void _Set( const std::string& name, const _Type& v );
 
       template< class _Type, unsigned int _Enum >
-        inline std::vector< _Type > _GetList( const std::string& name ) const;
+      inline std::vector< _Type > _GetList( const std::string& name ) const;
 
       template< class _Type, unsigned int _Enum >
-        inline void _AddToList( const std::string& name, const _Type& v );
+      inline void _AddToList( const std::string& name, const _Type& v );
 
       template< unsigned int _Enum >
-        inline void _ClearList( const std::string& name );
+      inline void _ClearList( const std::string& name );
 
     private:
       // Purposely not implemented