Salome HOME
PR: merge from BR_DATACONV_PR tag "mergeto_trunk_25oct06"
[modules/yacs.git] / src / engine / Bloc.hxx
1 #ifndef __BLOC_HXX__
2 #define __BLOC_HXX__
3
4 #include "ComposedNode.hxx"
5
6 namespace YACS
7 {
8   namespace ENGINE
9   {
10     class Bloc : public ComposedNode
11     {
12     protected:
13       std::set<Node *> _setOfNode;//OWNERSHIP OF ALL NODES
14     public:
15       Bloc(const std::string& name);
16       ~Bloc();
17       void init();
18       bool isFinished();
19       int getNumberOfCFLinks() const;
20       std::vector<Task *> getNextTasks(bool& isMore);
21       void getReadyTasks(std::vector<Task *>& tasks);
22       std::set<ElementaryNode *> getRecursiveConstituents();
23       void exUpdateState();
24       bool edAddChild(Node *node) throw(Exception);
25       void edRemoveChild(Node *node) throw(Exception);
26       std::set<Node *> getChildren() { return _setOfNode; }
27       void selectRunnableTasks(std::vector<Task *>& tasks);
28     protected:
29       bool areAllSubNodesFinished() const;
30       bool isNodeAlreadyAggregated(Node *node) const;
31       bool isNameAlreadyUsed(const std::string& name) const;
32       void checkNoCyclePassingThrough(Node *node) throw(Exception);
33       YACS::Event updateStateOnStartEventFrom(Node *node);
34       YACS::Event updateStateOnFinishedEventFrom(Node *node);
35     private:
36       void initChildrenForDFS() const;
37     };
38   }
39 }
40
41 #endif