28 typedef std::vector<std::shared_ptr<fireworks::OptionNode> >
Options;
33 bool operator()(
const T& iLHS,
const T& iRHS)
const {
return *iLHS < *iRHS; }
38 bool operator()(
const T& iLHS,
const T& iRHS)
const {
return iLHS->description() == iRHS->description(); }
48 const std::vector<std::shared_ptr<OptionNode> >&
options()
const {
53 std::vector<std::shared_ptr<OptionNode> >::iterator
it =
std::unique(
78 unsigned long iSubstitutionEnd,
81 m_description(iDescription),
82 m_endOfName(iSubstitutionEnd),
83 m_hasSubOptions(typeHasOptions(iType)) {}
89 if (
index == std::string::npos) {
90 return iMember.
name() +
":" + typeString;
92 return iMember.
name() + typeString.substr(
index, std::string::npos) +
":" + typeString.substr(0,
index);
99 m_description(descriptionFromMember(iMember)),
100 m_endOfName(iMember.
name().size()),
101 m_hasSubOptions(typeHasOptions(m_type)) {}
104 std::vector<std::shared_ptr<OptionNode> >& oOptions) {
106 if (
type.isPointer()) {
111 oOptions.reserve(oOptions.size() +
functions.size());
114 if (!
m.isConst() ||
m.isConstructor() ||
m.isDestructor() ||
m.isOperator() || !
m.isPublic() ||
115 m.name().substr(0, 2) ==
"__") {
118 oOptions.push_back(std::make_shared<OptionNode>(
m));
122 for (
auto const&
base : bases) {
138 #define FUN1(_fun_) \ 139 m_builtins.push_back(std::make_shared<OptionNode>(#_fun_ "(float):float", strlen(#_fun_) + 1, s_float)) 141 #define FUN2(_fun_) \ 142 m_builtins.push_back(std::make_shared<OptionNode>(#_fun_ "(float,float):float", strlen(#_fun_) + 1, s_float)) 196 OptionNode::fillOptionForType(iType,
m_options);
198 std::vector<std::shared_ptr<OptionNode> >::iterator
it =
207 void dummyDelete(
void*) {}
209 void findTypeDelimiters(
const char*& ioBegin,
const char* iEnd, std::vector<const char*>& oDelimeters) {
211 if (ioBegin == iEnd) {
214 const char*
it = iEnd - 1;
215 const char* itEnd = ioBegin - 1;
216 for (;
it != itEnd; --
it) {
220 bool shouldStop =
false;
225 oDelimeters.push_back(
it);
245 std::vector<const char*> delimeters;
246 findTypeDelimiters(iBegin, iEnd, delimeters);
249 const char*
begin = iBegin;
250 for (std::vector<const char*>::iterator
it = delimeters.begin(), itEnd = delimeters.end();
it != itEnd; ++
it) {
253 std::shared_ptr<OptionNode>
comp(&
temp, dummyDelete);
257 if (itFind ==
nodes->end() || *
comp < *(*itFind)) {
261 nodes = &((*itFind)->options());
267 unsigned int part_size =
part.size();
268 for (Options::const_iterator
it =
nodes->begin(), itEnd =
nodes->end();
it != itEnd; ++
it) {
269 if (
part == (*it)->description().substr(0, part_size)) {
271 std::make_pair(std::shared_ptr<std::string>(const_cast<std::string*>(&((*it)->description())), dummyDelete),
272 (*it)->description().substr(part_size, (*it)->substitutionEnd() - part_size)));
OptionNode(const edm::FunctionWithDict &)
bool operator()(const T &iLHS, const T &iRHS) const
void setType(const edm::TypeWithDict &)
void tanh(data_T data[CONFIG_T::n_in], res_T res[CONFIG_T::n_in])
std::string::size_type m_endOfName
unsigned long substitutionEnd() const
Sin< T >::type sin(const T &t)
bool operator()(const T &iLHS, const T &iRHS) const
~FWExpressionValidator() override
std::vector< std::shared_ptr< fireworks::OptionNode > > m_options
bool operator<(const OptionNode &iRHS) const
void fillOptions(const char *iBegin, const char *iEnd, std::vector< std::pair< std::shared_ptr< std::string >, std::string > > &oOptions) const override
edm::TypeWithDict returnType(const edm::FunctionWithDict &)
def unique(seq, keepstr=True)
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
std::vector< std::shared_ptr< fireworks::OptionNode > > Options
std::string m_description
const std::vector< std::shared_ptr< OptionNode > > & options() const
std::string typeName() const
static bool typeHasOptions(const edm::TypeWithDict &iType)
static void fillOptionForType(const edm::TypeWithDict &, std::vector< std::shared_ptr< OptionNode > > &)
std::vector< std::shared_ptr< fireworks::OptionNode > > m_builtins
std::vector< std::shared_ptr< OptionNode > > m_subOptions
TypeWithDict toType() const
const std::string & description() const
Power< A, B >::type pow(const A &a, const B &b)
MPlex< T, D1, D2, N > atan2(const MPlex< T, D1, D2, N > &y, const MPlex< T, D1, D2, N > &x)