#include <IterationPack_IterQuantityAccess.hpp>
Inheritance diagram for IterationPack::IterQuantityAccess< T_info >:
Public Types | |
| typedef IterQuantity::NoStorageAvailable | NoStorageAvailable |
| | |
| typedef IterQuantity::QuanityNotSet | QuanityNotSet |
| | |
Public Member Functions | |
| virtual T_info & | get_k (int offset)=0 |
Return a reference for the k + offset iteration quanity. | |
| virtual const T_info & | get_k (int offset) const =0 |
Return a const reference for the k + offset iteration quanity. | |
| virtual T_info & | set_k (int offset)=0 |
Return a reference to the storage location for the k + offset iteration quanity. | |
| virtual T_info & | set_k (int set_offset, int get_offset)=0 |
Set the iteration quantity for the k + set_offset iteration to the k + get_offset iteration and return the reference to the k + set_offset iteration quantity. | |
Quantities are updated, read and queried given the offset to the current iteration k. For example, to set a quantity for the k+1 iteration you would call set_k(+1). The functions ending with prefix_k(offset) are meant to suggest prefix k + offset. For example:
has_storage_k(+1) => has storage k+1 get_k(-1) => get k-1
IterQuantity::has_storage_k() and set_k(). Note that any type that is to be used as an iteration quantity must at the bare minimum have the assignment operation defined for it.
The client should not have to worry about how much memory is available. Instead, it is for the object that configures the client to provide the appropriate subclass to meet the needs of the client.
Usage:
There are sevearl different techniques for using IterQuantityAccess<T_info>. An implementation subclass for IterQuantityAccess<T_info> will maintain one or more storage locations for iteration quantities that can be updateded and accessed. These storage locations need not be contiguous but this is the most common scenario (see IterQuantityAccessContiguous).
It is important to understand what a client is requesting and what is implied by various calls to get and set methods.
By calling the const version of get_k(offset), the client is expecting to gain read access to previously updated iteration quantity. This quantity should not be modified through this constant reference.
The non-const version of get_k(offset) is called by a client to gain read-write access to a reviously updated iteration quantity. The quantity can be further modified through this non-constant reference.
The method set_k(offset) is called by a client so that it may fully initialize the iteration quantity which may not have been previously updated. The object pointed to by the non-const reference returned from set_k(offset) can not expected to have any more than a default initialization.
Finally, the method set_k(set_offset,get_offset) is called to explicitly update the iteration quantitiy at k + set_offset to the value at iteration k + get_offset. This method is most useful when the client simply wants to set the iteration quantity at the current iteration (set_offset = 0 to its value at the previous iteration (get_offset = -1). The outcome of this operation is insured no matter how the storage is managed by the subclass. The non-const reference returned from this method may be used to futher modify the just updated iteration quantity or the reference can just be discarded.
Definition at line 97 of file IterationPack_IterQuantityAccess.hpp.
|
|||||
|
Definition at line 101 of file IterationPack_IterQuantityAccess.hpp. |
|
|||||
|
Definition at line 103 of file IterationPack_IterQuantityAccess.hpp. |
|
||||||||||
|
Return a reference for the Clients call this member function to access a quantity for a given iteration or modify the quantity which has already been set for that iteration. Preconditions:
Implemented in IterationPack::IterQuantityAccessContiguous< T_info >. |
|
||||||||||
|
Return a const reference for the Preconditions:
Clients call this member function to access a const quantity for a given iteration. Implemented in IterationPack::IterQuantityAccessContiguous< T_info >. |
|
||||||||||
|
Return a reference to the storage location for the Precondtions:
Postcondtions:
Implemented in IterationPack::IterQuantityAccessContiguous< T_info >. |
|
||||||||||||||||
|
Set the iteration quantity for the
Postcondtions:
Implemented in IterationPack::IterQuantityAccessContiguous< T_info >. |
1.3.9.1