Version: 9.16.0
YACS::ENGINE::sampleParser Class Reference

#include <LoadState.hxx>

Inheritance diagram for YACS::ENGINE::sampleParser:
Collaboration diagram for YACS::ENGINE::sampleParser:

Public Member Functions

 sampleParser (loopPortParser *father)
 
virtual void init (const xmlChar **p, xmlParserBase *father=0)
 
virtual void onStart (const XML_Char *elem, const xmlChar **p)
 
virtual void onEnd (const XML_Char *name)
 
virtual void charData (std::string data)
 
virtual void init (const xmlChar **p, xmlParserBase *father=0)
 
- Public Member Functions inherited from xmlParserBase
void setAttribute (std::string key, std::string value)
 
std::string getAttribute (std::string key)
 
virtual void addData (std::string value)
 
virtual void init (const xmlChar **p, xmlParserBase *father=0)
 

Private Attributes

loopPortParser_sampleFather
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::ENGINE::stateParser
static void setProc (Proc *p)
 
static void setRuntime (Runtime *runtime)
 
- Static Public Member Functions inherited from xmlParserBase
static void XMLCALL start_document (void *userData)
 
static void XMLCALL end_document (void *userData)
 
static void XMLCALL start_element (void *userData, const xmlChar *name, const xmlChar **p)
 
static void XMLCALL end_element (void *userData, const xmlChar *name)
 
static void XMLCALL characters (void *userData, const xmlChar *ch, int len)
 
static void XMLCALL comment (void *userData, const xmlChar *value)
 
static void XMLCALL warning (void *userData, const char *fmt,...)
 
static void XMLCALL error (void *userData, const char *fmt,...)
 
static void XMLCALL fatal_error (void *userData, const char *fmt,...)
 
static void XMLCALL cdata_block (void *userData, const xmlChar *value, int len)
 
static void cleanGarbage ()
 
static int getGarbageSize ()
 
static void XML_SetUserData (_xmlParserCtxt *ctxt, xmlParserBase *parser)
 
- Public Attributes inherited from xmlParserBase
std::map< std::string, int > counts
 
- Static Public Attributes inherited from YACS::ENGINE::stateParser
static XMLReadState _state
 
static std::string _what
 
- Static Public Attributes inherited from xmlParserBase
static _xmlParserCtxt * _xmlParser
 
static std::stack< xmlParserBase * > _stackParser
 
virtual void onStart (const XML_Char *elem, const xmlChar **p)
 
virtual void onEnd (const XML_Char *name)
 
virtual void charData (std::string data)
 
- Protected Member Functions inherited from xmlParserBase
void getAttributes (const xmlChar **p)
 
virtual void onStart (const XML_Char *elem, const xmlChar **p)
 
virtual void onEnd (const XML_Char *name)
 
virtual void charData (std::string data)
 
virtual void incrCount (const XML_Char *elem)
 
virtual void end ()
 
virtual void stopParse (std::string what)
 
- Protected Attributes inherited from xmlParserBase
std::map< std::string, std::string > _mapAttrib
 
std::string _data
 
xmlParserBase_father
 
- Static Protected Attributes inherited from YACS::ENGINE::stateParser
static std::stack< XMLReadState_stackState
 
static Proc_p
 
static Runtime_runtime
 
static std::map< std::string, YACS::StatesForNode_nodeStateValue
 
static std::map< std::string, YACS::StatesForNode_nodeStates
 
- Static Protected Attributes inherited from xmlParserBase
static std::list< xmlParserBase * > _garbage
 

Detailed Description

Definition at line 203 of file LoadState.hxx.

Constructor & Destructor Documentation

◆ sampleParser()

sampleParser::sampleParser ( loopPortParser father)

Definition at line 854 of file LoadState.cxx.

855: stateParser(),
856 _sampleFather(father)
857{
858}
loopPortParser * _sampleFather
Definition: LoadState.hxx:214
specialized parser to load SALOME execution saved states.
Definition: LoadState.hxx:81

