Version: 9.15.0
YACS::ENGINE::LinkInfo Class Reference

Class that deal with list of semantics links for high level analysis. More...

#include <LinkInfo.hxx>

Collaboration diagram for YACS::ENGINE::LinkInfo:

Public Member Functions

 LinkInfo (unsigned char level)
 
void clearAll ()
 
void startCollapseTransac ()
 
void endCollapseTransac ()
 
void setPointOfView (ComposedNode *pov)
 
void pushInfoLink (OutPort *semStart, InPort *end, InfoReason reason)
 
void pushWarnLink (OutPort *semStart, InPort *end, WarnReason reason)
 
void pushErrLink (OutPort *semStart, InPort *end, ErrReason reason)
 
void pushErrSwitch (CollectorSwOutPort *collector)
 
void pushUselessCFLink (Node *start, Node *end)
 
void takeDecision () const
 
std::string getGlobalRepr () const
 
std::string getInfoRepr () const
 
std::string getWarnRepr () const
 
std::string getErrRepr () const
 
bool areWarningsOrErrors () const
 
unsigned getNumberOfInfoLinks (InfoReason reason) const
 
unsigned getNumberOfWarnLinksGrp (WarnReason reason) const
 
unsigned getNumberOfErrLinks (ErrReason reason) const
 
std::set< std::pair< Node *, Node * > > getInfoUselessLinks () const
 
std::pair< OutPort *, InPort * > getInfoLink (unsigned id, InfoReason reason) const
 
std::vector< std::pair< OutPort *, InPort * > > getWarnLink (unsigned id, WarnReason reason) const
 
std::pair< OutPort *, InPort * > getErrLink (unsigned id, ErrReason reason) const
 

Static Public Attributes

static const unsigned char ALL_STOP_ASAP = 1
 
static const unsigned char ALL_DONT_STOP = 2
 
static const unsigned char WARN_ONLY_DONT_STOP = 3
 

Static Protected Member Functions

static std::string getStringReprOfI (InfoReason reason)
 
static std::string getStringReprOfW (WarnReason reason)
 
static std::string getStringReprOfE (ErrReason reason)
 
static std::string printThereIsAre (unsigned val, const std::string &other)
 

Private Attributes

ComposedNode_pov
 
unsigned int _level
 
unsigned char _levelOfInfo
 
std::vector< InPort * > _unsetInPort
 
std::vector< InPort * > _onlyBackDefined
 
std::set< std::pair< Node *, Node * > > _uselessLinks
 
std::map< InfoReason, std::vector< std::pair< OutPort *, InPort * > > > _infos
 
std::map< WarnReason, std::vector< std::vector< std::pair< OutPort *, InPort * > > > > _collapse
 
std::map< ErrReason, std::vector< std::pair< OutPort *, InPort * > > > _errors
 
std::vector< CollectorSwOutPort * > _errorsOnSwitchCases
 

Detailed Description

Class that deal with list of semantics links for high level analysis.

Definition at line 82 of file LinkInfo.hxx.

Constructor & Destructor Documentation

◆ LinkInfo()

LinkInfo::LinkInfo ( unsigned char  level)

Definition at line 32 of file LinkInfo.cxx.

32  :_levelOfInfo(level),_level(0)
33 {
34 }
unsigned int _level
Definition: LinkInfo.hxx:86
unsigned char _levelOfInfo
Definition: LinkInfo.hxx:87

Member Function Documentation

◆ areWarningsOrErrors()

bool LinkInfo::areWarningsOrErrors ( ) const

Definition at line 199 of file LinkInfo.cxx.

200 {
201  return (getNumberOfWarnLinksGrp(W_ALL)!=0) || (getNumberOfErrLinks(E_ALL)!=0) || !_unsetInPort.empty() || !_onlyBackDefined.empty();
202 }
std::vector< InPort * > _onlyBackDefined
Definition: LinkInfo.hxx:89
unsigned getNumberOfErrLinks(ErrReason reason) const
Definition: LinkInfo.cxx:246
std::vector< InPort * > _unsetInPort
Definition: LinkInfo.hxx:88
unsigned getNumberOfWarnLinksGrp(WarnReason reason) const
Definition: LinkInfo.cxx:229

