28 typedef std::vector<boost::shared_ptr<fireworks::OptionNode> >
Options;
45 return iLHS->description() == iRHS->description();
54 unsigned long iSubstitutionEnd,
63 const std::vector<boost::shared_ptr<OptionNode> >&
options()
const {
68 std::vector<boost::shared_ptr<OptionNode> >::iterator it=
83 std::vector<boost::shared_ptr<OptionNode> >& );
94 unsigned long iSubstitutionEnd,
97 m_description(iDescription),
98 m_endOfName(iSubstitutionEnd),
99 m_hasSubOptions(typeHasOptions(iType) )
108 if(index == std::string::npos) {
109 return iMember.
name()+
":"+typeString;
111 return iMember.
name()+typeString.substr(index,std::string::npos)+
":"+
112 typeString.substr(0,index);
119 m_description(descriptionFromMember(iMember)),
121 m_hasSubOptions(typeHasOptions(m_type))
127 std::vector<boost::shared_ptr<OptionNode> >& oOptions)
135 oOptions.reserve(oOptions.size()+functions.
size());
136 for(
auto const&
function : functions) {
143 m.
name().substr(0,2)==
"__") {
continue;}
144 oOptions.push_back(boost::shared_ptr<OptionNode>(
new OptionNode(m)));
148 for(
auto const&
base : bases) {
166 #define FUN1(_fun_) \
167 m_builtins.push_back(boost::shared_ptr<OptionNode>( new OptionNode( # _fun_ "(float):float", strlen( # _fun_ )+1,s_float)))
169 #define FUN2(_fun_) \
170 m_builtins.push_back(boost::shared_ptr<OptionNode>( new OptionNode( # _fun_ "(float,float):float", strlen( # _fun_ )+1,s_float)))
231 OptionNode::fillOptionForType(iType,
m_options);
234 std::vector<boost::shared_ptr<OptionNode> >::iterator it=
244 void dummyDelete(
void*) {
247 void findTypeDelimiters(
const char*& ioBegin,
249 std::vector<const char*>& oDelimeters)
252 if(ioBegin==iEnd) {
return; }
253 const char* it = iEnd-1;
254 const char* itEnd = ioBegin-1;
255 for(; it != itEnd; --it) {
256 if(isalnum(*it)) {
continue;}
257 bool shouldStop=
false;
261 oDelimeters.push_back(it);
266 if(shouldStop) {
break;}
269 std::reverse(oDelimeters.begin(),oDelimeters.end());
275 std::vector<std::pair<boost::shared_ptr<std::string>,
std::string> >& oOptions)
const
279 std::vector<const char*> delimeters;
280 findTypeDelimiters(iBegin, iEnd, delimeters);
283 const char*
begin = iBegin;
284 for(std::vector<const char*>::iterator it = delimeters.begin(), itEnd = delimeters.end();
290 boost::shared_ptr<OptionNode>
comp(&temp, dummyDelete);
291 Options::const_iterator itFind =std::lower_bound(nodes->begin(),
296 if(itFind == nodes->end() || *comp < *(*itFind) ) {
300 nodes = &((*itFind)->options());
306 unsigned int part_size = part.size();
307 for(Options::const_iterator it = nodes->begin(), itEnd = nodes->end();
310 if(part == (*it)->description().substr(0,part_size) ) {
311 oOptions.push_back(std::make_pair(boost::shared_ptr<std::string>(const_cast<std::string*>(&((*it)->description())), dummyDelete),
312 (*it)->description().substr(part_size,(*it)->substitutionEnd()-part_size)));
OptionNode(const edm::FunctionWithDict &)
void setType(const edm::TypeWithDict &)
std::string::size_type m_endOfName
bool isConstructor() const
Sin< T >::type sin(const T &t)
bool operator<(const OptionNode &iRHS) const
std::vector< boost::shared_ptr< fireworks::OptionNode > > m_options
TypeWithDict toType() const
virtual void fillOptions(const char *iBegin, const char *iEnd, std::vector< std::pair< boost::shared_ptr< std::string >, std::string > > &oOptions) const
std::string typeName() const
const std::string & description() const
edm::TypeWithDict returnType(const edm::FunctionWithDict &func)
Cos< T >::type cos(const T &t)
unsigned long substitutionEnd() const
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
std::string m_description
const std::vector< boost::shared_ptr< OptionNode > > & options() const
std::vector< boost::shared_ptr< OptionNode > > m_subOptions
static bool typeHasOptions(const edm::TypeWithDict &iType)
bool operator()(const T &iLHS, const T &iRHS) const
static void fillOptionForType(const edm::TypeWithDict &, std::vector< boost::shared_ptr< OptionNode > > &)
virtual ~FWExpressionValidator()
std::vector< boost::shared_ptr< fireworks::OptionNode > > Options
std::vector< boost::shared_ptr< fireworks::OptionNode > > m_builtins
bool isDestructor() const
bool operator()(const T &iLHS, const T &iRHS) const
tuple size
Write out results.
Power< A, B >::type pow(const A &a, const B &b)