Version: 8.3.0
YACS::ENGINE::VisitorSaveSalomeSchema Class Reference

#include <VisitorSaveSalomeSchema.hxx>

Inheritance diagram for YACS::ENGINE::VisitorSaveSalomeSchema:
Collaboration diagram for YACS::ENGINE::VisitorSaveSalomeSchema:

Public Member Functions

 VisitorSaveSalomeSchema (ComposedNode *root)
 
virtual ~VisitorSaveSalomeSchema ()
 
virtual void visitPresetNode (DataNode *node)
 
virtual void visitOutNode (DataNode *node)
 
virtual void visitStudyInNode (DataNode *node)
 
virtual void visitStudyOutNode (DataNode *node)
 
- Public Member Functions inherited from YACS::ENGINE::VisitorSaveSchema
 VisitorSaveSchema (ComposedNode *root)
 
virtual ~VisitorSaveSchema ()
 
void openFileSchema (std::string xmlDump) throw (Exception)
 
void closeFileSchema ()
 
virtual void visitBloc (Bloc *node)
 
virtual void visitElementaryNode (ElementaryNode *node)
 
virtual void visitForEachLoop (ForEachLoop *node)
 
virtual void visitOptimizerLoop (OptimizerLoop *node)
 
virtual void visitDynParaLoop (DynParaLoop *node)
 
virtual void visitForLoop (ForLoop *node)
 
virtual void visitInlineNode (InlineNode *node)
 
virtual void visitInlineFuncNode (InlineFuncNode *node)
 
virtual void visitLoop (Loop *node)
 
virtual void visitProc (Proc *node)
 
virtual void visitServiceNode (ServiceNode *node)
 
virtual void visitServerNode (ServerNode *node)
 
virtual void visitServiceInlineNode (ServiceInlineNode *node)
 
virtual void visitSwitch (Switch *node)
 
virtual void visitWhileLoop (WhileLoop *node)
 
- Public Member Functions inherited from YACS::ENGINE::Visitor
 Visitor (ComposedNode *root)
 

Protected Member Functions

virtual void writeDataNodeParameters (DataNode *node)
 
virtual void writeStudyInNodeParameters (DataNode *node)
 
virtual void writeOutNodeParameters (DataNode *node)
 
virtual void writeStudyOutNodeParameters (DataNode *node)
 
- Protected Member Functions inherited from YACS::ENGINE::VisitorSaveSchema
virtual void writeProperties (Node *node)
 
virtual void dumpTypeCode (TypeCode *type, std::set< std::string > &typeNames, std::map< std::string, TypeCode * > &typeMap, int depth)
 
virtual void writeTypeCodes (Proc *proc)
 
virtual void writeContainers (Proc *proc)
 
virtual void writeComponentInstances (Proc *proc)
 
virtual void writeInputPorts (Node *node)
 
virtual void writeInputDataStreamPorts (Node *node)
 
virtual void writeOutputPorts (Node *node)
 
virtual void writeOutputDataStreamPorts (Node *node)
 
virtual void writeControls (ComposedNode *node)
 
virtual void writeSimpleDataLinks (ComposedNode *node)
 
virtual void writeSimpleStreamLinks (ComposedNode *node)
 
virtual void writeParameters (Proc *proc)
 
virtual void writeParametersNode (ComposedNode *proc, Node *node)
 
virtual void beginCase (Node *node)
 
virtual void endCase (Node *node)
 
std::set< Node * > getAllNodes (ComposedNode *node)
 
int depthNode (Node *node)
 
std::string indent (int val)
 
- Protected Member Functions inherited from YACS::ENGINE::Visitor
std::map< std::string,
std::string > 
getNodeProperties (Node *node)
 
std::map< std::string, TypeCode * > getTypeCodeMap (Proc *proc)
 
std::map< std::string,
Container * > 
getContainerMap (Proc *proc)
 
std::list< TypeCodeObjref * > getListOfBases (TypeCodeObjref *objref)
 

Additional Inherited Members

- Protected Attributes inherited from YACS::ENGINE::VisitorSaveSchema
std::ofstream _out
 
std::map< int, std::string > _nodeStateName
 
