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

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

Definition at line 97 of file FWExpressionValidator.cc.

Referenced by FWExpressionValidator::fillOptions().

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

Definition at line 77 of file FWExpressionValidator.cc.

References edm::FunctionWithDict::name(), AlCaHLTBitMon_QueryRunRegistry::string, and edm::FunctionWithDict::typeName().

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

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

Definition at line 46 of file FWExpressionValidator.cc.

46 { return m_description; }
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, edm::FunctionWithDict::isConst(), edm::FunctionWithDict::isConstructor(), edm::FunctionWithDict::isDestructor(), edm::FunctionWithDict::isOperator(), edm::TypeWithDict::isPointer(), edm::FunctionWithDict::isPublic(), visualization-live-secondInstance_cfg::m, edm::FunctionWithDict::name(), edm::TypeFunctionMembers::size(), and edm::TypeWithDict::toType().

Referenced by FWExpressionValidator::setType().

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  }
type
Definition: HCALResponse.h:21
base
Main Program
Definition: newFWLiteAna.py:92
TypeWithDict toType() const
static void fillOptionForType(const edm::TypeWithDict &, std::vector< std::shared_ptr< OptionNode > > &)
bool isPointer() const
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
const std::vector<std::shared_ptr<OptionNode> >& fireworks::OptionNode::options ( ) const
inline

Definition at line 48 of file FWExpressionValidator.cc.

References tier0::unique().

Referenced by betterConfigParser.BetterConfigParser::__updateDict(), betterConfigParser.BetterConfigParser::checkInput(), CrabHelper.CrabHelper::crab_config_filename(), CrabHelper.CrabHelper::crab_taskname(), DOTExport.DotExport::export(), CrabHelper.CrabHelper::fill_options_from_crab_config(), and DOTExport.DotExport::write_output().

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
unsigned long fireworks::OptionNode::substitutionEnd ( ) const
inline

Definition at line 47 of file FWExpressionValidator.cc.

47 { return m_endOfName; }
std::string::size_type m_endOfName
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

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

Definition at line 70 of file FWExpressionValidator.cc.

Referenced by operator<().

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

Definition at line 71 of file FWExpressionValidator.cc.

Referenced by operator<().

bool fireworks::OptionNode::m_hasSubOptions
mutableprivate

Definition at line 73 of file FWExpressionValidator.cc.

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

Definition at line 72 of file FWExpressionValidator.cc.

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

Definition at line 69 of file FWExpressionValidator.cc.

Referenced by FWExpressionValidator::setType().