Version: 9.15.0
YACS::HMI::YACSGuiLoader Class Reference

#include <YACSGuiLoader.hxx>

Inheritance diagram for YACS::HMI::YACSGuiLoader:
Collaboration diagram for YACS::HMI::YACSGuiLoader:

Public Member Functions

 YACSGuiLoader ()
 
virtual ~YACSGuiLoader ()
 
virtual void reset ()
 
virtual YACS::ENGINE::Procload (const char *filename)
 
std::map< YACS::ENGINE::Node *, PrsDatagetPrsData (YACS::ENGINE::Proc *proc)
 
void process (std::string element, bool newLink=false)
 
- Public Member Functions inherited from YACS::YACSLoader
 YACSLoader ()
 
virtual ~YACSLoader ()
 
void registerProcCataLoader ()
 

Private Attributes

std::map< YACS::ENGINE::Node *, PrsData_prsMap
 
std::map< std::string, PrsData_inputMap
 

Additional Inherited Members

- Protected Attributes inherited from YACS::YACSLoader
std::map< std::string, parser * > _defaultParsersMap
 

Detailed Description

Class that extends engine XML loader. It can process the presentation data not hanled by the base class.

Definition at line 87 of file YACSGuiLoader.hxx.

Constructor & Destructor Documentation

◆ YACSGuiLoader()

YACSGuiLoader::YACSGuiLoader ( )

Definition at line 33 of file YACSGuiLoader.cxx.

34  : YACSLoader()
35 {
37  _defaultParsersMap.insert(make_pair("presentation", &presentation_parser));
38  _inputMap.clear();
39  _prsMap.clear();
40 }
static presentationtype_parser presentation_parser
std::map< YACS::ENGINE::Node *, PrsData > _prsMap
std::map< std::string, PrsData > _inputMap
std::map< std::string, parser * > _defaultParsersMap
Definition: parsers.hxx:44

References YACS::YACSLoader::_defaultParsersMap, _inputMap, _prsMap, YACS::HMI::presentationtype_parser::collector_, and presentation_parser.

◆ ~YACSGuiLoader()

YACSGuiLoader::~YACSGuiLoader ( )
virtual

Definition at line 42 of file YACSGuiLoader.cxx.

43 {
44 }

Member Function Documentation

◆ getPrsData()

std::map< YACS::ENGINE::Node *, PrsData > YACSGuiLoader::getPrsData ( YACS::ENGINE::Proc proc)

Definition at line 57 of file YACSGuiLoader.cxx.

58 {
59  _prsMap.clear();
60 
61  if (_defaultParsersMap.empty()) return _prsMap;
62 
63  for (map<string, PrsData>::iterator it = _inputMap.begin(); it != _inputMap.end(); ++it)
64  {
65  Node* node = 0;
66  string name = (*it).first;
67 
68  if (name == "__ROOT__")
69  node = proc;
70  else
71  {
72  try
73  {
74  node = proc->getChildByName(name);
75  }
76  catch(Exception& ex)
77  {
78  continue;
79  }
80  }
81  _prsMap[node] = (*it).second;
82  }
83  return _prsMap;
84 }
Node * getChildByName(const std::string &name) const
Base class for all nodes.
Definition: Node.hxx:70

References YACS::YACSLoader::_defaultParsersMap, _inputMap, _prsMap, testCppPluginInvokation::ex, and YACS::ENGINE::ComposedNode::getChildByName().

◆ load()

YACS::ENGINE::Proc * YACSGuiLoader::load ( const char *  filename)
virtual

Reimplemented from YACS::YACSLoader.

Definition at line 51 of file YACSGuiLoader.cxx.

52 {
53  _inputMap.clear();
54  return YACS::YACSLoader::load(filename);
55 }
virtual YACS::ENGINE::Proc * load(const char *filename)
Definition: parsers.cxx:63

References _inputMap, and YACS::YACSLoader::load().

◆ process()

void YACSGuiLoader::process ( std::string  element,
bool  newLink = false 
)

Definition at line 86 of file YACSGuiLoader.cxx.

87 {
88  if(theElement == "presentation")
89  {
90  if ( _defaultParsersMap["presentation"] )
91  {
93  _inputMap[aP->name_] = PrsData(aP->x_, aP->y_, aP->width_, aP->height_, aP->expx_, aP->expy_,
94  aP->expWidth_, aP->expHeight_, aP->expanded_, aP->shownState_);
95  DEBTRACE(aP->name_ << " " << aP->x_ << " " << aP->y_ << " " << aP->width_ << " " << aP->height_ << " "
96  << aP->expx_ << " " << aP->expy_ << " " << aP->expWidth_ << " " << aP->expHeight_ << " " << aP->expanded_ << " " << aP->shownState_);
97  }
98  }
99 }
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31

References YACS::YACSLoader::_defaultParsersMap, _inputMap, DEBTRACE, YACS::HMI::presentationtype_parser::expanded_, YACS::HMI::presentationtype_parser::expHeight_, YACS::HMI::presentationtype_parser::expWidth_, YACS::HMI::presentationtype_parser::expx_, YACS::HMI::presentationtype_parser::expy_, YACS::HMI::presentationtype_parser::height_, YACS::HMI::presentationtype_parser::name_, YACS::HMI::presentationtype_parser::shownState_, YACS::HMI::presentationtype_parser::width_, YACS::HMI::presentationtype_parser::x_, and YACS::HMI::presentationtype_parser::y_.

Referenced by YACS::HMI::presentationtype_parser::buildAttr().

◆ reset()

void YACSGuiLoader::reset ( )
virtual

Definition at line 46 of file YACSGuiLoader.cxx.

47 {
48  _inputMap.clear();
49 }

References _inputMap.

Referenced by gui.graph.grid::findPath().

Member Data Documentation

◆ _inputMap

std::map<std::string, PrsData> YACS::HMI::YACSGuiLoader::_inputMap
private

Definition at line 101 of file YACSGuiLoader.hxx.

Referenced by getPrsData(), load(), process(), reset(), and YACSGuiLoader().

◆ _prsMap

std::map<YACS::ENGINE::Node*, PrsData> YACS::HMI::YACSGuiLoader::_prsMap
private

Definition at line 100 of file YACSGuiLoader.hxx.

Referenced by getPrsData(), and YACSGuiLoader().


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