References _onlyBackDefined, _unsetInPort, YACS::ENGINE::E_ALL, getNumberOfErrLinks(), getNumberOfWarnLinksGrp(), and YACS::ENGINE::W_ALL.

Referenced by endCollapseTransac(), main(), YACS::HMI::GenericGui::onRunLoadedSchema(), and YACS::HMI::EditionProc::synchronize().

◆ clearAll()

void LinkInfo::clearAll ( )

Definition at line 36 of file LinkInfo.cxx.

37 {
38  _level=0;
39  _unsetInPort.clear();
40  _onlyBackDefined.clear();
41  _uselessLinks.clear();
42  _infos.clear();
43  _collapse.clear();
44  _errors.clear();
45  _errorsOnSwitchCases.clear();
46 }
std::set< std::pair< Node *, Node * > > _uselessLinks
Definition: LinkInfo.hxx:90
std::map< ErrReason, std::vector< std::pair< OutPort *, InPort * > > > _errors
Definition: LinkInfo.hxx:93
std::map< InfoReason, std::vector< std::pair< OutPort *, InPort * > > > _infos
Definition: LinkInfo.hxx:91
std::map< WarnReason, std::vector< std::vector< std::pair< OutPort *, InPort * > > > > _collapse
Definition: LinkInfo.hxx:92
std::vector< CollectorSwOutPort * > _errorsOnSwitchCases
Definition: LinkInfo.hxx:94

References _collapse, _errors, _errorsOnSwitchCases, _infos, _level, _onlyBackDefined, _unsetInPort, and _uselessLinks.

Referenced by YACS::ENGINE::ComposedNode::checkConsistency().

◆ endCollapseTransac()

void LinkInfo::endCollapseTransac ( )

Definition at line 53 of file LinkInfo.cxx.

54 {
55  if(--_level==0)
56  {
59  throw Exception(getGlobalRepr());
62  throw Exception(getErrRepr());
63  }
64 }
static const unsigned char WARN_ONLY_DONT_STOP
Definition: LinkInfo.hxx:128
static const unsigned char ALL_STOP_ASAP
Definition: LinkInfo.hxx:126
std::string getGlobalRepr() const
Definition: LinkInfo.cxx:118
bool areWarningsOrErrors() const
Definition: LinkInfo.cxx:199
std::string getErrRepr() const
Definition: LinkInfo.cxx:182

References _level, _levelOfInfo, ALL_STOP_ASAP, areWarningsOrErrors(), getErrRepr(), getGlobalRepr(), getNumberOfWarnLinksGrp(), YACS::ENGINE::W_ALL, and WARN_ONLY_DONT_STOP.

Referenced by YACS::ENGINE::Bloc::verdictForCollapses().

◆ getErrLink()

std::pair< OutPort *, InPort * > LinkInfo::getErrLink ( unsigned  id,
ErrReason  reason 
) const

Definition at line 291 of file LinkInfo.cxx.

292 {
293  if(reason==E_NEVER_SET_INPUTPORT)
294  return pair<OutPort *, InPort *>( reinterpret_cast<OutPort *>(0), _unsetInPort[id] );
295  else if(reason==E_ONLY_BACKWARD_DEFINED)
296  return pair<OutPort *, InPort *>( reinterpret_cast<OutPort *>(0), _onlyBackDefined[id] );
297  else
298  {
299  map<ErrReason, vector< pair<OutPort *,InPort *> > >::const_iterator iter=_errors.find(reason);
300  if(iter!=_errors.end())
301  return (*iter).second[id];
302  else
303  return pair<OutPort *, InPort *>( reinterpret_cast<OutPort *>(0), reinterpret_cast<InPort *>(0) );
304  }
305 }
@ E_NEVER_SET_INPUTPORT
Definition: LinkInfo.hxx:69
@ E_ONLY_BACKWARD_DEFINED
Definition: LinkInfo.hxx:70

