Version: 9.15.0
YACS::forlooptypeParser< T > Struct Template Reference

#include <loopParsers.hxx>

Inheritance diagram for YACS::forlooptypeParser< T >:
Collaboration diagram for YACS::forlooptypeParser< T >:

Public Member Functions

virtual void buildAttr (const XML_Char **attr)
 
virtual void name (const std::string &name)
 
virtual void nsteps (const int &n)
 
virtual T post ()
 
- Public Member Functions inherited from YACS::looptypeParser< ENGINE::ForLoop * >
virtual void onStart (const XML_Char *el, const XML_Char **attr)
 
virtual void onEnd (const char *el, parser *child)
 
virtual void pre ()
 
virtual void state (const std::string &name)
 
virtual void property (const myprop &prop)
 
virtual void inline_ (ENGINE::InlineNode *const &n)
 
virtual void sinline (ENGINE::ServiceInlineNode *const &n)
 
virtual void service (ENGINE::ServiceNode *const &n)
 
virtual void server (ENGINE::ServerNode *const &n)
 
virtual void remote (ENGINE::InlineNode *const &n)
 
virtual void node (ENGINE::InlineNode *const &n)
 
virtual void forloop (ENGINE::ForLoop *const &b)
 
virtual void foreach (ENGINE::ForEachLoopGen *const &b)
 
virtual void optimizer (ENGINE::OptimizerLoop *const &b)
 
virtual void while_ (ENGINE::WhileLoop *const &b)
 
virtual void switch_ (ENGINE::Switch *const &b)
 
virtual void bloc (ENGINE::Bloc *const &b)
 
virtual void datalink (const mylink &l)
 
- Public Member Functions inherited from YACS::parser
 parser ()
 
virtual ~parser ()
 
virtual void SetUserDataAndPush (parser *pp)
 
virtual void charData (const XML_Char *s, int len)
 
virtual void endParser ()
 
virtual void init ()
 
virtual void incrCount (const XML_Char *elem)
 
virtual void checkOrder (std::string &el)
 
virtual void maxcount (std::string name, int max, std::string &el)
 
virtual void mincount (std::string name, int min)
 
virtual void maxchoice (std::string *names, int max, std::string &el)
 
virtual void minchoice (std::string *names, int min)
 
virtual void required (const std::string &name, const XML_Char **attr)
 
std::stack< parser * > & getStack ()
 
template<class T >
post ()
 
void logError (const std::string &reason)
 

Public Attributes

int _nsteps
 
- Public Attributes inherited from YACS::looptypeParser< ENGINE::ForLoop * >
std::string _state
 
ENGINE::ForLoop_cnode
 
std::vector< ENGINE::ForLoop * > _cnodes
 
- Public Attributes inherited from YACS::parser
std::string _file
 
std::string _content
 
std::map< std::string, int > * _counts
 
std::map< std::string, int > _orders
 
int _orderState
 
int _level
 
std::stack< std::map< std::string, int > * > _stackCount
 
std::stack< int > _stackOrder
 
std::map< std::string, parser * > * _defaultParsersMap
 

Static Public Attributes

static forlooptypeParser< T > forloopParser
 
- Static Public Attributes inherited from YACS::parser
static parser main_parser
 
static std::stack< parser * > _stackParser
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::parser
static void XMLCALL start_document (void *data)
 
static void XMLCALL end_document (void *data)
 
static void XMLCALL start_element (void *data, const xmlChar *name, const xmlChar **p)
 
static void XMLCALL end_element (void *data, const xmlChar *name)
 
static void XMLCALL characters (void *data, const xmlChar *ch, int len)
 
static void XMLCALL comment (void *data, const xmlChar *value)
 
static void XMLCALL cdata_block (void *data, const xmlChar *value, int len)
 
static void XMLCALL warning (void *data, const char *fmt,...)
 
static void XMLCALL error (void *data, const char *fmt,...)
 
static void XMLCALL fatal_error (void *data, const char *fmt,...)
 
static void XML_SetUserData (_xmlParserCtxt *ctxt, parser *par)
 

Detailed Description

template<class T = ENGINE::ForLoop*>
struct YACS::forlooptypeParser< T >

