#include <IterationPack_IterQuantity.hpp>
Inheritance diagram for IterationPack::IterQuantity:
Public types | |
| enum | |
| Constant for value returned when no iteration quantity has been updated. More... | |
Misc query (const) methods | |
| virtual const char * | name () const =0 |
| Return the name (zero terminated string) of this quantity. | |
| virtual bool | has_storage_k (int offset) const =0 |
Determine if there is storage advailable for the k offset iteration quanity. | |
| 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 IterQuantityAccess). | |
| virtual int | last_updated () const =0 |
Return the highest k such that updated_k(k) returns true. | |
| 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 IterQuantityAccess). | |
Misc modifier (non-const) methods | |
| virtual void | set_not_updated_k (int offset)=0 |
Causes updated_k(k) to return false. | |
| virtual void | set_all_not_updated ()=0 |
Causes updated_k(k) to return false for all k. | |
Iteration incrementation | |
| virtual void | next_iteration ()=0 |
| Shift the reference point from the k to the k+1 iteration. | |
Runtime information | |
| virtual void | print_concrete_type (std::ostream &out) const =0 |
| Print to an output stream a description of this iteration quantity. | |
Assert state | |
| void | assert_has_storage_k (int offset) const |
Assert has_storage_k(offset) == true (throw NoStorageAvailable). | |
| void | assert_updated_k (int offset) const |
Assert updated_k(offset) == true (throw QuanityNotSet). | |
This class provides and interface to all concrete types of iteration quantities and provides all of the services except storage access. It is assumed that every concrete iteration quantity subclass will will be derived from the tempalted interface class IterQuantityAccess.
ToDo: Finish the documentation and give examples.
Definition at line 55 of file IterationPack_IterQuantity.hpp.
|
|
Constant for value returned when no iteration quantity has been updated.
Definition at line 62 of file IterationPack_IterQuantity.hpp. |
|
|
Return the name (zero terminated string) of this quantity.
Implemented in IterationPack::IterQuantityAccessContiguous< T_info >. |
|
|
Determine if there is storage advailable for the k
If this function returns true then Implemented in IterationPack::IterQuantityAccessContiguous< T_info >. |
|
|
Determine if the quanity for the k
This function does not confirm that the k Implemented in IterationPack::IterQuantityAccessContiguous< T_info >. |
|
|
Return the highest k such that
If Implemented in IterationPack::IterQuantityAccessContiguous< T_info >. |
|
||||||||||||
|
Determine if the memory for the k +
This member function allows clients to know a little about the specific behavior of the subclass. Clients can use this function to determine if it is safe to call for(int i = 1; i <= n; ++i) { info.set_k(+1)(i) = info.get_k(0)(i); } i == 1, set_k(+1) would cause a state transition and for i == 2 info.get_k(0) would throw an exception. Actually, the compiler may evaluate info.set_k(+1) before info.get_k(0) so info.get_k(0) whould throw an exception right away for i == 1.If the client knows that only single storage is needed then it could use something like the following code: if(info.will_loose_mem(0,+1) { info.set_k(+1) = info.get_k(0); for(int i = 1; i <= n; ++i) info.set_k(+1)(i) = info.get_k(+1)(i) * 2; } else { for(int i = 1; i <= n; ++i) info.set_k(+1)(i) = info.get_k(0)(i); } set_k() and get_k() multiple times like this but you get the basic idea. The above code works for both single and multiple storage and will not result in any unnecessary copying since assingment to self should be detected. In the above code info.set_k(+1) = info.get_k(0); is called to effect the state transistion.
On the other hand if you need dual storage you will need a temporary copy in the event that for(int i = 2; i <= n; ++i) info.set_k(+1)(i) = info.get_k(0)(i) * info.get_k(0)(i-1); Preconditions:
Implemented in IterationPack::IterQuantityAccessContiguous< T_info >. |
|
|
Causes Preconditions:
Postconditions:
Implemented in IterationPack::IterQuantityAccessContiguous< T_info >. |
|
|
Causes
Implemented in IterationPack::IterQuantityAccessContiguous< T_info >. |
|
|
Shift the reference point from the k to the k+1 iteration. Postcondtions:
Implemented in IterationPack::IterQuantityAccessContiguous< T_info >. |
|
|
Print to an output stream a description of this iteration quantity. The purpose if this method is allow the client get information as to what the type of the iteration quantity really is for debugging and informational purposes. This should just include information on types and nothing else.
The concrete type of Implemented in IterationPack::IterQuantityAccessContiguous< T_info >. |
|
|
Assert
Definition at line 9 of file IterationPack_IterQuantity.cpp. |
|
|
Assert updated_k(offset) == true
Definition at line 17 of file IterationPack_IterQuantity.cpp. |
1.3.9.1