std::map< std::string,
Container * > 
_containerMap
 
std::map< ComponentInstance
*, std::string > 
_componentInstanceMap
 
ComposedNode_root
 
std::multimap< int, DataLinkInfo_mapOfDLtoCreate
 
std::multimap< int,
StreamLinkInfo
_mapOfSLtoCreate
 

Detailed Description

Definition at line 30 of file VisitorSaveSalomeSchema.hxx.

Constructor & Destructor Documentation

VisitorSaveSalomeSchema::VisitorSaveSalomeSchema ( ComposedNode root)

Definition at line 42 of file VisitorSaveSalomeSchema.cxx.

43  : VisitorSaveSchema(root)
44 {
45 }
VisitorSaveSalomeSchema::~VisitorSaveSalomeSchema ( )
virtual

Definition at line 47 of file VisitorSaveSalomeSchema.cxx.

48 {
49 }

Member Function Documentation

void VisitorSaveSalomeSchema::visitOutNode ( DataNode node)
virtual

Reimplemented from YACS::ENGINE::VisitorSaveSchema.

Definition at line 70 of file VisitorSaveSalomeSchema.cxx.

References YACS::ENGINE::VisitorSaveSchema::_out, YACS::ENGINE::VisitorSaveSchema::_root, YACS::ENGINE::VisitorSaveSchema::beginCase(), DEBTRACE, YACS::ENGINE::VisitorSaveSchema::depthNode(), YACS::DISABLED, YACS::ENGINE::VisitorSaveSchema::endCase(), YACS::ENGINE::ComposedNode::getChildName(), YACS::ENGINE::Node::getName(), YACS::ENGINE::DataNode::getRef(), YACS::ENGINE::ElementaryNode::getState(), YACS::ENGINE::VisitorSaveSchema::indent(), gui.CONNECTOR::ref(), writeOutNodeParameters(), and YACS::ENGINE::VisitorSaveSchema::writeProperties().

71 {
72  DEBTRACE("START visitOutNode " << _root->getChildName(node));
73  beginCase(node);
74  int depth = depthNode(node);
75  _out << indent(depth) << "<outnode name=\"" << node->getName() << "\"";
76  string ref = node->getRef();
77  if (!ref.empty()) _out << " ref=\"" << ref << "\"";
78  if (node->getState() == YACS::DISABLED)
79  _out << " state=\"disabled\">" << endl;
80  else
81  _out << ">" << endl;
83  writeProperties(node);
84  _out << indent(depth) << "</outnode>" << endl;
85  endCase(node);
86  DEBTRACE("END visitOutNode " << _root->getChildName(node));
87 }
void VisitorSaveSalomeSchema::visitPresetNode ( DataNode node)
virtual

Reimplemented from YACS::ENGINE::VisitorSaveSchema.

Definition at line 51 of file VisitorSaveSalomeSchema.cxx.

References YACS::ENGINE::VisitorSaveSchema::_out, YACS::ENGINE::VisitorSaveSchema::_root, YACS::ENGINE::VisitorSaveSchema::beginCase(), DEBTRACE, YACS::ENGINE::VisitorSaveSchema::depthNode(), YACS::DISABLED, YACS::ENGINE::VisitorSaveSchema::endCase(), YACS::ENGINE::ComposedNode::getChildName(), YACS::ENGINE::Node::getName(), YACS::ENGINE::DataNode::getRef(), YACS::ENGINE::ElementaryNode::getState(), YACS::ENGINE::VisitorSaveSchema::indent(), gui.CONNECTOR::ref(), writeDataNodeParameters(), and YACS::ENGINE::VisitorSaveSchema::writeProperties().

52 {
53  DEBTRACE("START visitPresetNode " << _root->getChildName(node));
54  beginCase(node);
55  int depth = depthNode(node);
56  _out << indent(depth) << "<datanode name=\"" << node->getName() << "\"";
57  string ref = node->getRef();
58  if (!ref.empty()) _out << " ref=\"" << ref << "\"";
59  if (node->getState() == YACS::DISABLED)
60  _out << " state=\"disabled\">" << endl;
61  else
62  _out << ">" << endl;
64  writeProperties(node);
65  _out << indent(depth) << "</datanode>" << endl;
66  endCase(node);
67  DEBTRACE("END visitPresetNode " << _root->getChildName(node));
68 }
void VisitorSaveSalomeSchema::visitStudyInNode ( DataNode node)
virtual

