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

#include <loopParsers.hxx>

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

Public Member Functions

virtual void buildAttr (const XML_Char **attr)
 
virtual void pre ()
 
virtual void name (const std::string &name)
 
virtual void nbranch (const int &n)
 
virtual void weight (const double &x)
 
virtual void datatype (const std::string &type)
 
virtual void postAttr ()
 
virtual T post ()
 
- Public Member Functions inherited from YACS::dynparalooptypeParser< T >
virtual void onStart (const XML_Char *el, const XML_Char **attr)
 
virtual void onEnd (const char *el, parser *child)
 
virtual void initnode (PseudoComposedNode *const &n)
 
virtual void finalizenode (PseudoComposedNode *const &n)
 
- Public Member Functions inherited from YACS::looptypeParser< T >
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 _nbranch
 
double _weight
 
std::string _fullname
 
std::string _name
 
std::string _datatype
 
- Public Attributes inherited from YACS::looptypeParser< T >
std::string _state
 
_cnode
 
std::vector< T > _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 foreachlooptypeParser< T > foreachloopParser
 
- 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>
struct YACS::foreachlooptypeParser< T >

Definition at line 506 of file loopParsers.hxx.

Member Function Documentation

◆ buildAttr()

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

Reimplemented from YACS::looptypeParser< T >.

Definition at line 510 of file loopParsers.hxx.

511  {
512  if (!attr)
513  return;
514  this->required("name",attr);
515  this->required("type",attr);
516  for (int i = 0; attr[i]; i += 2)
517  {
518  if(std::string(attr[i]) == "name")name(attr[i+1]);
519  if(std::string(attr[i]) == "state")this->state(attr[i+1]);
520  if(std::string(attr[i]) == "nbranch")nbranch(atoi(attr[i+1]));
521  if(std::string(attr[i]) == "loopWeight")weight(atof(attr[i+1]));
522  if(std::string(attr[i]) == "type")datatype(attr[i+1]);
523  }
524  postAttr();
525  }
virtual void nbranch(const int &n)
virtual void weight(const double &x)
virtual void datatype(const std::string &type)
virtual void name(const std::string &name)
virtual void state(const std::string &name)
virtual void required(const std::string &name, const XML_Char **attr)
Definition: parserBase.cxx:186

References YACS::foreachlooptypeParser< T >::datatype(), yacsorb.CORBAEngineTest::i, YACS::foreachlooptypeParser< T >::name(), YACS::foreachlooptypeParser< T >::nbranch(), YACS::foreachlooptypeParser< T >::postAttr(), YACS::parser::required(), YACS::looptypeParser< T >::state(), and YACS::foreachlooptypeParser< T >::weight().

◆ datatype()

template<class T >
virtual void YACS::foreachlooptypeParser< T >::datatype ( const std::string &  type)
inlinevirtual

Definition at line 548 of file loopParsers.hxx.

549  {
550  DEBTRACE("foreach_datatype: "<< type)
551  _datatype=type;
552  }
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31

References YACS::foreachlooptypeParser< T >::_datatype, and DEBTRACE.

Referenced by YACS::foreachlooptypeParser< T >::buildAttr().

◆ name()

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

Reimplemented from YACS::looptypeParser< T >.

Definition at line 532 of file loopParsers.hxx.

533  {
534  DEBTRACE("foreach_name: " << name)
535  _name=name;
537  }
YACS::ENGINE::Proc * currentProc
Definition: parserBase.cxx:30
std::vector< std::string > names
Definition: Proc.hxx:93

References YACS::foreachlooptypeParser< T >::_fullname, YACS::foreachlooptypeParser< T >::_name, currentProc, DEBTRACE, and YACS::ENGINE::Proc::names.

Referenced by YACS::foreachlooptypeParser< T >::buildAttr().

◆ nbranch()

template<class T >
virtual void YACS::foreachlooptypeParser< T >::nbranch ( const int &  n)
inlinevirtual

Definition at line 538 of file loopParsers.hxx.

539  {
540  DEBTRACE("foreach_nbranch: " << n )
541  _nbranch=n;
542  }

