Public Member Functions | List of all members
ecl::blueprints::ArrayBluePrint< Derived > Class Template Reference

Parent class for array blueprints. More...

#include <array_no_mem_check.hpp>

Public Member Functions

template<typename BaseType >
void implementApply (BaseType &array) const
 
template<typename BaseType >
BaseType implementInstantiate ()
 
virtual ~ArrayBluePrint ()
 

Detailed Description

template<typename Derived>
class ecl::blueprints::ArrayBluePrint< Derived >

Parent class for array blueprints.

This parent class for array blueprints is necessary to provide a convenient assignment interface to the array class. Without this, no casting to simple fundamental types gets done when using the comma initialiser because they get locked into a templatised blueprint assignment operator. e.g.

Array<double,4> array;
array = 1,2,3,4;

This would cause a concept checking compile time error because the first value is an integer, not a double. Hence this would be passed to the templatised constructor and the concept check would fail. What was intended was that this be automatically casted before being sent to the assignment operator for the double.

So here we generate a parent class and design the constructor in the Array to use that. We don't want to lose speed through virtual calls though, so we use the curiously recurring template pattern trick to get us to the goal!

See also
Array.

Definition at line 60 of file array_no_mem_check.hpp.

Constructor & Destructor Documentation

◆ ~ArrayBluePrint()

template<typename Derived >
virtual ecl::blueprints::ArrayBluePrint< Derived >::~ArrayBluePrint ( )
inlinevirtual

Definition at line 457 of file array_no_mem_check.hpp.

Member Function Documentation

◆ implementApply()

template<typename Derived >
template<typename BaseType >
void ecl::blueprints::ArrayBluePrint< Derived >::implementApply ( BaseType &  array) const
inline

A crtp virtual call to its children's apply method. This acts on the blueprint's target class to configure it according to the blueprint. The template parameter is a trick to delay the determination of the target type, because at this point of the compilation it cannot retrieve the base_type from the derived type.

Note, this cannot have the same name as the blueprint method because then the child will inherit it, even if it doesn't have the class and the concept check will fail.

Parameters
array: the underlying array to be configured.

Definition at line 453 of file array_no_mem_check.hpp.

◆ implementInstantiate()

template<typename Derived >
template<typename BaseType >
BaseType ecl::blueprints::ArrayBluePrint< Derived >::implementInstantiate ( )
inline

A crtp virtual call to its children's instantiate method. The template argument is used, because the crtp base cannot catch typedef's in its children at this point of the compilation. With the template parameter this check is delayed until enough of this base class is known.

Note, this cannot have the same name as the blueprint method because then the child will inherit it, even if it doesn't have the class and the concept check will fail.

Returns
BaseType : the type to be generated by the blueprint.

Definition at line 436 of file array_no_mem_check.hpp.


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


ecl_containers
Author(s): Daniel Stonier
autogenerated on Wed Mar 2 2022 00:16:34