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

◆ 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),

Member Function Documentation

◆ description()

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

Definition at line 46 of file FWExpressionValidator.cc.

46 { return m_description; }

References 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.

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  }

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

Referenced by options().

◆ operator<()

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

Definition at line 62 of file FWExpressionValidator.cc.

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

References m_description, and m_endOfName.

◆ options()

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

◆ substitutionEnd()

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

Definition at line 47 of file FWExpressionValidator.cc.

47 { return m_endOfName; }

References m_endOfName.

◆ typeHasOptions()

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

Definition at line 127 of file FWExpressionValidator.cc.

127 { return iType.isClass(); }

References edm::TypeWithDict::isClass().

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

fireworks::OptionNode::m_endOfName
std::string::size_type m_endOfName
Definition: FWExpressionValidator.cc:71
fireworks::OptionNode::m_type
edm::TypeWithDict m_type
Definition: FWExpressionValidator.cc:69
edm::TypeWithDict::isClass
bool isClass() const
Definition: TypeWithDict.cc:403
edm::BaseWithDict
Definition: BaseWithDict.h:18
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:78
fireworks::OptionNode::m_description
std::string m_description
Definition: FWExpressionValidator.cc:70
reco::returnType
edm::TypeWithDict returnType(const edm::FunctionWithDict &func)
Definition: returnType.cc:16
edm::TypeWithDict
Definition: TypeWithDict.h:38
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
edm::TypeWithDict::toType
TypeWithDict toType() const
Definition: TypeWithDict.cc:633
fireworks::OptionNode::m_hasSubOptions
bool m_hasSubOptions
Definition: FWExpressionValidator.cc:73
stringResolutionProvider_cfi.functions
functions
Definition: stringResolutionProvider_cfi.py:7
fireworks::OptionNodePtrCompare
Definition: FWExpressionValidator.cc:32
fireworks::OptionNodePtrEqual
Definition: FWExpressionValidator.cc:37
fireworks::OptionNode::fillOptionForType
static void fillOptionForType(const edm::TypeWithDict &, std::vector< std::shared_ptr< OptionNode > > &)
Definition: FWExpressionValidator.cc:103
edm::FunctionWithDict
Definition: FunctionWithDict.h:27
tier0.unique
def unique(seq, keepstr=True)
Definition: tier0.py:24
fireworks::OptionNode::typeHasOptions
static bool typeHasOptions(const edm::TypeWithDict &iType)
Definition: FWExpressionValidator.cc:127
edm::FunctionWithDict::name
std::string name() const
Definition: FunctionWithDict.cc:36
fireworks::OptionNode::m_subOptions
std::vector< std::shared_ptr< OptionNode > > m_subOptions
Definition: FWExpressionValidator.cc:72
edm::TypeBases
Definition: TypeWithDict.h:153
newFWLiteAna.base
base
Definition: newFWLiteAna.py:92
edm::TypeFunctionMembers
Definition: TypeWithDict.h:175