Version: 9.15.0
YACS::ENGINE::BlocPoint Class Reference

#include <BlocPoint.hxx>

Inheritance diagram for YACS::ENGINE::BlocPoint:
Collaboration diagram for YACS::ENGINE::BlocPoint:

Public Member Functions

 BlocPoint ()=default
 
 BlocPoint (const std::list< AbstractPoint * > &nodes, AbstractPoint *father)
 
void deepCopyFrom (const BlocPoint &other)
 
AbstractPointfindPointWithNode (Node *node)
 
AbstractPointgetNodeAfter (Node *node)
 
AbstractPointgetNodeB4 (Node *node)
 
bool contains (Node *node) const override
 
bool anyOf (const std::set< Node * > &nodes) const override
 
int getNumberOfNodes () const
 
const std::list< AbstractPoint * > & getListOfPoints () const
 
virtual ~BlocPoint ()
 
bool internalContinueForSimplify () const
 
bool presenceOfNonSimpleCase () const
 
AbstractPointgetUnique ()
 
const AbstractPointgetUnique () const
 
AbstractPointgetUniqueAndReleaseIt ()
 
- Public Member Functions inherited from YACS::ENGINE::AbstractPoint
 AbstractPoint ()=default
 
 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)
 
bool isNullBeforeNullAfter (BlocPoint *sop)
 
LinkedBlocPointtryAsLink (BlocPoint *sop)
 
ForkBlocPointtryAsFork (BlocPoint *sop)
 
ForkBlocPointtryAsForkBis (BlocPoint *sop)
 
ForkBlocPointtryAsForkTer (BlocPoint *sop)
 
ForkBlocPointtryAsForkQuatro (BlocPoint *sop)
 
virtual AbstractPointdeepCopy (AbstractPoint *father) const =0
 
virtual NodegetFirstNode ()=0
 
virtual NodegetLastNode ()=0
 
virtual int getMaxLevelOfParallelism () const =0
 
virtual void getWeightRegardingDPL (ComplexWeight *weight)=0
 
virtual void partitionRegardingDPL (const PartDefinition *pd, std::map< ComposedNode *, YACS::BASES::AutoRefCnt< PartDefinition > > &zeMap) const =0
 
virtual std::string getRepr () const =0
 
virtual void accept (PointVisitor *pv)=0
 
virtual AbstractPointexpandNonSimpleCaseOn (NotSimpleCasePoint *pathologicalPt, const std::set< Node * > &uncatchedNodes)=0
 
virtual ~AbstractPoint ()
 
bool isSimplyLinkedAfter (BlocPoint *sop, Node *node)
 
bool isSimplyLinkedBefore (BlocPoint *sop, Node *node)
 

Protected Member Functions

void getOutPoint (AbstractPoint *node)
 

Protected Attributes

std::list< AbstractPoint * > _nodes
 
- Protected Attributes inherited from YACS::ENGINE::AbstractPoint
AbstractPoint_father = nullptr
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::ENGINE::AbstractPoint
static void TryAsNotSimpleCase (AbstractPoint *father, const std::vector< AbstractPoint * > &ptsToKill, std::list< AbstractPoint * > &nodes, bool &somethingDone)
 
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)
 
static void FeedData (AbstractPoint *ptToBeRewired, std::map< std::string, std::tuple< ElementaryPoint *, Node *, std::shared_ptr< Bloc > > > *m)
 
static void FeedData (const std::list< AbstractPoint * > &ptsToBeRewired, std::map< std::string, std::tuple< ElementaryPoint *, Node *, std::shared_ptr< Bloc > > > *m)
 
static void Rewire (const std::vector< AbstractPoint * > &ptsToKill, std::map< std::string, std::tuple< ElementaryPoint *, Node *, std::shared_ptr< Bloc > > > *m)
 
static void UnRewire (std::map< std::string, std::tuple< ElementaryPoint *, Node *, std::shared_ptr< Bloc > > > &m)
 
static void Display (std::map< std::string, std::tuple< ElementaryPoint *, Node *, std::shared_ptr< Bloc > > > *m)
 

Detailed Description

Definition at line 32 of file BlocPoint.hxx.

Constructor & Destructor Documentation

◆ BlocPoint() [1/2]

