Version: 8.3.0
YACS::ENGINE::BagPoint Class Reference

#include <BagPoint.hxx>

Inheritance diagram for YACS::ENGINE::BagPoint:
Collaboration diagram for YACS::ENGINE::BagPoint:

Public Member Functions

 BagPoint (const std::list< AbstractPoint * > &nodes, AbstractPoint *father)
 
NodegetFirstNode ()
 
NodegetLastNode ()
 
int getMaxLevelOfParallelism () const
 
std::string getRepr () const
 
int size () const
 
void replaceInMe (BlocPoint *aSet)
 
void deal1 (bool &somethingDone)
 
void deal2 (bool &somethingDone)
 
void deal2Bis (bool &somethingDone)
 
void deal2Ter (bool &somethingDone)
 
- Public Member Functions inherited from YACS::ENGINE::BlocPoint
 BlocPoint (const std::list< AbstractPoint * > &nodes, AbstractPoint *father)
 
AbstractPointfindPointWithNode (Node *node)
 
AbstractPointgetNodeAfter (Node *node)
 
AbstractPointgetNodeB4 (Node *node)
 
bool contains (Node *node)
 
int getNumberOfNodes () const
 
const std::list< AbstractPoint * > & getListOfPoints () const
 
virtual ~BlocPoint ()
 
- Public Member Functions inherited from YACS::ENGINE::AbstractPoint
 AbstractPoint (AbstractPoint *father)
 
AbstractPointgetFather () const
 
AbstractPointgetGodFather ()
 
bool amIGod ()
 
void setFather (AbstractPoint *father)
 
bool isBegin ()
 
bool isLast ()
 
bool isSimplyLinkedBeforeAfter (BlocPoint *sop)
 
bool isSimplyLinkedAfterNullBefore (BlocPoint *sop)
 
bool isSimplyLinkedBeforeNullAfter (BlocPoint *sop)
 
LinkedBlocPointtryAsLink (BlocPoint *sop)
 
ForkBlocPointtryAsFork (BlocPoint *sop)
 
ForkBlocPointtryAsForkBis (BlocPoint *sop)
 
ForkBlocPointtryAsForkTer (BlocPoint *sop)
 
virtual ~AbstractPoint ()
 
bool isSimplyLinkedAfter (BlocPoint *sop, Node *node)
 
bool isSimplyLinkedBefore (BlocPoint *sop, Node *node)
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::ENGINE::AbstractPoint
static bool IsGatherB4Ext (Node *node)
 
static bool IsSimplyLinkedAfterExt (Node *node)
 
static bool IsScatterAfterExt (Node *node)
 
static bool IsSimplyLinkedBeforeExt (Node *node)
 
static bool IsNoLinksBefore (Node *node)
 
static bool IsNoLinksAfter (Node *node)
 
static NodeGetNodeB4 (Node *node)
 
static NodeGetNodeAfter (Node *node)
 
static AbstractPointGetDirectSonOf (AbstractPoint *refFather, AbstractPoint *sonOrLittleSon)
 
static bool IsCommonDirectSonOf (AbstractPoint *refFather, const std::list< OutGate * > &outgs, AbstractPoint *&ret)
 
static bool IsCommonDirectSonOf (AbstractPoint *refFather, const std::list< InGate * > &ings, AbstractPoint *&ret)
 
- Protected Attributes inherited from YACS::ENGINE::BlocPoint
std::list< AbstractPoint * > _nodes
 

Detailed Description

Definition at line 32 of file BagPoint.hxx.

Constructor & Destructor Documentation

BagPoint::BagPoint ( const std::list< AbstractPoint * > &  nodes,
AbstractPoint father 
)

Definition at line 30 of file BagPoint.cxx.

30  :BlocPoint(nodes,father)
31 {
32 }

Member Function Documentation

void BagPoint::deal1 ( bool &  somethingDone)

Definition at line 81 of file BagPoint.cxx.

References YACS::ENGINE::BlocPoint::_nodes, and replaceInMe().

Referenced by YACS::ENGINE::SetOfPoints::simplify().

82 {
83  somethingDone=false;
84  for(std::list<AbstractPoint *>::iterator it=_nodes.begin();it!=_nodes.end();it++)
85  {
86  if(!(*it)->isSimplyLinkedBeforeAfter(this))
87  if(!(*it)->isSimplyLinkedAfterNullBefore(this) && !(*it)->isSimplyLinkedBeforeNullAfter(this))
88  continue;
89  LinkedBlocPoint *try0((*it)->tryAsLink(this));
90  if(try0)
91  {
92  replaceInMe(try0);
93  somethingDone=true;
94  break;
95  }
96  }
97 }
void BagPoint::deal2 ( bool &  somethingDone)

Definition at line 99 of file BagPoint.cxx.

References YACS::ENGINE::BlocPoint::_nodes, and replaceInMe().

Referenced by YACS::ENGINE::SetOfPoints::simplify().

