Marlin
01.17.01
|
handles information about marlin processors and their collections needed by MarlinSteerCheck More...
#include <CCProcessor.h>
Public Member Functions | |
CCProcessor (bool status, const std::string &name, const std::string &type, std::shared_ptr< StringParameters > p) | |
CCProcessor (CCProcessor &p) | |
~CCProcessor () | |
CCProcessor & | operator= (const CCProcessor &)=delete |
bool | hasErrors () |
Returns true if the processor has errors. More... | |
bool | hasParameters () |
Returns true if the processor has parameters. More... | |
bool | hasErrorCols () |
Returns true if the processor has collection errors. More... | |
bool | isInstalled () |
Returns true if the processor is installed. More... | |
bool | isActive () |
Returns true if the processor is active. More... | |
bool | hasCondition (const std::string &condition) |
Returns true if the processor is constrained by the given condition. More... | |
const std::string & | getName () |
Returns the Name of the processor. More... | |
const std::string & | getType () |
Returns the Type of the processor. More... | |
sSet & | getConditions () |
Returns the Conditions of the processor. More... | |
const std::string | getDescription () |
Returns the Description of the processor. More... | |
const std::string | getError () |
Returns a string with the error of the processor. More... | |
const std::string | getStatusDesc () |
Returns a string with the processor status ( "Active", "Inactive" ) More... | |
bool | isErrorCol (const std::string &type, const std::string &value) |
Returns true if the given collection is in the unavailable or duplicate list of this processor. More... | |
bool | isParamOptional (const std::string &key) |
Returns true if a parameter is optional (optional means the parameter will be written out as a comment) More... | |
std::shared_ptr< StringParameters > | getParameters () |
Returns the string parameters for this processor. More... | |
const ssMap & | getColHeaders (const std::string &iotype) |
Returns a map with collection names and their respective types for INPUT/OUTPUT collections of this processor. More... | |
ColVec & | getCols (const std::string &iotype, const std::string &type_name="ALL_COLLECTIONS") |
Returns collections of a given iotype ( INPUT, OUTPUT, UNAVAILABLE, DUPLICATE ) for a given name or type If iotype == INPUT/OUTPUT then type_name is the name of the collection If iotype == UNAVAILABLE/DUPLICATE then type_name is the type of the collection. More... | |
sSet & | getColTypeNames (const std::string &iotype) |
Returns collection's types/names of a given iotype found in the processor If iotype == INPUT/OUTPUT then names are returned If iotype == UNAVAILABLE/DUPLICATE then types are returned. More... | |
void | addCol (const std::string &iotype, const std::string &name, const std::string &type, const std::string &value) |
Adds a collection of the given iotype ( INPUT / OUTPUT ) with the given name, type and value. More... | |
void | remCol (const std::string &iotype, const std::string &name, unsigned int index) |
Removes collection of the given iotype ( INPUT / OUTPUT ) with the given name at the given index. More... | |
void | addUCol (CCCollection *c) |
Adds an unavailable collection to this processor. More... | |
void | addDCol (CCCollection *c) |
Adds a duplicate collection to this processor. More... | |
void | changeStatus () |
Changes the processor status ( ACTIVE->INACTIVE or INACTIVE->ACTIVE ) More... | |
void | setName (const std::string &name) |
Sets the processor's name. More... | |
void | setConditions (const std::string &conditions) |
Sets the processor's conditions. More... | |
void | setError (int error) |
Activates an error flag in this processor ( NO_PARAMETERS=0, NOT_INSTALLED=1, COL_ERRORS=2 ) More... | |
void | clearError (int error) |
Clears an error flag in this processor ( NO_PARAMETERS=0, NOT_INSTALLED=1, COL_ERRORS=2 ) More... | |
void | setOptionalParam (const std::string &key, bool optional=true) |
Sets a parameter as optional (if optional=true parameter is written out as a comment) More... | |
void | writeToXML (std::ofstream &stream) |
Writes this processor to a stream using the XML format. More... | |
Private Member Functions | |
void | addColsFromParam (std::shared_ptr< StringParameters > p) |
void | writeColsToParam () |
void | clearParameters () |
void | setMarlinProc () |
CCCollection * | popCol (ColVec &v, CCCollection *c) |
Private Attributes | |
bool | _status |
std::vector< bool > | _error |
std::string | _name |
std::string | _type |
std::shared_ptr< StringParameters > | _param |
Processor * | _proc |
const StringVec | _error_desc { "Processor has no Parameters", "Processor not available!", "Some Collections have Errors"} |
StringVec | _errors {} |
sSet | _conditions |
ssColVecMap | _cols |
sssMap | _types |
sSet | _optParams |
handles information about marlin processors and their collections needed by MarlinSteerCheck
Definition at line 39 of file CCProcessor.h.
marlin::CCProcessor::CCProcessor | ( | bool | status, |
const std::string & | name, | ||
const std::string & | type, | ||
std::shared_ptr< StringParameters > | p | ||
) |
Definition at line 11 of file CCProcessor.cc.
marlin::CCProcessor::CCProcessor | ( | CCProcessor & | p | ) |
Definition at line 41 of file CCProcessor.cc.
References _param, addColsFromParam(), clearParameters(), and writeColsToParam().
marlin::CCProcessor::~CCProcessor | ( | ) |
Definition at line 76 of file CCProcessor.cc.
References _cols, std::map< K, T >::begin(), DUPLICATE, std::map< K, T >::end(), and UNAVAILABLE.
void marlin::CCProcessor::addCol | ( | const std::string & | iotype, |
const std::string & | name, | ||
const std::string & | type, | ||
const std::string & | value | ||
) |
Adds a collection of the given iotype ( INPUT / OUTPUT ) with the given name, type and value.
Definition at line 290 of file CCProcessor.cc.
Referenced by IColDelegate::addCollection(), and addColsFromParam().
|
private |
Definition at line 88 of file CCProcessor.cc.
References _param, _proc, addCol(), clearError(), marlin::Processor::getLCIOInType(), marlin::Processor::getLCIOOutType(), INPUT, marlin::Processor::isInputCollectionName(), isInstalled(), marlin::Processor::isOutputCollectionName(), NO_PARAMETERS, OUTPUT, setError(), and std::vector< T >::size().
Referenced by CCProcessor().
void marlin::CCProcessor::addDCol | ( | CCCollection * | c | ) |
Adds a duplicate collection to this processor.
Definition at line 319 of file CCProcessor.cc.
References _cols, COL_ERRORS, DUPLICATE, marlin::CCCollection::getType(), and setError().
void marlin::CCProcessor::addUCol | ( | CCCollection * | c | ) |
Adds an unavailable collection to this processor.
Definition at line 311 of file CCProcessor.cc.
References _cols, COL_ERRORS, marlin::CCCollection::getType(), setError(), and UNAVAILABLE.
void marlin::CCProcessor::changeStatus | ( | ) |
Changes the processor status ( ACTIVE->INACTIVE or INACTIVE->ACTIVE )
Definition at line 281 of file CCProcessor.cc.
References _status, clearError(), and COL_ERRORS.
void marlin::CCProcessor::clearError | ( | int | error | ) |
Clears an error flag in this processor ( NO_PARAMETERS=0, NOT_INSTALLED=1, COL_ERRORS=2 )
Definition at line 406 of file CCProcessor.cc.
References _cols, _error, _error_desc, _errors, std::vector< T >::clear(), std::map< K, T >::clear(), COL_ERRORS, DUPLICATE, std::map< K, T >::end(), std::map< K, T >::find(), std::vector< T >::push_back(), std::vector< T >::size(), and UNAVAILABLE.
Referenced by addColsFromParam(), changeStatus(), and setMarlinProc().
|
private |
Definition at line 217 of file CCProcessor.cc.
References _cols, _optParams, _param, std::begin(), std::map< K, T >::end(), hasParameters(), INPUT, std::set< K >::insert(), OUTPUT, and std::vector< T >::size().
Referenced by CCProcessor().
|
inline |
Returns a map with collection names and their respective types for INPUT/OUTPUT collections of this processor.
Definition at line 106 of file CCProcessor.h.
References _types.
Referenced by Dialog::setupViews().
ColVec & marlin::CCProcessor::getCols | ( | const std::string & | iotype, |
const std::string & | type_name = "ALL_COLLECTIONS" |
||
) |
Returns collections of a given iotype ( INPUT, OUTPUT, UNAVAILABLE, DUPLICATE ) for a given name or type If iotype == INPUT/OUTPUT then type_name is the name of the collection If iotype == UNAVAILABLE/DUPLICATE then type_name is the type of the collection.
Definition at line 352 of file CCProcessor.cc.
References _cols, std::begin(), std::vector< T >::clear(), std::map< K, T >::end(), std::map< K, T >::find(), and std::vector< T >::push_back().
Referenced by marlin::MarlinSteerCheck::getColsSet(), isErrorCol(), OColDelegate::setModelData(), IColDelegate::setModelData(), IColTDelegate::setModelData(), and Dialog::setupViews().
sSet & marlin::CCProcessor::getColTypeNames | ( | const std::string & | iotype | ) |
Returns collection's types/names of a given iotype found in the processor If iotype == INPUT/OUTPUT then names are returned If iotype == UNAVAILABLE/DUPLICATE then types are returned.
Definition at line 370 of file CCProcessor.cc.
References _cols, std::begin(), std::set< K >::clear(), std::map< K, T >::end(), and std::set< K >::insert().
|
inline |
Returns the Conditions of the processor.
Definition at line 80 of file CCProcessor.h.
References _conditions.
|
inline |
Returns the Description of the processor.
Definition at line 83 of file CCProcessor.h.
References _proc, marlin::Processor::description(), and isInstalled().
Referenced by Dialog::setupViews(), and writeToXML().
|
inline |
Returns a string with the error of the processor.
Definition at line 91 of file CCProcessor.h.
References _errors, and std::vector< T >::size().
|
inline |
Returns the Name of the processor.
Definition at line 74 of file CCProcessor.h.
References _name.
Referenced by Dialog::Dialog(), and NParamVecSet::updateTable().
|
inline |
Returns the string parameters for this processor.
Definition at line 103 of file CCProcessor.h.
References _param.
Referenced by NParamVecSet::addValSet(), NParamVecSet::remValSet(), ParamDelegate::setModelData(), NParamVecSetD::setModelData(), Dialog::setupViews(), and Dialog::updateParam().
|
inline |
Returns a string with the processor status ( "Active", "Inactive" )
Definition at line 94 of file CCProcessor.h.
References isActive().
|
inline |
Returns the Type of the processor.
Definition at line 77 of file CCProcessor.h.
References _type.
Referenced by NParamVecSet::addValSet(), Dialog::Dialog(), NParamVecSet::remValSet(), NParamVecSetD::setModelData(), Dialog::setupViews(), Dialog::updateParam(), and NParamVecSet::updateTable().
bool marlin::CCProcessor::hasCondition | ( | const std::string & | condition | ) |
Returns true if the processor is constrained by the given condition.
Definition at line 201 of file CCProcessor.cc.
References _conditions, std::set< K >::end(), and std::set< K >::find().
|
inline |
Returns true if the processor has collection errors.
Definition at line 62 of file CCProcessor.h.
References _error, and COL_ERRORS.
bool marlin::CCProcessor::hasErrors | ( | ) |
Returns true if the processor has errors.
Definition at line 428 of file CCProcessor.cc.
References _error, and MAX_ERRORS.
|
inline |
Returns true if the processor has parameters.
Definition at line 59 of file CCProcessor.h.
References _error, and NO_PARAMETERS.
Referenced by clearParameters(), Dialog::setupViews(), writeColsToParam(), and writeToXML().
|
inline |
Returns true if the processor is active.
Definition at line 68 of file CCProcessor.h.
References _status.
Referenced by IColDelegate::addCollection(), marlin::MarlinSteerCheck::getColsSet(), getStatusDesc(), IColDelegate::setEditorData(), IColTDelegate::setEditorData(), OColDelegate::setEditorData(), IColDelegate::setModelData(), OColDelegate::setModelData(), IColTDelegate::setModelData(), and Dialog::setupViews().
bool marlin::CCProcessor::isErrorCol | ( | const std::string & | type, |
const std::string & | value | ||
) |
Returns true if the given collection is in the unavailable or duplicate list of this processor.
Definition at line 381 of file CCProcessor.cc.
References std::vector< T >::begin(), DUPLICATE, std::vector< T >::end(), getCols(), compareMarlinSteeringFiles::getValue(), std::vector< T >::insert(), std::vector< T >::size(), and UNAVAILABLE.
Referenced by IColDelegate::addCollection(), IColDelegate::setEditorData(), IColTDelegate::setEditorData(), OColDelegate::setEditorData(), IColDelegate::setModelData(), OColDelegate::setModelData(), IColTDelegate::setModelData(), and Dialog::setupViews().
|
inline |
Returns true if the processor is installed.
Definition at line 65 of file CCProcessor.h.
References _error, and NOT_INSTALLED.
Referenced by addColsFromParam(), getDescription(), setMarlinProc(), writeColsToParam(), and writeToXML().
bool marlin::CCProcessor::isParamOptional | ( | const std::string & | key | ) |
Returns true if a parameter is optional (optional means the parameter will be written out as a comment)
Definition at line 437 of file CCProcessor.cc.
References _optParams, _type, std::set< K >::end(), std::set< K >::find(), and marlin::CMProcessor::instance().
Referenced by Dialog::setupViews(), and writeToXML().
|
delete |
|
private |
Definition at line 334 of file CCProcessor.cc.
References std::vector< T >::assign(), std::vector< T >::begin(), std::vector< T >::end(), std::vector< T >::push_back(), and std::vector< T >::size().
Referenced by remCol().
void marlin::CCProcessor::remCol | ( | const std::string & | iotype, |
const std::string & | name, | ||
unsigned int | index | ||
) |
Removes collection of the given iotype ( INPUT / OUTPUT ) with the given name at the given index.
Definition at line 327 of file CCProcessor.cc.
References _cols, popCol(), and std::size().
Referenced by IColDelegate::remCollection().
void marlin::CCProcessor::setConditions | ( | const std::string & | conditions | ) |
Sets the processor's conditions.
Definition at line 153 of file CCProcessor.cc.
References _conditions, std::set< K >::insert(), std::string::size(), and std::string::substr().
void marlin::CCProcessor::setError | ( | int | error | ) |
Activates an error flag in this processor ( NO_PARAMETERS=0, NOT_INSTALLED=1, COL_ERRORS=2 )
Definition at line 399 of file CCProcessor.cc.
References _error, _error_desc, _errors, and std::vector< T >::push_back().
Referenced by addColsFromParam(), addDCol(), addUCol(), and setMarlinProc().
|
private |
Definition at line 208 of file CCProcessor.cc.
References _proc, _type, clearError(), marlin::CMProcessor::getProc(), marlin::CMProcessor::instance(), isInstalled(), NOT_INSTALLED, and setError().
|
inline |
void marlin::CCProcessor::setOptionalParam | ( | const std::string & | key, |
bool | optional = true |
||
) |
Sets a parameter as optional (if optional=true parameter is written out as a comment)
Definition at line 446 of file CCProcessor.cc.
References _optParams, std::set< K >::erase(), and std::set< K >::insert().
Referenced by Dialog::optParamChanged(), and NParamVecSet::remValSet().
|
private |
Definition at line 252 of file CCProcessor.cc.
References _cols, _param, std::begin(), std::vector< T >::clear(), std::map< K, T >::end(), hasParameters(), INPUT, isInstalled(), OUTPUT, and std::vector< T >::push_back().
Referenced by CCProcessor().
void marlin::CCProcessor::writeToXML | ( | std::ofstream & | stream | ) |
Writes this processor to a stream using the XML format.
Definition at line 455 of file CCProcessor.cc.
References _cols, _name, _param, _type, std::map< K, T >::begin(), std::vector< T >::clear(), DUPLICATE, std::map< K, T >::end(), std::endl(), getDescription(), marlin::CMProcessor::getParam(), marlin::CMProcessor::getParamD(), marlin::CMProcessor::getParamSetSize(), hasParameters(), marlin::CMProcessor::instance(), isInstalled(), isParamOptional(), std::vector< T >::size(), std::ssize(), marlin::ProcessorParameter::type(), and UNAVAILABLE.
|
private |
Definition at line 177 of file CCProcessor.h.
Referenced by addCol(), addDCol(), addUCol(), clearError(), clearParameters(), getCols(), getColTypeNames(), remCol(), writeColsToParam(), writeToXML(), and ~CCProcessor().
|
private |
Definition at line 175 of file CCProcessor.h.
Referenced by getConditions(), hasCondition(), and setConditions().
|
private |
Definition at line 166 of file CCProcessor.h.
Referenced by clearError(), hasErrorCols(), hasErrors(), hasParameters(), isInstalled(), and setError().
|
private |
Definition at line 172 of file CCProcessor.h.
Referenced by clearError(), and setError().
|
private |
Definition at line 173 of file CCProcessor.h.
Referenced by clearError(), getError(), and setError().
|
private |
Definition at line 167 of file CCProcessor.h.
Referenced by getName(), setName(), and writeToXML().
|
private |
Definition at line 184 of file CCProcessor.h.
Referenced by clearParameters(), isParamOptional(), and setOptionalParam().
|
private |
Definition at line 169 of file CCProcessor.h.
Referenced by addColsFromParam(), CCProcessor(), clearParameters(), getParameters(), writeColsToParam(), and writeToXML().
|
private |
Definition at line 170 of file CCProcessor.h.
Referenced by addColsFromParam(), getDescription(), and setMarlinProc().
|
private |
Definition at line 165 of file CCProcessor.h.
Referenced by changeStatus(), and isActive().
|
private |
Definition at line 168 of file CCProcessor.h.
Referenced by getType(), isParamOptional(), setMarlinProc(), and writeToXML().
|
private |
Definition at line 181 of file CCProcessor.h.
Referenced by addCol(), and getColHeaders().