References _errors, _onlyBackDefined, _unsetInPort, YACS::ENGINE::E_NEVER_SET_INPUTPORT, and YACS::ENGINE::E_ONLY_BACKWARD_DEFINED.

◆ getErrRepr()

std::string LinkInfo::getErrRepr ( ) const

Definition at line 182 of file LinkInfo.cxx.

183 {
184  vector<InPort *>::const_iterator iter;
185  ostringstream stream;
186  for(iter=_unsetInPort.begin();iter!=_unsetInPort.end();iter++)
187  stream << getStringReprOfE(E_NEVER_SET_INPUTPORT) << "\"" << _pov->getInPortName(*iter) << "\"." << endl;
188  for(iter=_onlyBackDefined.begin();iter!=_onlyBackDefined.end();iter++)
189  stream << getStringReprOfE(E_ONLY_BACKWARD_DEFINED) << "\"" << _pov->getInPortName(*iter) << "\"." << endl;
190  map<ErrReason, vector< pair<OutPort *,InPort *> > >::const_iterator iter2;
191  for(iter2=_errors.begin();iter2!=_errors.end();iter2++)
192  for(vector< pair<OutPort *,InPort *> >::const_iterator iter3=(*iter2).second.begin();iter3!=(*iter2).second.end();iter3++)
193  stream << getStringReprOfE((*iter2).first) << " between \"" <<_pov->getOutPortName((*iter3).first) << "\" and \"" << _pov->getInPortName((*iter3).second) << endl;
194  for(vector<CollectorSwOutPort *>::const_iterator iter3=_errorsOnSwitchCases.begin();iter3!=_errorsOnSwitchCases.end();iter3++)
195  (*iter3)->getHumanReprOfIncompleteCases(stream);
196  return stream.str();
197 }
std::string getOutPortName(const OutPort *) const
std::string getInPortName(const InPort *) const
Get the input port name.
ComposedNode * _pov
Definition: LinkInfo.hxx:85
static std::string getStringReprOfE(ErrReason reason)
Definition: LinkInfo.cxx:364

References _errors, _errorsOnSwitchCases, _onlyBackDefined, _pov, _unsetInPort, YACS::ENGINE::E_NEVER_SET_INPUTPORT, YACS::ENGINE::E_ONLY_BACKWARD_DEFINED, YACS::ENGINE::ComposedNode::getInPortName(), YACS::ENGINE::ComposedNode::getOutPortName(), and getStringReprOfE().

Referenced by endCollapseTransac(), getGlobalRepr(), pushErrLink(), pushErrSwitch(), and takeDecision().

◆ getGlobalRepr()

std::string LinkInfo::getGlobalRepr ( ) const

Definition at line 118 of file LinkInfo.cxx.

119 {
120  ostringstream retS; retS << GLOBAL_MESSAGE1;
121  retS << printThereIsAre(getNumberOfErrLinks(E_ALL),"error") << ".\n";
122  retS << printThereIsAre(getNumberOfWarnLinksGrp(W_ALL),"warning") << ".\n";
123  retS << printThereIsAre(getNumberOfInfoLinks(I_ALL),"info") << ".\n";
125  {
126  retS << "****** ERRORS ******" << endl;
127  retS << getErrRepr() << endl;
128  }
130  {
131  retS << "****** WARNINGS ******" << endl;
132  retS << getWarnRepr() << endl;
133  }
135  {
136  retS << "****** INFO ******" << endl;
137  retS << getInfoRepr() << endl;
138  }
139  return retS.str();
140 }
static const char GLOBAL_MESSAGE1[]
Definition: LinkInfo.cxx:28
static std::string printThereIsAre(unsigned val, const std::string &other)
Definition: LinkInfo.cxx:389
unsigned getNumberOfInfoLinks(InfoReason reason) const
Definition: LinkInfo.cxx:207
std::string getInfoRepr() const
Definition: LinkInfo.cxx:142
std::string getWarnRepr() const
Definition: LinkInfo.cxx:163