Member Function Documentation

◆ charData()

void sampleParser::charData ( std::string  data)
virtual

to be specialized following the kind of xml tag

Reimplemented from YACS::ENGINE::stateParser.

Definition at line 903 of file LoadState.cxx.

904{
905 _data = _data + data;
906}
std::string _data

References xmlParserBase::_data.

◆ init()

void sampleParser::init ( const xmlChar **  p,
xmlParserBase father = 0 
)
virtual

all parsers must know their father parser (father tag), in order to set values or attributes in father.

Reimplemented from YACS::ENGINE::stateParser.

Definition at line 860 of file LoadState.cxx.

861{
862 DEBTRACE("sampleParser::init()");
863 //_state = XMLINPORT;
864 _father = father;
865 _stackState.push(_state);
866 if (p) getAttributes(p);
867}
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
static std::stack< XMLReadState > _stackState
Definition: LoadState.hxx:98
static XMLReadState _state
Definition: LoadState.hxx:83
xmlParserBase * _father
void getAttributes(const xmlChar **p)
Proc * p
Definition: driver.cxx:216

References xmlParserBase::_father, YACS::ENGINE::stateParser::_stackState, YACS::ENGINE::stateParser::_state, DEBTRACE, xmlParserBase::getAttributes(), and p.

◆ onEnd()

void sampleParser::onEnd ( const XML_Char name)
virtual

Reimplemented from YACS::ENGINE::stateParser.

Definition at line 890 of file LoadState.cxx.

891{
892 if (_mapAttrib.find("index") == _mapAttrib.end())
893 {
894 _what = "no attribute index in sample ";
897 }
898 int index = atoi(_mapAttrib["index"].c_str());
900 stateParser::onEnd(name);
901}
void addSample(int index, const std::string data)
Definition: LoadState.cxx:826
static std::string _what
Definition: LoadState.hxx:84
virtual void onEnd(const XML_Char *name)
Definition: LoadState.cxx:111
virtual void stopParse(std::string what)
std::map< std::string, std::string > _mapAttrib

References xmlParserBase::_data, xmlParserBase::_mapAttrib, _sampleFather, YACS::ENGINE::stateParser::_state, YACS::ENGINE::stateParser::_what, YACS::ENGINE::loopPortParser::addSample(), YACS::ENGINE::stateParser::onEnd(), xmlParserBase::stopParse(), and YACS::ENGINE::XMLFATALERROR.

◆ onStart()

void sampleParser::onStart ( const XML_Char elem,
const xmlChar **  p 
)
virtual

Reimplemented from YACS::ENGINE::stateParser.

Definition at line 869 of file LoadState.cxx.

870{
871 DEBTRACE("sampleParser::onStart" << elem);
872 string element(elem);
873 stateParser *parser = 0;
874 if (element == "index") parser = new attrParser();
875 else if (element == "value") parser = new valueParser();
876 else
877 {
878 _what = "expected index or value, got <" + element + ">";
881 }
882 if (parser)
883 {
884 _stackParser.push(parser);
886 parser->init(p, this);
887 }
888}
virtual void init(const xmlChar **p, xmlParserBase *father=0)
Definition: LoadState.cxx:65
static void XML_SetUserData(_xmlParserCtxt *ctxt, xmlParserBase *parser)
static _xmlParserCtxt * _xmlParser
static std::stack< xmlParserBase * > _stackParser

References xmlParserBase::_stackParser, YACS::ENGINE::stateParser::_state, YACS::ENGINE::stateParser::_what, xmlParserBase::_xmlParser, DEBTRACE, YACS::parser::init(), p, xmlParserBase::stopParse(), xmlParserBase::XML_SetUserData(), and YACS::ENGINE::XMLFATALERROR.

Member Data Documentation

◆ _sampleFather

loopPortParser* YACS::ENGINE::sampleParser::_sampleFather
private

Definition at line 214 of file LoadState.hxx.

Referenced by onEnd().


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