Marlin  01.17.01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
marlin::CCProcessor Class Reference

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 ()
 
CCProcessoroperator= (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::stringgetName ()
 Returns the Name of the processor. More...
 
const std::stringgetType ()
 Returns the Type of the processor. More...
 
sSetgetConditions ()
 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< StringParametersgetParameters ()
 Returns the string parameters for this processor. More...
 
const ssMapgetColHeaders (const std::string &iotype)
 Returns a map with collection names and their respective types for INPUT/OUTPUT collections of this processor. More...
 
ColVecgetCols (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...
 
sSetgetColTypeNames (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 ()
 
CCCollectionpopCol (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
 

Detailed Description

handles information about marlin processors and their collections needed by MarlinSteerCheck

Author
Jan Engels, Benjamin Eberhardt, DESY
Version
Id:
CCProcessor.h,v 1.23 2007-01-11 16:56:37 engels Exp

Definition at line 39 of file CCProcessor.h.

Constructor & Destructor Documentation

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 ( )

Member Function Documentation

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.

References _cols, and _types.

Referenced by IColDelegate::addCollection(), and addColsFromParam().

void marlin::CCProcessor::addColsFromParam ( std::shared_ptr< StringParameters p)
private
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().

void marlin::CCProcessor::clearParameters ( )
private
const ssMap& marlin::CCProcessor::getColHeaders ( const std::string iotype)
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().

sSet& marlin::CCProcessor::getConditions ( )
inline

Returns the Conditions of the processor.

Definition at line 80 of file CCProcessor.h.

References _conditions.

const std::string marlin::CCProcessor::getDescription ( )
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().

const std::string marlin::CCProcessor::getError ( )
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().

const std::string& marlin::CCProcessor::getName ( )
inline

Returns the Name of the processor.

Definition at line 74 of file CCProcessor.h.

References _name.

Referenced by Dialog::Dialog(), and NParamVecSet::updateTable().

std::shared_ptr<StringParameters> marlin::CCProcessor::getParameters ( )
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().

const std::string marlin::CCProcessor::getStatusDesc ( )
inline

Returns a string with the processor status ( "Active", "Inactive" )

Definition at line 94 of file CCProcessor.h.

References isActive().

const std::string& marlin::CCProcessor::getType ( )
inline
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().

bool marlin::CCProcessor::hasErrorCols ( )
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.

bool marlin::CCProcessor::hasParameters ( )
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().

bool marlin::CCProcessor::isActive ( )
inline
bool marlin::CCProcessor::isErrorCol ( const std::string type,
const std::string value 
)
bool marlin::CCProcessor::isInstalled ( )
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().

CCProcessor& marlin::CCProcessor::operator= ( const CCProcessor )
delete
CCCollection * marlin::CCProcessor::popCol ( ColVec v,
CCCollection c 
)
private
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().

void marlin::CCProcessor::setMarlinProc ( )
private
void marlin::CCProcessor::setName ( const std::string name)
inline

Sets the processor's name.

Definition at line 134 of file CCProcessor.h.

References _name.

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().

void marlin::CCProcessor::writeColsToParam ( )
private
void marlin::CCProcessor::writeToXML ( std::ofstream stream)

Member Data Documentation

ssColVecMap marlin::CCProcessor::_cols
private
sSet marlin::CCProcessor::_conditions
private

Definition at line 175 of file CCProcessor.h.

Referenced by getConditions(), hasCondition(), and setConditions().

std::vector<bool> marlin::CCProcessor::_error
private

Definition at line 166 of file CCProcessor.h.

Referenced by clearError(), hasErrorCols(), hasErrors(), hasParameters(), isInstalled(), and setError().

const StringVec marlin::CCProcessor::_error_desc { "Processor has no Parameters", "Processor not available!", "Some Collections have Errors"}
private

Definition at line 172 of file CCProcessor.h.

Referenced by clearError(), and setError().

StringVec marlin::CCProcessor::_errors {}
private

Definition at line 173 of file CCProcessor.h.

Referenced by clearError(), getError(), and setError().

std::string marlin::CCProcessor::_name
private

Definition at line 167 of file CCProcessor.h.

Referenced by getName(), setName(), and writeToXML().

sSet marlin::CCProcessor::_optParams
private

Definition at line 184 of file CCProcessor.h.

Referenced by clearParameters(), isParamOptional(), and setOptionalParam().

std::shared_ptr<StringParameters> marlin::CCProcessor::_param
private
Processor* marlin::CCProcessor::_proc
private

Definition at line 170 of file CCProcessor.h.

Referenced by addColsFromParam(), getDescription(), and setMarlinProc().

bool marlin::CCProcessor::_status
private

Definition at line 165 of file CCProcessor.h.

Referenced by changeStatus(), and isActive().

std::string marlin::CCProcessor::_type
private

Definition at line 168 of file CCProcessor.h.

Referenced by getType(), isParamOptional(), setMarlinProc(), and writeToXML().

sssMap marlin::CCProcessor::_types
private

Definition at line 181 of file CCProcessor.h.

Referenced by addCol(), and getColHeaders().


The documentation for this class was generated from the following files: