CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes
fireworks::OptionNode Class Reference

Public Member Functions

const std::string & description () const
 
bool operator< (const OptionNode &iRHS) const
 
 OptionNode (const edm::FunctionWithDict &)
 
 OptionNode (const std::string &iDescription, unsigned long iSubstitutionEnd, const edm::TypeWithDict &iType)
 
const std::vector< std::shared_ptr< OptionNode > > & options () const
 
unsigned long substitutionEnd () const
 

Static Public Member Functions

static void fillOptionForType (const edm::TypeWithDict &, std::vector< std::shared_ptr< OptionNode > > &)
 

Static Private Member Functions

static bool typeHasOptions (const edm::TypeWithDict &iType)
 

Private Attributes

std::string m_description
 
std::string::size_type m_endOfName
 
bool m_hasSubOptions
 
std::vector< std::shared_ptr< OptionNode > > m_subOptions
 
edm::TypeWithDict m_type
 

Detailed Description

Definition at line 41 of file FWExpressionValidator.cc.

Constructor & Destructor Documentation

◆ OptionNode() [1/2]

fireworks::OptionNode::OptionNode ( const edm::FunctionWithDict iMember)

Definition at line 97 of file FWExpressionValidator.cc.

98  : m_type(reco::returnType(iMember)),
99  m_description(descriptionFromMember(iMember)),
100  m_endOfName(iMember.name().size()),
std::string::size_type m_endOfName
edm::TypeWithDict returnType(const edm::FunctionWithDict &)
Definition: returnType.cc:16
std::string name() const
static bool typeHasOptions(const edm::TypeWithDict &iType)

◆ OptionNode() [2/2]

fireworks::OptionNode::OptionNode ( const std::string &  iDescription,
unsigned long  iSubstitutionEnd,
const edm::TypeWithDict iType 
)

Definition at line 77 of file FWExpressionValidator.cc.

80  : m_type(iType),
81  m_description(iDescription),
82  m_endOfName(iSubstitutionEnd),
std::string::size_type m_endOfName
static bool typeHasOptions(const edm::TypeWithDict &iType)

Member Function Documentation

◆ description()

const std::string& fireworks::OptionNode::description ( ) const
inline

Definition at line 46 of file FWExpressionValidator.cc.

References m_description.

46 { return m_description; }

◆ fillOptionForType()

void fireworks::OptionNode::fillOptionForType ( const edm::TypeWithDict iType,
std::vector< std::shared_ptr< OptionNode > > &  oOptions 
)
static

Definition at line 103 of file FWExpressionValidator.cc.

References newFWLiteAna::base, stringResolutionProvider_cfi::functions, visualization-live-secondInstance_cfg::m, and edm::TypeWithDict::toType().

Referenced by options().

104  {
105  edm::TypeWithDict type = iType;
106  if (type.isPointer()) {
107  type = type.toType(); // for Pointers, I get the real type this way
108  }
109  // first look in base scope
111  oOptions.reserve(oOptions.size() + functions.size());
112  for (auto const& function : functions) {
113  edm::FunctionWithDict m(function);
114  if (!m.isConst() || m.isConstructor() || m.isDestructor() || m.isOperator() || !m.isPublic() ||
115  m.name().substr(0, 2) == "__") {
116  continue;
117  }
118  oOptions.push_back(std::make_shared<OptionNode>(m));
119  }
120 
121  edm::TypeBases bases(type);
122  for (auto const& base : bases) {
123  fillOptionForType(edm::BaseWithDict(base).typeOf(), oOptions);
124  }
125  }
base
Main Program
Definition: newFWLiteAna.py:92
static void fillOptionForType(const edm::TypeWithDict &, std::vector< std::shared_ptr< OptionNode > > &)
TypeWithDict toType() const

◆ operator<()

bool fireworks::OptionNode::operator< ( const OptionNode iRHS) const
inline

Definition at line 62 of file FWExpressionValidator.cc.

References m_description, and m_endOfName.

62  {
63  return m_description.substr(0, m_endOfName) < iRHS.m_description.substr(0, iRHS.m_endOfName);
64  }
std::string::size_type m_endOfName

◆ options()

const std::vector<std::shared_ptr<OptionNode> >& fireworks::OptionNode::options ( ) const
inline

Definition at line 48 of file FWExpressionValidator.cc.

References fillOptionForType(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, m_hasSubOptions, m_subOptions, m_type, jetUpdater_cfi::sort, and tier0::unique().

Referenced by betterConfigParser.BetterConfigParser::__updateDict(), submitPVValidationJobs.BetterConfigParser::__updateDict(), CrabHelper.CrabHelper::check_crabtask(), betterConfigParser.BetterConfigParser::checkInput(), CrabHelper.CrabHelper::crab_config_filename(), CrabHelper.CrabHelper::crab_config_filepath(), CrabHelper.CrabHelper::crab_taskname(), CrabHelper.CrabHelper::fill_options_from_crab_config(), CrabHelper.CrabHelper::submit_crab_task(), and CrabHelper.CrabHelper::write_crabConfig().

48  {
49  if (m_hasSubOptions && m_subOptions.empty()) {
51  std::sort(
53  std::vector<std::shared_ptr<OptionNode> >::iterator it = std::unique(
55  m_subOptions.erase(it, m_subOptions.end());
56 
57  m_hasSubOptions = !m_subOptions.empty();
58  }
59  return m_subOptions;
60  }
def unique(seq, keepstr=True)
Definition: tier0.py:24
static void fillOptionForType(const edm::TypeWithDict &, std::vector< std::shared_ptr< OptionNode > > &)
std::vector< std::shared_ptr< OptionNode > > m_subOptions

◆ substitutionEnd()

unsigned long fireworks::OptionNode::substitutionEnd ( ) const
inline

Definition at line 47 of file FWExpressionValidator.cc.

References m_endOfName.

47 { return m_endOfName; }
std::string::size_type m_endOfName

◆ typeHasOptions()

bool fireworks::OptionNode::typeHasOptions ( const edm::TypeWithDict iType)
staticprivate

Definition at line 127 of file FWExpressionValidator.cc.

References edm::TypeWithDict::isClass().

127 { return iType.isClass(); }
bool isClass() const

Member Data Documentation

◆ m_description

std::string fireworks::OptionNode::m_description
mutableprivate

Definition at line 70 of file FWExpressionValidator.cc.

Referenced by description(), and operator<().

◆ m_endOfName

std::string::size_type fireworks::OptionNode::m_endOfName
mutableprivate

Definition at line 71 of file FWExpressionValidator.cc.

Referenced by operator<(), and substitutionEnd().

◆ m_hasSubOptions

bool fireworks::OptionNode::m_hasSubOptions
mutableprivate

Definition at line 73 of file FWExpressionValidator.cc.

Referenced by options().

◆ m_subOptions

std::vector<std::shared_ptr<OptionNode> > fireworks::OptionNode::m_subOptions
mutableprivate

Definition at line 72 of file FWExpressionValidator.cc.

Referenced by options().

◆ m_type

edm::TypeWithDict fireworks::OptionNode::m_type
private

Definition at line 69 of file FWExpressionValidator.cc.

Referenced by options().