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

Class for OutNode parser. More...

#include <outputParsers.hxx>

Inheritance diagram for YACS::outnodetypeParser< T >:
Collaboration diagram for YACS::outnodetypeParser< 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 buildAttr (const XML_Char **attr)
 
virtual void pre ()
 
virtual void name (const std::string &name)
 
virtual void kind (const std::string &kind)
 
virtual void ref (const std::string &ref)
 
virtual void create ()
 
virtual void parameter (myoutport &p)
 
virtual T post ()
 
- Public Member Functions inherited from YACS::nodetypeParser< ENGINE::DataNode * >
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)
 

Public Attributes

std::string _name
 
std::string _kind
 
std::string _ref
 
- Public Attributes inherited from YACS::nodetypeParser< ENGINE::DataNode * >
std::string _type
 
std::string _name
 
std::string _state
 
std::string _container
 
ENGINE::DataNode_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
 

Static Public Attributes

static outnodetypeParser< T > outnodeParser
 
- Static Public Attributes inherited from YACS::nodetypeParser< ENGINE::DataNode * >
static nodetypeParser< ENGINE::DataNode * > 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)
 

Detailed Description

template<class T = ENGINE::DataNode*>
struct YACS::outnodetypeParser< T >

Class for OutNode parser.

Its XML schema is:

    <xsd:complexType name="OutNodeType">
      <xsd:attribute name="name" type="xsd:string" use="required"/>
      <xsd:attribute name="kind" type="xsd:string" />
      <xsd:attribute name="ref" type="xsd:string" />
      <xsd:element name="parameter" type="OutputDataType"/>
    </xsd:complexType>

Definition at line 114 of file outputParsers.hxx.

Member Function Documentation

◆ buildAttr()

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

Reimplemented from YACS::nodetypeParser< ENGINE::DataNode * >.

Definition at line 159 of file outputParsers.hxx.

160  {
161  if (!attr)
162  return;
163  DEBTRACE("outnodetypeParser::buildAttr");
164  this->required("name",attr);
165  for (int i = 0; attr[i]; i += 2)
166  {
167  if(std::string(attr[i]) == "name")name(attr[i+1]);
168  if(std::string(attr[i]) == "kind")kind(attr[i+1]);
169  if(std::string(attr[i]) == "ref")ref(attr[i+1]);
170  }
171  create();
172  }
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
virtual void name(const std::string &name)
virtual void kind(const std::string &kind)
virtual void ref(const std::string &ref)
virtual void required(const std::string &name, const XML_Char **attr)
Definition: parserBase.cxx:186

References DEBTRACE, yacsorb.CORBAEngineTest::i, and gui.CONNECTOR::ref().

◆ create()

template<class T >
void YACS::outnodetypeParser< T >::create
virtual

Definition at line 199 of file outputParsers.hxx.

200 {
202 }
YACS::ENGINE::Runtime * theRuntime
Definition: parsers.cxx:40
virtual DataNode * createOutDataNode(const std::string &kind, const std::string &name)
Definition: Runtime.cxx:185

References YACS::ENGINE::Runtime::createOutDataNode(), and theRuntime.

◆ kind()

template<class T >
void YACS::outnodetypeParser< T >::kind ( const std::string &  kind)
virtual

Definition at line 188 of file outputParsers.hxx.

189 {
190  _kind=kind;
191 }

◆ name()

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

Reimplemented from YACS::nodetypeParser< ENGINE::DataNode * >.

Definition at line 183 of file outputParsers.hxx.

184 {
185  _name=name;
186 }

◆ onEnd()

template<class T >
void YACS::outnodetypeParser< T >::onEnd ( const char *  el,
parser child 
)
virtual

Reimplemented from YACS::nodetypeParser< ENGINE::DataNode * >.

Definition at line 150 of file outputParsers.hxx.

151  {
152  DEBTRACE("outnodetypeParser::onEnd");
153  std::string element(el);
154  if(element == "parameter")parameter(((outputdatatypeParser*)child)->post());
155  if(element == "property")this->property(((propertytypeParser*)child)->post());
156  }
virtual void property(const myprop &prop)
virtual void parameter(myoutport &p)

References DEBTRACE.

◆ onStart()

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

