SmartPointers.hpp File Reference

#include <boost/shared_ptr.hpp>

Include dependency graph for SmartPointers.hpp:

Go to the source code of this file.

Defines

#define MAKE_PTR_A(ABS_TYPE, TYPE, NAME, ARGS)   boost::shared_ptr<ABS_TYPE> NAME(new TYPE ARGS)
#define MAKE_PTR(TYPE, NAME, ARGS)   MAKE_PTR_A(TYPE, TYPE, NAME, ARGS)
#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.


Define 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:
NAME the name of the pointer variable
TYPE the type of the concrete instance to create
ARGS constructor arguments for the instance, in brackets

Definition at line 63 of file SmartPointers.hpp.

#define MAKE_PTR ( TYPE,
NAME,
ARGS   )     MAKE_PTR_A(TYPE, TYPE, NAME, ARGS)

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

Parameters:
TYPE the type of the concrete instance to create
NAME the name of the pointer variable
ARGS constructor arguments for the instance, in brackets

Definition at line 55 of file SmartPointers.hpp.

#define MAKE_PTR_A ( 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_TYPE the type of the base of the class hierarchy
TYPE the type of the concrete instance to create
NAME the name of the pointer variable
ARGS constructor arguments for the instance, in brackets

Definition at line 47 of file SmartPointers.hpp.


Generated on Tue May 31 14:31:53 2011 for Chaste by  doxygen 1.5.5