blaze::Proxy< PT, RT > Class Template Reference

Proxy base class.The Proxy class is a base class for all proxy classes within the Blaze library that may represent non-numeric data types (vectors, matrices, ...). It augments the interface of the deriving proxy class depending on the data type represented by the proxy. In addition, it provides an abstraction from the actual type of the proxy, but enables a type-safe conversion back to this type via the 'Curiously Recurring Template Pattern' (CRTP). More...

#include <Proxy.h>

Inherits If_< IsVector< RT >, If_< IsDenseVector< RT >, DenseVectorProxy< PT, RT >, SparseVectorProxy< PT, RT > >, If_< IsMatrix< RT >, If_< IsDenseMatrix< RT >, DenseMatrixProxy< PT, RT >, SparseMatrixProxy< PT, RT > >, If_< IsComplex< RT >, ComplexProxy< PT, RT >, DefaultProxy< PT, RT > > > >.

Detailed Description

template<typename PT, typename RT = int>
class blaze::Proxy< PT, RT >

Proxy base class.

The Proxy class is a base class for all proxy classes within the Blaze library that may represent non-numeric data types (vectors, matrices, ...). It augments the interface of the deriving proxy class depending on the data type represented by the proxy. In addition, it provides an abstraction from the actual type of the proxy, but enables a type-safe conversion back to this type via the 'Curiously Recurring Template Pattern' (CRTP).

In order to use the Proxy class it is necessary to publicly derive from it and to provide an accessible member function called get(), which grants access to the represented element via non-const reference. The following example demonstrates these requirements by means of the VectorAccessProxy class:

template< typename VT >
class VectorAccessProxy : public Proxy< VectorAccessProxy<VT>, typename VT::ElementType >
{
// ...
typedef typename VT::ElementType RepresentedType;
inline RepresentedType& get() const;
// ...
};

The first template parameter specifies the type of the deriving proxy class (CRTP), the second template parameter specifies the type of the element represented by the proxy. Within the context of the VectorAccessProxy this is the type of the elements of the vector to be accessed. Depending on this type the proxy selects the additional interface to provide to the deriving class.


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