OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
encapc< dim, T, typename memory_traits_inte< 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_inte< 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 712 of file Encap.hpp.

#include <Encap.hpp>

Public Types

typedef T::type type
 Original list if types.
 
typedef int yes_i_am_encap
 indicate it is an encapsulated object
 
typedef T T_type
 original object type
 

Public Member Functions

__device__ __host__ encapc (typename memory_traits_inte< T >::type &data, size_t k)
 constructor require a key and a memory data
 
template<unsigned int p>
__device__ __host__ auto get () -> decltype(boost::fusion::at_c< p >(data).mem_r.operator[](k))
 Access the data. More...
 
template<unsigned int p>
__device__ __host__ auto get () const -> decltype(boost::fusion::at_c< p >(data).mem_r.operator[](k))
 Access the data. More...
 
__device__ __host__ encapc (const encapc< dim, T, Mem > &ec)
 
__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...
 
__device__ __host__ void private_set_data_k (Mem &data_c, size_t k)
 
__device__ __host__ Memprivate_get_data ()
 
__device__ __host__ size_t private_get_k ()
 
__device__ __host__ size_t private_set_k (unsigned int k)
 

Static Public Attributes

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

Private Types

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

Private Attributes

Memdata
 reference to the encapsulated object
 
size_t k
 element id
 

Member Function Documentation

◆ get() [1/2]

template<unsigned int dim, typename T >
template<unsigned int p>
__device__ __host__ auto encapc< dim, T, typename memory_traits_inte< T >::type >::get ( ) -> decltype(boost::fusion::at_c<p>(data).mem_r.operator[](k))
inline

Access the data.

Template Parameters
pproperty selected
Returns
The reference of the data

Definition at line 780 of file Encap.hpp.

◆ get() [2/2]

template<unsigned int dim, typename T >
template<unsigned int p>
__device__ __host__ auto encapc< dim, T, typename memory_traits_inte< T >::type >::get ( ) const -> decltype(boost::fusion::at_c<p>(data).mem_r.operator[](k))
inline

Access the data.

Template Parameters
pproperty selected
Returns
The reference of the data

Definition at line 795 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_inte< T >::type >::operator= ( const encapc< dim, T, Mem > &  ec)
inline

Assignment.

Parameters
ecencapsulator
Returns
itself

Definition at line 819 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_inte< T >::type >::operator= ( const encapc< dim, T, Mem2 > &  ec)
inline

Assignment.

Parameters
ecencapsulator
Returns
itself

Definition at line 838 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_inte< T >::type >::operator= ( const T &  obj)
inline

Assignment.

Parameters
objobject to copy
Returns
itself

Definition at line 857 of file Encap.hpp.


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