Object-oriented Scientific Computing Library: Version 0.910
Data Structures | Public Member Functions | Protected Types | Protected Attributes
pointer_2d_alloc< base_t > Class Template Reference

A simple class to provide an allocate() function for pointers. More...

#include <array.h>


Detailed Description

template<class base_t>
class pointer_2d_alloc< base_t >

This class uses new and delete and may throw a C++ exception in the usual way. It contains a simple garbage collection mechanism to assist in exception safety.

This class is used in columnify and cern_mroot.

Idea for Future:
There may be a slight issue here if the pointer allocation succeeds and the list insertion fails, and the user catches the exception thrown by the list insertion failure, then a memory leak will ensue. This might be partially ameliorated by counting allocations and insertions. This failure mechanism is rarely encountered in practice.

Definition at line 200 of file array.h.

Data Structures

struct  pointer_comp

Public Member Functions

void allocate (base_t **&v, size_t i, size_t j)
 Allocate v for i elements.
void free (base_t **&v, size_t i)
 Free memory.

Protected Types

typedef std::map< base_t
**, size_t, pointer_comp >
::iterator 
iter
 Iterator type.

Protected Attributes

std::map< base_t **, size_t,
pointer_comp
list
 Store allocated pointers.

The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).

Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads.