Last change
on this file since 1007 was
1006,
checked in by rlacroix, 8 years ago
|
The workflow is now triggered when using xios_recv_field for fields in read mode received from the servers.
Previously the workflow was triggered upon receiving the data which could cause deadlocks since there are no garanties that clients are receiving data at the same time.
|
File size:
1.1 KB
|
Rev | Line | |
---|
[639] | 1 | #include "garbage_collector.hpp" |
---|
| 2 | |
---|
| 3 | namespace xios |
---|
| 4 | { |
---|
[1006] | 5 | void CGarbageCollector::registerObject(InvalidableObject* Object, Time timestamp) |
---|
[639] | 6 | { |
---|
[1006] | 7 | registeredObjects[timestamp].insert(Object); |
---|
[639] | 8 | } |
---|
| 9 | |
---|
[1006] | 10 | void CGarbageCollector::unregisterObject(InvalidableObject* Object, Time timestamp) |
---|
[639] | 11 | { |
---|
[1006] | 12 | std::map<Time, std::set<InvalidableObject*> >::iterator it = registeredObjects.find(timestamp); |
---|
| 13 | if (it != registeredObjects.end()) |
---|
| 14 | it->second.erase(Object); |
---|
[639] | 15 | } |
---|
| 16 | |
---|
| 17 | void CGarbageCollector::invalidate(Time timestamp) |
---|
| 18 | { |
---|
[1006] | 19 | std::map<Time, std::set<InvalidableObject*> >::iterator it = registeredObjects.begin(), |
---|
| 20 | itEnd = registeredObjects.lower_bound(timestamp); |
---|
[639] | 21 | for (; it != itEnd; ++it) |
---|
| 22 | { |
---|
[1006] | 23 | std::set<InvalidableObject*>::iterator itObject = it->second.begin(), |
---|
| 24 | itObjectEnd = it->second.end(); |
---|
| 25 | for (; itObject != itObjectEnd; ++itObject) |
---|
| 26 | (*itObject)->invalidate(timestamp); |
---|
[639] | 27 | } |
---|
[1006] | 28 | registeredObjects.erase(registeredObjects.begin(), itEnd); |
---|
[639] | 29 | } |
---|
| 30 | } // namespace xios |
---|
Note: See
TracBrowser
for help on using the repository browser.