References YACS::ENGINE::E_ALL, getErrRepr(), getInfoRepr(), getNumberOfErrLinks(), getNumberOfInfoLinks(), getNumberOfWarnLinksGrp(), getWarnRepr(), GLOBAL_MESSAGE1, YACS::ENGINE::I_ALL, printThereIsAre(), and YACS::ENGINE::W_ALL.

Referenced by endCollapseTransac(), main(), and YACS::HMI::EditionProc::synchronize().

◆ getInfoLink()

std::pair< OutPort *, InPort * > LinkInfo::getInfoLink ( unsigned  id,
InfoReason  reason 
) const

Definition at line 271 of file LinkInfo.cxx.

272 {
273  if(reason==I_CF_USELESS)
274  return pair<OutPort *, InPort *>();
275  map<InfoReason, vector< pair<OutPort *,InPort *> > >::const_iterator iter=_infos.find(reason);
276  if(iter!=_infos.end())
277  return (*iter).second[id];
278  else
279  return pair<OutPort *, InPort *>( reinterpret_cast<OutPort *>(0), reinterpret_cast<InPort *>(0) );
280 }

References _infos, and YACS::ENGINE::I_CF_USELESS.

◆ getInfoRepr()

std::string LinkInfo::getInfoRepr ( ) const

Definition at line 142 of file LinkInfo.cxx.

143 {
144  map<InfoReason, vector< pair<OutPort *,InPort *> > >::const_iterator iter;
145  ostringstream stream;
146  for(iter=_infos.begin();iter!=_infos.end();iter++)
147  {
148  for(vector< pair<OutPort *,InPort *> >::const_iterator iter2=(*iter).second.begin();iter2!=(*iter).second.end();iter2++)
149  {
150  stream << getStringReprOfI((*iter).first) << " between \"" << _pov->getOutPortName((*iter2).first);
151  stream << "\" and \"" << _pov->getInPortName((*iter2).second) << "\"." << endl;
152  }
153  }
154  set< pair<Node *, Node *> >::const_iterator iter3;
155  for(iter3=_uselessLinks.begin();iter3!=_uselessLinks.end();iter3++)
156  {
157  stream << "Useless CF link between \"" << _pov->getChildName((*iter3).first);
158  stream << "\" and \"" << _pov->getChildName((*iter3).second) << "\"." << endl;
159  }
160  return stream.str();
161 }
std::string getChildName(const Node *node) const
static std::string getStringReprOfI(InfoReason reason)
Definition: LinkInfo.cxx:307

References _infos, _pov, _uselessLinks, YACS::ENGINE::ComposedNode::getChildName(), YACS::ENGINE::ComposedNode::getInPortName(), YACS::ENGINE::ComposedNode::getOutPortName(), and getStringReprOfI().

Referenced by getGlobalRepr().

◆ getInfoUselessLinks()

std::set< std::pair< Node *, Node * > > LinkInfo::getInfoUselessLinks ( ) const

Definition at line 266 of file LinkInfo.cxx.

267 {
268  return _uselessLinks;
269 }

References _uselessLinks.

Referenced by YACS::ENGINE::Bloc::removeRecursivelyRedundantCL().

◆ getNumberOfErrLinks()

unsigned LinkInfo::getNumberOfErrLinks ( ErrReason  reason) const

Definition at line 246 of file LinkInfo.cxx.

247 {
248  if(reason==E_ALL)
249  return _errors.size()+_onlyBackDefined.size()+_unsetInPort.size()+_errorsOnSwitchCases.size();
250  else if(reason==E_NEVER_SET_INPUTPORT)
251  return _unsetInPort.size();
252  else if(reason==E_ONLY_BACKWARD_DEFINED)
253  return _onlyBackDefined.size();
254  else if(reason==E_UNCOMPLETE_SW)
255  return _errorsOnSwitchCases.size();
256  else
257  {
258  map<ErrReason, vector< pair<OutPort *,InPort *> > >::const_iterator iter=_errors.find(reason);
259  if(iter!=_errors.end())
260  return (*iter).second.size();
261  else
262  return 0;
263  }
264 }

References _errors, _errorsOnSwitchCases, _onlyBackDefined, _unsetInPort, YACS::ENGINE::E_ALL, YACS::ENGINE::E_NEVER_SET_INPUTPORT, YACS::ENGINE::E_ONLY_BACKWARD_DEFINED, and YACS::ENGINE::E_UNCOMPLETE_SW.

Referenced by areWarningsOrErrors(), and getGlobalRepr().

◆ getNumberOfInfoLinks()

unsigned LinkInfo::getNumberOfInfoLinks ( InfoReason  reason) const

If 'reason'==I_ALL returns nummmber of types of links info whereas it returns number of info per type.

Definition at line 207 of file LinkInfo.cxx.

208 {
209  if(reason==I_ALL)
210  {
211  map<InfoReason, vector< pair<OutPort *,InPort *> > >::const_iterator iter=_infos.begin();
212  unsigned val=0;
213  for(;iter!=_infos.end();iter++)
214  val+=(*iter).second.size();
215  return val+_uselessLinks.size();
216  }
217  if(reason==I_CF_USELESS)
218  return _uselessLinks.size();
219  else
220  {
221  map<InfoReason, vector< pair<OutPort *,InPort *> > >::const_iterator iter=_infos.find(reason);
222  if(iter!=_infos.end())
223  return (*iter).second.size();
224  else
225  return 0;
226  }
227 }

References _infos, _uselessLinks, YACS::ENGINE::I_ALL, and YACS::ENGINE::I_CF_USELESS.

Referenced by getGlobalRepr().

◆ getNumberOfWarnLinksGrp()

unsigned LinkInfo::getNumberOfWarnLinksGrp ( WarnReason  reason) const

Definition at line 229 of file LinkInfo.cxx.

230 {
231  unsigned ret=0;
232  map<WarnReason, vector< vector< pair<OutPort *,InPort *> > > >::const_iterator iter;
233  if(reason==W_ALL)
234  {
235  for(iter=_collapse.begin();iter!=_collapse.end();iter++)
236  ret+=(*iter).second.size();
237  return ret;
238  }
239  map<WarnReason, vector< vector< pair<OutPort *,InPort *> > > >::const_iterator iter2=_collapse.find(reason);
240  if(iter2!=_collapse.end())
241  return (*iter2).second.size();
242  else
243  return 0;
244 }

References _collapse, and YACS::ENGINE::W_ALL.

Referenced by areWarningsOrErrors(), endCollapseTransac(), and getGlobalRepr().

◆ getStringReprOfE()

std::string LinkInfo::getStringReprOfE ( ErrReason  reason)
staticprotected

Definition at line 364 of file LinkInfo.cxx.

365 {
366  string ret;
367  if(reason==E_NEVER_SET_INPUTPORT)
368  return "Never set InPort ";
369  if(reason==E_ONLY_BACKWARD_DEFINED)
370  return "Never set InPort only back defined ";
371  switch(reason)
372  {
374  ret="DS unestablishable";
375  break;
376  case E_COLLAPSE_DFDS:
377  ret="DF/DS collapse";
378  break;
379  case E_COLLAPSE_DS:
380  ret="Inter DS collapse";
381  break;
382  case E_UNPREDICTABLE_FED:
383  ret="Unpredictable fed";
384  }
385  ret+=" "; ret+=LINK_REPR;
386  return ret;
387 }
static const char LINK_REPR[]
Definition: LinkInfo.cxx:30
@ E_UNPREDICTABLE_FED
Definition: LinkInfo.hxx:74
@ E_DS_LINK_UNESTABLISHABLE
Definition: LinkInfo.hxx:71

