mxnet
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Member Functions | List of all members
mxnet::common::LazyAllocArray< TElem > Class Template Reference

#include <lazy_alloc_array.h>

Collaboration diagram for mxnet::common::LazyAllocArray< TElem >:
Collaboration graph

Public Member Functions

 LazyAllocArray ()
 
template<typename FCreate >
std::shared_ptr< TElem > Get (int index, FCreate creator)
 Get element of corresponding index, if it is not created create by creator. More...
 
template<typename FVisit >
void ForEach (FVisit fvisit)
 for each not null element of the array, call fvisit More...
 
void Clear ()
 clear all the allocated elements in array More...
 

Constructor & Destructor Documentation

template<typename TElem >
mxnet::common::LazyAllocArray< TElem >::LazyAllocArray ( )
inline

Member Function Documentation

template<typename TElem >
void mxnet::common::LazyAllocArray< TElem >::Clear ( )
inline

clear all the allocated elements in array

template<typename TElem >
template<typename FVisit >
void mxnet::common::LazyAllocArray< TElem >::ForEach ( FVisit  fvisit)
inline

for each not null element of the array, call fvisit

Parameters
fvisita function of (size_t, TElem*)
template<typename TElem >
template<typename FCreate >
std::shared_ptr< TElem > mxnet::common::LazyAllocArray< TElem >::Get ( int  index,
FCreate  creator 
)
inline

Get element of corresponding index, if it is not created create by creator.

Parameters
indexthe array index position
creatora lambda function to create new element when needed.

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