IterationPack_cast_iq.hpp File Reference

#include <stdexcept>
#include <typeinfo>
#include "IterationPack_AlgorithmState.hpp"
#include "IterationPack_IterQuantityAccess.hpp"

Include dependency graph for IterationPack_cast_iq.hpp:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  IterationPack

Functions

template<class T>
IterQuantityAccess< T > & cast_iq (AlgorithmState &state, const std::string &iq_name)
 Lookup an iteration quantity by name and cast it to an IterQuantityAccess<T> of the given type T. If the iteration quantity of that name does not exist then a AlgorithmState::DoesNotExist exception will be thrown. If the type of the iteration quantity is not of the type IterQuantityAcess<T> (as determined by dynamic_cast<T>) then the exception InvalidTypeCastException: will be thrown with a helpful error message.
template<class T>
const IterQuantityAccess<
T > & 
cast_iq (const AlgorithmState &state, const std::string &iq_name)
 
template<class T>
IterQuantityAccess< T > & cast_iq (AlgorithmState &state, const AlgorithmState::iq_id_type iq_id, const std::string &iq_name)
 Lookup an iteration quantity using its id and cast it to an IterQuantityAccess<T> of the given type T.
template<class T>
const IterQuantityAccess<
T > & 
cast_iq (const AlgorithmState &state, const AlgorithmState::iq_id_type iq_id, const std::string &iq_name)
 
void imp_cast_iq_throw_error (const std::string &iq_name, const std::string &iq_is_type_name, const std::string &iq_want_type_name)
void imp_cast_iq_throw_error (const AlgorithmState::iq_id_type iq_id, const std::string &iq_name, const std::string &iq_is_type_name, const std::string &iq_want_type_name)


Function Documentation

template<class T>
IterQuantityAccess< T > & IterationPack::cast_iq AlgorithmState &  state,
const std::string &  iq_name
 

Lookup an iteration quantity by name and cast it to an IterQuantityAccess<T> of the given type T. If the iteration quantity of that name does not exist then a AlgorithmState::DoesNotExist exception will be thrown. If the type of the iteration quantity is not of the type IterQuantityAcess<T> (as determined by dynamic_cast<T>) then the exception InvalidTypeCastException: will be thrown with a helpful error message.

Note that using this function always cost O(s.num_iter_quantities()) everytime it is called. Therefore, the developer should consider using the class CastIQMember instead if it is appropriate.

Definition at line 106 of file IterationPack_cast_iq.hpp.

template<class T>
const IterQuantityAccess< T > & IterationPack::cast_iq const AlgorithmState &  state,
const std::string &  iq_name
 

Definition at line 121 of file IterationPack_cast_iq.hpp.

template<class T>
IterQuantityAccess< T > & IterationPack::cast_iq AlgorithmState &  state,
const AlgorithmState::iq_id_type  iq_id,
const std::string &  iq_name
 

Lookup an iteration quantity using its id and cast it to an IterQuantityAccess<T> of the given type T.

Parameters:
state [in]
If the iteration quantity with that id does not exist then a AlgorithmState::DoesNotExist exception will be thrown. If the type of the iteration quantity is not of the type IterQuantityAcess<T> (as determined by dynamic_cast<T>) then the exception InvalidTypeCastException: will be thrown with a helpful error message.

Note that using this function always cost just O(1) everytime it is called.

Definition at line 136 of file IterationPack_cast_iq.hpp.

template<class T>
const IterQuantityAccess< T > & IterationPack::cast_iq const AlgorithmState &  state,
const AlgorithmState::iq_id_type  iq_id,
const std::string &  iq_name
 

Definition at line 151 of file IterationPack_cast_iq.hpp.

void IterationPack::imp_cast_iq_throw_error const std::string &  iq_name,
const std::string &  iq_is_type_name,
const std::string &  iq_want_type_name
 

Definition at line 32 of file IterationPack_cast_iq.cpp.

void IterationPack::imp_cast_iq_throw_error const AlgorithmState::iq_id_type  iq_id,
const std::string &  iq_name,
const std::string &  iq_is_type_name,
const std::string &  iq_want_type_name
 

Definition at line 45 of file IterationPack_cast_iq.cpp.


Generated on Thu Sep 18 12:35:43 2008 for MOOCHO (Single Doxygen Collection) by doxygen 1.3.9.1