References YACS::ENGINE::E_COLLAPSE_DFDS, YACS::ENGINE::E_COLLAPSE_DS, YACS::ENGINE::E_DS_LINK_UNESTABLISHABLE, YACS::ENGINE::E_NEVER_SET_INPUTPORT, YACS::ENGINE::E_ONLY_BACKWARD_DEFINED, YACS::ENGINE::E_UNPREDICTABLE_FED, and LINK_REPR.

Referenced by getErrRepr().

◆ getStringReprOfI()

std::string LinkInfo::getStringReprOfI ( InfoReason  reason)
staticprotected

Definition at line 307 of file LinkInfo.cxx.

308 {
309  string ret;
310  switch(reason)
311  {
312  case I_USELESS:
313  ret="Useless DF";
314  break;
315  case I_BACK:
316  ret="Back";
317  break;
318  case I_BACK_USELESS:
319  ret="Back and useless";
320  break;
321  case I_BACK_CRAZY:
322  ret+="Crazy back";
323  break;
324  case I_DFDS:
325  ret+="DF/DS";
326  }
327  ret+=" "; ret+=LINK_REPR;
328  return ret;
329 }

References YACS::ENGINE::I_BACK, YACS::ENGINE::I_BACK_CRAZY, YACS::ENGINE::I_BACK_USELESS, YACS::ENGINE::I_DFDS, YACS::ENGINE::I_USELESS, and LINK_REPR.

Referenced by getInfoRepr().

◆ getStringReprOfW()

std::string LinkInfo::getStringReprOfW ( WarnReason  reason)
staticprotected

Definition at line 331 of file LinkInfo.cxx.

332 {
333  string ret;
334  switch(reason)
335  {
336  case W_COLLAPSE:
337  ret="Collapse";
338  break;
340  ret="Collapse and useless";
341  break;
342  case W_COLLAPSE_EL:
343  ret="Collapse on ElementaryNode";
344  break;
346  ret+="Collapse on ElementaryNode and useless";
347  break;
348  case W_BACK_COLLAPSE:
349  ret+="Back collapse";
350  break;
352  ret+="Back collapse and useless";
353  break;
354  case W_BACK_COLLAPSE_EL:
355  ret+="Back collapse on ElementaryNode";
356  break;
358  ret+="Back collapse and useless on ElementaryNode";
359  }
360  ret+=" "; ret+=LINK_REPR;
361  return ret;
362 }
@ W_COLLAPSE_EL_AND_USELESS
Definition: LinkInfo.hxx:59
@ W_BACK_COLLAPSE_AND_USELESS
Definition: LinkInfo.hxx:61
@ W_BACK_COLLAPSE_EL
Definition: LinkInfo.hxx:62
@ W_BACK_COLLAPSE_EL_AND_USELESS
Definition: LinkInfo.hxx:63
@ W_COLLAPSE_AND_USELESS
Definition: LinkInfo.hxx:57

References LINK_REPR, YACS::ENGINE::W_BACK_COLLAPSE, YACS::ENGINE::W_BACK_COLLAPSE_AND_USELESS, YACS::ENGINE::W_BACK_COLLAPSE_EL, YACS::ENGINE::W_BACK_COLLAPSE_EL_AND_USELESS, YACS::ENGINE::W_COLLAPSE, YACS::ENGINE::W_COLLAPSE_AND_USELESS, YACS::ENGINE::W_COLLAPSE_EL, and YACS::ENGINE::W_COLLAPSE_EL_AND_USELESS.

Referenced by getWarnRepr().

◆ getWarnLink()

std::vector< std::pair< OutPort *, InPort * > > LinkInfo::getWarnLink ( unsigned  id,
WarnReason  reason 
) const

Definition at line 282 of file LinkInfo.cxx.

