Flow123d  3.9.0-9663d1cde
Public Types | Public Member Functions | Private Attributes | List of all members
Input::AbstractRecord Class Reference

Accessor to the polymorphic input data of a type given by an AbstracRecord object. More...

#include <accessors.hh>

Collaboration diagram for Input::AbstractRecord:
Collaboration graph
[legend]

Public Types

typedef ::Input::Type::Abstract InputType
 

Public Member Functions

 AbstractRecord ()
 
 AbstractRecord (const AbstractRecord &rec)
 
 AbstractRecord (const Address &address, const Type::Abstract type)
 
 operator Record () const
 
Input::Type::Record type () const
 
EI_Address ei_address () const
 
string address_string () const
 
template<class Type , class... Arguments>
const std::shared_ptr< Type > factory (Arguments... arguments) const
 

Private Attributes

Input::Type::Abstract abstract_type_
 Corresponding Type::Abstract object. More...
 
Address address_
 Contains address and relationships with abstract record ancestor. More...
 

Detailed Description

Accessor to the polymorphic input data of a type given by an AbstracRecord object.

Provides conversion operator to the Record accessor in ordred to behave in the same way, but further it provides method type() that can be used to call constructor of the class corresponding to the input data.

Definition at line 458 of file accessors.hh.

Member Typedef Documentation

◆ InputType

Definition at line 460 of file accessors.hh.

Constructor & Destructor Documentation

◆ AbstractRecord() [1/3]

Input::AbstractRecord::AbstractRecord ( )

Default constructor creates an empty accessor.

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

Definition at line 247 of file accessors.cc.

◆ AbstractRecord() [2/3]

Input::AbstractRecord::AbstractRecord ( const AbstractRecord rec)

Copy constructor.

Definition at line 253 of file accessors.cc.

◆ AbstractRecord() [3/3]

Input::AbstractRecord::AbstractRecord ( const Address address,
const Type::Abstract  type 
)

Constructs the accessor providing pointer store to storage node with list of data of the record and type specification of the record given by parameter type.

Definition at line 259 of file accessors.cc.

Member Function Documentation

◆ address_string()

string Input::AbstractRecord::address_string ( ) const

Get address as string.

Definition at line 285 of file accessors.cc.

Here is the caller graph for this function:

◆ ei_address()

Input::EI_Address Input::AbstractRecord::ei_address ( ) const

Returns address error info.

Definition at line 280 of file accessors.cc.

◆ factory()

template<class Type , class... Arguments>
const std::shared_ptr< Type > Input::AbstractRecord::factory ( Arguments...  arguments) const

Construct classes given by TYPE key of AbstractRecord.

Method uses Input::Factory class. All constructed classes (representing by descendants of AbstractRecord) must be registered to factory (see Input::Factory class) and must have constructors with same parameters (given by Arguments).

Definition at line 135 of file accessors_impl.hh.

Here is the caller graph for this function:

◆ operator Record()

Input::AbstractRecord::operator Record ( ) const

Implicit conversion to the Input::Record accessor. You can use Input::AbstractRecord in the same way as the Input::Record.

Definition at line 268 of file accessors.cc.

◆ type()

Input::Type::Record Input::AbstractRecord::type ( ) const

Returns particular type selected from input. You can use it to construct particular type.

class MyClass {
MyClass( Input::Record );
}
if (abstract_record.type() == MyClass.get_input_type())
my_class = new MyClass(abstract_record); // here the implicit conversion to Input::Record is used

Definition at line 273 of file accessors.cc.

Here is the caller graph for this function:

Member Data Documentation

◆ abstract_type_

Input::Type::Abstract Input::AbstractRecord::abstract_type_
private

Corresponding Type::Abstract object.

Definition at line 523 of file accessors.hh.

◆ address_

Address Input::AbstractRecord::address_
private

Contains address and relationships with abstract record ancestor.

Definition at line 526 of file accessors.hh.


The documentation for this class was generated from the following files:
Input::Record
Accessor to the data with type Type::Record.
Definition: accessors.hh:291