References YACS::foreachlooptypeParser< T >::_nbranch, DEBTRACE, and gui.Appli::n.

Referenced by YACS::foreachlooptypeParser< T >::buildAttr().

◆ post()

template<class T >
virtual T YACS::foreachlooptypeParser< T >::post ( )
inlinevirtual

Definition at line 578 of file loopParsers.hxx.

579  {
580  DEBTRACE("foreach_post" << this->_cnode->getName())
581  T b=this->_cnode;
582  this->_cnodes.pop_back();
583  currentProc->names.pop_back();
584  this->_cnode=this->_cnodes.empty() ? 0 : this->_cnodes.back();
585  return b;
586  }
std::vector< T > _cnodes
Definition: loopParsers.hxx:72

References YACS::looptypeParser< T >::_cnode, YACS::looptypeParser< T >::_cnodes, gui.CONNECTOR::b, currentProc, DEBTRACE, and YACS::ENGINE::Proc::names.

◆ postAttr()

template<class T >
virtual void YACS::foreachlooptypeParser< T >::postAttr ( )
inlinevirtual

Definition at line 553 of file loopParsers.hxx.

554  {
555  if(currentProc->typeMap.count(_datatype)==0)
556  {
557  //Check if the typecode is defined in the runtime
559  if(t==0)
560  {
561  std::stringstream msg;
562  msg << "Type "<< _datatype <<" does not exist"<<" ("<<__FILE__<<":"<<__LINE__<< ")";
563  throw Exception(msg.str());
564  }
565  else
566  {
568  t->incrRef();
569  }
570  }
571  this->_cnode=buildFrom<T>(theRuntime,_name,currentProc->typeMap[_datatype]);
572  //set number of branches
573  if(_nbranch > 0)this->_cnode->edGetNbOfBranchesPort()->edInit(_nbranch);
574  if(_weight > 0)this->_cnode->setWeight(_weight);
575  this->_cnodes.push_back(this->_cnode);
576  currentProc->names.push_back(_fullname + '.');
577  }
YACS::ENGINE::Runtime * theRuntime
Definition: parsers.cxx:40
std::map< std::string, TypeCode * > typeMap
Definition: Proc.hxx:90
virtual TypeCode * getTypeCode(const std::string &name)
Get a typecode by its name from runtime catalogs.
Definition: Runtime.cxx:333
Base class for all type objects.
Definition: TypeCode.hxx:68

References YACS::looptypeParser< T >::_cnode, YACS::looptypeParser< T >::_cnodes, YACS::foreachlooptypeParser< T >::_datatype, YACS::foreachlooptypeParser< T >::_fullname, YACS::foreachlooptypeParser< T >::_name, YACS::foreachlooptypeParser< T >::_nbranch, YACS::foreachlooptypeParser< T >::_weight, currentProc, YACS::ENGINE::Runtime::getTypeCode(), YACS::ENGINE::Proc::names, gui.Appli::t, theRuntime, and YACS::ENGINE::Proc::typeMap.

Referenced by YACS::foreachlooptypeParser< T >::buildAttr().

◆ pre()

template<class T >
virtual void YACS::foreachlooptypeParser< T >::pre ( )
inlinevirtual

◆ weight()

template<class T >
virtual void YACS::foreachlooptypeParser< T >::weight ( const double &  x)
inlinevirtual

Definition at line 543 of file loopParsers.hxx.

544  {
545  DEBTRACE("foreach_weight: " << x )
546  _weight=x;
547  }

References YACS::foreachlooptypeParser< T >::_weight, and DEBTRACE.

Referenced by YACS::foreachlooptypeParser< T >::buildAttr().

Member Data Documentation

◆ _datatype

template<class T >
std::string YACS::foreachlooptypeParser< T >::_datatype

◆ _fullname

template<class T >
std::string YACS::foreachlooptypeParser< T >::_fullname

◆ _name

template<class T >
std::string YACS::foreachlooptypeParser< T >::_name

◆ _nbranch

◆ _weight

◆ foreachloopParser

template<class T >
foreachlooptypeParser< T > YACS::foreachlooptypeParser< T >::foreachloopParser
static

Definition at line 508 of file loopParsers.hxx.


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