cl.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #ifndef CL_H
  2. #define CL_H
  3. #include <string>
  4. #include <vector>
  5. using namespace std;
  6. class cl_base{
  7. string name="";
  8. cl_base* master = nullptr;
  9. vector<cl_base*> slaves;
  10. vector < cl_base * > :: iterator it_slave;
  11. int ready;
  12. void delete_children();
  13. public:
  14. cl_base(){}
  15. cl_base(cl_base* m);
  16. cl_base(cl_base* m, string n, int r):name(n),master(m), ready(r){}
  17. cl_base* getMaster();
  18. string getName();
  19. int getReady();
  20. void showTree();
  21. void coutIsReady();
  22. void add_slave(cl_base*);
  23. cl_base* get_slave(string n);
  24. void kill_slave(string n);
  25. };
  26. class cl_base2 : public cl_base{
  27. public:
  28. cl_base2():cl_base(){}
  29. cl_base2(cl_base* m):cl_base(m){}
  30. cl_base2(cl_base* m, string n, int r):cl_base(m,n,r){}
  31. };
  32. class cl_base3 : public cl_base{
  33. public:
  34. cl_base3():cl_base(){}
  35. cl_base3(cl_base* m):cl_base(m){}
  36. cl_base3(cl_base* m, string n, int r):cl_base(m,n,r){}
  37. };
  38. class cl_base4 : public cl_base{
  39. public:
  40. cl_base4():cl_base(){}
  41. cl_base4(cl_base* m):cl_base(m){}
  42. cl_base4(cl_base* m, string n, int r):cl_base(m,n,r){}
  43. };
  44. class cl_application{
  45. cl_base* root;
  46. void add_slave(string, cl_base*);
  47. public:
  48. void build_tree();
  49. void show_tree();
  50. };
  51. #endif // CL_H