OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
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.
 
template<unsigned int p>
__device__ __host__ auto get () const -> decltype(boost::fusion::at_c< p >(data).mem_r.operator[](k))
 Access the data.
 
__device__ __host__ encapc (const encapc< dim, T, Mem > &ec)
 
__device__ __host__ encapc< dim, T, Mem > & operator= (const encapc< dim, T, Mem > &ec)
 Assignment.
 
__device__ __host__ encapc< dim, T, Mem > & operator= (const encapc< dim, T, Mem2 > &ec)
 Assignment.
 
__device__ __host__ encapc< dim, T, Mem > & operator= (const T &obj)
 Assignment.
 
__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 Typedef Documentation

◆ Mem

template<unsigned int dim, typename T >
typedef memory_traits_inte<T>::type encapc< dim, T, typename memory_traits_inte< T >::type >::Mem
private

type of layout

Definition at line 715 of file Encap.hpp.

◆ Mem2

template<unsigned int dim, typename T >
typedef memory_traits_lin<T>::type encapc< dim, T, typename memory_traits_inte< T >::type >::Mem2
private

layout of the encapsulated object

Definition at line 718 of file Encap.hpp.

◆ T_type

template<unsigned int dim, typename T >
typedef T encapc< dim, T, typename memory_traits_inte< T >::type >::T_type

original object type

Definition at line 753 of file Encap.hpp.

◆ type

template<unsigned int dim, typename T >
typedef T::type encapc< dim, T, typename memory_traits_inte< T >::type >::type

Original list if types.

Definition at line 747 of file Encap.hpp.

◆ yes_i_am_encap

template<unsigned int dim, typename T >
typedef int encapc< dim, T, typename memory_traits_inte< T >::type >::yes_i_am_encap

indicate it is an encapsulated object

Definition at line 750 of file Encap.hpp.

Constructor & Destructor Documentation

◆ encapc() [1/2]

template<unsigned int dim, typename T >
__device__ __host__ encapc< dim, T, typename memory_traits_inte< T >::type >::encapc ( typename memory_traits_inte< T >::type data,
size_t  k 
)
inline

constructor require a key and a memory data

Definition at line 764 of file Encap.hpp.

◆ encapc() [2/2]

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

Definition at line 804 of file Encap.hpp.

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.

◆ private_get_data()

template<unsigned int dim, typename T >
__device__ __host__ Mem & encapc< dim, T, typename memory_traits_inte< T >::type >::private_get_data ( )
inline

Definition at line 878 of file Encap.hpp.

◆ private_get_k()

template<unsigned int dim, typename T >
__device__ __host__ size_t encapc< dim, T, typename memory_traits_inte< T >::type >::private_get_k ( )
inline

Definition at line 886 of file Encap.hpp.

◆ private_set_data_k()

template<unsigned int dim, typename T >
__device__ __host__ void encapc< dim, T, typename memory_traits_inte< T >::type >::private_set_data_k ( Mem data_c,
size_t  k 
)
inline

Definition at line 869 of file Encap.hpp.

◆ private_set_k()

template<unsigned int dim, typename T >
__device__ __host__ size_t encapc< dim, T, typename memory_traits_inte< T >::type >::private_set_k ( unsigned int  k)
inline

Definition at line 894 of file Encap.hpp.

Field Documentation

◆ data

template<unsigned int dim, typename T >
Mem& encapc< dim, T, typename memory_traits_inte< T >::type >::data
private

reference to the encapsulated object

Definition at line 721 of file Encap.hpp.

◆ k

template<unsigned int dim, typename T >
size_t encapc< dim, T, typename memory_traits_inte< T >::type >::k
private

element id

Definition at line 724 of file Encap.hpp.

◆ max_prop

template<unsigned int dim, typename T >
const int encapc< dim, T, typename memory_traits_inte< T >::type >::max_prop = T::max_prop
static

number of properties

Definition at line 756 of file Encap.hpp.


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