Last change
on this file since 1654 was
1653,
checked in by oabramkina, 5 years ago
|
Developments for visualization of XIOS workflow.
Branch is spawned from trunk r1649.
Boost library is used for producing Graphviz DOT files. Current results: a DOT file representing a static workflow. For a complete proof of concept, DOT files for each timestamp should be generated. The necessary information has been collected by XIOS, it only requires rearranging the information for graphing (changes in classes CWorkflowGraph and CGraphviz).
|
File size:
1.1 KB
|
Rev | Line | |
---|
[639] | 1 | #include "garbage_collector.hpp" |
---|
| 2 | |
---|
| 3 | namespace xios |
---|
| 4 | { |
---|
[1653] | 5 | |
---|
| 6 | int InvalidableObject::count = 0; |
---|
| 7 | |
---|
[1021] | 8 | void CGarbageCollector::registerObject(InvalidableObject* Object, Time timestamp) |
---|
[639] | 9 | { |
---|
[1021] | 10 | registeredObjects[timestamp].insert(Object); |
---|
[639] | 11 | } |
---|
| 12 | |
---|
[1021] | 13 | void CGarbageCollector::unregisterObject(InvalidableObject* Object, Time timestamp) |
---|
[639] | 14 | { |
---|
[1021] | 15 | std::map<Time, std::set<InvalidableObject*> >::iterator it = registeredObjects.find(timestamp); |
---|
| 16 | if (it != registeredObjects.end()) |
---|
| 17 | it->second.erase(Object); |
---|
[639] | 18 | } |
---|
| 19 | |
---|
| 20 | void CGarbageCollector::invalidate(Time timestamp) |
---|
| 21 | { |
---|
[1021] | 22 | std::map<Time, std::set<InvalidableObject*> >::iterator it = registeredObjects.begin(), |
---|
| 23 | itEnd = registeredObjects.lower_bound(timestamp); |
---|
[639] | 24 | for (; it != itEnd; ++it) |
---|
| 25 | { |
---|
[1021] | 26 | std::set<InvalidableObject*>::iterator itObject = it->second.begin(), |
---|
| 27 | itObjectEnd = it->second.end(); |
---|
| 28 | for (; itObject != itObjectEnd; ++itObject) |
---|
| 29 | (*itObject)->invalidate(timestamp); |
---|
[639] | 30 | } |
---|
[1021] | 31 | registeredObjects.erase(registeredObjects.begin(), itEnd); |
---|
[639] | 32 | } |
---|
| 33 | } // namespace xios |
---|
Note: See
TracBrowser
for help on using the repository browser.