Version: 9.15.0
YACS::ENGINE::stateParser Class Reference

specialized parser to load SALOME execution saved states. More...

#include <LoadState.hxx>

Inheritance diagram for YACS::ENGINE::stateParser:
Collaboration diagram for YACS::ENGINE::stateParser:

Public Member Functions

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)
 

Static Public Member Functions

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)
 

Static Public Attributes

static XMLReadState _state
 
static std::string _what
 
- Static Public Attributes inherited from xmlParserBase
static _xmlParserCtxt * _xmlParser
 
static std::stack< xmlParserBase * > _stackParser
 

Protected Member Functions

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 incrCount (const XML_Char *elem)
 
virtual void end ()
 
virtual void stopParse (std::string what)
 

Static Protected Attributes

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
 

Additional Inherited Members

- Public Attributes inherited from xmlParserBase
std::map< std::string, int > counts
 
- Protected Attributes inherited from xmlParserBase
std::map< std::string, std::string > _mapAttrib
 
std::string _data
 
xmlParserBase_father
 

Detailed Description

specialized parser to load SALOME execution saved states.

this base class must be derived to build specific parsers for each tag defined in the xml file

Definition at line 80 of file LoadState.hxx.

Member Function Documentation

◆ charData()

void stateParser::charData ( std::string  data)
protectedvirtual

to be specialized following the kind of xml tag

Reimplemented from xmlParserBase.

Reimplemented in YACS::ENGINE::sampleParser, YACS::ENGINE::loopPortParser, YACS::ENGINE::simpleTypeParser, and YACS::ENGINE::attrParser.

Definition at line 119 of file LoadState.cxx.

120 {
121  //cerr << "data " << data << endl;
122 }

◆ init()

void stateParser::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 xmlParserBase.

Reimplemented in YACS::ENGINE::sampleParser, YACS::ENGINE::loopPortParser, YACS::ENGINE::simpleTypeParser, YACS::ENGINE::dataParser, YACS::ENGINE::arrayParser, YACS::ENGINE::valueParser, YACS::ENGINE::portParser, YACS::ENGINE::attrParser, YACS::ENGINE::nodeParser, YACS::ENGINE::graphParser, and outputParser.

Definition at line 65 of file LoadState.cxx.

66 {
67  DEBTRACE("stateParser::init()");
69  _father = father;
70  _stackState.push(_state);
71  _nodeStateValue["READY"] =YACS::READY;
72  _nodeStateValue["TOLOAD"] =YACS::TOLOAD;
73  _nodeStateValue["LOADED"] =YACS::LOADED;
74  _nodeStateValue["TOACTIVATE"] =YACS::TOACTIVATE;
75  _nodeStateValue["ACTIVATED"] =YACS::ACTIVATED;
76  _nodeStateValue["DESACTIVATED"] =YACS::DESACTIVATED;
77  _nodeStateValue["DONE"] =YACS::DONE;
78  _nodeStateValue["SUSPENDED"] =YACS::SUSPENDED;
79  _nodeStateValue["LOADFAILED"] =YACS::LOADFAILED;
80  _nodeStateValue["EXECFAILED"] =YACS::EXECFAILED;
81  _nodeStateValue["PAUSE"] =YACS::PAUSE;
82  _nodeStateValue["INTERNALERR"] =YACS::INTERNALERR;
83  _nodeStateValue["DISABLED"] =YACS::DISABLED;
84  _nodeStateValue["FAILED"] =YACS::FAILED;
85  _nodeStateValue["ERROR"] =YACS::ERROR;
86  _nodeStates.clear();
87 }
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
static std::stack< XMLReadState > _stackState
Definition: LoadState.hxx:98
static XMLReadState _state
Definition: LoadState.hxx:83
static std::map< std::string, YACS::StatesForNode > _nodeStates
Definition: LoadState.hxx:102
static std::map< std::string, YACS::StatesForNode > _nodeStateValue
Definition: LoadState.hxx:101
xmlParserBase * _father
@ FAILED
Definition: define.hxx:51
@ DESACTIVATED
Definition: define.hxx:42
@ EXECFAILED
Definition: define.hxx:46
@ TOLOAD
Definition: define.hxx:38
@ LOADED
Definition: define.hxx:39
@ READY
Definition: define.hxx:37
@ ACTIVATED
Definition: define.hxx:41
@ INTERNALERR
Definition: define.hxx:49
@ DONE
Definition: define.hxx:43
@ TOACTIVATE
Definition: define.hxx:40
@ SUSPENDED
Definition: define.hxx:44
@ PAUSE
Definition: define.hxx:47
@ DISABLED
Definition: define.hxx:50
@ LOADFAILED
Definition: define.hxx:45
@ ERROR
Definition: define.hxx:52

