# PhasicFlow: MapPtr< Container, Key, T > Class Template Reference
PhasicFlow is an open-source parallel DEM (discrete element method) package for simulating granular flow. It is developed in C++ and can be exectued on both GPU (like CUDA) and CPU.

MapPtr< Container, Key, T > Class Template Reference
Inheritance diagram for MapPtr< Container, Key, T >:
[legend]

## Public Types

using | MapPtrType = MapPtr< Container, Key, T >
using | mapType = Container< Key, T * >
using | keyType = typename mapType::key_type
using | mappedType = typename mapType::mapped_type
using | valueType = typename mapType::value_type
using | reference = typename mapType::reference
using | constReference = typename mapType::const_reference
using | iterator = typename mapType::iterator
using | constIterator = typename mapType::const_iterator

## Public Member Functions

| TypeInfoTemplateNV11 ("MapPtr", Key)
| MapPtr ()
| MapPtr (const MapPtrType &src)
MapPtrType & | operator= (const MapPtrType &rhs)
| MapPtr (MapPtrType &&src)
MapPtrType & | operator= (MapPtrType &&rhs)
uniquePtr< MapPtrType > | clone () const
MapPtrType * | clonePtr () const
| ~MapPtr ()
bool | insertReplace (const keyType &key, T *ptr)
bool | insertReplace (const keyType &key, uniquePtr< T > &ptr)
template<typename... Args>
bool | insertReplaceSafe (const keyType &key, Args &&... args)
T * | set (const keyType &key, T *ptr)
uniquePtr< T > | set (const keyType &key, uniquePtr< T > &ptr)
template<typename... Args>
uniquePtr< T > | setSafe (const keyType &key, Args &&... args)
T & | operator[] (const keyType &key)
const T & | operator[] (const keyType &key) const
bool | search (const keyType k) const
std::pair< const T *, bool > | find (const keyType &k) const
std::pair< T *, bool > | find (const keyType &k)
uniquePtr< T > | release (const keyType &k)
void | erase (const keyType &key)
void | clear ()
size_t | size () const
auto | empty () const
iterator | begin ()
constIterator | begin () const
iterator | end ()
constIterator | end () const
template<typename... Args>
pFlow::uniquePtr< T > | setSafe (const keyType &key, Args &&... args)

## Static Public Member Functions

template<typename... Args>
static uniquePtr< T > | makeSafe (Args &&... args)

## Protected Member Functions

bool | copy (const MapPtrType &src)
T * | findPtr (const keyType &k)
const T * | findPtr (const keyType &k) const

## Protected Attributes

Container< Key, T * > | map_

## Detailed Description

### template<template< class, class > class Container, class Key, class T>
class pFlow::MapPtr< Container, Key, T >

Definition at line 39 of file MapPtr.hpp.

## Member Typedef Documentation

## MapPtrType

using MapPtrType = MapPtr<Container, Key, T>

Definition at line 44 of file MapPtr.hpp.

## mapType

using mapType = Container<Key, T*>

Definition at line 46 of file MapPtr.hpp.

## keyType

using keyType = typename mapType::key_type

Definition at line 48 of file MapPtr.hpp.

## mappedType

using mappedType = typename mapType::mapped_type

Definition at line 50 of file MapPtr.hpp.

## valueType

using valueType = typename mapType::value_type

Definition at line 52 of file MapPtr.hpp.

## reference

using reference = typename mapType::reference

Definition at line 54 of file MapPtr.hpp.

## constReference

using constReference = typename mapType::const_reference

Definition at line 56 of file MapPtr.hpp.

## iterator

using iterator = typename mapType::iterator

Definition at line 58 of file MapPtr.hpp.

## constIterator

using constIterator = typename mapType::const_iterator

Definition at line 60 of file MapPtr.hpp.

## Constructor & Destructor Documentation

## MapPtr() [1/3]

MapPtr | ( |  | ) |

inline

Definition at line 92 of file MapPtr.hpp.

## MapPtr() [2/3]

MapPtr | ( | const MapPtrType & | src | ) |

Definition at line 77 of file MapPtrI.hpp.

## MapPtr() [3/3]

MapPtr | ( | MapPtrType && | src | ) |

Definition at line 119 of file MapPtrI.hpp.

## ~MapPtr()

~MapPtr | ( |  | ) |

inline

Definition at line 127 of file MapPtr.hpp.

## Member Function Documentation

## makeSafe()

static uniquePtr<T> makeSafe | ( | Args &&... | args | ) |

inlinestatic

Definition at line 63 of file MapPtr.hpp.

## copy()

bool copy | ( | const MapPtrType & | src | ) |

protected

Definition at line 24 of file MapPtrI.hpp.

## findPtr() [1/2]

T * findPtr | ( | const keyType & | k | ) |

protected

Definition at line 53 of file MapPtrI.hpp.

