monotone

monotone Mtn Source Tree

Root/botan/allocate.h

1/*************************************************
2* Allocator Header File *
3* (C) 1999-2005 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_ALLOCATOR_H__
7#define BOTAN_ALLOCATOR_H__
8
9#include <botan/types.h>
10#include <string>
11
12namespace Botan {
13
14/*************************************************
15* Allocator *
16*************************************************/
17class Allocator
18 {
19 public:
20 virtual void* allocate(u32bit) const = 0;
21 virtual void deallocate(void*, u32bit) const = 0;
22
23 virtual void init() {}
24 virtual void destroy() {}
25
26 virtual ~Allocator() {}
27 };
28
29/*************************************************
30* Get an allocator *
31*************************************************/
32Allocator* get_allocator(const std::string& = "");
33
34/*************************************************
35* Set the default allocator type *
36*************************************************/
37std::string set_default_allocator(const std::string&);
38
39/*************************************************
40* Add new allocator type *
41*************************************************/
42bool add_allocator_type(const std::string&, Allocator*);
43
44}
45
46#endif

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status