MOOCHO (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Private Types | Private Member Functions | Private Attributes | List of all members
IterationPack::IterQuantityAccessContiguous< T_info > Class Template Reference

Iteration Quanities subclass for contiguous iterations. More...

#include <IterationPack_IterQuantityAccessContiguousDecl.hpp>

Inheritance diagram for IterationPack::IterQuantityAccessContiguous< T_info >:
Inheritance graph
[legend]

Public Types

typedef IterQuantityAccess
< T_info > 
base_t
 
typedef Teuchos::RCP< const
Teuchos::AbstractFactory
< T_info > > 
abstract_factory_ptr_t
 
typedef
Teuchos::AbstractFactoryStd
< T_info, T_info > 
abstract_factory_std_t
 
- Public Types inherited from IterationPack::IterQuantityAccess< T_info >
typedef
IterQuantity::NoStorageAvailable 
NoStorageAvailable
 
typedef IterQuantity::QuanityNotSet QuanityNotSet
 
- Public Types inherited from IterationPack::IterQuantity
enum  { NONE_UPDATED = INT_MIN }
 Constant for value returned when no iteration quantity has been updated. More...
 

Private Types

typedef std::vector< bool > updated_t
 
typedef std::vector< typename
abstract_factory_ptr_t::element_type::obj_ptr_t > 
store_t
 
typedef std::vector< T_info * > quantities_t
 

Private Member Functions

bool is_initialized () const
 
void lazy_initialization ()
 
void release_mem ()
 
 IterQuantityAccessContiguous ()
 
 IterQuantityAccessContiguous (const IterQuantityAccessContiguous &)
 
IterQuantityAccessContiguousoperator= (const IterQuantityAccessContiguous &)
 

Private Attributes

int num_quantities_
 
std::string name_
 
abstract_factory_ptr_t abstract_factory_
 
int max_offset_
 
updated_t updated_
 
store_t store_
 
quantities_t quantities_
 

Constructors/initalizers

 IterQuantityAccessContiguous (int num_quantities, const std::string &name, const abstract_factory_ptr_t &abstract_factory=Teuchos::rcp(new abstract_factory_std_t()))
 Construct storage for num_quantities with the name name given an abstract factory. More...
 
void set_factory (const abstract_factory_ptr_t &abstract_factory)
 Set the abstract factory to use to allocate storate. More...
 
void resize (int num_quantities)
 Resize the number of contiguous storage locations. More...
 
 ~IterQuantityAccessContiguous ()
 

Access

int num_quantities () const
 Return the number of continous storage locations. More...
 

Overridden from IterQuantity

IterQuantityclone () const
 
const char * name () const
 
bool has_storage_k (int offset) const
 
bool updated_k (int offset) const
 
int last_updated () const
 
void set_not_updated_k (int offset)
 
void set_all_not_updated ()
 
bool will_loose_mem (int offset, int set_offset) const
 
void next_iteration ()
 
void print_concrete_type (std::ostream &out) const
 

Overridden from IterQuantityAccess

T_info & get_k (int offset)
 
const T_info & get_k (int offset) const
 
T_info & set_k (int offset)
 
T_info & set_k (int set_offset, int get_offset)
 

Additional Inherited Members

- Public Member Functions inherited from IterationPack::IterQuantity
virtual ~IterQuantity ()
 
void assert_has_storage_k (int offset) const
 Assert has_storage_k(offset) == true (throw NoStorageAvailable). More...
 
void assert_updated_k (int offset) const
 Assert updated_k(offset) == true (throw QuanityNotSet). More...
 

Detailed Description

template<class T_info>
class IterationPack::IterQuantityAccessContiguous< T_info >

Iteration Quanities subclass for contiguous iterations.

This class implements the IterQuantityAccess interface for the case where storage is provided for consecutive iterations. This class allows the number of iterations to be variable on construction. For 3 storage locations, this class could provide memory for the intervals [k-5, k-4, k-3], or [k-1, k, k+1] or [k+1, k+2, k+3] etc. The particular interval being represented is dependent on the sequence in which set_k(offset) and next_iteration() are called. The only rule is that backward interation is not allowed. For example, if the [k, k+1] interval is being represented then set_k(-1) will throw an exception but set_k(+5) would not. Backward memory is keep as long as possible and is only changed by set_k(). For example, if the range [k-1, k] is being represented and set_k(+1) is called, the interval [k, k+1] is now represented and the value for the kth iteration is still keep but the value for the k-1 iteration is lost. This could have been determined a priori by calling will_loose_mem().

The default constructor, copy constructor and assignment operators are not not allowed (i.e. declared private).

Definition at line 86 of file IterationPack_IterQuantityAccessContiguousDecl.hpp.

Member Typedef Documentation

template<class T_info>
typedef IterQuantityAccess<T_info> IterationPack::IterQuantityAccessContiguous< T_info >::base_t
template<class T_info>
typedef std::vector<bool> IterationPack::IterQuantityAccessContiguous< T_info >::updated_t
private
template<class T_info>
typedef std::vector<typename abstract_factory_ptr_t::element_type::obj_ptr_t> IterationPack::IterQuantityAccessContiguous< T_info >::store_t
private
template<class T_info>
typedef std::vector<T_info*> IterationPack::IterQuantityAccessContiguous< T_info >::quantities_t
private

Constructor & Destructor Documentation

template<class T_info >
IterationPack::IterQuantityAccessContiguous< T_info >::IterQuantityAccessContiguous ( int  num_quantities,
const std::string &  name,
const abstract_factory_ptr_t abstract_factory = Teuchos::rcp(new abstract_factory_std_t()) 
)

Construct storage for num_quantities with the name name given an abstract factory.

After construction this->set_k(offset) can be called for any offset in the range of legal integers.

Preconditions:

  • num_quantities > 0 (throw std::length_error)

If abstract_factory.get() == NULL then the client had better call this->set_factory() with an non-NULL factory before any attempt is made to call get_k() or set_k() or an exception will be thrown.

Definition at line 59 of file IterationPack_IterQuantityAccessContiguousDef.hpp.

template<class T_info>
IterationPack::IterQuantityAccessContiguous< T_info >::IterQuantityAccessContiguous ( )
private
template<class T_info>
IterationPack::IterQuantityAccessContiguous< T_info >::IterQuantityAccessContiguous ( const IterQuantityAccessContiguous< T_info > &  )
private

Member Function Documentation

template<class T_info >
void IterationPack::IterQuantityAccessContiguous< T_info >::set_factory ( const abstract_factory_ptr_t abstract_factory)

Set the abstract factory to use to allocate storate.

Postconditions:

  • this will become uninitialized and current memory will be wipped out.

If abstract_factory.get() == NULL then the client had better call this->set_factory() again later with a non-NULL factory before any attempt is made to call get_k() or set_k() or an exception will be thrown.

Definition at line 78 of file IterationPack_IterQuantityAccessContiguousDef.hpp.

template<class T_info >
void IterationPack::IterQuantityAccessContiguous< T_info >::resize ( int  num_quantities)

Resize the number of contiguous storage locations.

Postconditions:

  • this will become uninitialized and current memory will be wipped out.

Definition at line 92 of file IterationPack_IterQuantityAccessContiguousDef.hpp.

template<class T_info >
int IterationPack::IterQuantityAccessContiguous< T_info >::num_quantities ( ) const
inline

Return the number of continous storage locations.

Definition at line 258 of file IterationPack_IterQuantityAccessContiguousDecl.hpp.

template<class T_info >
IterQuantity * IterationPack::IterQuantityAccessContiguous< T_info >::clone ( ) const
virtual
template<class T_info >
const char * IterationPack::IterQuantityAccessContiguous< T_info >::name ( ) const
virtual
template<class T_info >
bool IterationPack::IterQuantityAccessContiguous< T_info >::has_storage_k ( int  offset) const
virtual
template<class T_info >
bool IterationPack::IterQuantityAccessContiguous< T_info >::updated_k ( int  offset) const
virtual
template<class T_info >
int IterationPack::IterQuantityAccessContiguous< T_info >::last_updated ( ) const
virtual
template<class T_info >
void IterationPack::IterQuantityAccessContiguous< T_info >::set_not_updated_k ( int  offset)
virtual
template<class T_info >
void IterationPack::IterQuantityAccessContiguous< T_info >::set_all_not_updated ( )
virtual
template<class T_info >
bool IterationPack::IterQuantityAccessContiguous< T_info >::will_loose_mem ( int  offset,
int  set_offset 
) const
virtual
template<class T_info >
void IterationPack::IterQuantityAccessContiguous< T_info >::next_iteration ( )
virtual
template<class T_info >
void IterationPack::IterQuantityAccessContiguous< T_info >::print_concrete_type ( std::ostream &  out) const
virtual
template<class T_info >
T_info & IterationPack::IterQuantityAccessContiguous< T_info >::get_k ( int  offset)
virtual
template<class T_info >
const T_info & IterationPack::IterQuantityAccessContiguous< T_info >::get_k ( int  offset) const
virtual
template<class T_info >
T_info & IterationPack::IterQuantityAccessContiguous< T_info >::set_k ( int  offset)
virtual
template<class T_info >
T_info & IterationPack::IterQuantityAccessContiguous< T_info >::set_k ( int  set_offset,
int  get_offset 
)
virtual
template<class T_info >
bool IterationPack::IterQuantityAccessContiguous< T_info >::is_initialized ( ) const
private
template<class T_info >
void IterationPack::IterQuantityAccessContiguous< T_info >::lazy_initialization ( )
private
template<class T_info >
void IterationPack::IterQuantityAccessContiguous< T_info >::release_mem ( )
private
template<class T_info>
IterQuantityAccessContiguous& IterationPack::IterQuantityAccessContiguous< T_info >::operator= ( const IterQuantityAccessContiguous< T_info > &  )
private

Member Data Documentation

template<class T_info>
int IterationPack::IterQuantityAccessContiguous< T_info >::num_quantities_
private
template<class T_info>
std::string IterationPack::IterQuantityAccessContiguous< T_info >::name_
private
template<class T_info>
abstract_factory_ptr_t IterationPack::IterQuantityAccessContiguous< T_info >::abstract_factory_
private
template<class T_info>
int IterationPack::IterQuantityAccessContiguous< T_info >::max_offset_
private
template<class T_info>
updated_t IterationPack::IterQuantityAccessContiguous< T_info >::updated_
private
template<class T_info>
store_t IterationPack::IterQuantityAccessContiguous< T_info >::store_
private
template<class T_info>
quantities_t IterationPack::IterQuantityAccessContiguous< T_info >::quantities_
private

The documentation for this class was generated from the following files: