CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
< boost::shared_ptr
< OptionNode > > & 
options () const
 
unsigned long substitutionEnd () const
 

Static Public Member Functions

static void fillOptionForType (const edm::TypeWithDict &, std::vector< boost::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< boost::shared_ptr
< OptionNode > > 
m_subOptions
 
edm::TypeWithDict m_type
 

Detailed Description

Definition at line 51 of file FWExpressionValidator.cc.

Constructor & Destructor Documentation

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

Definition at line 118 of file FWExpressionValidator.cc.

Referenced by fillOptionForType().

118  :
119  m_type(reco::returnType(iMember)),
120  m_description(descriptionFromMember(iMember)),
121  m_endOfName(iMember.name().size()),
123  {
124  }
std::string::size_type m_endOfName
std::string name() const
edm::TypeWithDict returnType(const edm::FunctionWithDict &mem)
Definition: returnType.cc:8
static bool typeHasOptions(const edm::TypeWithDict &iType)
fireworks::OptionNode::OptionNode ( const std::string &  iDescription,
unsigned long  iSubstitutionEnd,
const edm::TypeWithDict iType 
)

Definition at line 94 of file FWExpressionValidator.cc.

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

References m_description.

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

Definition at line 127 of file FWExpressionValidator.cc.

References newFWLiteAna::base, edm::FunctionWithDict::isConst(), edm::FunctionWithDict::isConstructor(), edm::FunctionWithDict::isDestructor(), edm::FunctionWithDict::isOperator(), edm::TypeWithDict::isPointer(), edm::FunctionWithDict::isPublic(), m, edm::FunctionWithDict::name(), OptionNode(), edm::TypeFunctionMembers::size(), and edm::TypeWithDict::toType().

Referenced by options().

129  {
130  edm::TypeWithDict type = iType;
131  if(type.isPointer()) {
132  type = type.toType(); // for Pointers, I get the real type this way
133  }
134  // first look in base scope
135  edm::TypeFunctionMembers functions(type);
136  oOptions.reserve(oOptions.size()+functions.size());
137  for(auto const& function : functions) {
138  edm::FunctionWithDict m(function);
139  if(!m.isConst() ||
140  m.isConstructor() ||
141  m.isDestructor() ||
142  m.isOperator() ||
143  !m.isPublic() ||
144  m.name().substr(0,2)=="__") {continue;}
145  oOptions.push_back(boost::shared_ptr<OptionNode>(new OptionNode(m)));
146  }
147 
148  edm::TypeBases bases(type);
149  for(auto const& base : bases) {
150  fillOptionForType(edm::BaseWithDict(base).typeOf(),oOptions);
151  }
152  }
tuple base
Main Program
Definition: newFWLiteAna.py:92
type
Definition: HCALResponse.h:21
OptionNode(const edm::FunctionWithDict &)
TypeWithDict toType() const
static void fillOptionForType(const edm::TypeWithDict &, std::vector< boost::shared_ptr< OptionNode > > &)
bool isPointer() const
bool fireworks::OptionNode::operator< ( const OptionNode iRHS) const
inline

Definition at line 79 of file FWExpressionValidator.cc.

References m_description, and m_endOfName.

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

Definition at line 64 of file FWExpressionValidator.cc.

References fillOptionForType(), m_hasSubOptions, m_subOptions, m_type, and python.multivaluedict::sort().

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

64  {
65  if(m_hasSubOptions && m_subOptions.empty()) {
67  std::sort(m_subOptions.begin(),m_subOptions.end(),
69  std::vector<boost::shared_ptr<OptionNode> >::iterator it=
70  std::unique(m_subOptions.begin(),m_subOptions.end(),
72  m_subOptions.erase(it, m_subOptions.end());
73 
74  m_hasSubOptions = !m_subOptions.empty();
75  }
76  return m_subOptions;
77  }
std::vector< boost::shared_ptr< OptionNode > > m_subOptions
static void fillOptionForType(const edm::TypeWithDict &, std::vector< boost::shared_ptr< OptionNode > > &)
unsigned long fireworks::OptionNode::substitutionEnd ( ) const
inline

Definition at line 61 of file FWExpressionValidator.cc.

References m_endOfName.

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

Definition at line 154 of file FWExpressionValidator.cc.

References edm::TypeWithDict::isClass().

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

Member Data Documentation

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

Definition at line 87 of file FWExpressionValidator.cc.

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

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

Definition at line 88 of file FWExpressionValidator.cc.

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

bool fireworks::OptionNode::m_hasSubOptions
mutableprivate

Definition at line 90 of file FWExpressionValidator.cc.

Referenced by options().

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

Definition at line 89 of file FWExpressionValidator.cc.

Referenced by options().

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

Definition at line 86 of file FWExpressionValidator.cc.

Referenced by options().