1 #include <cpPlugins/BaseObjects/Parameters.h>
2 #include <cpPlugins/BaseObjects/ProcessObject.h>
3 #include <cpPlugins/Utility.h>
4 #include <tinyxml2/tinyxml2.h>
6 // -------------------------------------------------------------------------
7 cpPlugins::BaseObjects::Parameters::
9 : m_ProcessObject( NULL )
14 // -------------------------------------------------------------------------
15 cpPlugins::BaseObjects::Parameters::
20 // -------------------------------------------------------------------------
21 cpPlugins::BaseObjects::ProcessObject* cpPlugins::BaseObjects::Parameters::
24 return( this->m_ProcessObject );
27 // -------------------------------------------------------------------------
29 cpPlugins::BaseObjects::ProcessObject* cpPlugins::BaseObjects::Parameters::
30 GetProcessObject( ) const
32 return( this->m_ProcessObject );
35 // -------------------------------------------------------------------------
36 void cpPlugins::BaseObjects::Parameters::
37 SetProcessObject( cpPlugins::BaseObjects::ProcessObject* po )
39 this->m_ProcessObject = po;
42 // -------------------------------------------------------------------------
43 void cpPlugins::BaseObjects::Parameters::
46 if( this->m_ProcessObject != NULL )
47 this->m_ProcessObject->Modified( );
50 // -------------------------------------------------------------------------
51 void cpPlugins::BaseObjects::Parameters::
54 this->m_Parameters.clear( );
58 // -------------------------------------------------------------------------
59 void cpPlugins::BaseObjects::Parameters::
60 GetNames( std::vector< std::string >& container ) const
63 TParameters::const_iterator i = this->m_Parameters.begin( );
64 for( ; i != this->m_Parameters.end( ); ++i )
65 container.push_back( i->first );
68 // -------------------------------------------------------------------------
69 cpPlugins::BaseObjects::Parameters::
70 Type cpPlugins::BaseObjects::Parameters::
71 GetType( const std::string& name ) const
73 auto i = this->m_Parameters.find( name );
74 if( i != this->m_Parameters.end( ) )
75 return( i->second.first );
77 return( Self::NoType );
80 // -------------------------------------------------------------------------
81 #define cpPlugins_BaseObjects_Parameters_TypeAsString( Y ) \
82 if( i->second.first == Self::Y ) \
85 std::string cpPlugins::BaseObjects::Parameters::
86 GetTypeAsString( const std::string& name ) const
88 auto i = this->m_Parameters.find( name );
89 cpPlugins_BaseObjects_Parameters_TypeAsString( String );
90 else cpPlugins_BaseObjects_Parameters_TypeAsString( Bool );
91 else cpPlugins_BaseObjects_Parameters_TypeAsString( Int );
92 else cpPlugins_BaseObjects_Parameters_TypeAsString( Uint );
93 else cpPlugins_BaseObjects_Parameters_TypeAsString( Real );
94 else cpPlugins_BaseObjects_Parameters_TypeAsString( OpenFileName );
95 else cpPlugins_BaseObjects_Parameters_TypeAsString( SaveFileName );
96 else cpPlugins_BaseObjects_Parameters_TypeAsString( PathName );
97 else cpPlugins_BaseObjects_Parameters_TypeAsString( StringList );
98 else cpPlugins_BaseObjects_Parameters_TypeAsString( BoolList );
99 else cpPlugins_BaseObjects_Parameters_TypeAsString( IntList );
100 else cpPlugins_BaseObjects_Parameters_TypeAsString( UintList );
101 else cpPlugins_BaseObjects_Parameters_TypeAsString( RealList );
102 else cpPlugins_BaseObjects_Parameters_TypeAsString( OpenFileNameList );
103 else cpPlugins_BaseObjects_Parameters_TypeAsString( SaveFileNameList );
104 else cpPlugins_BaseObjects_Parameters_TypeAsString( PathNameList );
105 else cpPlugins_BaseObjects_Parameters_TypeAsString( Choices );
106 else return( "NoType" );
109 // -------------------------------------------------------------------------
110 #define cpPlugins_BaseObjects_Parameters_TypeFromString( Y, str ) \
111 if( str == std::string( #Y ) ) \
114 cpPlugins::BaseObjects::Parameters::
115 Type cpPlugins::BaseObjects::Parameters::
116 GetTypeFromString( const std::string& t )
118 cpPlugins_BaseObjects_Parameters_TypeFromString( String, t );
119 else cpPlugins_BaseObjects_Parameters_TypeFromString( Bool, t );
120 else cpPlugins_BaseObjects_Parameters_TypeFromString( Int, t );
121 else cpPlugins_BaseObjects_Parameters_TypeFromString( Uint, t );
122 else cpPlugins_BaseObjects_Parameters_TypeFromString( Real, t );
123 else cpPlugins_BaseObjects_Parameters_TypeFromString( OpenFileName, t );
124 else cpPlugins_BaseObjects_Parameters_TypeFromString( SaveFileName, t );
125 else cpPlugins_BaseObjects_Parameters_TypeFromString( PathName, t );
126 else cpPlugins_BaseObjects_Parameters_TypeFromString( StringList, t );
127 else cpPlugins_BaseObjects_Parameters_TypeFromString( BoolList, t );
128 else cpPlugins_BaseObjects_Parameters_TypeFromString( IntList, t );
129 else cpPlugins_BaseObjects_Parameters_TypeFromString( UintList, t );
130 else cpPlugins_BaseObjects_Parameters_TypeFromString( RealList, t );
131 else cpPlugins_BaseObjects_Parameters_TypeFromString( OpenFileNameList, t );
132 else cpPlugins_BaseObjects_Parameters_TypeFromString( SaveFileNameList, t );
133 else cpPlugins_BaseObjects_Parameters_TypeFromString( PathNameList, t );
134 else cpPlugins_BaseObjects_Parameters_TypeFromString( Choices, t );
135 else return( Self::NoType );
138 // -------------------------------------------------------------------------
139 std::string cpPlugins::BaseObjects::Parameters::
140 GetString( const std::string& name, bool force ) const
142 auto i = this->m_Parameters.find( name );
143 if( i != this->m_Parameters.end( ) )
145 if( i->second.first == Self::String || force )
146 return( i->second.second );
154 // -------------------------------------------------------------------------
155 void cpPlugins::BaseObjects::Parameters::
156 SetString( const std::string& name, const std::string& v, bool force )
158 auto i = this->m_Parameters.find( name );
159 if( i != this->m_Parameters.end( ) )
161 if( i->second.first == Self::String || force )
163 if( i->second.second != v )
165 i->second.second = v;
175 // -------------------------------------------------------------------------
176 void cpPlugins::BaseObjects::Parameters::
178 const std::string& name, const std::vector< std::string >& choices
181 // It is invalid not to give choices when configuring
182 if( choices.size( ) == 0 )
185 std::stringstream str_choices;
186 str_choices << choices[ 0 ];
187 for( unsigned int i = 1; i < choices.size( ); ++i )
188 str_choices << "#" << choices[ i ];
190 this->m_Parameters[ name ] =
191 TParameter( Self::Choices, str_choices.str( ) );
195 // -------------------------------------------------------------------------
196 void cpPlugins::BaseObjects::Parameters::
197 ConfigureAsRealTypesChoices( const std::string& name )
199 std::vector< std::string > choices;
200 #ifdef cpPlugins_CONFIG_REAL_TYPES_float
201 choices.push_back( "float" );
202 #endif // cpPlugins_CONFIG_REAL_TYPES_float
203 #ifdef cpPlugins_CONFIG_REAL_TYPES_double
204 choices.push_back( "double" );
205 #endif // cpPlugins_CONFIG_REAL_TYPES_double
206 this->ConfigureAsChoices( name, choices );
209 // -------------------------------------------------------------------------
210 void cpPlugins::BaseObjects::Parameters::
211 ConfigureAsIntTypesChoices( const std::string& name )
213 std::vector< std::string > choices;
214 #ifdef cpPlugins_CONFIG_INTEGER_TYPES_char
215 choices.push_back( "char" );
216 choices.push_back( "uchar" );
217 #endif // cpPlugins_CONFIG_INTEGER_TYPES_char
218 #ifdef cpPlugins_CONFIG_INTEGER_TYPES_short
219 choices.push_back( "short" );
220 choices.push_back( "ushort" );
221 #endif // cpPlugins_CONFIG_INTEGER_TYPES_short
222 #ifdef cpPlugins_CONFIG_INTEGER_TYPES_int
223 choices.push_back( "int" );
224 choices.push_back( "uint" );
225 #endif // cpPlugins_CONFIG_INTEGER_TYPES_int
226 #ifdef cpPlugins_CONFIG_INTEGER_TYPES_long
227 choices.push_back( "long" );
228 choices.push_back( "ulong" );
229 #endif // cpPlugins_CONFIG_INTEGER_TYPES_long
230 this->ConfigureAsChoices( name, choices );
233 // -------------------------------------------------------------------------
234 void cpPlugins::BaseObjects::Parameters::
235 ConfigureAsScalarTypesChoices( const std::string& name )
237 std::vector< std::string > choices;
238 #ifdef cpPlugins_CONFIG_INTEGER_TYPES_char
239 choices.push_back( "char" );
240 choices.push_back( "uchar" );
241 #endif // cpPlugins_CONFIG_INTEGER_TYPES_char
242 #ifdef cpPlugins_CONFIG_INTEGER_TYPES_short
243 choices.push_back( "short" );
244 choices.push_back( "ushort" );
245 #endif // cpPlugins_CONFIG_INTEGER_TYPES_short
246 #ifdef cpPlugins_CONFIG_INTEGER_TYPES_int
247 choices.push_back( "int" );
248 choices.push_back( "uint" );
249 #endif // cpPlugins_CONFIG_INTEGER_TYPES_int
250 #ifdef cpPlugins_CONFIG_INTEGER_TYPES_long
251 choices.push_back( "long" );
252 choices.push_back( "ulong" );
253 #endif // cpPlugins_CONFIG_INTEGER_TYPES_long
254 #ifdef cpPlugins_CONFIG_REAL_TYPES_float
255 choices.push_back( "float" );
256 #endif // cpPlugins_CONFIG_REAL_TYPES_float
257 #ifdef cpPlugins_CONFIG_REAL_TYPES_double
258 choices.push_back( "double" );
259 #endif // cpPlugins_CONFIG_REAL_TYPES_double
260 this->ConfigureAsChoices( name, choices );
263 // -------------------------------------------------------------------------
264 std::vector< std::string > cpPlugins::BaseObjects::Parameters::
265 GetChoices( const std::string& name ) const
267 std::vector< std::string > choices;
269 TParameters::const_iterator i = this->m_Parameters.find( name );
270 if( i != this->m_Parameters.end( ) )
272 if( i->second.first == Self::Choices )
274 std::istringstream str_choices( i->second.second );
275 std::string real_choices;
276 std::getline( str_choices, real_choices, '@' );
277 std::istringstream str( real_choices );
279 while( std::getline( str, token, '#' ) )
280 choices.push_back( token );
288 // -------------------------------------------------------------------------
289 std::string cpPlugins::BaseObjects::Parameters::
290 GetSelectedChoice( const std::string& name ) const
292 auto i = this->m_Parameters.find( name );
293 if( i != this->m_Parameters.end( ) )
295 if( i->second.first == Self::Choices )
297 std::istringstream str_choices( i->second.second );
298 std::string real_choice;
299 std::getline( str_choices, real_choice, '@' );
300 std::getline( str_choices, real_choice, '@' );
301 return( real_choice );
310 // -------------------------------------------------------------------------
311 bool cpPlugins::BaseObjects::Parameters::
312 SetSelectedChoice( const std::string& name, const std::string& choice )
314 auto i = this->m_Parameters.find( name );
315 if( i != this->m_Parameters.end( ) )
317 if( i->second.first == Self::Choices )
319 std::istringstream str_choices( i->second.second );
321 std::getline( str_choices, choices, '@' );
322 if( choices.find( choice ) != std::string::npos )
324 std::stringstream new_choices;
325 new_choices << choices << "@" << choice;
326 i->second.second = new_choices.str( );
340 // -------------------------------------------------------------------------
341 std::string cpPlugins::BaseObjects::Parameters::
342 GetAcceptedFileExtensions( const std::string& name ) const
344 auto i = this->m_AcceptedFileExtensions.find( name );
345 if( i != this->m_AcceptedFileExtensions.end( ) )
351 // -------------------------------------------------------------------------
352 void cpPlugins::BaseObjects::Parameters::
353 SetAcceptedFileExtensions(
354 const std::string& name, const std::string& extensions
357 auto i = this->m_Parameters.find( name );
358 if( i != this->m_Parameters.end( ) )
360 bool is_valid = ( i->second.first == Self::OpenFileName );
361 is_valid |= ( i->second.first == Self::SaveFileName );
362 is_valid |= ( i->second.first == Self::OpenFileNameList );
363 is_valid |= ( i->second.first == Self::SaveFileNameList );
365 this->m_AcceptedFileExtensions[ name ] = extensions;
370 // -------------------------------------------------------------------------
371 bool cpPlugins::BaseObjects::Parameters::
373 tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* parent_elem
376 if( parent_elem == NULL )
379 auto pIt = this->m_Parameters.begin( );
380 for( ; pIt != this->m_Parameters.end( ); ++pIt )
382 tinyxml2::XMLElement* p = doc->NewElement( "Parameter" );
383 p->SetAttribute( "Name", pIt->first.c_str( ) );
384 p->SetAttribute( "Value", pIt->second.second.c_str( ) );
385 p->SetAttribute( "Type", this->GetTypeAsString( pIt->first ).c_str( ) );
386 parent_elem->InsertEndChild( p );
392 // -------------------------------------------------------------------------
393 bool cpPlugins::BaseObjects::Parameters::
394 FromXML( const tinyxml2::XMLElement* filter_elem )
396 const tinyxml2::XMLElement* param =
397 filter_elem->FirstChildElement( "Parameter" );
399 while( param != NULL )
401 const char* param_name = param->Attribute( "Name" );
402 const char* param_type = param->Attribute( "Type" );
403 if( param_name != NULL && param_type != NULL )
406 value.second = param->Attribute( "Value" );
407 value.first = Self::GetTypeFromString( param_type );
408 this->m_Parameters[ param_name ] = value;
411 param = param->NextSiblingElement( "Parameter" );
419 // -------------------------------------------------------------------------
420 cpPlugins::BaseObjects::Parameters::
421 TParameters& cpPlugins::BaseObjects::Parameters::
424 return( this->m_Parameters );
427 // -------------------------------------------------------------------------
428 const cpPlugins::BaseObjects::Parameters::
429 TParameters& cpPlugins::BaseObjects::Parameters::
430 GetRawParameters( ) const
432 return( this->m_Parameters );
435 // -------------------------------------------------------------------------
436 #define cpPlugins_BaseObjects_Parameters_Configure_Code( Y ) \
437 void cpPlugins::BaseObjects::Parameters:: \
438 ConfigureAs##Y( const std::string& name, const T##Y& init ) \
440 this->_Configure< Y >( name ); \
441 this->Set##Y( name, init ); \
443 bool cpPlugins::BaseObjects::Parameters:: \
444 Has##Y( const std::string& name ) const \
445 { return( this->_Has< Y >( name ) ); }
447 // -------------------------------------------------------------------------
448 #define cpPlugins_BaseObjects_Parameters_ConfigureList_Code( Y ) \
449 void cpPlugins::BaseObjects::Parameters:: \
450 ConfigureAs##Y##List( const std::string& name ) \
451 { this->_Configure< Y##List >( name ); } \
452 bool cpPlugins::BaseObjects::Parameters:: \
453 Has##Y##List( const std::string& name ) const \
454 { return( this->_Has< Y##List >( name ) ); }
456 // -------------------------------------------------------------------------
457 #define cpPlugins_BaseObjects_Parameters_GetSet_Code( Y ) \
458 cpPlugins::BaseObjects::Parameters::T##Y \
459 cpPlugins::BaseObjects::Parameters:: \
460 Get##Y( const std::string& name ) const \
461 { return( this->_Get< T##Y, Y >( name ) ); } \
462 void cpPlugins::BaseObjects::Parameters::Set##Y( \
463 const std::string& name, const T##Y& v \
465 { this->_Set< T##Y, Y >( name, v ); }
467 // -------------------------------------------------------------------------
468 #define cpPlugins_BaseObjects_Parameters_GetSetList_Code( Y ) \
469 std::vector< cpPlugins::BaseObjects::Parameters::T##Y > \
470 cpPlugins::BaseObjects::Parameters:: \
471 Get##Y##List( const std::string& name ) const \
472 { return( this->_GetList< T##Y, Y##List >( name ) ); } \
473 void cpPlugins::BaseObjects::Parameters::AddTo##Y##List( \
474 const std::string& name, \
475 const cpPlugins::BaseObjects::Parameters::T##Y& v \
477 { this->_AddToList< T##Y, Y##List >( name, v ); } \
478 void cpPlugins::BaseObjects::Parameters:: \
479 Clear##Y##List( const std::string& name ) \
480 { this->_ClearList< Y##List >( name ); }
482 // -------------------------------------------------------------------------
483 cpPlugins_BaseObjects_Parameters_Configure_Code( String );
484 cpPlugins_BaseObjects_Parameters_Configure_Code( Bool );
485 cpPlugins_BaseObjects_Parameters_Configure_Code( Int );
486 cpPlugins_BaseObjects_Parameters_Configure_Code( Uint );
487 cpPlugins_BaseObjects_Parameters_Configure_Code( Real );
488 cpPlugins_BaseObjects_Parameters_Configure_Code( OpenFileName );
489 cpPlugins_BaseObjects_Parameters_Configure_Code( SaveFileName );
490 cpPlugins_BaseObjects_Parameters_Configure_Code( PathName );
492 cpPlugins_BaseObjects_Parameters_ConfigureList_Code( String );
493 cpPlugins_BaseObjects_Parameters_ConfigureList_Code( Bool );
494 cpPlugins_BaseObjects_Parameters_ConfigureList_Code( Int );
495 cpPlugins_BaseObjects_Parameters_ConfigureList_Code( Uint );
496 cpPlugins_BaseObjects_Parameters_ConfigureList_Code( Real );
497 cpPlugins_BaseObjects_Parameters_ConfigureList_Code( OpenFileName );
498 cpPlugins_BaseObjects_Parameters_ConfigureList_Code( SaveFileName );
499 cpPlugins_BaseObjects_Parameters_ConfigureList_Code( PathName );
501 cpPlugins_BaseObjects_Parameters_GetSet_Code( Bool );
502 cpPlugins_BaseObjects_Parameters_GetSet_Code( Int );
503 cpPlugins_BaseObjects_Parameters_GetSet_Code( Uint );
504 cpPlugins_BaseObjects_Parameters_GetSet_Code( Real );
505 cpPlugins_BaseObjects_Parameters_GetSet_Code( OpenFileName );
506 cpPlugins_BaseObjects_Parameters_GetSet_Code( SaveFileName );
507 cpPlugins_BaseObjects_Parameters_GetSet_Code( PathName );
509 cpPlugins_BaseObjects_Parameters_GetSetList_Code( String );
510 cpPlugins_BaseObjects_Parameters_GetSetList_Code( Bool );
511 cpPlugins_BaseObjects_Parameters_GetSetList_Code( Int );
512 cpPlugins_BaseObjects_Parameters_GetSetList_Code( Uint );
513 cpPlugins_BaseObjects_Parameters_GetSetList_Code( Real );
514 cpPlugins_BaseObjects_Parameters_GetSetList_Code( PathName );
516 // -------------------------------------------------------------------------
517 std::vector< cpPlugins::BaseObjects::Parameters::TOpenFileName >
518 cpPlugins::BaseObjects::Parameters::
519 GetOpenFileNameList( const std::string& name ) const
521 return( this->_GetList< TOpenFileName, OpenFileNameList >( name ) );
524 // -------------------------------------------------------------------------
525 void cpPlugins::BaseObjects::Parameters::
526 AddToOpenFileNameList(
527 const std::string& name,
528 const cpPlugins::BaseObjects::Parameters::TOpenFileName& v
531 auto i = this->m_Parameters.find( name );
532 if( i != this->m_Parameters.end( ) )
534 if( i->second.first == OpenFileNameList )
536 auto pos = v.find_last_of( "/\\" );
537 if( i->second.second == "" )
538 i->second.second = v.substr( 0, pos );
539 i->second.second += std::string( "#" );
540 i->second.second += v.substr( pos + 1 );
548 // -------------------------------------------------------------------------
549 void cpPlugins::BaseObjects::Parameters::
550 ClearOpenFileNameList( const std::string& name )
552 this->_ClearList< OpenFileNameList >( name );
555 // -------------------------------------------------------------------------
556 std::vector< cpPlugins::BaseObjects::Parameters::TSaveFileName >
557 cpPlugins::BaseObjects::Parameters::
558 GetSaveFileNameList( const std::string& name ) const
560 return( this->_GetList< TSaveFileName, SaveFileNameList >( name ) );
563 // -------------------------------------------------------------------------
564 void cpPlugins::BaseObjects::Parameters::
565 AddToSaveFileNameList(
566 const std::string& name,
567 const cpPlugins::BaseObjects::Parameters::TSaveFileName& v
570 auto i = this->m_Parameters.find( name );
571 if( i != this->m_Parameters.end( ) )
573 if( i->second.first == SaveFileNameList )
575 auto pos = v.find_last_of( "/\\" );
576 if( i->second.second == "" )
577 i->second.second = v.substr( 0, pos );
578 i->second.second += std::string( "#" );
579 i->second.second += v.substr( pos + 1 );
587 // -------------------------------------------------------------------------
588 void cpPlugins::BaseObjects::Parameters::
589 ClearSaveFileNameList( const std::string& name )
591 this->_ClearList< SaveFileNameList >( name );
594 // -------------------------------------------------------------------------
595 template< unsigned int _Enum >
596 void cpPlugins::BaseObjects::Parameters::
597 _Configure( const std::string& name )
599 this->m_Parameters[ name ] = TParameter( ( Self::Type )( _Enum ), "" );
603 // -------------------------------------------------------------------------
604 template< unsigned int _Enum >
605 bool cpPlugins::BaseObjects::Parameters::
606 _Has( const std::string& name ) const
608 auto i = this->m_Parameters.find( name );
609 if( i != this->m_Parameters.end( ) )
610 return( i->second.first == ( Self::Type )( _Enum ) );
615 // -------------------------------------------------------------------------
616 template< class _Type, unsigned int _Enum >
617 _Type cpPlugins::BaseObjects::Parameters::
618 _Get( const std::string& name ) const
620 auto i = this->m_Parameters.find( name );
621 if( i != this->m_Parameters.end( ) )
623 if( i->second.first == ( Self::Type )( _Enum ) )
625 if( typeid( _Type ) != typeid( std::string ) )
627 std::istringstream tok_str( i->second.second );
635 reinterpret_cast< const _Type* >( &( i->second.second ) );
643 return( _Type( 0 ) );
646 // -------------------------------------------------------------------------
647 template< class _Type, unsigned int _Enum >
648 void cpPlugins::BaseObjects::Parameters::
649 _Set( const std::string& name, const _Type& v )
651 auto i = this->m_Parameters.find( name );
652 if( i != this->m_Parameters.end( ) )
654 if( i->second.first == ( Self::Type )( _Enum ) )
656 if( typeid( _Type ) != typeid( std::string ) )
658 std::stringstream str;
660 if( i->second.second != str.str( ) )
662 i->second.second = str.str( );
669 const std::string* str = reinterpret_cast< const std::string* >( &v );
670 if( i->second.second != *str )
672 i->second.second = *str;
685 // -------------------------------------------------------------------------
686 template< class _Type, unsigned int _Enum >
687 std::vector< _Type > cpPlugins::BaseObjects::Parameters::
688 _GetList( const std::string& name ) const
690 std::vector< _Type > lst;
691 std::vector< std::string >* slst =
692 reinterpret_cast< std::vector< std::string >* >( &lst );
693 auto i = this->m_Parameters.find( name );
694 if( i != this->m_Parameters.end( ) )
696 if( i->second.first == ( Self::Type )( _Enum ) )
698 std::vector< std::string > tokens;
699 cpPlugins::Tokenize( tokens, i->second.second, "#" );
700 for( auto t = tokens.begin( ); t != tokens.end( ); ++t )
702 if( typeid( _Type ) != typeid( std::string ) )
704 std::istringstream tok_str( *t );
710 slst->push_back( *t );
720 // -------------------------------------------------------------------------
721 template< class _Type, unsigned int _Enum >
722 void cpPlugins::BaseObjects::Parameters::
723 _AddToList( const std::string& name, const _Type& v )
725 auto i = this->m_Parameters.find( name );
726 if( i != this->m_Parameters.end( ) )
728 if( i->second.first == ( Self::Type )( _Enum ) )
730 std::stringstream str;
731 if( i->second.second != "" )
732 str << i->second.second << "#";
734 i->second.second = str.str( );
742 // -------------------------------------------------------------------------
743 template< unsigned int _Enum >
744 void cpPlugins::BaseObjects::Parameters::
745 _ClearList( const std::string& name )
747 auto i = this->m_Parameters.find( name );
748 if( i != this->m_Parameters.end( ) )
750 if( i->second.first == ( Self::Type )( _Enum ) )
752 if( i->second.second != "" )
754 i->second.second = "";