Reimplemented from YACS::ENGINE::VisitorSaveSchema.

Definition at line 89 of file VisitorSaveSalomeSchema.cxx.

References YACS::ENGINE::VisitorSaveSchema::_out, YACS::ENGINE::VisitorSaveSchema::_root, YACS::ENGINE::VisitorSaveSchema::beginCase(), DEBTRACE, YACS::ENGINE::VisitorSaveSchema::depthNode(), YACS::DISABLED, YACS::ENGINE::VisitorSaveSchema::endCase(), YACS::ENGINE::ComposedNode::getChildName(), YACS::ENGINE::Node::getName(), YACS::ENGINE::DataNode::getRef(), YACS::ENGINE::ElementaryNode::getState(), YACS::ENGINE::VisitorSaveSchema::indent(), gui.CONNECTOR::ref(), YACS::ENGINE::VisitorSaveSchema::writeProperties(), and writeStudyInNodeParameters().

90 {
91  DEBTRACE("START visitStudyInNode " << _root->getChildName(node));
92  beginCase(node);
93  int depth = depthNode(node);
94  _out << indent(depth) << "<datanode name=\"" << node->getName() << "\" kind=\"study\"";
95  string ref = node->getRef();
96  if (!ref.empty()) _out << " ref=\"" << ref << "\"";
97  if (node->getState() == YACS::DISABLED)
98  _out << " state=\"disabled\">" << endl;
99  else
100  _out << ">" << endl;
102  writeProperties(node);
103  _out << indent(depth) << "</datanode>" << endl;
104  endCase(node);
105  DEBTRACE("END visitStudyInNode " << _root->getChildName(node));
106 }
void VisitorSaveSalomeSchema::visitStudyOutNode ( DataNode node)
virtual

Reimplemented from YACS::ENGINE::VisitorSaveSchema.

Definition at line 108 of file VisitorSaveSalomeSchema.cxx.

References YACS::ENGINE::VisitorSaveSchema::_out, YACS::ENGINE::VisitorSaveSchema::_root, YACS::ENGINE::VisitorSaveSchema::beginCase(), DEBTRACE, YACS::ENGINE::VisitorSaveSchema::depthNode(), YACS::DISABLED, YACS::ENGINE::VisitorSaveSchema::endCase(), YACS::ENGINE::ComposedNode::getChildName(), YACS::ENGINE::Node::getName(), YACS::ENGINE::DataNode::getRef(), YACS::ENGINE::ElementaryNode::getState(), YACS::ENGINE::VisitorSaveSchema::indent(), gui.CONNECTOR::ref(), YACS::ENGINE::VisitorSaveSchema::writeProperties(), and writeStudyOutNodeParameters().

109 {
110  DEBTRACE("START visitStudyOutNode " << _root->getChildName(node));
111  beginCase(node);
112  int depth = depthNode(node);
113  _out << indent(depth) << "<outnode name=\"" << node->getName() << "\" kind=\"study\"";
114  string ref = node->getRef();
115  if (!ref.empty()) _out << " ref=\"" << ref << "\"";
116  if (node->getState() == YACS::DISABLED)
117  _out << " state=\"disabled\">" << endl;
118  else
119  _out << ">" << endl;
121  writeProperties(node);
122  _out << indent(depth) << "</outnode>" << endl;
123  endCase(node);
124  DEBTRACE("END visitStudyOutNode " << _root->getChildName(node));
125 }
void VisitorSaveSalomeSchema::writeDataNodeParameters ( DataNode node)
protectedvirtual

Definition at line 127 of file VisitorSaveSalomeSchema.cxx.

References YACS::ENGINE::VisitorSaveSchema::_out, YACS::ENGINE::VisitorSaveSchema::depthNode(), YACS::ENGINE::OutputPresetPort::getData(), YACS::ENGINE::ElementaryNode::getSetOfOutputPort(), YACS::ENGINE::VisitorSaveSchema::indent(), and YASSERT.