283 {
284  map<WarnReason, vector< vector< pair<OutPort *,InPort *> > > >::const_iterator iter=_collapse.find(reason);
285  if(iter!=_collapse.end())
286  return (*iter).second[id];
287  else
288  return vector< pair<OutPort *, InPort *> >();
289 }

References _collapse.

◆ getWarnRepr()

std::string LinkInfo::getWarnRepr ( ) const

Definition at line 163 of file LinkInfo.cxx.

164 {
165  map<WarnReason, vector< vector< pair<OutPort *,InPort *> > > >::const_iterator iter;
166  ostringstream stream;
167  unsigned i=0;
168  for(iter=_collapse.begin();iter!=_collapse.end();iter++)
169  {
170  stream << getStringReprOfW((*iter).first) << " for group containing following group links: ";
171  vector< vector< pair<OutPort *,InPort *> > >::const_iterator iter2=(*iter).second.begin();
172  for(;iter2!=(*iter).second.end();iter2++)
173  {
174  stream << " Group # " << i++ << " : " << endl;
175  for(vector< pair<OutPort *,InPort *> >::const_iterator iter3=(*iter2).begin();iter3!=(*iter2).end();iter3++)
176  stream << " \"" << _pov->getOutPortName((*iter3).first) << "\" and \"" << _pov->getInPortName((*iter3).second) << endl;
177  }
178  }
179  return stream.str();
180 }
static std::string getStringReprOfW(WarnReason reason)
Definition: LinkInfo.cxx:331

References _collapse, _pov, YACS::ENGINE::ComposedNode::getInPortName(), YACS::ENGINE::ComposedNode::getOutPortName(), getStringReprOfW(), and yacsorb.CORBAEngineTest::i.

Referenced by getGlobalRepr().

◆ printThereIsAre()

std::string LinkInfo::printThereIsAre ( unsigned  val,
const std::string &  other 
)
staticprotected

Definition at line 389 of file LinkInfo.cxx.

390 {
391  ostringstream ret;
392  ret << "There ";
393  if(val==0)
394  ret << "are no";
395  else if(val==1)
396  ret << "is one";
397  else
398  ret << "are " << val;
399  ret << " " << other;
400  if(val==0 || val>1)
401  ret << "s";
402  return ret.str();
403 }

Referenced by getGlobalRepr().

◆ pushErrLink()

◆ pushErrSwitch()

void LinkInfo::pushErrSwitch ( CollectorSwOutPort collector)

Definition at line 99 of file LinkInfo.cxx.

100 {
101  _errorsOnSwitchCases.push_back(collector);
102  if(_level==0)
104  throw Exception(getErrRepr());
105 }

References _errorsOnSwitchCases, _level, _levelOfInfo, ALL_STOP_ASAP, getErrRepr(), and WARN_ONLY_DONT_STOP.

Referenced by YACS::ENGINE::CollectorSwOutPort::checkConsistency().

◆ pushInfoLink()

void LinkInfo::pushInfoLink ( OutPort semStart,
InPort end,
InfoReason  reason 
)

◆ pushUselessCFLink()

void LinkInfo::pushUselessCFLink ( Node start,
Node end 
)

Definition at line 107 of file LinkInfo.cxx.

108 {
109  _uselessLinks.insert(pair<Node *,Node *>(start,end));
110 }

References _uselessLinks.

Referenced by YACS::ENGINE::Bloc::findUselessLinksIn(), and YACS::ENGINE::Bloc::performCFComputationsOnlyOneLevel().

◆ pushWarnLink()

void LinkInfo::pushWarnLink ( OutPort semStart,
InPort end,
WarnReason  reason 
)

Definition at line 76 of file LinkInfo.cxx.

77 {
78  if(_collapse[reason].empty())
79  _collapse[reason].push_back(vector< pair<OutPort *,InPort *> >());
80  else
81  if(_collapse[reason].back()[0].second!=end)
82  _collapse[reason].push_back(vector< pair<OutPort *,InPort *> >());
83  _collapse[reason].back().push_back(pair<OutPort *,InPort *>(semStart,end));
84 }

