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 Reflex::Member &)
 
 OptionNode (const std::string &iDescription, unsigned long iSubstitutionEnd, const Reflex::Type &iType)
 
const std::vector
< boost::shared_ptr
< OptionNode > > & 
options () const
 
unsigned long substitutionEnd () const
 

Static Public Member Functions

static void fillOptionForType (const Reflex::Type &, std::vector< boost::shared_ptr< OptionNode > > &)
 

Static Private Member Functions

static bool typeHasOptions (const Reflex::Type &iType)
 

Private Attributes

std::string m_description
 
std::string::size_type m_endOfName
 
bool m_hasSubOptions
 
std::vector< boost::shared_ptr
< OptionNode > > 
m_subOptions
 
Reflex::Type m_type
 

Detailed Description

Definition at line 51 of file FWExpressionValidator.cc.

Constructor & Destructor Documentation

fireworks::OptionNode::OptionNode ( const Reflex::Member &  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
Type returnType(const Member &mem)
Definition: returnType.cc:9
static bool typeHasOptions(const Reflex::Type &iType)
fireworks::OptionNode::OptionNode ( const std::string &  iDescription,
unsigned long  iSubstitutionEnd,
const Reflex::Type &  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 Reflex::Type &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 Reflex::Type &  iType,
std::vector< boost::shared_ptr< OptionNode > > &  oOptions 
)
static

Definition at line 127 of file FWExpressionValidator.cc.

References b, m, and OptionNode().

Referenced by options().

129  {
130  Reflex::Type type = iType;
131  if(type.IsPointer()) {
132  type = type.ToType();
133  }
134  // first look in base scope
135  oOptions.reserve(oOptions.size()+type.FunctionMemberSize());
136  for(Reflex::Member_Iterator m = type.FunctionMember_Begin(); m != type.FunctionMember_End(); ++m ) {
137  if(!m->TypeOf().IsConst() ||
138  m->IsConstructor() ||
139  m->IsDestructor() ||
140  m->IsOperator() ||
141  !m->IsPublic() ||
142  m->Name().substr(0,2)=="__") {continue;}
143  oOptions.push_back(boost::shared_ptr<OptionNode>(new OptionNode(*m)));
144  }
145 
146  for(Reflex::Base_Iterator b = type.Base_Begin(); b != type.Base_End(); ++b) {
147  fillOptionForType(b->ToType(),oOptions);
148  }
149  }
type
Definition: HCALResponse.h:22
static void fillOptionForType(const Reflex::Type &, std::vector< boost::shared_ptr< OptionNode > > &)
OptionNode(const Reflex::Member &)
double b
Definition: hdecay.h:120
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  }
static void fillOptionForType(const Reflex::Type &, std::vector< boost::shared_ptr< OptionNode > > &)
std::vector< boost::shared_ptr< OptionNode > > m_subOptions
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 Reflex::Type &  iType)
staticprivate

Definition at line 151 of file FWExpressionValidator.cc.

151  {
152  return iType.IsClass();
153  }

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

Reflex::Type fireworks::OptionNode::m_type
private

Definition at line 86 of file FWExpressionValidator.cc.

Referenced by options().