Blaze 3.9
List of all members
blaze::Proxy< PT, RT > Class Template Reference

Proxy base class. More...

#include <Proxy.h>

Inherits If_t< IsVector_v< int >, If_t< IsDenseVector_v< int >, DenseVectorProxy< PT, int >, SparseVectorProxy< PT, int > >, If_t< IsMatrix_v< int >, If_t< IsDenseMatrix_v< int >, DenseMatrixProxy< PT, int >, SparseMatrixProxy< PT, int > >, If_t< IsComplex_v< int >, ComplexProxy< PT, int >, DefaultProxy< PT, int > > > >.

Protected Member Functions

Special member functions
 Proxy ()=default
 
 Proxy (const Proxy &)=default
 
 Proxy (Proxy &&)=default
 
 ~Proxy ()=default
 
Proxyoperator= (const Proxy &)=default
 
Proxyoperator= (Proxy &&)=default
 

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 >
{
// ...
using RepresentedType = typename VT::ElementType;
inline RepresentedType& get() const;
// ...
};
constexpr Type & get(StaticVector< Type, N, TF, AF, PF, Tag > &v) noexcept
Tuple-like index-based access the contents of a static vector.
Definition: StaticVector.h:3052

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 files: