OSFEG-C++  1.4.6
OpenSF Error Generation Library
Composite.h
1 /*
2  * openSF Error Generation Libraries (OSFEG)
3  * Deimos Space, S.L.U.
4  *
5  * This file is part of OSFEG. OSFEG is free software; you can redistribute it
6  * and/or modify it under the terms of the 'ESA Software Community Licence Permissive' as
7  * published by the European Space Agency; either version 2.4 of the License,
8  * or (at your option) any later version. You should have received a
9  * copy of the 'ESA Software Community Licence Permissive - v2.4' along with this program
10  * or one can be found at <http://eop-cfi.esa.int/index.php/docs-and-mission-data/licensing-documents>.
11  *
12  */
13 
14 #ifndef COMPOSITE_H
15 #define COMPOSITE_H
16 
17 #include <vector>
18 #include <stdexcept>
19 
24 class Composite
25 {
26 protected:
31  std::vector<Composite *> children;
34 public:
37 
39  Composite(const Composite&) = delete;
41  Composite& operator=(const Composite&) = delete;
43  Composite(Composite&&) = default;
45  Composite& operator=(Composite&&) = default;
46 
48  virtual ~Composite();
49 
57  void add(Composite *node);
58 
66  void remove(Composite *node);
67 
74  Composite *getChild(int index);
75 
81  bool hasChildNodes() const;
82 
95  virtual double getValue(double time);
96 };
97 
98 #endif
Definition: Composite.h:25
Composite * getChild(int index)
Composite & operator=(const Composite &)=delete
std::vector< Composite * > children
Definition: Composite.h:31
void remove(Composite *node)
virtual double getValue(double time)
Composite & operator=(Composite &&)=default
void add(Composite *node)
Composite(const Composite &)=delete
virtual ~Composite()
Composite * parent
Definition: Composite.h:33
Composite(Composite &&)=default
bool hasChildNodes() const