OpenFPM_pdata  1.1.0
Project that contain the implementation of distributed structures
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Pages
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 273 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

 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))>
r_type get ()
 access the data More...
 
template<unsigned int p, typename r_type = decltype(boost::fusion::at_c<p>(data_c))>
const r_type get () const
 access the data but return a constant reference More...
 
template<unsigned int p>
void set (decltype(boost::fusion::at_c< p >(data_c))&ele)
 Set one property of the encapsulated object. More...
 
template<unsigned int dim2>
encapc< dim, T, Mem > & set (const encapc< dim2, T, Mem > &ec)
 Set one property of the encapsulated object. More...
 
encapc< dim, T, Mem > & operator= (const encapc< dim, T, Mem > &ec)
 Assignment. More...
 
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
 

Private Attributes

typedata_c
 reference to the encapsulated object
 

Member Function Documentation

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

access the data

Returns
the reference

Definition at line 320 of file Encap.hpp.

template<unsigned int dim, typename T >
template<unsigned int p, typename r_type = decltype(boost::fusion::at_c<p>(data_c))>
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 334 of file Encap.hpp.

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 431 of file Encap.hpp.

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 309 of file Encap.hpp.

template<unsigned int dim, typename T >
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 383 of file Encap.hpp.

template<unsigned int dim, typename T >
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 399 of file Encap.hpp.

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 415 of file Encap.hpp.

template<unsigned int dim, typename T >
template<unsigned int p>
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 349 of file Encap.hpp.

template<unsigned int dim, typename T >
template<unsigned int dim2>
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 367 of file Encap.hpp.


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