OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
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.
 
template<unsigned int p, typename r_type = decltype(boost::fusion::at_c<p>(data_c))>
__device__ __host__ r_type get ()
 access the data
 
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
 
template<unsigned int p>
__device__ __host__ void set (decltype(boost::fusion::at_c< p >(data_c)) &ele)
 Set one property of the encapsulated object.
 
template<unsigned int dim2>
__device__ __host__ encapc< dim, T, Mem > & set (const encapc< dim2, T, Mem > &ec)
 Set one property of the encapsulated object.
 
__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.
 
bool operator== (const encapc< dim, T, Mem > &ec) const
 Compare.
 
bool operator!= (const encapc< dim, T, Mem > &ec) const
 Compare.
 

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 Typedef Documentation

◆ Mem

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

layout of the encapsulated object

Definition at line 455 of file Encap.hpp.

◆ Mem2

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

layout of the encapsulated object

Definition at line 458 of file Encap.hpp.

◆ T_type

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

original object

Definition at line 485 of file Encap.hpp.

◆ type

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

object type the encap object encapsulate

Definition at line 443 of file Encap.hpp.

◆ yes_i_am_encap

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

indicate the it is an encapsulated object

Definition at line 482 of file Encap.hpp.

Constructor & Destructor Documentation

◆ encapc()

template<unsigned int dim, typename T >
__device__ __host__ encapc< dim, T, typename memory_traits_lin< T >::type >::encapc ( type data_c)
inline

constructor from a reference object

Definition at line 491 of file Encap.hpp.

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 >
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&()

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=() [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 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.

◆ set() [2/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.

Field Documentation

◆ data_c

template<unsigned int dim, typename T >
type& encapc< dim, T, typename memory_traits_lin< T >::type >::data_c
private

reference to the encapsulated object

Definition at line 452 of file Encap.hpp.

◆ max_prop

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

number of properties

Definition at line 488 of file Encap.hpp.


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