YACS::ENGINE::BlocPoint::BlocPoint ( )
default

◆ BlocPoint() [2/2]

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

Definition at line 28 of file BlocPoint.cxx.

28  :AbstractPoint(father),_nodes(nodes)
29 {
30  for(std::list<AbstractPoint *>::const_iterator it=_nodes.begin();it!=_nodes.end();it++)
31  (*it)->setFather(this);
32 }
std::list< AbstractPoint * > _nodes
Definition: BlocPoint.hxx:35

References _nodes, and YACS::ENGINE::AbstractPoint::setFather().

◆ ~BlocPoint()

BlocPoint::~BlocPoint ( )
virtual

Definition at line 152 of file BlocPoint.cxx.

153 {
154  for(std::list<AbstractPoint *>::iterator it=_nodes.begin();it!=_nodes.end();it++)
155  delete *it;
156 }

References _nodes.

Member Function Documentation

◆ anyOf()

bool BlocPoint::anyOf ( const std::set< Node * > &  nodes) const
overridevirtual

Implements YACS::ENGINE::AbstractPoint.

Definition at line 101 of file BlocPoint.cxx.

102 {
103  for(auto it : nodes)
104  {
105  if(this->contains(it))
106  return true;
107  }
108  return false;
109 }
bool contains(Node *node) const override
Definition: BlocPoint.cxx:91

References contains().

Referenced by YACS::ENGINE::LinkedBlocPoint::expandNonSimpleCaseOn().

◆ contains()

bool BlocPoint::contains ( Node node) const
overridevirtual

Implements YACS::ENGINE::AbstractPoint.

Definition at line 91 of file BlocPoint.cxx.

92 {
93  for(auto it : _nodes)
94  {
95  if(it->contains(node))
96  return true;
97  }
98  return false;
99 }

References _nodes.

Referenced by anyOf().

◆ deepCopyFrom()

void BlocPoint::deepCopyFrom ( const BlocPoint other)

Definition at line 34 of file BlocPoint.cxx.

35 {
36  const std::list<AbstractPoint *>& nodesToIterateOn(other.getListOfPoints());
37  for(auto it : nodesToIterateOn)
38  {
39  _nodes.push_back(it->deepCopy(this));
40  }
41 }
const std::list< AbstractPoint * > & getListOfPoints() const
Definition: BlocPoint.hxx:46

References _nodes, and getListOfPoints().

Referenced by YACS::ENGINE::BagPoint::deepCopy(), YACS::ENGINE::ForkBlocPoint::deepCopy(), YACS::ENGINE::LinkedBlocPoint::deepCopy(), and YACS::ENGINE::NotSimpleCasePoint::deepCopy().

◆ findPointWithNode()

AbstractPoint * BlocPoint::findPointWithNode ( Node node)
virtual

Implements YACS::ENGINE::AbstractPoint.

Definition at line 52 of file BlocPoint.cxx.

53 {
54  for(std::list<AbstractPoint *>::iterator it=_nodes.begin();it!=_nodes.end();it++)
55  {
56  AbstractPoint *ret((*it)->findPointWithNode(node));
57  if(ret)
58  return AbstractPoint::GetDirectSonOf(this,ret);
59  }
60  return 0;
61 }
static AbstractPoint * GetDirectSonOf(AbstractPoint *refFather, AbstractPoint *sonOrLittleSon)

References _nodes, and YACS::ENGINE::AbstractPoint::GetDirectSonOf().

Referenced by YACS::ENGINE::SetOfPoints::findPointWithNode(), YACS::ENGINE::AbstractPoint::tryAsFork(), YACS::ENGINE::AbstractPoint::tryAsForkBis(), YACS::ENGINE::AbstractPoint::tryAsForkQuatro(), and YACS::ENGINE::AbstractPoint::tryAsForkTer().

◆ getListOfPoints()

◆ getNodeAfter()

AbstractPoint * BlocPoint::getNodeAfter ( Node node)

Definition at line 63 of file BlocPoint.cxx.

