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 () |
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!
Definition at line 411 of file array_no_mem_check.hpp.
virtual ecl::blueprints::ArrayBluePrint< Derived >::~ArrayBluePrint | ( | ) | [inline, virtual] |
Definition at line 447 of file array_no_mem_check.hpp.
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.
array | : the underlying array to be configured. |
Definition at line 443 of file array_no_mem_check.hpp.
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.
Definition at line 426 of file array_no_mem_check.hpp.