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

#include <remoteParsers.hxx>

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

Public Member Functions

virtual void onStart (const XML_Char *el, const XML_Char **attr)
 
virtual void onEnd (const char *el, parser *child)
 
virtual void load (const loadon &l)
 
void function (const myfunc &f)
 
void script (const myfunc &f)
 
virtual T post ()
 
- Public Member Functions inherited from YACS::inlinetypeParser< YACS::ENGINE::InlineNode * >
virtual void buildAttr (const XML_Char **attr)
 
virtual void pre ()
 
virtual void weight (const double &x)
 
virtual void kind (const std::string &name)
 
void script (const myfunc &f)
 
void function (const myfunc &f)
 
void function (const myfunc &f)
 
virtual void inport (const myinport &p)
 
virtual void outport (const myoutport &p)
 
- Public Member Functions inherited from YACS::nodetypeParser< YACS::ENGINE::InlineNode * >
virtual void name (const std::string &name)
 
virtual void state (const std::string &name)
 
virtual void type (const std::string &name)
 
virtual void property (const myprop &prop)
 
YACS::ENGINE::InlineNodepost ()
 
- 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)
 

Static Public Attributes

static remotetypeParser< T > remoteParser
 
- Static Public Attributes inherited from YACS::inlinetypeParser< YACS::ENGINE::InlineNode * >
static inlinetypeParser< YACS::ENGINE::InlineNode * > inlineParser
 
- Static Public Attributes inherited from YACS::nodetypeParser< YACS::ENGINE::InlineNode * >
static nodetypeParser< YACS::ENGINE::InlineNode * > nodeParser
 
- 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)
 
- Public Attributes inherited from YACS::inlinetypeParser< YACS::ENGINE::InlineNode * >
std::string _kind
 
double _weight
 
- Public Attributes inherited from YACS::nodetypeParser< YACS::ENGINE::InlineNode * >
std::string _type
 
std::string _name
 
std::string _state
 
std::string _container
 
YACS::ENGINE::InlineNode_node
 
- 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
 

Detailed Description

template<class T = YACS::ENGINE::InlineNode*>
struct YACS::remotetypeParser< T >

Definition at line 32 of file remoteParsers.hxx.

Member Function Documentation

◆ function()

template<class T = YACS::ENGINE::InlineNode*>
void YACS::remotetypeParser< T >::function ( const myfunc f)
inlinevirtual

Reimplemented from YACS::inlinetypeParser< YACS::ENGINE::InlineNode * >.

Definition at line 56 of file remoteParsers.hxx.

57  {
58  DEBTRACE( "remote_function: " << f._code )
59  YACS::ENGINE::InlineFuncNode *fnode;
60  fnode=theRuntime->createFuncNode(this->_kind,this->_name);
61  fnode->setScript(f._code);
62  fnode->setFname(f._name);
63  fnode->setExecutionMode("remote");
64  if (this->_weight>0)fnode->setWeight(this->_weight);
65  this->_node=fnode;
66  }
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
YACS::ENGINE::Runtime * theRuntime
Definition: parsers.cxx:40

References YACS::inlinetypeParser< YACS::ENGINE::InlineNode * >::_kind, YACS::nodetypeParser< YACS::ENGINE::InlineNode * >::_name, YACS::nodetypeParser< YACS::ENGINE::InlineNode * >::_node, YACS::inlinetypeParser< YACS::ENGINE::InlineNode * >::_weight, YACS::ENGINE::Runtime::createFuncNode(), DEBTRACE, gui.CONNECTOR::f(), YACS::ENGINE::InlineNode::setExecutionMode(), YACS::ENGINE::InlineFuncNode::setFname(), YACS::ENGINE::InlineNode::setScript(), YACS::ENGINE::ElementaryNode::setWeight(), and theRuntime.

◆ load()

template<class T = YACS::ENGINE::InlineNode*>
virtual void YACS::remotetypeParser< T >::load ( const loadon l)
inlinevirtual

◆ onEnd()

template<class T = YACS::ENGINE::InlineNode*>
virtual void YACS::remotetypeParser< T >::onEnd ( const char *  el,
parser child 
)
inlinevirtual

Reimplemented from YACS::inlinetypeParser< YACS::ENGINE::InlineNode * >.

Definition at line 37 of file remoteParsers.hxx.

38  {
39  DEBTRACE( "remotetypeParser::onEnd: " << el )
40  std::string element(el);
41  if(element == "kind")this->kind(((stringtypeParser*)child)->post()); // inherited
42  else if(element == "function")this->function(((functypeParser*)child)->post());
43  else if(element == "script")this->script(((codetypeParser*)child)->post());
44  else if(element == "load") this->load(((loadtypeParser*)child)->post());
45  else if(element == "property")this->property(((propertytypeParser*)child)->post());
46  else if(element == "inport") this->inport(((inporttypeParser<myinport>*)child)->post());
47  else if(element == "outport") this->outport(((outporttypeParser<myoutport>*)child)->post());
48  }
virtual void kind(const std::string &name)
virtual void property(const myprop &prop)
virtual void load(const loadon &l)
void script(const myfunc &f)