Definition at line 326 of file loopParsers.hxx.

Member Function Documentation

◆ buildAttr()

template<class T >
void YACS::forlooptypeParser< T >::buildAttr ( const XML_Char **  attr)
virtual

Reimplemented from YACS::looptypeParser< ENGINE::ForLoop * >.

Definition at line 339 of file loopParsers.hxx.

340  {
341  if (!attr)
342  return;
343  this->required("name",attr);
344  for (int i = 0; attr[i]; i += 2)
345  {
346  if(std::string(attr[i]) == "name")name(attr[i+1]);
347  if(std::string(attr[i]) == "state")this->state(attr[i+1]);
348  if(std::string(attr[i]) == "nsteps")nsteps(atoi(attr[i+1]));
349  }
350  }
virtual void name(const std::string &name)
virtual void nsteps(const int &n)
virtual void state(const std::string &name)
virtual void required(const std::string &name, const XML_Char **attr)
Definition: parserBase.cxx:186

References yacsorb.CORBAEngineTest::i, and yacsorb.CORBAEngineTest::state.

◆ name()

template<class T >
void YACS::forlooptypeParser< T >::name ( const std::string &  name)
virtual

Reimplemented from YACS::looptypeParser< ENGINE::ForLoop * >.

Definition at line 353 of file loopParsers.hxx.

354  {
355  DEBTRACE( "forloop_name: " << name );
356  std::string fullname=currentProc->names.back()+name;
358  currentProc->nodeMap[fullname]=this->_cnode;
359  this->_cnodes.push_back(this->_cnode);
360  currentProc->names.push_back(fullname+'.');
361  _nsteps=0;
362  }
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
YACS::ENGINE::Runtime * theRuntime
Definition: parsers.cxx:40
YACS::ENGINE::Proc * currentProc
Definition: parserBase.cxx:30
std::map< std::string, Node * > nodeMap
Definition: Proc.hxx:87
std::vector< std::string > names
Definition: Proc.hxx:93
virtual ForLoop * createForLoop(const std::string &name)
Definition: Runtime.cxx:246
std::vector< ENGINE::ForLoop * > _cnodes
Definition: loopParsers.hxx:72

References YACS::ENGINE::Runtime::createForLoop(), currentProc, DEBTRACE, YACS::ENGINE::Proc::names, YACS::ENGINE::Proc::nodeMap, and theRuntime.

◆ nsteps()

template<class T >
void YACS::forlooptypeParser< T >::nsteps ( const int &  n)
virtual

Definition at line 365 of file loopParsers.hxx.

366  {
367  DEBTRACE( "forloop_nsteps: " << n )
368  if(!this->_cnode)
369  throw Exception("Node name must be defined before nsteps");
370  ENGINE::InputPort *iNbTimes=this->_cnode->edGetNbOfTimesInputPort();
371  iNbTimes->edInit(n);
372  }
InputPort * edGetNbOfTimesInputPort()
Definition: ForLoop.hxx:45
void edInit(T value)
Definition: InputPort.hxx:129

References DEBTRACE, YACS::ENGINE::InputPort::edInit(), and gui.Appli::n.

◆ post()

template<class T >
T YACS::forlooptypeParser< T >::post
virtual

Definition at line 375 of file loopParsers.hxx.

376  {
377  DEBTRACE( "forloop_post" )
378  T b=this->_cnode;
379  this->_cnodes.pop_back();
380  currentProc->names.pop_back();
381  this->_cnode=this->_cnodes.empty() ? 0 : this->_cnodes.back();
382  return b;
383  }

References gui.CONNECTOR::b, currentProc, DEBTRACE, and YACS::ENGINE::Proc::names.

Member Data Documentation

◆ _nsteps

template<class T = ENGINE::ForLoop*>
int YACS::forlooptypeParser< T >::_nsteps

Definition at line 333 of file loopParsers.hxx.

◆ forloopParser

template<class T >
forlooptypeParser< T > YACS::forlooptypeParser< T >::forloopParser
static

Definition at line 328 of file loopParsers.hxx.


The documentation for this struct was generated from the following file: