1 #ifndef ProcessorParameter_h
2 #define ProcessorParameter_h 1
9 #include "LCIOSTLTypes.h"
10 #include "StringParameters.h"
16 using namespace lcio ;
34 _description(
""), _name(
""),
35 _setSize(0), _optional(
false), _valueSet(
false) {}
39 virtual const std::string& name() {
return _name ; }
40 virtual const std::string& description() {
return _description ; }
41 virtual int setSize() {
return _setSize ; } ;
42 virtual bool isOptional() {
return _optional ; }
43 virtual bool valueSet() {
return _valueSet ; }
45 virtual const std::string type()=0 ;
46 virtual const std::string value()=0 ;
47 virtual const std::string defaultValue()=0 ;
55 std::string _description ;
79 void toStream( std::ostream& s,
int i ,
int N) ;
80 void toStream( std::ostream& s,
float f ,
int N) ;
81 void toStream( std::ostream& s,
double d ,
int N) ;
82 void toStream( std::ostream& s,
const std::string& str ,
int N) ;
83 void toStream( std::ostream& s,
bool b ,
int N) ;
86 std::ostream&
toStream( std::ostream& s,
const std::vector<T>& v ,
int N) {
88 typename std::vector<T>::const_iterator it ;
91 for( it = v.begin() ; it != v.end() ; it++) {
93 if( count && N && ! (count % N) )
123 const std::string& parameterDescription,
125 const T& parameterDefaultValue,
127 int parameterSetSize=0) :
129 _parameter( parameter ),
130 _defaultValue( parameterDefaultValue )
132 _name = parameterName ;
133 _parameter = parameterDefaultValue ;
134 _description = parameterDescription ;
135 _optional = optional ;
137 _setSize = parameterSetSize ;
146 virtual const std::string type() {
151 if (
typeid( _parameter ) ==
typeid( IntVec ))
return "IntVec" ;
152 else if(
typeid( _parameter ) ==
typeid( FloatVec ))
return "FloatVec" ;
153 else if(
typeid( _parameter ) ==
typeid( StringVec ))
return "StringVec" ;
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 ) ;
Templated implementation of ProcessorParameter - automatically created by Processor::registerProcesso...
Definition: ProcessorParameter.h:106
Class that holds a steering variable for a marlin processor - automatically created by Processor::reg...
Definition: ProcessorParameter.h:27
void toStream(std::ostream &s, int i, int N)
Helper function for printing parameter vectors.
Definition: ProcessorParameter.cc:17
Simple parameters class for Marlin.
Definition: StringParameters.h:34