CYCLUS
|
Tracks and records the state and parent-child relationships of resources as they are changed.
Resource implementations embed this as a member variable and invoke its methods appropriately to have their state changes tracked in the canonical core resource table.
Invocations to Create, Extract, Absorb, and Modify result in one or more entries in the output db Resource table and also call the Record method of the tracker's tracked resource. A zero parent id indicates a resource id has no parent; if both are zeros the resource was newly created.
Definition at line 21 of file res_tracker.h.
#include <res_tracker.h>
Public Member Functions | |
void | Absorb (ResTracker *absorbed) |
void | Create (Agent *creator) |
void | DontTrack () |
void | Extract (ResTracker *removed) |
void | Modify () |
void | Package (ResTracker *parent=NULL) |
ResTracker (Context *ctx, Resource *r) | |
Create a new tracker following r.
Definition at line 8 of file res_tracker.cc.
void cyclus::ResTracker::Absorb | ( | ResTracker * | absorbed | ) |
Should be called when a resource is combined with another.
absorbed | the tracker of the resource being absorbed. |
Definition at line 67 of file res_tracker.cc.
Should be called when a resource instance is newly created.
Definition at line 19 of file res_tracker.cc.
void cyclus::ResTracker::DontTrack | ( | ) |
Prevent a resource's heritage from being tracked and recorded.
Definition at line 15 of file res_tracker.cc.
void cyclus::ResTracker::Extract | ( | ResTracker * | removed | ) |
Should be called when a resource has some quantity removed from it (e.g.
resource is split).
removed | the tracker of the extracted/removed resource. |
Definition at line 44 of file res_tracker.cc.
void cyclus::ResTracker::Modify | ( | ) |
Should be called when the state of a resource changes (e.g.
radioactive decay).
Definition at line 34 of file res_tracker.cc.
void cyclus::ResTracker::Package | ( | ResTracker * | parent = NULL | ) |
Should be called when a resource's package gets modified.
If the resource was just created from a parent resource, the parent should be passed in. If the resource is just being repackaged (e.g. to unpackaged), the parent should be NULL.
Definition at line 77 of file res_tracker.cc.