64 {
65  OutGate *oug(node->getOutGate());
66  std::list<InGate *> fl(oug->edSetInGate());
67  if(fl.size()>=1)
68  {
69  AbstractPoint *ret(0);
70  IsCommonDirectSonOf(this,fl,ret);
71  return ret;
72  }
73  else
74  return 0;
75 }
static bool IsCommonDirectSonOf(AbstractPoint *refFather, const std::list< OutGate * > &outgs, AbstractPoint *&ret)
OutGate * getOutGate()
Definition: Node.hxx:124

References YACS::ENGINE::OutGate::edSetInGate(), YACS::ENGINE::Node::getOutGate(), and YACS::ENGINE::AbstractPoint::IsCommonDirectSonOf().

Referenced by YACS::ENGINE::AbstractPoint::tryAsLink().

◆ getNodeB4()

AbstractPoint * BlocPoint::getNodeB4 ( Node node)

Definition at line 77 of file BlocPoint.cxx.

78 {
79  InGate *ing(node->getInGate());
80  std::list<OutGate *> bl(ing->getBackLinks());
81  if(bl.size()>=1)
82  {
83  AbstractPoint *ret(0);
84  IsCommonDirectSonOf(this,bl,ret);
85  return ret;
86  }
87  else
88  return 0;
89 }
InGate * getInGate()
Definition: Node.hxx:123

References YACS::ENGINE::InGate::getBackLinks(), YACS::ENGINE::Node::getInGate(), and YACS::ENGINE::AbstractPoint::IsCommonDirectSonOf().

Referenced by YACS::ENGINE::AbstractPoint::tryAsLink().

◆ getNumberOfNodes()

int BlocPoint::getNumberOfNodes ( ) const
virtual

Implements YACS::ENGINE::AbstractPoint.

Definition at line 144 of file BlocPoint.cxx.

145 {
146  int ret(0);
147  for(std::list<AbstractPoint *>::const_iterator it=_nodes.begin();it!=_nodes.end();it++)
148  ret+=(*it)->getNumberOfNodes();
149  return ret;
150 }

References _nodes.

◆ getOutPoint()

void BlocPoint::getOutPoint ( AbstractPoint node)
protected

Definition at line 43 of file BlocPoint.cxx.

44 {
45  std::list<AbstractPoint *>::iterator it(std::find(_nodes.begin(),_nodes.end(),node));
46  if(it==_nodes.end())
47  throw YACS::Exception("BlocPoint::getOutPoint : node not in this !");
48  _nodes.erase(it);
49  node->setFather(NULL);
50 }
void setFather(AbstractPoint *father)

References _nodes, and YACS::ENGINE::AbstractPoint::setFather().

Referenced by getUniqueAndReleaseIt().

◆ getUnique() [1/2]

AbstractPoint * BlocPoint::getUnique ( )

Definition at line 111 of file BlocPoint.cxx.

112 {
113  if(_nodes.size()!=1)
114  throw YACS::Exception("BlocPoint::getUnique : invalid call !");
115  else
116  {
117  AbstractPoint *ret(*_nodes.begin());
118  if(!ret)
119  throw YACS::Exception("BlocPoint::getUnique : Ooops !");
120  return ret;
121  }
122 }

References _nodes.

Referenced by YACS::ENGINE::ElementaryPoint::expandNonSimpleCaseOn(), YACS::ENGINE::LinkedBlocPoint::expandNonSimpleCaseOn(), YACS::ENGINE::BagPoint::getFirstNode(), YACS::ENGINE::BagPoint::getLastNode(), YACS::ENGINE::BagPoint::getMaxLevelOfParallelism(), getUniqueAndReleaseIt(), YACS::ENGINE::BagPoint::getWeightRegardingDPL(), and YACS::ENGINE::BagPoint::partitionRegardingDPL().

◆ getUnique() [2/2]

const AbstractPoint * BlocPoint::getUnique ( ) const

Definition at line 124 of file BlocPoint.cxx.

125 {
126  if(_nodes.size()!=1)
127  throw YACS::Exception("BlocPoint::getUnique const : invalid call !");
128  else
129  {
130  AbstractPoint *ret(*_nodes.begin());
131  if(!ret)
132  throw YACS::Exception("BlocPoint::getUnique : Ooops !");
133  return ret;
134  }
135 }

References _nodes.

◆ getUniqueAndReleaseIt()

AbstractPoint * BlocPoint::getUniqueAndReleaseIt ( )

Definition at line 137 of file BlocPoint.cxx.

