1 #ifndef ProcessorParameter_h
2 #define ProcessorParameter_h 1
9 #include "LuizaSTLTypes.h"
10 #include "StringParameters.h"
37 virtual const std::string& name() {
return _name ; }
38 virtual const std::string& description() {
return _description ; }
39 virtual int setSize() {
return _setSize ; } ;
40 virtual bool isOptional() {
return _optional ; }
41 virtual bool valueSet() {
return _valueSet ; }
43 virtual const std::string type()=0 ;
44 virtual const std::string value()=0 ;
45 virtual const std::string defaultValue()=0 ;
49 virtual void setValue( StringParameters* params )=0 ;
53 std::string _description ;
77 void toStream( std::ostream& s,
int i ,
int N) ;
78 void toStream( std::ostream& s,
float f ,
int N) ;
79 void toStream( std::ostream& s,
double d ,
int N) ;
80 void toStream( std::ostream& s,
const std::string& str ,
int N) ;
81 void toStream( std::ostream& s,
bool b ,
int N) ;
84 std::ostream&
toStream( std::ostream& s,
const std::vector<T>& v ,
int N) {
86 typename std::vector<T>::const_iterator it ;
89 for( it = v.begin() ; it != v.end() ; it++) {
91 if( count && N && ! (count % N) )
121 const std::string& description,
123 const T& defaultValue,
127 _parameter( parameter ),
128 _defaultValue( defaultValue )
131 _parameter = defaultValue ;
132 _description = description ;
133 _optional = optional ;
144 virtual const std::string type() {
149 if (
typeid( _parameter ) ==
typeid( IntVec ))
return "IntVec" ;
150 else if(
typeid( _parameter ) ==
typeid( LongVec ))
return "LongVec" ;
151 else if(
typeid( _parameter ) ==
typeid( StringVec ))
return "StringVec" ;
152 else if(
typeid( _parameter ) ==
typeid( FloatVec ))
return "FloatVec" ;
153 else if(
typeid( _parameter ) ==
typeid( DoubleVec ))
return "DoubleVec" ;
154 else if(
typeid( _parameter ) ==
typeid(
int ))
return "int" ;
155 else if(
typeid( _parameter ) ==
typeid(
float ))
return "float" ;
156 else if(
typeid( _parameter ) ==
typeid(
double ))
return "double" ;
157 else if(
typeid( _parameter ) ==
typeid(std::string) )
return "string" ;
158 else if(
typeid( _parameter ) ==
typeid(
bool ) )
return "bool";
161 return typeid( _parameter ).name() ;
164 virtual const std::string defaultValue() {
166 std::stringstream def ;
169 toStream( def, _parameter , setSize() ) ;
174 virtual const std::string value() {
176 std::stringstream def ;
179 toStream( def, _parameter , setSize() ) ;
184 void setValue( StringParameters* params ) {
186 setProcessorParameter< T >( this , params ) ;
void toStream(std::ostream &s, int i, int N)
Definition: ProcessorParameter.cc:17
Definition: ProcessorParameter.h:27
Definition: ProcessorParameter.h:104
Namespace for Luiza framework.
Definition: CCCollection.h:6