47 #ifndef ITER_QUANTITY_H
48 #define ITER_QUANTITY_H
55 #include "IterationPack_Types.hpp"
57 namespace IterationPack {
75 enum { NONE_UPDATED = INT_MIN };
79 {
public:
NoStorageAvailable(
const std::string& what_arg) : std::logic_error(what_arg) {}};
83 {
public:
QuanityNotSet(
const std::string& what_arg) : std::logic_error(what_arg) {}};
102 virtual const char*
name()
const = 0;
120 virtual bool updated_k(
int offset)
const = 0;
180 virtual bool will_loose_mem(
int offset,
int set_offset)
const = 0;
250 #endif // ITER_QUANTITY_H
virtual void set_all_not_updated()=0
Causes updated_k(k) to return false for all k.
void assert_updated_k(int offset) const
Assert updated_k(offset) == true (throw QuanityNotSet).
virtual void print_concrete_type(std::ostream &out) const =0
Print to an output stream a description of this iteration quantity.
virtual const char * name() const =0
Return the name (zero terminated string) of this quantity.
void assert_has_storage_k(int offset) const
Assert has_storage_k(offset) == true (throw NoStorageAvailable).
Thrown when memory access is attempted when it has not yet been updated.
virtual bool has_storage_k(int offset) const =0
Determine if there is storage advailable for the k offset iteration quanity.
Thrown memory if attempted to be set that storage can not be allocated to.
virtual void next_iteration()=0
Shift the reference point from the k to the k+1 iteration.
virtual void set_not_updated_k(int offset)=0
Causes updated_k(k) to return false.
virtual bool updated_k(int offset) const =0
Determine if the quanity for the k offset iteration has been accessed by a call to set_k() (see IterQ...
Iterface for information about Iteration Quantities.
virtual bool will_loose_mem(int offset, int set_offset) const =0
Determine if the memory for the k + offset quantityy will be lost if set_k(set_offset) is called (see...
virtual int last_updated() const =0
Return the highest k such that updated_k(k) returns true.