OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
encapc< dim, T, typename memory_traits_lin< T >::type > Class Template Reference

this structure encapsulate an object of the grid More...

Detailed Description

template<unsigned int dim, typename T>
class encapc< dim, T, typename memory_traits_lin< T >::type >

this structure encapsulate an object of the grid

This structure encapsulate an object of the grid It give the possibility to select the property in a secondary moment

Can be thought as a reference to an object of the grid. So every time we use the term encapsulated object we mean reference to object

Note
A vector is a 1D grid
Parameters
dimDimensionality of the grid
Ttype of object the grid store

Definition at line 438 of file Encap.hpp.

#include <Encap.hpp>

Public Types

typedef T::type type
 object type the encap object encapsulate
 
typedef int yes_i_am_encap
 indicate the it is an encapsulated object
 
typedef T T_type
 original object
 

Public Member Functions

__device__ __host__ encapc (type &data_c)
 constructor from a reference object
 
typeoperator & ()
 Return the address of the base. More...
 
template<unsigned int p, typename r_type = decltype(boost::fusion::at_c<p>(data_c))>
__device__ __host__ r_type get ()
 access the data More...
 
template<unsigned int p, typename r_type = decltype(boost::fusion::at_c<p>(data_c))>
__device__ __host__ const r_type get () const
 access the data but return a constant reference More...
 
template<unsigned int p>
__device__ __host__ void set (decltype(boost::fusion::at_c< p >(data_c)) &ele)
 Set one property of the encapsulated object. More...
 
template<unsigned int dim2>
__device__ __host__ encapc< dim, T, Mem > & set (const encapc< dim2, T, Mem > &ec)
 Set one property of the encapsulated object. More...
 
__device__ __host__ encapc< dim, T, Mem > & operator= (const encapc< dim, T, Mem > &ec)
 Assignment. More...
 
__device__ __host__ encapc< dim, T, Mem > & operator= (const encapc< dim, T, Mem2 > &ec)
 Assignment. More...
 
__device__ __host__ encapc< dim, T, Mem > & operator= (const T &obj)
 Assignment. More...
 
bool operator== (const encapc< dim, T, Mem > &ec) const
 Compare. More...
 
bool operator!= (const encapc< dim, T, Mem > &ec) const
 Compare. More...
 

Static Public Attributes

static const int max_prop = T::max_prop
 number of properties
 

Private Types

typedef memory_traits_lin< T >::type Mem
 layout of the encapsulated object
 
typedef memory_traits_inte< T >::type Mem2
 layout of the encapsulated object
 

Private Attributes

typedata_c
 reference to the encapsulated object
 

Member Function Documentation

◆ get() [1/2]

template<unsigned int dim, typename T >
template<unsigned int p, typename r_type = decltype(boost::fusion::at_c<p>(data_c))>
__device__ __host__ r_type encapc< dim, T, typename memory_traits_lin< T >::type >::get ( )
inline

access the data

Returns
the reference

Definition at line 519 of file Encap.hpp.

◆ get() [2/2]

template<unsigned int dim, typename T >
template<unsigned int p, typename r_type = decltype(boost::fusion::at_c<p>(data_c))>
__device__ __host__ const r_type encapc< dim, T, typename memory_traits_lin< T >::type >::get ( ) const
inline

access the data but return a constant reference

Returns
the reference

Definition at line 533 of file Encap.hpp.

◆ operator &()

template<unsigned int dim, typename T >
type* encapc< dim, T, typename memory_traits_lin< T >::type >::operator & ( )
inline

Return the address of the base.

Returns
the address of the data encapsulated

Definition at line 505 of file Encap.hpp.

◆ operator!=()

template<unsigned int dim, typename T >
bool encapc< dim, T, typename memory_traits_lin< T >::type >::operator!= ( const encapc< dim, T, Mem > &  ec) const
inline

Compare.

Parameters
ecencapsulator
Returns
true if the two encap store different information

Definition at line 663 of file Encap.hpp.

◆ operator=() [1/3]

template<unsigned int dim, typename T >
__device__ __host__ encapc<dim,T,Mem>& encapc< dim, T, typename memory_traits_lin< T >::type >::operator= ( const encapc< dim, T, Mem > &  ec)
inline

Assignment.

Parameters
ecobject encapsulated to copy
Returns
itself

Definition at line 587 of file Encap.hpp.

◆ operator=() [2/3]

template<unsigned int dim, typename T >
__device__ __host__ encapc<dim,T,Mem>& encapc< dim, T, typename memory_traits_lin< T >::type >::operator= ( const encapc< dim, T, Mem2 > &  ec)
inline

Assignment.

Parameters
ecobject encapsulated to copy
Returns
itself

Definition at line 606 of file Encap.hpp.

◆ operator=() [3/3]

template<unsigned int dim, typename T >
__device__ __host__ encapc<dim,T,Mem>& encapc< dim, T, typename memory_traits_lin< T >::type >::operator= ( const T &  obj)
inline

Assignment.

Parameters
objobject to copy
Returns
itself

Definition at line 625 of file Encap.hpp.

◆ operator==()

template<unsigned int dim, typename T >
bool encapc< dim, T, typename memory_traits_lin< T >::type >::operator== ( const encapc< dim, T, Mem > &  ec) const
inline

Compare.

Parameters
ecencapsulator
Returns
true if the two encap store the same information

Definition at line 644 of file Encap.hpp.

◆ set() [1/2]

template<unsigned int dim, typename T >
template<unsigned int p>
__device__ __host__ void encapc< dim, T, typename memory_traits_lin< T >::type >::set ( decltype(boost::fusion::at_c< p >(data_c)) &  ele)
inline

Set one property of the encapsulated object.

Template Parameters
pproperty to set
Parameters
elevalue to set

Definition at line 549 of file Encap.hpp.

◆ set() [2/2]

template<unsigned int dim, typename T >
template<unsigned int dim2>
__device__ __host__ encapc<dim,T,Mem>& encapc< dim, T, typename memory_traits_lin< T >::type >::set ( const encapc< dim2, T, Mem > &  ec)
inline

Set one property of the encapsulated object.

Template Parameters
dim2dimensionality of the multy-array
pproperty to set
Parameters
ecvalue to set as encapsulated object
Returns
itself

Definition at line 568 of file Encap.hpp.


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