## findPtr() [2/2]

const T * findPtr | ( | const keyType & | k | ) | const

protected

Definition at line 65 of file MapPtrI.hpp.

## TypeInfoTemplateNV11()

TypeInfoTemplateNV11 | ( | "MapPtr< Container, Key, T >" | ,
|  | Key |
| ) |  |

## operator=() [1/2]

pFlow::MapPtr< Container, Key, T > & operator= | ( | const MapPtrType & | rhs | ) |

Definition at line 93 of file MapPtrI.hpp.

## operator=() [2/2]

pFlow::MapPtr< Container, Key, T > & operator= | ( | MapPtrType && | rhs | ) |

Definition at line 128 of file MapPtrI.hpp.

## clone()

uniquePtr<MapPtrType> clone | ( |  | ) | const

inline

Definition at line 117 of file MapPtr.hpp.

## clonePtr()

MapPtrType* clonePtr | ( |  | ) | const

inline

Definition at line 122 of file MapPtr.hpp.

## insertReplace() [1/2]

bool insertReplace | ( | const keyType & | key,
|  | T * | ptr
| ) |  |

Definition at line 142 of file MapPtrI.hpp.

## insertReplace() [2/2]

bool insertReplace | ( | const keyType & | key,
|  | uniquePtr< T > & | ptr
| ) |  |

Definition at line 157 of file MapPtrI.hpp.

## insertReplaceSafe()

bool insertReplaceSafe | ( | const keyType & | key,
|  | Args &&... | args
| ) |  |

Definition at line 175 of file MapPtrI.hpp.

## set() [1/2]

T * set | ( | const keyType & | key,
|  | T * | ptr
| ) |  |

Definition at line 187 of file MapPtrI.hpp.

## set() [2/2]

pFlow::uniquePtr< T > set | ( | const keyType & | key,
|  | uniquePtr< T > & | ptr
| ) |  |

Definition at line 200 of file MapPtrI.hpp.

## setSafe() [1/2]

uniquePtr<T> setSafe | ( | const keyType & | key,
|  | Args &&... | args
| ) |  |

## operator[]() [1/2]

T & operator[] | ( | const keyType & | key | ) |

Definition at line 225 of file MapPtrI.hpp.

## operator[]() [2/2]

const T & operator[] | ( | const keyType & | key | ) | const

Definition at line 242 of file MapPtrI.hpp.

## search()

bool search | ( | const keyType | k | ) | const

Definition at line 260 of file MapPtrI.hpp.

## find() [1/2]

std::pair< const T *, bool > find | ( | const keyType & | k | ) | const

Definition at line 271 of file MapPtrI.hpp.

## find() [2/2]

std::pair< T *, bool > find | ( | const keyType & | k | ) |

Definition at line 283 of file MapPtrI.hpp.

## release()

pFlow::uniquePtr< T > release | ( | const keyType & | k | ) |

Definition at line 294 of file MapPtrI.hpp.

## erase()

void erase | ( | const keyType & | key | ) |

Definition at line 306 of file MapPtrI.hpp.

## clear()

void clear

Definition at line 320 of file MapPtrI.hpp.

Referenced by MapPtr< pFlow::iEntry >::~MapPtr().

Here is the caller graph for this function:

## size()

size_t size | ( |  | ) | const

inline

Definition at line 190 of file MapPtr.hpp.

## empty()

auto empty | ( |  | ) | const

inline

Definition at line 196 of file MapPtr.hpp.

## begin() [1/2]

iterator begin | ( |  | ) |

inline

Definition at line 202 of file MapPtr.hpp.

Referenced by MapPtr< pFlow::iEntry >::copy().

Here is the caller graph for this function:

## begin() [2/2]

constIterator begin | ( |  | ) | const

inline

Definition at line 207 of file MapPtr.hpp.

## end() [1/2]

iterator end | ( |  | ) |

inline

Definition at line 212 of file MapPtr.hpp.

Referenced by MapPtr< pFlow::iEntry >::copy().

Here is the caller graph for this function:

## end() [2/2]

constIterator end | ( |  | ) | const

inline

Definition at line 217 of file MapPtr.hpp.

## setSafe() [2/2]

pFlow::uniquePtr<T> setSafe | ( | const keyType & | key,
|  | Args &&... | args
| ) |  |

Definition at line 214 of file MapPtrI.hpp.

## Member Data Documentation

## map_

Container<Key, T*> map_

protected

Definition at line 71 of file MapPtr.hpp.

Referenced by MapPtr< pFlow::iEntry >::begin(), MapPtr< pFlow::iEntry >::empty(), MapPtr< pFlow::iEntry >::end(), and MapPtr< pFlow::iEntry >::size().

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

- src/phasicFlow/containers/Map/MapPtr/MapPtr.hpp
- src/phasicFlow/containers/Map/MapPtr/MapPtrI.hpp