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

Class for Inport parser. More...

#include <portParsers.hxx>

Inheritance diagram for YACS::inporttypeParser< T >:
Collaboration diagram for YACS::inporttypeParser< 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 type (const std::string &type)
 
virtual void property (const myprop &prop)
 
virtual T & post ()
 
- 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 inporttypeParser< T > inportParser
 
- Static Public Attributes inherited from YACS::parser
static parser main_parser
 
static std::stack< parser * > _stackParser
 

Protected Attributes

_port
 

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::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 = myinport>
struct YACS::inporttypeParser< T >

Class for Inport parser.

This class is a base class for other inport parsers

XML schema:

  <xsd:complexType name="InPortType">
    <xsd:sequence>
      <xsd:element name="property" type="PropertyType" minOccurs="0"/>
    </xsd:sequence>
    <xsd:attribute name="name" type="xsd:string" use="required"/>
    <xsd:attribute name="type" type="xsd:string" use="required"/>
  </xsd:complexType>

Definition at line 48 of file portParsers.hxx.

Member Function Documentation

◆ buildAttr()

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

Reimplemented from YACS::parser.

Definition at line 95 of file portParsers.hxx.

96  {
97  if (!attr)
98  return;
99  required("name",attr);
100  required("type",attr);
101  for (int i = 0; attr[i]; i += 2)
102  {
103  if(std::string(attr[i]) == "name")name(attr[i+1]);
104  if(std::string(attr[i]) == "type")type(attr[i+1]);
105  }
106  }
virtual void name(const std::string &name)
virtual void type(const std::string &type)
virtual void required(const std::string &name, const XML_Char **attr)
Definition: parserBase.cxx:186

References yacsorb.CORBAEngineTest::i.

◆ name()

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

Definition at line 115 of file portParsers.hxx.

116  {
117  _port._name=name;
118  }

◆ onEnd()

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

Reimplemented from YACS::parser.

Definition at line 89 of file portParsers.hxx.

90  {
91  std::string element(el);
92  if(element == "property")property(((propertytypeParser*)child)->post());
93  }
virtual void property(const myprop &prop)

◆ onStart()

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

Reimplemented from YACS::parser.

Definition at line 78 of file portParsers.hxx.

79  {
80  std::string element(el);
82  if(element == "property")pp=&propertytypeParser::propertyParser;
83  this->SetUserDataAndPush(pp);
84  pp->init();
85  pp->pre();
86  pp->buildAttr(attr);
87  }
virtual void SetUserDataAndPush(parser *pp)
Definition: parserBase.cxx:55
static parser main_parser
Definition: parserBase.hxx:41
static propertytypeParser propertyParser

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

◆ post()

template<class T >
T & YACS::inporttypeParser< T >::post
virtual

Definition at line 131 of file portParsers.hxx.

132  {
133  return _port;
134  }

◆ pre()

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

Reimplemented from YACS::parser.

Definition at line 108 of file portParsers.hxx.

109  {
110  _port._name="";
111  _port._type="";
112  _port.clear();
113  }

◆ property()

template<class T >
void YACS::inporttypeParser< T >::property ( const myprop prop)
virtual

Definition at line 125 of file portParsers.hxx.

126  {
127  DEBTRACE( "property_set: " << prop._name << prop._value )
128  _port.setProperty(prop._name,prop._value);
129  }
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
std::string _name
Definition: factory.hxx:96
std::string _value
Definition: factory.hxx:97

References myprop::_name, myprop::_value, and DEBTRACE.

◆ type()

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

Definition at line 120 of file portParsers.hxx.

121  {
122  _port._type=type;
123  }

Member Data Documentation

◆ _port

template<class T = myinport>
T YACS::inporttypeParser< T >::_port
protected

Definition at line 60 of file portParsers.hxx.

◆ inportParser

template<class T >
inporttypeParser< T > YACS::inporttypeParser< T >::inportParser
static

Definition at line 50 of file portParsers.hxx.


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