Chaste  Release::2018.1
SmartPointers.hpp File Reference
#include <boost/shared_ptr.hpp>
+ Include dependency graph for SmartPointers.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAKE_PTR_ABS(ABS_TYPE, TYPE, NAME, ARGS)   boost::shared_ptr<ABS_TYPE> NAME(new TYPE ARGS)
 
#define MAKE_PTR_ARGS(TYPE, NAME, ARGS)   MAKE_PTR_ABS(TYPE, TYPE, NAME, ARGS)
 
#define MAKE_PTR(TYPE, NAME)   MAKE_PTR_ABS(TYPE, TYPE, NAME, )
 
#define ASSIGN_PTR(NAME, TYPE, ARGS)   NAME.reset(new TYPE ARGS)
 

Detailed Description

Includes the Boost shared_ptr smart pointer, and defines some useful macros to save typing when using it.

Definition in file SmartPointers.hpp.

Macro Definition Documentation

#define ASSIGN_PTR (   NAME,
  TYPE,
  ARGS 
)    NAME.reset(new TYPE ARGS)

Create a new class instance and reset a smart pointer to point at it.

Parameters
NAMEthe name of the pointer variable
TYPEthe type of the concrete instance to create
ARGSconstructor arguments for the instance, in brackets

Definition at line 77 of file SmartPointers.hpp.

#define MAKE_PTR (   TYPE,
  NAME 
)    MAKE_PTR_ABS(TYPE, TYPE, NAME, )

Create a new instance of a class and assign it to a smart pointer.

Parameters
TYPEthe type of the concrete instance to create
NAMEthe name of the pointer variable

Definition at line 69 of file SmartPointers.hpp.

Referenced by Cell::Cell(), CryptSimulation1d::CryptSimulation1d(), and CryptSimulation2d::CryptSimulation2d().

#define MAKE_PTR_ABS (   ABS_TYPE,
  TYPE,
  NAME,
  ARGS 
)    boost::shared_ptr<ABS_TYPE> NAME(new TYPE ARGS)

Create a new instance of a class and assign it to a smart pointer.

Parameters
ABS_TYPEthe type of the base of the class hierarchy
TYPEthe type of the concrete instance to create
NAMEthe name of the pointer variable
ARGSconstructor arguments for the instance, in brackets

Definition at line 54 of file SmartPointers.hpp.

#define MAKE_PTR_ARGS (   TYPE,
  NAME,
  ARGS 
)    MAKE_PTR_ABS(TYPE, TYPE, NAME, ARGS)

Create a new instance of a class and assign it to a smart pointer.

Parameters
TYPEthe type of the concrete instance to create
NAMEthe name of the pointer variable
ARGSconstructor arguments for the instance, in brackets

Definition at line 62 of file SmartPointers.hpp.

Referenced by CryptSimulation1d::CryptSimulation1d(), CryptSimulation2d::CryptSimulation2d(), Cell::Divide(), CryptSimulation2d::SetBottomCellAncestors(), AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::SetCellAncestorsToLocationIndices(), and VertexBasedCellPopulation< SPACE_DIM >::SimulationSetupHook().