Version: 8.3.0
YACS::ENGINE::loopPortParser Class Reference

#include <LoadState.hxx>

Inheritance diagram for YACS::ENGINE::loopPortParser:
Collaboration diagram for YACS::ENGINE::loopPortParser:

Public Member Functions

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)
 
void addSample (int index, const std::string data)
 
unsigned int getNbSamples () const
 
unsigned int getSampleId (unsigned int i) const
 
const std::string & getSampleData (unsigned int i) const
 
const std::string & getPortName () const
 

Private Attributes

std::vector< unsigned int > _ids
 
std::vector< std::string > _sampleData
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::ENGINE::stateParser
static void setProc (Proc *p)
 
static void setRuntime (Runtime *runtime)
 
- 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
 
- 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)
 
- 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
 

Detailed Description

Definition at line 186 of file LoadState.hxx.

Member Function Documentation

void loopPortParser::addSample ( int  index,
const std::string  data 
)

Definition at line 826 of file LoadState.cxx.

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

827 {
828  _ids.push_back(index);
829  _sampleData.push_back(data);
830 }
void loopPortParser::charData ( std::string  data)
virtual

to be specialized following the kind of xml tag

Reimplemented from YACS::ENGINE::stateParser.

Definition at line 822 of file LoadState.cxx.

823 {
824 }
unsigned int loopPortParser::getNbSamples ( ) const

Definition at line 832 of file LoadState.cxx.

833 {
834  return _ids.size();
835 }
const std::string & loopPortParser::getPortName ( ) const

Definition at line 847 of file LoadState.cxx.

848 {
849  return _mapAttrib.at("name");
850 }
const std::string & loopPortParser::getSampleData ( unsigned int  i) const

Definition at line 842 of file LoadState.cxx.

References CORBAEngineTest::i.

843 {
844  return _sampleData[i];
845 }
unsigned int loopPortParser::getSampleId ( unsigned int  i) const

Definition at line 837 of file LoadState.cxx.

References CORBAEngineTest::i.

838 {
839  return _ids[i];
840 }
void loopPortParser::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 785 of file LoadState.cxx.

References DEBTRACE.

786 {
787  DEBTRACE("loopPortParser::init()");
788  //_state = XMLINPORT;
789  _father = father;
790  _stackState.push(_state);
791  _ids.clear();
792  _sampleData.clear();
793  if (p) getAttributes(p);
794 }
void loopPortParser::onEnd ( const XML_Char name)
virtual

Reimplemented from YACS::ENGINE::stateParser.

Definition at line 817 of file LoadState.cxx.

References YACS::ENGINE::stateParser::onEnd().

818 {
819  stateParser::onEnd(name);
820 }
void loopPortParser::onStart ( const XML_Char elem,
const xmlChar **  p 
)
virtual

Reimplemented from YACS::ENGINE::stateParser.

Definition at line 796 of file LoadState.cxx.

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

797 {
798  DEBTRACE("loopPortParser::onStart" << elem);
799  string element(elem);
800  stateParser *parser = 0;
801  if (element == "name") parser = new attrParser();
802  else if (element == "sample") parser = new sampleParser(this);
803  else
804  {
805  _what = "expected name or sample, got <" + element + ">";
807  stopParse(_what);
808  }
809  if (parser)
810  {
811  _stackParser.push(parser);
812  XML_SetUserData(_xmlParser, parser);
813  parser->init(p, this);
814  }
815 }

Member Data Documentation

std::vector<unsigned int> YACS::ENGINE::loopPortParser::_ids
private

Definition at line 199 of file LoadState.hxx.

std::vector<std::string> YACS::ENGINE::loopPortParser::_sampleData
private

Definition at line 200 of file LoadState.hxx.


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