Flow123d  jenkins-Flow123d-linux-release-multijob-282
Classes | Public Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
Input::Type::Array Class Reference

Class for declaration of inputs sequences. More...

#include <type_base.hh>

Inheritance diagram for Input::Type::Array:
Inheritance graph
[legend]
Collaboration diagram for Input::Type::Array:
Collaboration graph
[legend]

Classes

class  ArrayData
 

Public Member Functions

template<class ValueType >
 Array (const ValueType &type, unsigned int min_size=0, unsigned int max_size=std::numeric_limits< unsigned int >::max())
 
std::size_t content_hash () const override
 
virtual bool finish ()
 Finishes initialization of the Array type because of lazy evaluation of type_of_values. More...
 
virtual bool is_finished () const
 
const TypeBaseget_sub_type () const
 Getter for the type of array items. More...
 
bool match_size (unsigned int size) const
 Checks size of particular array. More...
 
virtual string type_name () const
 Implements Type::TypeBase::type_name. Name has form array_of_'subtype name'. More...
 
virtual string full_type_name () const
 Implements Type::TypeBase::full_type_name. More...
 
virtual bool operator== (const TypeBase &other) const
 Implements Type::TypeBase::operator== Compares also subtypes. More...
 
virtual bool valid_default (const string &str) const
 
- Public Member Functions inherited from Input::Type::TypeBase
string desc () const
 
bool operator!= (const TypeBase &other) const
 Comparison of types. More...
 
virtual ~TypeBase ()
 

Protected Attributes

boost::shared_ptr< ArrayDatadata_
 Handle to the actual array data. More...
 

Private Member Functions

 Array ()
 Forbids default constructor in order to prevent empty data_. More...
 

Friends

class OutputBase
 

Additional Inherited Members

- Static Public Member Functions inherited from Input::Type::TypeBase
static void lazy_finish ()
 Finishes all registered lazy types. More...
 
- Protected Types inherited from Input::Type::TypeBase
typedef string KeyHash
 
typedef std::vector
< boost::shared_ptr< TypeBase > > 
LazyTypeVector
 
typedef std::set< const
TypeBase * > 
LazyObjectsSet
 
- Protected Member Functions inherited from Input::Type::TypeBase
 TypeBase ()
 
 TypeBase (const TypeBase &other)
 
- Static Protected Member Functions inherited from Input::Type::TypeBase
static KeyHash key_hash (const string &str)
 Hash function. More...
 
static bool is_valid_identifier (const string &key)
 
static LazyTypeVectorlazy_type_list ()
 
static LazyObjectsSetlazy_object_set ()
 
static bool was_constructed (const TypeBase *ptr)
 

Detailed Description

Class for declaration of inputs sequences.

The type is fully specified after its constructor is called. All elements of the Array has same type, however you can use elements of AbstractRecord.

If you not disallow Array size 1, the input reader will try to convert any other type on input into array with one element, e.g.

int_array=1 # is equivalent to
int_array=[ 1 ]

Definition at line 239 of file type_base.hh.

Constructor & Destructor Documentation

template<class ValueType >
Input::Type::Array::Array ( const ValueType &  type,
unsigned int  min_size = 0,
unsigned int  max_size = std::numeric_limits<unsigned int>::max() 
)

Constructor with a type of array items given as pure reference. In this case type has to by descendant of TypeBase different from 'complex' types Record and Selection. You can also specify minimum and maximum size of the array.

Definition at line 226 of file type_base.cc.

Input::Type::Array::Array ( )
private

Forbids default constructor in order to prevent empty data_.

Member Function Documentation

std::size_t Input::Type::Array::content_hash ( ) const
overridevirtual

Hash of the type specification. Provides unique id computed from its content (definition) so that same types have same hash.

Implements Input::Type::TypeBase.

Definition at line 140 of file type_base.cc.

Here is the caller graph for this function:

bool Input::Type::Array::finish ( )
virtual

Finishes initialization of the Array type because of lazy evaluation of type_of_values.

Reimplemented from Input::Type::TypeBase.

Definition at line 151 of file type_base.cc.

string Input::Type::Array::full_type_name ( ) const
virtual

Implements Type::TypeBase::full_type_name.

Reimplemented from Input::Type::TypeBase.

Definition at line 199 of file type_base.cc.

Here is the caller graph for this function:

const TypeBase& Input::Type::Array::get_sub_type ( ) const
inline

Getter for the type of array items.

Definition at line 277 of file type_base.hh.

Here is the caller graph for this function:

virtual bool Input::Type::Array::is_finished ( ) const
inlinevirtual

Returns true if the type is fully specified and ready for read access. For Record and Array types this say nothing about child types referenced in particular type object. In particular for Record and Selection, it returns true after finish() method is called.

Reimplemented from Input::Type::TypeBase.

Definition at line 273 of file type_base.hh.

bool Input::Type::Array::match_size ( unsigned int  size) const
inline

Checks size of particular array.

Definition at line 282 of file type_base.hh.

Here is the caller graph for this function:

bool Input::Type::Array::operator== ( const TypeBase other) const
virtual

Implements Type::TypeBase::operator== Compares also subtypes.

Reimplemented from Input::Type::TypeBase.

Definition at line 205 of file type_base.cc.

string Input::Type::Array::type_name ( ) const
virtual

Implements Type::TypeBase::type_name. Name has form array_of_'subtype name'.

Reimplemented from Input::Type::TypeBase.

Definition at line 195 of file type_base.cc.

bool Input::Type::Array::valid_default ( const string &  str) const
virtual

Default values for an array creates array containing one element that is initialized by given default value. So this method check if the default value is valid for the sub type of the array.

Implements Input::Type::TypeBase.

Definition at line 212 of file type_base.cc.

Friends And Related Function Documentation

friend class OutputBase
friend

Definition at line 240 of file type_base.hh.

Member Data Documentation

boost::shared_ptr<ArrayData> Input::Type::Array::data_
protected

Handle to the actual array data.

Definition at line 304 of file type_base.hh.


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