Flow123d  release_2.2.0-26-ge868538
Public Types | Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
Input::Iterator< T > Class Template Reference

#include <accessors.hh>

Inheritance diagram for Input::Iterator< T >:
Inheritance graph
[legend]
Collaboration diagram for Input::Iterator< T >:
Collaboration graph
[legend]

Public Types

typedef T DispatchType
 Converts C++ type T (template parameter) to 'DispatchType' from smaller set of types. More...
 
typedef internal::TypeDispatch< DispatchType >::ReadType OutputType
 
typedef internal::TypeDispatch< DispatchType >::InputType InputType
 

Public Member Functions

 Iterator ()
 
 Iterator (const Input::Type::TypeBase &type, const Address &address, const unsigned int index)
 
Iterator< T > & operator++ ()
 Prefix. Advance operator. More...
 
Iterator< T > & operator-- ()
 Prefix. Back operator. More...
 
OutputType operator* () const
 
OutputTypeoperator-> () const
 
- Public Member Functions inherited from Input::IteratorBase
 IteratorBase (const Address &address, const unsigned int index)
 
bool operator== (const IteratorBase &that) const
 Comparison of two Iterators. Do no compare types only position in the storage. More...
 
bool operator!= (const IteratorBase &that) const
 
 operator bool () const
 
unsigned int idx () const
 
const Addressget_address () const
 

Static Private Member Functions

static InputType type_check_and_convert (const Input::Type::TypeBase &type)
 

Private Attributes

InputType type_
 Input type declaration. More...
 
internal::TypeDispatch< DispatchType >::TmpType temporary_value_
 

Additional Inherited Members

- Protected Attributes inherited from Input::IteratorBase
Address address_
 
unsigned int index_
 

Detailed Description

template<class T>
class Input::Iterator< T >

This class behaves like iterator to type T (the template parameter), but in fact it is iterator into input storage and also into tree of declarations through Input::Type classes.

This class provides only limited functionality of iterators, namely prefix advance operator ++(), dereference operator * (), dereference operator -> (), comparison operators == and != and implicit conversion to bool (false in the case of the 'null' iterator).

Definition at line 144 of file accessors.hh.

Member Typedef Documentation

template<class T>
typedef T Input::Iterator< T >::DispatchType

Converts C++ type T (template parameter) to 'DispatchType' from smaller set of types.

Definition at line 732 of file accessors.hh.

A descendant of Input::Type::TypeBase that is appropriate to template parameter T.

Definition at line 741 of file accessors.hh.

template<class T>
typedef internal::TypeDispatch<DispatchType>::ReadType Input::Iterator< T >::OutputType

For small set of C++ types and accessor classes Record, AbstractRecord, and Array, returns type of value given by dereference of the iterator (just add const to C++ types).

Definition at line 737 of file accessors.hh.

Constructor & Destructor Documentation

template<class T>
Input::Iterator< T >::Iterator ( )
inline

Iterator is not default constructible.

Constructor uses empty Address which causes error in program, Address has to be filled.

Definition at line 749 of file accessors.hh.

template<class T>
Input::Iterator< T >::Iterator ( const Input::Type::TypeBase type,
const Address address,
const unsigned int  index 
)
inline

Constructor. Creates iterator effectively pointing to data address_->get_storage()->get_item(index), that is parameter address points to StorageArray and parameter index gives index into this array. Parameter type is Input::Type of object the iterator points to.

Definition at line 758 of file accessors.hh.

Member Function Documentation

template<class T >
Iterator< T >::OutputType Input::Iterator< T >::operator* ( ) const
inline

Dereference operator * ; Shouldn't we return type T, i.e. try to cast from OutputType to T ??

Definition at line 228 of file accessors_impl.hh.

template<class T >
Iterator< T > & Input::Iterator< T >::operator++ ( )
inline

Prefix. Advance operator.

Definition at line 212 of file accessors_impl.hh.

template<class T >
Iterator< T > & Input::Iterator< T >::operator-- ( )
inline

Prefix. Back operator.

Definition at line 220 of file accessors_impl.hh.

template<class T >
Iterator< T >::OutputType * Input::Iterator< T >::operator-> ( ) const
inline

Dereference operator can be used only for iterators to accessors Record, AbstractRecord, and Array.

Definition at line 238 of file accessors_impl.hh.

template<class T >
Iterator< T >::InputType Input::Iterator< T >::type_check_and_convert ( const Input::Type::TypeBase type)
staticprivate

Check that Type::TypeBase reference is in fact object of InputType and returns converted copy (note that Type declaration objects are only handles.

Definition at line 252 of file accessors_impl.hh.

Member Data Documentation

template<class T>
internal::TypeDispatch<DispatchType>::TmpType Input::Iterator< T >::temporary_value_
mutableprivate

temporary for -> operator, necessary only for T == DispatchType == OutputType == any accessor: Record, AbstractRecord, Array

for other types this is just an int.

Definition at line 796 of file accessors.hh.

template<class T>
InputType Input::Iterator< T >::type_
private

Input type declaration.

Definition at line 788 of file accessors.hh.


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