#include <cpPlugins/Interface/Parameters.h>
-#include <cstdarg>
-#include <cstdlib>
-#include <sstream>
+#include <cpPlugins/Interface/ProcessObject.h>
+#include <third_party/tinyxml/tinyxml.h>
// -------------------------------------------------------------------------
-#define cpPlugins_Interface_Parameters_SetMacro( TYPE ) \
- void cpPlugins::Interface::Parameters:: \
- SetValueAs##TYPE( const TString& name, const T##TYPE& v ) \
- { \
- TParameters::iterator pIt = this->m_Parameters.find( name ); \
- if( pIt == this->m_Parameters.end( ) ) \
- return; \
- if( pIt->second.first != Self::TYPE ) \
- return; \
- std::stringstream ss; \
- ss << v; \
- pIt->second.second = ss.str( ); \
- }
-
-cpPlugins_Interface_Parameters_SetMacro( String );
-cpPlugins_Interface_Parameters_SetMacro( Bool );
-cpPlugins_Interface_Parameters_SetMacro( Int );
-cpPlugins_Interface_Parameters_SetMacro( Uint );
-cpPlugins_Interface_Parameters_SetMacro( Real );
-
-// -------------------------------------------------------------------------
-#define cpPlugins_Interface_Parameters_SetArrayMacro( TYPE, ATYPE ) \
- void cpPlugins::Interface::Parameters:: \
- SetValueAs##TYPE( const TString& name, const TUint& n, ... ) \
- { \
- TParameters::iterator pIt = this->m_Parameters.find( name ); \
- if( pIt == this->m_Parameters.end( ) ) \
- return; \
- if( pIt->second.first != Self::TYPE ) \
- return; \
- va_list v_lst; \
- va_start( v_lst, n ); \
- std::stringstream ss; \
- for( TUint i = 0; i < n; ++i ) \
- ss << va_arg( v_lst, ATYPE ) << ","; \
- va_end( v_lst ); \
- pIt->second.second = ss.str( ); \
- }
-
-cpPlugins_Interface_Parameters_SetArrayMacro( Index, int );
-cpPlugins_Interface_Parameters_SetArrayMacro( Point, double );
-
-// -------------------------------------------------------------------------
-#define cpPlugins_Interface_Parameters_SetListMacro( TYPE ) \
- void cpPlugins::Interface::Parameters:: \
- AddValueTo##TYPE##List( const TString& name, const T##TYPE& v ) \
- { \
- TParameters::iterator pIt = this->m_Parameters.find( name ); \
- if( pIt == this->m_Parameters.end( ) ) \
- return; \
- if( pIt->second.first != Self::TYPE##List ) \
- return; \
- std::stringstream ss; \
- ss << pIt->second.second << v << "#"; \
- pIt->second.second = ss.str( ); \
- }
-
-cpPlugins_Interface_Parameters_SetListMacro( String );
-cpPlugins_Interface_Parameters_SetListMacro( Bool );
-cpPlugins_Interface_Parameters_SetListMacro( Int );
-cpPlugins_Interface_Parameters_SetListMacro( Uint );
-cpPlugins_Interface_Parameters_SetListMacro( Real );
-
-// -------------------------------------------------------------------------
-#define cpPlugins_Interface_Parameters_SetArrayListMacro( TYPE, ATYPE ) \
- void cpPlugins::Interface::Parameters:: \
- AddValueTo##TYPE##List( const TString& name, const TUint& n, ... ) \
- { \
- TParameters::iterator pIt = this->m_Parameters.find( name ); \
- if( pIt == this->m_Parameters.end( ) ) \
- return; \
- if( pIt->second.first != Self::TYPE##List ) \
- return; \
- va_list v_lst; \
- va_start( v_lst, n ); \
- std::stringstream ss; \
- ss << pIt->second.second; \
- for( TUint i = 0; i < n; ++i ) \
- ss << va_arg( v_lst, ATYPE ) << ","; \
- va_end( v_lst ); \
- ss << "#"; \
- pIt->second.second = ss.str( ); \
- }
-
-cpPlugins_Interface_Parameters_SetArrayListMacro( Index, int );
-cpPlugins_Interface_Parameters_SetArrayListMacro( Point, double );
-
-// -------------------------------------------------------------------------
-#define cpPlugins_Interface_Parameters_ClearListMacro( TYPE ) \
- void cpPlugins::Interface::Parameters:: \
- Clear##TYPE##List( const TString& name ) \
- { \
- TParameters::iterator pIt = this->m_Parameters.find( name ); \
- if( pIt == this->m_Parameters.end( ) ) \
- return; \
- if( pIt->second.first != Self::TYPE##List ) \
- return; \
- pIt->second.second = ""; \
- }
-
-cpPlugins_Interface_Parameters_ClearListMacro( String );
-cpPlugins_Interface_Parameters_ClearListMacro( Bool );
-cpPlugins_Interface_Parameters_ClearListMacro( Int );
-cpPlugins_Interface_Parameters_ClearListMacro( Uint );
-cpPlugins_Interface_Parameters_ClearListMacro( Real );
-cpPlugins_Interface_Parameters_ClearListMacro( Index );
-cpPlugins_Interface_Parameters_ClearListMacro( Point );
-
-// -------------------------------------------------------------------------
-cpPlugins::Interface::Parameters::
-Parameters( )
+cpPlugins::Interface::
+ProcessObject* cpPlugins::Interface::Parameters::
+GetProcessObject( )
{
- this->Clear( );
+ return( this->m_Process );
}
// -------------------------------------------------------------------------
-cpPlugins::Interface::Parameters::
-Parameters( const Self& other )
+const cpPlugins::Interface::
+ProcessObject* cpPlugins::Interface::Parameters::
+GetProcessObject( ) const
{
- this->m_Parameters = other.m_Parameters;
+ return( this->m_Process );
}
// -------------------------------------------------------------------------
-cpPlugins::Interface::Parameters::
-~Parameters( )
+void cpPlugins::Interface::Parameters::
+SetProcessObject( ProcessObject* v )
{
- this->Clear( );
+ if( this->m_Process != v )
+ {
+ this->m_Process = v;
+ this->Modified( );
+
+ } // fi
}
// -------------------------------------------------------------------------
-cpPlugins::Interface::Parameters::
-Self& cpPlugins::Interface::Parameters::
-operator=( const Self& other )
+void cpPlugins::Interface::Parameters::
+Modified( ) const
{
- this->m_Parameters = other.m_Parameters;
- return( *this );
+ this->Superclass::Modified( );
+ if( this->m_Process != NULL )
+ this->m_Process->Modified( );
}
// -------------------------------------------------------------------------
Clear( )
{
this->m_Parameters.clear( );
+ this->Modified( );
}
// -------------------------------------------------------------------------
void cpPlugins::Interface::Parameters::
-Configure( const Self::Type& type, const TString& name )
+GetNames( std::vector< std::string >& container ) const
{
- this->m_Parameters[ name ] = TParameter( type, "" );
-}
-
-// -------------------------------------------------------------------------
-std::vector< cpPlugins::Interface::Parameters::TString >
-cpPlugins::Interface::Parameters::
-GetParameters( ) const
-{
- std::vector< TString > parameters;
- TParameters::const_iterator pIt = this->m_Parameters.begin( );
- for( ; pIt != this->m_Parameters.end( ); ++pIt )
- parameters.push_back( pIt->first );
- return( parameters );
+ container.clear( );
+ TParameters::const_iterator i = this->m_Parameters.begin( );
+ for( ; i != this->m_Parameters.end( ); ++i )
+ container.push_back( i->first );
}
// -------------------------------------------------------------------------
cpPlugins::Interface::Parameters::
Type cpPlugins::Interface::Parameters::
-GetParameterType( const TString& name ) const
+GetType( const std::string& name ) const
{
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt == this->m_Parameters.end( ) )
+ auto i = this->m_Parameters.find( name );
+ if( i != this->m_Parameters.end( ) )
+ return( i->second.first );
+ else
return( Self::NoType );
- return( pIt->second.first );
-}
-
-// -------------------------------------------------------------------------
-const cpPlugins::Interface::Parameters::
-TString& cpPlugins::Interface::Parameters::
-GetRawValue( const TString& name ) const
-{
- static const TString null_str = "";
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt == this->m_Parameters.end( ) )
- return( null_str );
- return( pIt->second.second );
-}
-
-// -------------------------------------------------------------------------
-const cpPlugins::Interface::Parameters::
-TString& cpPlugins::Interface::Parameters::
-GetValueAsString( const TString& name ) const
-{
- static const TString null_str = "";
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt == this->m_Parameters.end( ) )
- return( null_str );
- if( pIt->second.first != Self::String )
- return( null_str );
-
- return( pIt->second.second );
}
// -------------------------------------------------------------------------
-cpPlugins::Interface::Parameters::
-TBool cpPlugins::Interface::Parameters::
-GetValueAsBool( const TString& name ) const
-{
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt == this->m_Parameters.end( ) )
- return( TBool( false ) );
- if( pIt->second.first != Self::Bool )
- return( TBool( false ) );
- return( TBool( std::atoi( pIt->second.second.c_str( ) ) == 1 ) );
-}
+#define cpPlugins_Parameters_TypeAsString( Y ) \
+ if( i->second.first == Self::Y ) \
+ return( #Y )
-// -------------------------------------------------------------------------
-cpPlugins::Interface::Parameters::
-TInt cpPlugins::Interface::Parameters::
-GetValueAsInt( const TString& name ) const
+std::string cpPlugins::Interface::Parameters::
+GetTypeAsString( const std::string& name ) const
{
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt == this->m_Parameters.end( ) )
- return( TInt( 0 ) );
- if( pIt->second.first != Self::Int )
- return( TInt( 0 ) );
- return( TInt( std::atoi( pIt->second.second.c_str( ) ) ) );
+ auto i = this->m_Parameters.find( name );
+ cpPlugins_Parameters_TypeAsString( String );
+ else cpPlugins_Parameters_TypeAsString( Bool );
+ else cpPlugins_Parameters_TypeAsString( Int );
+ else cpPlugins_Parameters_TypeAsString( Uint );
+ else cpPlugins_Parameters_TypeAsString( Real );
+ else cpPlugins_Parameters_TypeAsString( OpenFileName );
+ else cpPlugins_Parameters_TypeAsString( SaveFileName );
+ else cpPlugins_Parameters_TypeAsString( PathName );
+ else cpPlugins_Parameters_TypeAsString( StringList );
+ else cpPlugins_Parameters_TypeAsString( BoolList );
+ else cpPlugins_Parameters_TypeAsString( IntList );
+ else cpPlugins_Parameters_TypeAsString( UintList );
+ else cpPlugins_Parameters_TypeAsString( RealList );
+ else cpPlugins_Parameters_TypeAsString( OpenFileNameList );
+ else cpPlugins_Parameters_TypeAsString( SaveFileNameList );
+ else cpPlugins_Parameters_TypeAsString( PathNameList );
+ else cpPlugins_Parameters_TypeAsString( Choices );
+ else return( "NoType" );
}
// -------------------------------------------------------------------------
-cpPlugins::Interface::Parameters::
-TUint cpPlugins::Interface::Parameters::
-GetValueAsUint( const TString& name ) const
-{
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt == this->m_Parameters.end( ) )
- return( TUint( 0 ) );
- if( pIt->second.first != Self::Uint )
- return( TUint( 0 ) );
- return( TUint( std::atoi( pIt->second.second.c_str( ) ) ) );
-}
+#define cpPlugins_Parameters_TypeFromString( Y, str ) \
+ if( str == std::string( #Y ) ) \
+ return( Self::Y )
-// -------------------------------------------------------------------------
cpPlugins::Interface::Parameters::
-TReal cpPlugins::Interface::Parameters::
-GetValueAsReal( const TString& name ) const
-{
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt == this->m_Parameters.end( ) )
- return( TReal( 0 ) );
- if( pIt->second.first != Self::Real )
- return( TReal( 0 ) );
- return( TReal( std::atof( pIt->second.second.c_str( ) ) ) );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Parameters::
-GetValueAsStringList(
- std::vector< TString >& lst, const TString& name
- ) const
-{
- lst.clear( );
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt == this->m_Parameters.end( ) )
- return;
- if( pIt->second.first != Self::StringList )
- return;
-
- std::istringstream ss( pIt->second.second );
- std::string token;
- while( std::getline( ss, token, '#' ) )
- if( token != "" )
- lst.push_back( token );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Parameters::
-GetValueAsBoolList( std::vector< TBool >& lst, const TString& name ) const
-{
- lst.clear( );
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt == this->m_Parameters.end( ) )
- return;
- if( pIt->second.first != Self::BoolList )
- return;
-
- std::istringstream ss( pIt->second.second );
- std::string token;
- while( std::getline( ss, token, '#' ) )
- if( token != "" )
- lst.push_back( TBool( std::atoi( token.c_str( ) ) == 1 ) );
+Type cpPlugins::Interface::Parameters::
+GetTypeFromString( const std::string& t )
+{
+ cpPlugins_Parameters_TypeFromString( String, t );
+ else cpPlugins_Parameters_TypeFromString( Bool, t );
+ else cpPlugins_Parameters_TypeFromString( Int, t );
+ else cpPlugins_Parameters_TypeFromString( Uint, t );
+ else cpPlugins_Parameters_TypeFromString( Real, t );
+ else cpPlugins_Parameters_TypeFromString( OpenFileName, t );
+ else cpPlugins_Parameters_TypeFromString( SaveFileName, t );
+ else cpPlugins_Parameters_TypeFromString( PathName, t );
+ else cpPlugins_Parameters_TypeFromString( StringList, t );
+ else cpPlugins_Parameters_TypeFromString( BoolList, t );
+ else cpPlugins_Parameters_TypeFromString( IntList, t );
+ else cpPlugins_Parameters_TypeFromString( UintList, t );
+ else cpPlugins_Parameters_TypeFromString( RealList, t );
+ else cpPlugins_Parameters_TypeFromString( OpenFileNameList, t );
+ else cpPlugins_Parameters_TypeFromString( SaveFileNameList, t );
+ else cpPlugins_Parameters_TypeFromString( PathNameList, t );
+ else cpPlugins_Parameters_TypeFromString( Choices, t );
+ else return( Self::NoType );
+}
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::Parameters::
+GetString( const std::string& name, bool force ) const
+{
+ auto i = this->m_Parameters.find( name );
+ if( i != this->m_Parameters.end( ) )
+ {
+ if( i->second.first == Self::String || force )
+ return( i->second.second );
+ else
+ return( "" );
+ }
+ else
+ return( "" );
}
// -------------------------------------------------------------------------
void cpPlugins::Interface::Parameters::
-GetValueAsIntList( std::vector< TInt >& lst, const TString& name ) const
+SetString( const std::string& name, const std::string& v, bool force )
{
- lst.clear( );
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt == this->m_Parameters.end( ) )
- return;
- if( pIt->second.first != Self::IntList )
- return;
+ auto i = this->m_Parameters.find( name );
+ if( i != this->m_Parameters.end( ) )
+ {
+ if( i->second.first == Self::String || force )
+ {
+ if( i->second.second != v )
+ {
+ i->second.second = v;
+ this->Modified( );
- std::istringstream ss( pIt->second.second );
- std::string token;
- while( std::getline( ss, token, '#' ) )
- if( token != "" )
- lst.push_back( TInt( std::atoi( token.c_str( ) ) ) );
-}
+ } // fi
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Parameters::
-GetValueAsUintList( std::vector< TUint >& lst, const TString& name ) const
-{
- lst.clear( );
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt == this->m_Parameters.end( ) )
- return;
- if( pIt->second.first != Self::UintList )
- return;
+ } // fi
- std::istringstream ss( pIt->second.second );
- std::string token;
- while( std::getline( ss, token, '#' ) )
- if( token != "" )
- lst.push_back( TUint( std::atoi( token.c_str( ) ) ) );
+ } // fi
}
// -------------------------------------------------------------------------
void cpPlugins::Interface::Parameters::
-GetValueAsRealList( std::vector< TReal >& lst, const TString& name ) const
+ConfigureAsChoices(
+ const std::string& name, const std::vector< std::string >& choices
+ )
{
- lst.clear( );
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt == this->m_Parameters.end( ) )
- return;
- if( pIt->second.first != Self::RealList )
+ // It is invalid not to give choices when configuring
+ if( choices.size( ) == 0 )
return;
- std::istringstream ss( pIt->second.second );
- std::string token;
- while( std::getline( ss, token, '#' ) )
- if( token != "" )
- lst.push_back( TReal( std::atof( token.c_str( ) ) ) );
+ std::stringstream str_choices;
+ str_choices << choices[ 0 ];
+ for( unsigned int i = 1; i < choices.size( ); ++i )
+ str_choices << "#" << choices[ i ];
+ str_choices << "@";
+ this->m_Parameters[ name ] =
+ TParameter( Self::Choices, str_choices.str( ) );
+ this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+std::vector< std::string > cpPlugins::Interface::Parameters::
+GetChoices( const std::string& name ) const
+{
+ std::vector< std::string > choices;
+
+ TParameters::const_iterator i = this->m_Parameters.find( name );
+ if( i != this->m_Parameters.end( ) )
+ {
+ if( i->second.first == Self::Choices )
+ {
+ std::istringstream str_choices( i->second.second );
+ std::string real_choices;
+ std::getline( str_choices, real_choices, '@' );
+ std::istringstream str( real_choices );
+ std::string token;
+ while( std::getline( str, token, '#' ) )
+ choices.push_back( token );
+
+ } // fi
+
+ } // fi
+ return( choices );
+}
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::Parameters::
+GetSelectedChoice( const std::string& name ) const
+{
+ auto i = this->m_Parameters.find( name );
+ if( i != this->m_Parameters.end( ) )
+ {
+ if( i->second.first == Self::Choices )
+ {
+ std::istringstream str_choices( i->second.second );
+ std::string real_choice;
+ std::getline( str_choices, real_choice, '@' );
+ std::getline( str_choices, real_choice, '@' );
+ return( real_choice );
+ }
+ else
+ return( "" );
+ }
+ else
+ return( "" );
}
// -------------------------------------------------------------------------
bool cpPlugins::Interface::Parameters::
-HasStringValue( const TString& name ) const
-{
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt != this->m_Parameters.end( ) )
- return( pIt->second.first == Self::String );
- return( false );
+SetSelectedChoice( const std::string& name, const std::string& choice )
+{
+ auto i = this->m_Parameters.find( name );
+ if( i != this->m_Parameters.end( ) )
+ {
+ if( i->second.first == Self::Choices )
+ {
+ std::istringstream str_choices( i->second.second );
+ std::string choices;
+ std::getline( str_choices, choices, '@' );
+ if( choices.find( choice ) != std::string::npos )
+ {
+ std::stringstream new_choices;
+ new_choices << choices << "@" << choice;
+ i->second.second = new_choices.str( );
+ this->Modified( );
+ return( true );
+ }
+ else
+ return( false );
+ }
+ else
+ return( false );
+ }
+ else
+ return( false );
}
// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Parameters::
-HasBoolValue( const TString& name ) const
+std::string cpPlugins::Interface::Parameters::
+GetAcceptedFileExtensions( const std::string& name ) const
{
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt != this->m_Parameters.end( ) )
- return( pIt->second.first == Self::Bool );
- return( false );
+ auto i = this->m_AcceptedFileExtensions.find( name );
+ if( i != this->m_AcceptedFileExtensions.end( ) )
+ return( i->second );
+ else
+ return( "" );
}
// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Parameters::
-HasIntValue( const TString& name ) const
+void cpPlugins::Interface::Parameters::
+SetAcceptedFileExtensions(
+ const std::string& name, const std::string& extensions
+ )
{
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt != this->m_Parameters.end( ) )
- return( pIt->second.first == Self::Int );
- return( false );
-}
+ auto i = this->m_Parameters.find( name );
+ if( i != this->m_Parameters.end( ) )
+ {
+ bool is_valid = ( i->second.first == Self::OpenFileName );
+ is_valid |= ( i->second.first == Self::SaveFileName );
+ is_valid |= ( i->second.first == Self::OpenFileNameList );
+ is_valid |= ( i->second.first == Self::SaveFileNameList );
+ if( is_valid )
+ this->m_AcceptedFileExtensions[ name ] = extensions;
-// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Parameters::
-HasUintValue( const TString& name ) const
-{
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt != this->m_Parameters.end( ) )
- return( pIt->second.first == Self::Uint );
- return( false );
+ } // fi
}
// -------------------------------------------------------------------------
bool cpPlugins::Interface::Parameters::
-HasRealValue( const TString& name ) const
+ToXML( TiXmlElement* parent_elem ) const
{
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt != this->m_Parameters.end( ) )
- return( pIt->second.first == Self::Real );
- return( false );
-}
+ if( parent_elem == NULL )
+ return( false );
-// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Parameters::
-HasIndexValue( const TString& name ) const
-{
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt != this->m_Parameters.end( ) )
- return( pIt->second.first == Self::Index );
- return( false );
-}
+ auto pIt = this->m_Parameters.begin( );
+ for( ; pIt != this->m_Parameters.end( ); ++pIt )
+ {
+ TiXmlElement* p = new TiXmlElement( "parameter" );
+ p->SetAttribute( "name", pIt->first.c_str( ) );
+ p->SetAttribute( "value", pIt->second.second.c_str( ) );
+ p->SetAttribute( "type", this->GetTypeAsString( pIt->first ).c_str( ) );
+ parent_elem->LinkEndChild( p );
-// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Parameters::
-HasPointValue( const TString& name ) const
-{
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt != this->m_Parameters.end( ) )
- return( pIt->second.first == Self::Point );
- return( false );
+ } // rof
+ return( true );
}
// -------------------------------------------------------------------------
bool cpPlugins::Interface::Parameters::
-HasStringListValue( const TString& name ) const
+FromXML( const TiXmlElement* filter_elem )
{
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt != this->m_Parameters.end( ) )
- return( pIt->second.first == Self::StringList );
- return( false );
-}
+ const TiXmlElement* param = filter_elem->FirstChildElement( "parameter" );
+ bool ret = false;
+ while( param != NULL )
+ {
+ const char* param_name = param->Attribute( "name" );
+ const char* param_type = param->Attribute( "type" );
+ if( param_name != NULL && param_type != NULL )
+ {
+ TParameter value;
+ value.second = param->Attribute( "value" );
+ value.first = Self::GetTypeFromString( param_type );
+ this->m_Parameters[ param_name ] = value;
-// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Parameters::
-HasBoolListValue( const TString& name ) const
-{
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt != this->m_Parameters.end( ) )
- return( pIt->second.first == Self::BoolList );
- return( false );
+ } // fi
+ param = param->NextSiblingElement( "parameter" );
+ ret = true;
+
+ } // elihw
+ this->Modified( );
+ return( ret );
}
// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Parameters::
-HasIntListValue( const TString& name ) const
+cpPlugins::Interface::Parameters::
+Parameters( )
+ : Superclass( ),
+ m_Process( NULL )
{
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt != this->m_Parameters.end( ) )
- return( pIt->second.first == Self::IntList );
- return( false );
+ this->Clear( );
}
// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Parameters::
-HasUintListValue( const TString& name ) const
+cpPlugins::Interface::Parameters::
+~Parameters( )
{
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt != this->m_Parameters.end( ) )
- return( pIt->second.first == Self::UintList );
- return( false );
}
// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Parameters::
-HasRealListValue( const TString& name ) const
+void cpPlugins::Interface::Parameters::
+PrintSelf( std::ostream& os, itk::Indent indent ) const
{
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt != this->m_Parameters.end( ) )
- return( pIt->second.first == Self::RealList );
- return( false );
+ TParameters::const_iterator i = this->m_Parameters.begin( );
+ for( ; i != this->m_Parameters.end( ); ++i )
+ os << indent
+ << i->first << ": ("
+ << i->second.first << " | "
+ << i->second.second << ")"
+ << std::endl;
}
// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Parameters::
-HasIndexListValue( const TString& name ) const
+cpPlugins::Interface::Parameters::
+TParameters& cpPlugins::Interface::Parameters::
+GetRawParameters( )
{
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt != this->m_Parameters.end( ) )
- return( pIt->second.first == Self::IndexList );
- return( false );
+ return( this->m_Parameters );
}
// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Parameters::
-HasPointListValue( const TString& name ) const
+const cpPlugins::Interface::Parameters::
+TParameters& cpPlugins::Interface::Parameters::
+GetRawParameters( ) const
{
- TParameters::const_iterator pIt = this->m_Parameters.find( name );
- if( pIt != this->m_Parameters.end( ) )
- return( pIt->second.first == Self::PointList );
- return( false );
+ return( this->m_Parameters );
}
// eof - $RCSfile$