Referenced by visitPresetNode().

128 {
129  int depth = depthNode(node)+1;
130  list<OutputPort*> listOfOutputPorts = node->getSetOfOutputPort();
131  for (list<OutputPort*>::iterator it = listOfOutputPorts.begin(); it != listOfOutputPorts.end(); ++it)
132  {
133  _out << indent(depth) << "<parameter name=\"" << (*it)->getName() << "\" type=\""
134  << (*it)->edGetType()->name() << "\">" << endl;
135  OutputPresetPort *outp = dynamic_cast<OutputPresetPort*>(*it);
136  YASSERT(outp);
137  _out << indent(depth+1) << outp->getData();
138  _out << indent(depth) << "</parameter>" << endl;
139  }
140 }
void VisitorSaveSalomeSchema::writeOutNodeParameters ( DataNode node)
protectedvirtual

Definition at line 156 of file VisitorSaveSalomeSchema.cxx.

References YACS::ENGINE::VisitorSaveSchema::_out, YACS::ENGINE::VisitorSaveSchema::depthNode(), YACS::ENGINE::ElementaryNode::getSetOfInputPort(), and YACS::ENGINE::VisitorSaveSchema::indent().

Referenced by visitOutNode().

157 {
158  int depth = depthNode(node)+1;
159  list<InputPort*> listOfInputPorts = node->getSetOfInputPort();
160  for (list<InputPort*>::iterator it = listOfInputPorts.begin(); it != listOfInputPorts.end(); ++it)
161  {
162  _out << indent(depth) << "<parameter name=\"" << (*it)->getName() << "\" type=\""
163  << (*it)->edGetType()->name() << "\"/>" << endl;
164  }
165 }
void VisitorSaveSalomeSchema::writeStudyInNodeParameters ( DataNode node)
protectedvirtual

Definition at line 142 of file VisitorSaveSalomeSchema.cxx.

References YACS::ENGINE::VisitorSaveSchema::_out, YACS::ENGINE::VisitorSaveSchema::depthNode(), YACS::ENGINE::OutputStudyPort::getData(), YACS::ENGINE::ElementaryNode::getSetOfOutputPort(), YACS::ENGINE::VisitorSaveSchema::indent(), and YASSERT.

Referenced by visitStudyInNode().

143 {
144  int depth = depthNode(node)+1;
145  list<OutputPort*> listOfOutputPorts = node->getSetOfOutputPort();
146  for (list<OutputPort*>::iterator it = listOfOutputPorts.begin(); it != listOfOutputPorts.end(); ++it)
147  {
148  _out << indent(depth) << "<parameter name=\"" << (*it)->getName() << "\" type=\""
149  << (*it)->edGetType()->name() << "\" ref=\"";
150  OutputStudyPort *outp = dynamic_cast<OutputStudyPort*>(*it);
151  YASSERT(outp);
152  _out << outp->getData() << "\"/>" << endl;
153  }
154 }
void VisitorSaveSalomeSchema::writeStudyOutNodeParameters ( DataNode node)
protectedvirtual

Definition at line 167 of file VisitorSaveSalomeSchema.cxx.

References YACS::ENGINE::VisitorSaveSchema::_out, YACS::ENGINE::VisitorSaveSchema::depthNode(), YACS::ENGINE::InputStudyPort::getData(), YACS::ENGINE::ElementaryNode::getSetOfInputPort(), YACS::ENGINE::VisitorSaveSchema::indent(), and YASSERT.

Referenced by visitStudyOutNode().

168 {
169  int depth = depthNode(node)+1;
170  list<InputPort*> listOfInputPorts = node->getSetOfInputPort();
171  for (list<InputPort*>::iterator it = listOfInputPorts.begin(); it != listOfInputPorts.end(); ++it)
172  {
173  _out << indent(depth) << "<parameter name=\"" << (*it)->getName() << "\" type=\""
174  << (*it)->edGetType()->name() << "\" ref=\"";
175  InputStudyPort *inp = dynamic_cast<InputStudyPort*>(*it);
176  YASSERT(inp);
177  _out << inp->getData() << "\"/>" << endl;
178  }
179 }

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