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 50 of file FWExpressionValidator.cc.

Constructor & Destructor Documentation

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

Definition at line 117 of file FWExpressionValidator.cc.

Referenced by FWExpressionValidator::fillOptions().

117  :
118  m_type(reco::returnType(iMember)),
119  m_description(descriptionFromMember(iMember)),
120  m_endOfName(iMember.name().size()),
122  {
123  }
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 93 of file FWExpressionValidator.cc.

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

95  :
96  m_type(iType),
97  m_description(iDescription),
98  m_endOfName(iSubstitutionEnd),
100  {
101  }
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 57 of file FWExpressionValidator.cc.

57  {
58  return m_description;
59  }
void fireworks::OptionNode::fillOptionForType ( const edm::TypeWithDict iType,
std::vector< std::shared_ptr< OptionNode > > &  oOptions 
)
static

Definition at line 126 of file FWExpressionValidator.cc.

References runEdmFileComparison::base, stringResolutionProvider_cfi::functions, edm::FunctionWithDict::isConst(), edm::FunctionWithDict::isConstructor(), edm::FunctionWithDict::isDestructor(), edm::FunctionWithDict::isOperator(), edm::TypeWithDict::isPointer(), edm::FunctionWithDict::isPublic(), funct::m, edm::FunctionWithDict::name(), edm::TypeFunctionMembers::size(), and edm::TypeWithDict::toType().

Referenced by FWExpressionValidator::setType().

128  {
129  edm::TypeWithDict type = iType;
130  if(type.isPointer()) {
131  type = type.toType(); // for Pointers, I get the real type this way
132  }
133  // first look in base scope
135  oOptions.reserve(oOptions.size()+functions.size());
136  for(auto const& function : functions) {
137  edm::FunctionWithDict m(function);
138  if(!m.isConst() ||
139  m.isConstructor() ||
140  m.isDestructor() ||
141  m.isOperator() ||
142  !m.isPublic() ||
143  m.name().substr(0,2)=="__") {continue;}
144  oOptions.push_back(std::make_shared<OptionNode>(m));
145  }
146 
147  edm::TypeBases bases(type);
148  for(auto const& base : bases) {
149  fillOptionForType(edm::BaseWithDict(base).typeOf(),oOptions);
150  }
151  }
type
Definition: HCALResponse.h:21
TypeWithDict toType() const
base
Make Sure CMSSW is Setup ##.
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 78 of file FWExpressionValidator.cc.

References m_description, and m_endOfName.

78  {
79  return m_description.substr(0,m_endOfName) < iRHS.m_description.substr(0,iRHS.m_endOfName);
80  }
std::string::size_type m_endOfName
const std::vector<std::shared_ptr<OptionNode> >& fireworks::OptionNode::options ( ) const
inline

Definition at line 63 of file FWExpressionValidator.cc.

References tier0::unique().

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

63  {
64  if(m_hasSubOptions && m_subOptions.empty()) {
66  std::sort(m_subOptions.begin(),m_subOptions.end(),
68  std::vector<std::shared_ptr<OptionNode> >::iterator it=
71  m_subOptions.erase(it, m_subOptions.end());
72 
73  m_hasSubOptions = !m_subOptions.empty();
74  }
75  return m_subOptions;
76  }
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 60 of file FWExpressionValidator.cc.

60  {
61  return m_endOfName;
62  }
std::string::size_type m_endOfName
bool fireworks::OptionNode::typeHasOptions ( const edm::TypeWithDict iType)
staticprivate

Definition at line 153 of file FWExpressionValidator.cc.

References edm::TypeWithDict::isClass().

153  {
154  return iType.isClass();
155  }
bool isClass() const

Member Data Documentation

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

Definition at line 86 of file FWExpressionValidator.cc.

Referenced by operator<().

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

Definition at line 87 of file FWExpressionValidator.cc.

Referenced by operator<().

bool fireworks::OptionNode::m_hasSubOptions
mutableprivate

Definition at line 89 of file FWExpressionValidator.cc.

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

Definition at line 88 of file FWExpressionValidator.cc.

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

Definition at line 85 of file FWExpressionValidator.cc.

Referenced by FWExpressionValidator::setType().