Last change
on this file since 2296 was
2267,
checked in by ymipsl, 3 years ago
|
tracking memory leak
Elements, views, and connectors are now managed with shared pointer.
YM
|
-
Property svn:executable set to
*
|
File size:
1.3 KB
|
Rev | Line | |
---|
[1918] | 1 | #ifndef __GRID_ELEMENTS_HPP__ |
---|
| 2 | #define __GRID_ELEMENTS_HPP__ |
---|
| 3 | |
---|
| 4 | #include "xios_spl.hpp" |
---|
| 5 | #include "array_new.hpp" |
---|
| 6 | #include "element.hpp" |
---|
| 7 | |
---|
| 8 | namespace xios |
---|
| 9 | { |
---|
| 10 | class CGridLocalView ; |
---|
| 11 | class CGridLocalConnector ; |
---|
| 12 | |
---|
[2267] | 13 | class CGridLocalElements : public std::enable_shared_from_this<CGridLocalElements> |
---|
[1918] | 14 | { |
---|
| 15 | private: |
---|
[2267] | 16 | std::vector<shared_ptr<CLocalElement>> elements_ ; |
---|
| 17 | std::vector<shared_ptr<CGridLocalView>> views_= std::vector<shared_ptr<CGridLocalView>>(CElementView::numViewType_) ; |
---|
| 18 | std::map<pair<CElementView::type,CElementView::type>, shared_ptr<CGridLocalConnector>> connectors_ ; |
---|
[1918] | 19 | vector<bool> localMask_ ; |
---|
| 20 | |
---|
| 21 | public: |
---|
[2267] | 22 | CGridLocalElements(vector<shared_ptr<CLocalElement> > elements) : elements_(elements) {} |
---|
| 23 | CGridLocalElements(vector<shared_ptr<CLocalElement>> elements, vector<bool>& localMask) : elements_(elements), localMask_(localMask) {} |
---|
[1918] | 24 | |
---|
| 25 | bool hasLocalMask() { return !localMask_.empty() ;} |
---|
| 26 | vector<bool>& getLocalMask(void) { return localMask_ ;} |
---|
| 27 | |
---|
[2267] | 28 | std::vector<shared_ptr<CLocalElement>>& getElements(void) { return elements_ ; } |
---|
| 29 | shared_ptr<CGridLocalView> getView(CElementView::type type) ; |
---|
| 30 | shared_ptr<CGridLocalConnector> getConnector(CElementView::type srcType, CElementView::type dstType, bool withMask=false) ; |
---|
[1918] | 31 | } ; |
---|
| 32 | } |
---|
| 33 | |
---|
| 34 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.