1 #ifndef __DEPLOYMENTTREE_HXX__
2 #define __DEPLOYMENTTREE_HXX__
13 class ComponentInstance;
15 class DeploymentTreeOnHeap
18 DeploymentTreeOnHeap();
19 ~DeploymentTreeOnHeap();
23 unsigned char appendTask(Task *task, Scheduler *cloner);
25 unsigned getNumberOfCTDefContainer() const;
26 unsigned getNumberOfRTODefContainer() const;
27 unsigned getNumberOfCTDefComponentInstances() const;
28 unsigned getNumberOfRTODefComponentInstances() const;
30 std::vector<Container *> getAllContainers() const;
31 std::vector<Container *> getAllCTDefContainers() const;
32 std::vector<Container *> getAllRTODefContainers() const;
33 std::vector<Task *> getTasksLinkedToComponent(ComponentInstance *comp) const;
34 std::vector<ComponentInstance *> getComponentsLinkedToContainer(Container *cont) const;
36 bool presenceOfDefaultContainer() const;
37 std::vector<Task *> getFreeDeployableTasks() const;
39 static bool isConsistentTaskRegardingShCompInst(std::vector< std::pair<Task *, Scheduler * > >& tasksSharingSameCompInst, Scheduler *cloner);
42 std::vector< std::pair<Task *,Scheduler *> > _freePlacableTasks;
43 //! internal representation of tree. Scheduler is the duplicating Task, \b if it exists, on runtime unpredictable times on compil-time
44 std::vector< std::vector< std::vector< std::pair<Task *, Scheduler * > > > > _tree;
52 DeploymentTree(const DeploymentTree& other);
53 const DeploymentTree &operator=(const DeploymentTree& other);
54 unsigned char appendTask(Task *task, Scheduler *cloner);
56 unsigned getNumberOfCTDefContainer() const;
57 unsigned getNumberOfRTODefContainer() const;
58 unsigned getNumberOfCTDefComponentInstances() const;
59 unsigned getNumberOfRTODefComponentInstances() const;
61 bool presenceOfDefaultContainer() const;
62 std::vector<Container *> getAllContainers() const;
63 std::vector<Container *> getAllCTDefContainers() const;
64 std::vector<Container *> getAllRTODefContainers() const;
65 std::vector<Task *> getTasksLinkedToComponent(ComponentInstance *comp) const;
66 std::vector<ComponentInstance *> getComponentsLinkedToContainer(Container *cont) const;
69 std::vector<Task *> getFreeDeployableTasks() const;
71 //possible return of appendTask method.
72 static const unsigned char NULL_TASK = 3;
73 static const unsigned char APPEND_OK = 0;
74 static const unsigned char NULL_TREE = 199;
75 static const unsigned char ALREADY_IN_TREE = 1;
76 static const unsigned char NOT_DEPLOYABLE_TASK = 2;
77 static const unsigned char DEPLOYABLE_BUT_NOT_SPECIFIED = 5;
78 static const unsigned char DUP_TASK_NOT_COMPATIBLE_WITH_EXISTING_TREE = 4;
80 DeploymentTreeOnHeap *_treeHandle;