138 {
139  AbstractPoint *ret(getUnique());
140  getOutPoint(ret);
141  return ret;
142 }
AbstractPoint * getUnique()
Definition: BlocPoint.cxx:111
void getOutPoint(AbstractPoint *node)
Definition: BlocPoint.cxx:43

References getOutPoint(), and getUnique().

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

◆ internalContinueForSimplify()

bool BlocPoint::internalContinueForSimplify ( ) const

Definition at line 158 of file BlocPoint.cxx.

159 {
160  std::size_t i(0);
161  std::for_each(_nodes.begin(),_nodes.end(),[&i](AbstractPoint *elt) { if(!dynamic_cast<NotSimpleCasePoint *>(elt)) i++; });
162  return i>1;
163 }

References _nodes, and yacsorb.CORBAEngineTest::i.

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

◆ presenceOfNonSimpleCase()

bool BlocPoint::presenceOfNonSimpleCase ( ) const

Definition at line 165 of file BlocPoint.cxx.

166 {
167  std::size_t i(0);
168  std::for_each(_nodes.begin(),_nodes.end(),[&i](AbstractPoint *elt) { if(dynamic_cast<NotSimpleCasePoint *>(elt)) i++; });
169  return i>0;
170 }

References _nodes, and yacsorb.CORBAEngineTest::i.

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

Member Data Documentation

◆ _nodes

std::list<AbstractPoint *> YACS::ENGINE::BlocPoint::_nodes
protected

Definition at line 35 of file BlocPoint.hxx.

Referenced by YACS::ENGINE::BagPoint::accept(), YACS::ENGINE::ForkBlocPoint::accept(), YACS::ENGINE::LinkedBlocPoint::accept(), YACS::ENGINE::NotSimpleCasePoint::accept(), BlocPoint(), contains(), YACS::ENGINE::BagPoint::deal1(), YACS::ENGINE::BagPoint::deal2(), YACS::ENGINE::BagPoint::deal2Bis(), YACS::ENGINE::BagPoint::deal2Quatro(), YACS::ENGINE::BagPoint::deal2Ter(), YACS::ENGINE::BagPoint::dealNotSimpleCase(), deepCopyFrom(), YACS::ENGINE::BagPoint::expandNonSimpleCase(), YACS::ENGINE::BagPoint::expandNonSimpleCaseOn(), YACS::ENGINE::ForkBlocPoint::expandNonSimpleCaseOn(), YACS::ENGINE::LinkedBlocPoint::expandNonSimpleCaseOn(), findPointWithNode(), YACS::ENGINE::ForkBlocPoint::getFirstNode(), YACS::ENGINE::LinkedBlocPoint::getFirstNode(), YACS::ENGINE::NotSimpleCasePoint::getFirstNode(), YACS::ENGINE::ForkBlocPoint::getLastNode(), YACS::ENGINE::LinkedBlocPoint::getLastNode(), YACS::ENGINE::NotSimpleCasePoint::getLastNode(), YACS::ENGINE::ForkBlocPoint::getMaxLevelOfParallelism(), YACS::ENGINE::LinkedBlocPoint::getMaxLevelOfParallelism(), YACS::ENGINE::NotSimpleCasePoint::getMaxLevelOfParallelism(), getNumberOfNodes(), getOutPoint(), YACS::ENGINE::BagPoint::getRepr(), YACS::ENGINE::ForkBlocPoint::getRepr(), YACS::ENGINE::LinkedBlocPoint::getRepr(), YACS::ENGINE::NotSimpleCasePoint::getRepr(), getUnique(), YACS::ENGINE::ForkBlocPoint::getWeightRegardingDPL(), YACS::ENGINE::LinkedBlocPoint::getWeightRegardingDPL(), YACS::ENGINE::NotSimpleCasePoint::getWeightRegardingDPL(), internalContinueForSimplify(), YACS::ENGINE::ForkBlocPoint::partitionRegardingDPL(), YACS::ENGINE::LinkedBlocPoint::partitionRegardingDPL(), YACS::ENGINE::NotSimpleCasePoint::partitionRegardingDPL(), presenceOfNonSimpleCase(), YACS::ENGINE::BagPoint::replaceInMe(), and ~BlocPoint().


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