References DEBTRACE, YACS::inlinetypeParser< YACS::ENGINE::InlineNode * >::inport(), YACS::inlinetypeParser< YACS::ENGINE::InlineNode * >::kind(), YACS::remotetypeParser< T >::load(), YACS::inlinetypeParser< YACS::ENGINE::InlineNode * >::outport(), YACS::remotetypeParser< T >::post(), YACS::nodetypeParser< YACS::ENGINE::InlineNode * >::property(), and YACS::remotetypeParser< T >::script().

◆ onStart()

template<class T >
void YACS::remotetypeParser< T >::onStart ( const XML_Char el,
const XML_Char **  attr 
)
virtual

Reimplemented from YACS::inlinetypeParser< YACS::ENGINE::InlineNode * >.

Definition at line 105 of file remoteParsers.hxx.

106 {
107  DEBTRACE( "remotetypeParser::onStart: " << el )
108  std::string element(el);
110  this->maxcount("kind",1,element);
111  this->maxcount("function",1,element);
112  this->maxcount("script",1,element);
113  this->maxcount("load",1,element);
114  this->maxchoice(t1,1,element);
115 
116  if(element == "kind")pp=&stringtypeParser::stringParser;
117  else if(element == "load")pp=&loadtypeParser::loadParser;
118  else if(element == "function")pp=&functypeParser::funcParser;
119  else if(element == "script")pp=&codetypeParser::codeParser;
120  else if(element == "property")pp=&propertytypeParser::propertyParser;
121  else if(element == "inport")pp=&inporttypeParser<>::inportParser;
122  else if(element == "outport")pp=&outporttypeParser<>::outportParser;
123 
124  this->SetUserDataAndPush(pp);
125  pp->init();
126  pp->pre();
127  pp->buildAttr(attr);
128 }
static std::string t1[]
static codetypeParser codeParser
Definition: codeParsers.hxx:36
static functypeParser funcParser
Definition: codeParsers.hxx:75
static inporttypeParser< T > inportParser
Definition: portParsers.hxx:50
static loadtypeParser loadParser
static outporttypeParser< T > outportParser
Definition: portParsers.hxx:71
virtual void maxcount(std::string name, int max, std::string &el)
Definition: parserBase.cxx:122
virtual void SetUserDataAndPush(parser *pp)
Definition: parserBase.cxx:55
static parser main_parser
Definition: parserBase.hxx:41
virtual void maxchoice(std::string *names, int max, std::string &el)
Definition: parserBase.cxx:145
static propertytypeParser propertyParser
static stringtypeParser stringParser
Definition: dataParsers.hxx:33

References YACS::parser::buildAttr(), YACS::codetypeParser::codeParser, DEBTRACE, YACS::functypeParser::funcParser, YACS::parser::init(), YACS::loadtypeParser::loadParser, YACS::parser::main_parser, YACS::parser::pre(), YACS::propertytypeParser::propertyParser, YACS::stringtypeParser::stringParser, and YACS::t1.

◆ post()

template<class T = YACS::ENGINE::InlineNode*>
virtual T YACS::remotetypeParser< T >::post ( )
inlinevirtual

Reimplemented from YACS::inlinetypeParser< YACS::ENGINE::InlineNode * >.

Definition at line 79 of file remoteParsers.hxx.

80  {
81  DEBTRACE( "remote_post " << this->_node->getName() )
82  if(this->_state == "disabled")this->_node->exDisabledState();
83 
84  //set the container
85  if(currentProc->containerMap.count(this->_container) != 0)
86  {
87  // a container with name (this->_container) exists. Use it
88  this->_node->setContainer(currentProc->containerMap[this->_container]);
89  }
90  else if(this->_container == "" && currentProc->containerMap.count("DefaultContainer") != 0)
91  {
92  // a container with name (this->_container) does not exist
93  //a default container is defined : use it
94  this->_node->setContainer(currentProc->containerMap["DefaultContainer"]);
95  }
96  else
97  std::cerr << "WARNING: Unknown container and no DefaultContainer " << this->_container << " will be ignored" << std::endl;
98 
99  return this->_node;
100  }
virtual void setContainer(Container *container)
Definition: InlineNode.cxx:105
const std::string & getName() const
Definition: Node.hxx:125
std::map< std::string, Container * > containerMap
Definition: Proc.hxx:91
YACS::ENGINE::Proc * currentProc
Definition: parserBase.cxx:30

References YACS::nodetypeParser< YACS::ENGINE::InlineNode * >::_container, YACS::nodetypeParser< YACS::ENGINE::InlineNode * >::_node, YACS::nodetypeParser< YACS::ENGINE::InlineNode * >::_state, YACS::ENGINE::Proc::containerMap, DEBTRACE, YACS::ENGINE::Node::exDisabledState(), YACS::ENGINE::Node::getName(), and YACS::ENGINE::InlineNode::setContainer().

Referenced by YACS::remotetypeParser< T >::onEnd().

◆ script()

template<class T = YACS::ENGINE::InlineNode*>
void YACS::remotetypeParser< T >::script ( const myfunc f)
inlinevirtual

Member Data Documentation

◆ remoteParser

template<class T >
remotetypeParser< T > YACS::remotetypeParser< T >::remoteParser
static

Definition at line 34 of file remoteParsers.hxx.


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