References YACS::ACTIVATED, DEBTRACE, YACS::DESACTIVATED, YACS::DISABLED, YACS::DONE, YACS::ERROR, YACS::EXECFAILED, YACS::FAILED, YACS::INTERNALERR, YACS::LOADED, YACS::LOADFAILED, YACS::PAUSE, YACS::READY, YACS::SUSPENDED, YACS::TOACTIVATE, YACS::TOLOAD, and YACS::ENGINE::XMLNOCONTEXT.

Referenced by outputParser::onStart().

◆ onEnd()

◆ onStart()

void stateParser::onStart ( const XML_Char elem,
const xmlChar **  p 
)
protectedvirtual

Reimplemented in YACS::ENGINE::sampleParser, YACS::ENGINE::loopPortParser, YACS::ENGINE::simpleTypeParser, YACS::ENGINE::dataParser, YACS::ENGINE::arrayParser, YACS::ENGINE::valueParser, YACS::ENGINE::portParser, YACS::ENGINE::attrParser, YACS::ENGINE::nodeParser, and YACS::ENGINE::graphParser.

Definition at line 90 of file LoadState.cxx.

91 {
92  DEBTRACE("stateParser::onStart");
93  string element(elem);
94  stateParser *parser = 0;
95  if (element == "graphState") parser = new graphParser();
96  else
97  {
98  _what = "expected <graphState>, got <" + element + ">";
100  stopParse(_what);
101  }
102  if (parser)
103  {
104  _stackParser.push(parser);
105  XML_SetUserData(_xmlParser, parser);
106  parser->init(p);
107  }
108 }
specialized parser to load SALOME execution saved states.
Definition: LoadState.hxx:81
virtual void init(const xmlChar **p, xmlParserBase *father=0)
Definition: LoadState.cxx:65
static std::string _what
Definition: LoadState.hxx:84
static void XML_SetUserData(_xmlParserCtxt *ctxt, xmlParserBase *parser)
virtual void stopParse(std::string what)
static _xmlParserCtxt * _xmlParser
static std::stack< xmlParserBase * > _stackParser
Proc * p
Definition: driver.cxx:216

References DEBTRACE, YACS::parser::init(), p, and YACS::ENGINE::XMLFATALERROR.

◆ setProc()

void stateParser::setProc ( Proc p)
static

Definition at line 55 of file LoadState.cxx.

56 {
57  _p= p;
58 }

References p.

◆ setRuntime()

void stateParser::setRuntime ( Runtime runtime)
static

Definition at line 60 of file LoadState.cxx.

61 {
62  _runtime = runtime;
63 }
static Runtime * _runtime
Definition: LoadState.hxx:100

Member Data Documentation

◆ _nodeStates

std::map< std::string, YACS::StatesForNode > stateParser::_nodeStates
staticprotected

Definition at line 102 of file LoadState.hxx.

◆ _nodeStateValue

std::map< std::string, YACS::StatesForNode > stateParser::_nodeStateValue
staticprotected

Definition at line 101 of file LoadState.hxx.

◆ _p

Proc * stateParser::_p
staticprotected

Definition at line 99 of file LoadState.hxx.

◆ _runtime

Runtime * stateParser::_runtime
staticprotected

Definition at line 100 of file LoadState.hxx.

◆ _stackState

std::stack< XMLReadState > stateParser::_stackState
staticprotected

Definition at line 98 of file LoadState.hxx.

Referenced by YACS::ENGINE::sampleParser::init().

◆ _state

◆ _what

std::string stateParser::_what
static

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