Reimplemented from YACS::nodetypeParser< ENGINE::DataNode * >.

Definition at line 136 of file outputParsers.hxx.

137  {
138  DEBTRACE("outnodetypeParser::onStart");
139  std::string element(el);
141  if(element == "parameter")pp=&outputdatatypeParser::outputdataParser;
142  if(element == "property")pp=&propertytypeParser::propertyParser;
143  this->SetUserDataAndPush(pp);
144  pp->init();
145  pp->pre();
146  pp->buildAttr(attr);
147  }
static outputdatatypeParser outputdataParser
virtual void SetUserDataAndPush(parser *pp)
Definition: parserBase.cxx:55
static parser main_parser
Definition: parserBase.hxx:41
static propertytypeParser propertyParser

References YACS::parser::buildAttr(), DEBTRACE, YACS::parser::init(), YACS::parser::main_parser, YACS::outputdatatypeParser::outputdataParser, YACS::parser::pre(), and YACS::propertytypeParser::propertyParser.

◆ parameter()

template<class T >
void YACS::outnodetypeParser< T >::parameter ( myoutport p)
virtual

Definition at line 205 of file outputParsers.hxx.

206 {
207  DEBTRACE("outnodetypeParser::parameter");
208  if(currentProc->typeMap.count(p._type)==0)
209  {
210  //Check if the typecode is defined in the runtime
212  if(t==0)
213  {
214  std::string msg="Unknown Type: ";
215  msg=msg+p._type+" for node: "+this->_node->getName()+" port name: "+p._name;
216  this->logError(msg);
217  return;
218  }
219  else
220  {
221  currentProc->typeMap[p._type]=t;
222  t->incrRef();
223  }
224  }
225  ENGINE::InputPort *port = this->_node->edAddInputPort(p._name,currentProc->typeMap[p._type]);
226  this->_node->setData(port,p._props["ref"]);
227 }
YACS::ENGINE::Proc * currentProc
Definition: parserBase.cxx:30
virtual void setData(InputPort *port, const std::string &data)
Definition: DataNode.cxx:29
virtual InputPort * edAddInputPort(const std::string &inputPortName, TypeCode *type)
const std::string & getName() const
Definition: Node.hxx:125
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
Proc * p
Definition: driver.cxx:216
void logError(const std::string &reason)
Definition: parserBase.cxx:214
std::string _name
Definition: factory.hxx:80

References currentProc, DEBTRACE, YACS::ENGINE::Runtime::getTypeCode(), p, gui.Appli::t, theRuntime, and YACS::ENGINE::Proc::typeMap.

◆ post()

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

Reimplemented from YACS::nodetypeParser< ENGINE::DataNode * >.

Definition at line 230 of file outputParsers.hxx.

231 {
232  this->_node->setRef(_ref);
233  return this->_node;
234 }
virtual void setRef(const std::string &ref)
Definition: DataNode.cxx:35

◆ pre()

template<class T >
void YACS::outnodetypeParser< T >::pre
virtual

Reimplemented from YACS::nodetypeParser< ENGINE::DataNode * >.

Definition at line 175 of file outputParsers.hxx.

176 {
177  this->_node=0;
178  _kind="";
179  _ref="";
180 }

◆ ref()

template<class T >
void YACS::outnodetypeParser< T >::ref ( const std::string &  ref)
virtual

Definition at line 193 of file outputParsers.hxx.

194 {
195  _ref=ref;
196 }

References gui.CONNECTOR::ref().

Member Data Documentation

◆ _kind

template<class T = ENGINE::DataNode*>
std::string YACS::outnodetypeParser< T >::_kind

Definition at line 128 of file outputParsers.hxx.

◆ _name

template<class T = ENGINE::DataNode*>
std::string YACS::outnodetypeParser< T >::_name

Definition at line 127 of file outputParsers.hxx.

◆ _ref

template<class T = ENGINE::DataNode*>
std::string YACS::outnodetypeParser< T >::_ref

Definition at line 129 of file outputParsers.hxx.

◆ outnodeParser

template<class T >
outnodetypeParser< T > YACS::outnodetypeParser< T >::outnodeParser
static

Definition at line 116 of file outputParsers.hxx.


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