Version: 9.15.0
YACS::seqtypeParser Struct Reference

Class for sequence parser. More...

#include <typeParsers.hxx>

Inheritance diagram for YACS::seqtypeParser:
Collaboration diagram for YACS::seqtypeParser:

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)
 
void name (const std::string &name)
 
void content (const std::string &name)
 
YACS::ENGINE::TypeCodepost ()
 
- 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 pre ()
 
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

YACS::ENGINE::TypeCode_contentType
 
std::string _name
 
- 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 seqtypeParser seqParser
 
- 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

Class for sequence parser.

Class used to parse a sequence (type) definition (class TypeCodeSeq in implementation)

XML schema is

    <xsd:complexType name="SequenceType">
      <xsd:attribute name="name" type="xsd:string" use="required"/>
      <xsd:attribute name="content" type="xsd:string" use="required"/>
    </xsd:complexType>

Definition at line 69 of file typeParsers.hxx.

Member Function Documentation

◆ buildAttr()

void YACS::seqtypeParser::buildAttr ( const XML_Char **  attr)
virtual

Reimplemented from YACS::parser.

Definition at line 87 of file typeParsers.cxx.

88  {
89  if (!attr)
90  return;
91  required("name",attr);
92  required("content",attr);
93  for (int i = 0; attr[i]; i += 2)
94  {
95  if(std::string(attr[i]) == "name")name(attr[i+1]);
96  if(std::string(attr[i]) == "content")content(attr[i+1]);
97  }
98  }
virtual void required(const std::string &name, const XML_Char **attr)
Definition: parserBase.cxx:186
void content(const std::string &name)
void name(const std::string &name)
Definition: typeParsers.cxx:99

References content(), yacsorb.CORBAEngineTest::i, name(), and YACS::parser::required().

◆ content()

void YACS::seqtypeParser::content ( const std::string &  name)

Definition at line 104 of file typeParsers.cxx.

105  {
106  DEBTRACE( "seqtype_content: " << name )
107  if(currentProc->typeMap.count(name)==0)
108  {
109  //Check if the typecode is defined in the runtime
111  if(t==0)
112  {
113  std::stringstream msg;
114  msg << "Type " << name << " does not exist" << " (" <<__FILE__ << ":" << __LINE__ << ")";
115  throw Exception(msg.str());
116  }
117  else
118  {
120  t->incrRef();
121  }
122  }
124 
125  }
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
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
YACS::ENGINE::TypeCode * _contentType
Definition: typeParsers.hxx:78
YACS::ENGINE::Runtime * theRuntime
Definition: parsers.cxx:40
YACS::ENGINE::Proc * currentProc
Definition: parserBase.cxx:30

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

Referenced by buildAttr().

◆ name()

void YACS::seqtypeParser::name ( const std::string &  name)

Definition at line 99 of file typeParsers.cxx.

100  {
101  DEBTRACE( "seqtype_name: " << name )
102  _name=name;
103  }

References _name, and DEBTRACE.

Referenced by buildAttr(), and content().

◆ onEnd()

void YACS::seqtypeParser::onEnd ( const char *  el,
parser child 
)
virtual

Reimplemented from YACS::parser.

Definition at line 83 of file typeParsers.cxx.

84  {
85  DEBTRACE( "seqtypeParser::onEnd: " << el )
86  }

References DEBTRACE.

◆ onStart()

void YACS::seqtypeParser::onStart ( const XML_Char el,
const XML_Char **  attr 
)
virtual

Reimplemented from YACS::parser.

Definition at line 74 of file typeParsers.cxx.

75  {
76  DEBTRACE( "seqtypeParser::onStart: " << el )
79  pp->init();
80  pp->pre();
81  pp->buildAttr(attr);
82  }
virtual void SetUserDataAndPush(parser *pp)
Definition: parserBase.cxx:55
static parser main_parser
Definition: parserBase.hxx:41

References YACS::parser::buildAttr(), DEBTRACE, YACS::parser::init(), YACS::parser::main_parser, YACS::parser::pre(), and YACS::parser::SetUserDataAndPush().

◆ post()

ENGINE::TypeCode * YACS::seqtypeParser::post ( )

Definition at line 126 of file typeParsers.cxx.

127  {
128  DEBTRACE( "seqtype_post" )
129  ENGINE::TypeCode *t = currentProc->createSequenceTc(_name,_name,_contentType);
130  return t;
131  }

References _contentType, _name, YACS::ENGINE::Proc::createSequenceTc(), currentProc, DEBTRACE, and gui.Appli::t.

Member Data Documentation

◆ _contentType

YACS::ENGINE::TypeCode* YACS::seqtypeParser::_contentType

Definition at line 78 of file typeParsers.hxx.

Referenced by content(), and post().

◆ _name

std::string YACS::seqtypeParser::_name

Definition at line 79 of file typeParsers.hxx.

Referenced by name(), and post().

◆ seqParser

seqtypeParser YACS::seqtypeParser::seqParser
static

Definition at line 71 of file typeParsers.hxx.

Referenced by YACS::proctypeParser< T >::onStart().


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