CYCLUS
|
Resource defines an abstract interface implemented by types that are offered, requested, and transferred between simulation agents.
Resources represent the lifeblood of a simulation.
Definition at line 19 of file resource.h.
#include <resource.h>
Public Types | |
typedef boost::shared_ptr< Resource > | Ptr |
Public Member Functions | |
void | BumpStateId () |
virtual Ptr | Clone () const =0 |
virtual Ptr | ExtractRes (double quantity)=0 |
const int | obj_id () const |
virtual int | qual_id () const =0 |
virtual double | quantity () const =0 |
virtual void | Record (Context *ctx) const =0 |
Resource () | |
const int | state_id () const |
virtual const ResourceType | type () const =0 |
virtual std::string | units () const =0 |
virtual | ~Resource () |
typedef boost::shared_ptr<Resource> cyclus::Resource::Ptr |
Definition at line 24 of file resource.h.
|
inline |
Definition at line 26 of file resource.h.
|
inlinevirtual |
Definition at line 28 of file resource.h.
void cyclus::Resource::BumpStateId | ( | ) |
Assigns a new, unique internal id to this resource and its state.
This should be called by resource implementations whenever their state changes. A call to BumpStateId is not necessarily accompanied by a change to the state id. This should NEVER be called by agents.
Definition at line 8 of file resource.cc.
|
pure virtual |
Returns an untracked (not part of the simulation) copy of the resource.
A cloned resource should never record anything in the output database.
Implemented in cyclus::Material, and cyclus::Product.
|
pure virtual |
Splits the resource and returns the extracted portion as a new resource object.
Allows for things like ResBuf and Traders to split offers/requests of arbitrary resource implementation type.
Implemented in cyclus::Material, and cyclus::Product.
|
inline |
Returns the unique id corresponding to this resource object.
Can be used to track and/or associate other information with this resource object. You should NOT track resources by pointer.
Definition at line 33 of file resource.h.
|
pure virtual |
Returns an id representing the specific resource implementation's internal state that is not accessible via the Resource class public interface.
Any change to the qual_id should always be accompanied by a call to BumpStateId.
Implemented in cyclus::Material, and cyclus::Product.
|
pure virtual |
Returns the quantity of this resource with dimensions as specified by the return value of units().
Implemented in cyclus::Material, and cyclus::Product.
|
pure virtual |
Records the resource's state to the output database.
This method should generally NOT record data accessible via the Resource class public methods (e.g. qual_id, units, type, quantity).
ctx | the simulation context used to record the data. |
Implemented in cyclus::Material, and cyclus::Product.
|
inline |
Returns the unique id corresponding to this resource and its current state.
All resource id's are unique - even across different resource types/implementations. Runtime tracking of resources should generally use the obj_id rather than this.
Definition at line 39 of file resource.h.
|
pure virtual |
A unique type/name for the concrete resource implementation.
Implemented in cyclus::Material, and cyclus::Product.
|
pure virtual |
Returns the units this resource is based in (e.g. "kg").
Implemented in cyclus::Material, and cyclus::Product.