100 {
101  somethingDone=false;
102  for(std::list<AbstractPoint *>::iterator it=_nodes.begin();it!=_nodes.end();it++)
103  {
104  if(!(*it)->isSimplyLinkedBeforeAfter(this))
105  continue;
106  ForkBlocPoint *try1((*it)->tryAsFork(this));
107  if(try1)
108  {
109  replaceInMe(try1);
110  somethingDone=true;
111  break;
112  }
113  }
114 }
void BagPoint::deal2Bis ( bool &  somethingDone)

Definition at line 116 of file BagPoint.cxx.

References YACS::ENGINE::BlocPoint::_nodes, and replaceInMe().

Referenced by YACS::ENGINE::SetOfPoints::simplify().

117 {
118  somethingDone=false;
119  for(std::list<AbstractPoint *>::iterator it=_nodes.begin();it!=_nodes.end();it++)
120  {
121  if(!(*it)->isSimplyLinkedAfterNullBefore(this))
122  continue;
123  ForkBlocPoint *try1((*it)->tryAsForkBis(this));
124  if(try1)
125  {
126  replaceInMe(try1);
127  somethingDone=true;
128  break;
129  }
130  }
131 }
void BagPoint::deal2Ter ( bool &  somethingDone)

Definition at line 133 of file BagPoint.cxx.

References YACS::ENGINE::BlocPoint::_nodes, and replaceInMe().

Referenced by YACS::ENGINE::SetOfPoints::simplify().

134 {
135  somethingDone=false;
136  for(std::list<AbstractPoint *>::iterator it=_nodes.begin();it!=_nodes.end();it++)
137  {
138  if(!(*it)->isSimplyLinkedBeforeNullAfter(this))
139  continue;
140  ForkBlocPoint *try1((*it)->tryAsForkTer(this));
141  if(try1)
142  {
143  replaceInMe(try1);
144  somethingDone=true;
145  break;
146  }
147  }
148 }
Node * BagPoint::getFirstNode ( )
virtual

Implements YACS::ENGINE::AbstractPoint.

Definition at line 34 of file BagPoint.cxx.

References YACS::ENGINE::BlocPoint::_nodes.

35 {
36  if(_nodes.size()!=1)
37  throw YACS::Exception("BagPoint::getFirstNode : invalid call !");
38  else
39  return (*_nodes.begin())->getFirstNode();
40 }
Node * BagPoint::getLastNode ( )
virtual

Implements YACS::ENGINE::AbstractPoint.

Definition at line 42 of file BagPoint.cxx.

References YACS::ENGINE::BlocPoint::_nodes.

43 {
44  if(_nodes.size()!=1)
45  throw YACS::Exception("BagPoint::getLastNode : invalid call !");
46  else
47  return (*_nodes.begin())->getLastNode();
48 }
int BagPoint::getMaxLevelOfParallelism ( ) const
virtual

Implements YACS::ENGINE::AbstractPoint.

Definition at line 50 of file BagPoint.cxx.

References YACS::ENGINE::BlocPoint::_nodes.

Referenced by YACS::ENGINE::SetOfPoints::getMaxLevelOfParallelism().

51 {
52  if(_nodes.size()!=1)
53  throw YACS::Exception("BagPoint::getMaxLevelOfParallelism : invalid call !");
54  else
55  return (*_nodes.begin())->getMaxLevelOfParallelism();
56 }
std::string BagPoint::getRepr ( ) const
virtual

Implements YACS::ENGINE::AbstractPoint.

Definition at line 58 of file BagPoint.cxx.

References YACS::ENGINE::BlocPoint::_nodes.

Referenced by YACS::ENGINE::SetOfPoints::getRepr().

59 {
60  std::ostringstream oss;
61  for(std::list<AbstractPoint *>::const_iterator it=_nodes.begin();it!=_nodes.end();it++)
62  oss << (*it)->getRepr() << " - ";
63  return oss.str();
64 }
void BagPoint::replaceInMe ( BlocPoint aSet)

Definition at line 68 of file BagPoint.cxx.

References YACS::ENGINE::BlocPoint::_nodes, and YACS::ENGINE::BlocPoint::getListOfPoints().

Referenced by deal1(), deal2(), deal2Bis(), and deal2Ter().

69 {
70  const std::list<AbstractPoint *>& pts(aSet->getListOfPoints());
71  for(std::list<AbstractPoint *>::const_iterator it0=pts.begin();it0!=pts.end();it0++)
72  {
73  std::list<AbstractPoint *>::iterator it1(std::find(_nodes.begin(),_nodes.end(),*it0));
74  if(it1==_nodes.end())
75  throw Exception("SetOfPoints::replaceInMe : internal error !");
76  _nodes.erase(it1);
77  }
78  _nodes.push_back(aSet);
79 }
int YACS::ENGINE::BagPoint::size ( ) const
inline

Definition at line 42 of file BagPoint.hxx.

Referenced by YACS::ENGINE::SetOfPoints::simplify().

42 { return (int)_nodes.size(); }

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