References _collapse.

Referenced by YACS::ENGINE::ComposedNode::checkCFLinks(), YACS::ENGINE::ComposedNode::solveObviousOrDelegateCFLinks(), YACS::ENGINE::Bloc::verdictForCollapses(), and YACS::ENGINE::Bloc::verdictForOkAndUseless1().

◆ setPointOfView()

void LinkInfo::setPointOfView ( ComposedNode pov)

Definition at line 66 of file LinkInfo.cxx.

67 {
68  _pov=pov;
69 }

References _pov.

Referenced by YACS::ENGINE::ComposedNode::checkConsistency().

◆ startCollapseTransac()

void LinkInfo::startCollapseTransac ( )

Definition at line 48 of file LinkInfo.cxx.

49 {
50  _level++;
51 }

References _level.

Referenced by YACS::ENGINE::Bloc::verdictForCollapses().

◆ takeDecision()

void LinkInfo::takeDecision ( ) const

Definition at line 112 of file LinkInfo.cxx.

113 {
114  if(!_errors.empty())
115  throw Exception(getErrRepr());
116 }

References _errors, and getErrRepr().

Member Data Documentation

◆ _collapse

std::map<WarnReason, std::vector< std::vector< std::pair<OutPort *,InPort *> > > > YACS::ENGINE::LinkInfo::_collapse
private

◆ _errors

std::map<ErrReason, std::vector< std::pair<OutPort *,InPort *> > > YACS::ENGINE::LinkInfo::_errors
private

◆ _errorsOnSwitchCases

std::vector<CollectorSwOutPort *> YACS::ENGINE::LinkInfo::_errorsOnSwitchCases
private

Definition at line 94 of file LinkInfo.hxx.

Referenced by clearAll(), getErrRepr(), getNumberOfErrLinks(), and pushErrSwitch().

◆ _infos

std::map<InfoReason, std::vector< std::pair<OutPort *,InPort *> > > YACS::ENGINE::LinkInfo::_infos
private

Definition at line 91 of file LinkInfo.hxx.

Referenced by clearAll(), getInfoLink(), getInfoRepr(), getNumberOfInfoLinks(), and pushInfoLink().

◆ _level

unsigned int YACS::ENGINE::LinkInfo::_level
private

◆ _levelOfInfo

unsigned char YACS::ENGINE::LinkInfo::_levelOfInfo
private

Definition at line 87 of file LinkInfo.hxx.

Referenced by endCollapseTransac(), pushErrLink(), and pushErrSwitch().

◆ _onlyBackDefined

std::vector<InPort *> YACS::ENGINE::LinkInfo::_onlyBackDefined
private

◆ _pov

ComposedNode* YACS::ENGINE::LinkInfo::_pov
private

Definition at line 85 of file LinkInfo.hxx.

Referenced by getErrRepr(), getInfoRepr(), getWarnRepr(), and setPointOfView().

◆ _unsetInPort

std::vector<InPort *> YACS::ENGINE::LinkInfo::_unsetInPort
private

◆ _uselessLinks

std::set< std::pair<Node *, Node *> > YACS::ENGINE::LinkInfo::_uselessLinks
private

◆ ALL_DONT_STOP

const unsigned char YACS::ENGINE::LinkInfo::ALL_DONT_STOP = 2
static

Definition at line 127 of file LinkInfo.hxx.

Referenced by main().

◆ ALL_STOP_ASAP

const unsigned char YACS::ENGINE::LinkInfo::ALL_STOP_ASAP = 1
static

◆ WARN_ONLY_DONT_STOP

const unsigned char YACS::ENGINE::LinkInfo::WARN_ONLY_DONT_STOP = 3
static

Definition at line 128 of file LinkInfo.hxx.

Referenced by endCollapseTransac(), pushErrLink(), and pushErrSwitch().


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