1 #include <odindata/step.h>
9 result->args.copy_ldr_vals(args);
18 unsigned int nargs=args.numof_pars();
22 for(
unsigned int i=0; i<toks.size(); i++) {
23 STD_string oneargstr=
replaceStr(toks[i],
"\"",
"");
24 ODINLOG(odinlog,normalDebug) <<
"oneargstr[" << i <<
"]=" << oneargstr << STD_endl;
26 args[i].parsevalstring(oneargstr);
28 ODINLOG(odinlog,warningLog) <<
"More arguments provided than parameters in step - argument: " << toks[i] << STD_endl;
36 int nargs=args.numof_pars();
38 for(
int i=0; i<nargs; i++) {
39 result+=args[i].get_description();
41 STD_string unit=args[i].get_unit();
42 if(unit!=
"") result+=
" ["+unit+
"]";
44 STD_string defval=args[i].printvalstring();
45 if(defval!=
"" && defval!=ODIN_NONE_STR) result+=
" (default="+defval+
")";
47 svector alt=args[i].get_alternatives();
49 if(i<(nargs-1)) result+=
",";
57 int nargs=args.numof_pars();
59 for(
int i=0; i<nargs; i++) {
60 result+=args[i].printvalstring();
61 STD_string unit=args[i].get_unit();
62 if(unit!=
"") result+=
"["+unit+
"]";
63 if(i<(nargs-1)) result+=
",";
88 STD_list<T*> steplist;
89 T::create_templates(steplist);
91 for(
typename STD_list<T*>::const_iterator it=steplist.begin(); it!=steplist.end(); ++it) {
94 if(parblock) p->append_opts(*parblock);
95 templates[p->label()]=p;
102 for(
typename StepMap::iterator it=templates.begin(); it!=templates.end(); ++it)
delete it->second;
103 for(
typename STD_list<T*>::iterator it=garbage.begin(); it!=garbage.end(); ++it)
delete (*it);
111 typename StepMap::const_iterator it=templates.find(label);
112 if(it!=templates.end()) {
113 result=it->second->clone();
115 ODINLOG(odinlog,errorLog) <<
"Step with label >" << label <<
"< not found" << STD_endl;
118 garbage.push_back(result);
126 STD_string description;
137 STD_map<STD_string, STD_list<StepDoc> > strmap;
139 for(
typename StepMap::const_iterator it=templates.begin(); it!=templates.end(); ++it) {
141 const char* classtype=
typeid(*(it->second)).name();
142 while( (*classtype) >=
'0' && (*classtype) <=
'9' ) classtype++;
144 STD_string classname(classtype);
145 classname=
rmblock(classname,
"IL",
"");
149 doc.description=it->second->description();
150 T::interface_description(it->second, doc.in, doc.out);
153 it->second->append_opts(parblock);
155 for(
int i=0; i<nargs; i++) {
157 STD_string cmdlineopt=parblock[i].get_cmdline_option();
158 if(cmdlineopt!=
"") doc.options+=
", command-line option: -"+cmdlineopt;
161 strmap[classname].push_back(doc);
166 result+=
" * @addtogroup "+T::manual_group()+
"\n";
170 for(STD_map<STD_string, STD_list<StepDoc> >::const_iterator it=strmap.begin(); it!=strmap.end(); ++it) {
173 result+=
" * \\class "+it->first+
"\n";
177 for(STD_list<StepDoc>::const_iterator docit=it->second.begin(); docit!=it->second.end(); ++docit) {
178 if(labels!=
"") labels+=
", ";
179 labels+=
"\\b "+docit->label;
180 descr=docit->description;
182 result+=
" * \\brief "+labels+
": "+descr+
"\n\n";
184 for(STD_list<StepDoc>::const_iterator docit=it->second.begin(); docit!=it->second.end(); ++docit) {
185 result+=
" * Functor label: \\b "+docit->label+
"\n\n";
186 if(docit->in!=
"" || docit->out!=
"") {
187 result+=
" * Interface of \\b "+docit->label+
":\n";
188 result+=
" * - input: "+docit->in+
"\n";
189 result+=
" * - output: "+docit->out+
"\n";
193 if(docit->options!=
"") {
194 result+=
" * Options of \\b "+docit->label+
":\n";
195 result+=
" * \\verbatim \n";
196 result+=docit->options;
197 result+=
" \\endverbatim \n\n";
213 for(
typename StepMap::const_iterator it=templates.begin(); it!=templates.end(); ++it) {
214 const T* st=it->second;
215 ret += lineprefix+
"-"+st->label();
216 STD_string argsdescr=st->args_description();
217 if(argsdescr!=
"") ret +=
" <"+argsdescr+
">";
218 ret +=
" : "+st->description()+
"\n";
const STD_string & get_description() const
LDRblock & merge(LDRblock &block, bool onlyUserPars=true)
unsigned int numof_pars() const
Labeled & set_label(const STD_string &label)
STD_string manual() const
T * create(const STD_string &label) const
STD_string get_cmdline_usage(const STD_string &lineprefix) const
StepFactory(LDRblock *parblock=0)
void append_arg(LDRbase &arg, const STD_string &arglabel)
void set_args(const STD_string &argstr)
void append_opts(LDRblock &parblock)
STD_string args_description() const
STD_string args_values() const
STD_string replaceStr(const STD_string &s, const STD_string &searchstring, const STD_string &replacement, whichOccurences mode=allOccurences)
STD_string rmblock(const STD_string &s, const STD_string &blockbegin, const STD_string &blockend, bool rmbegin=true, bool rmend=true, bool rmall=true, bool hierachical=false)
STD_string tokenstring(const svector &tokens, unsigned int linewidth=_DEFAULT_LINEWIDTH_)
svector tokens(const STD_string &tokenstring, char custom_separator=0, char escape_begin='"', char escape_end='"')
STD_string itos(int i, unsigned int maxabs=0)