| QxOrm 1.4.8 C++ Object Relational Mapping library

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Directories

- File List
- File Members

Classes | Namespaces | Defines
static_mem_pool.h File Reference
QxMemLeak : QxOrm library memory leak detection (by Wu Yongwei)
`#include <new>`
`#include <stdexcept>`
`#include <string>`
`#include <vector>`
`#include <assert.h>`
`#include <stddef.h>`
`#include "class_level_lock.h"`
`#include "mem_pool_base.h"`

Go to the source code of this file.

## Classes
class | qx::memory::static_mem_pool_set
class | qx::memory::static_mem_pool< _Sz, _Gid >
## Namespaces
namespace | qx
| Root namespace for all QxOrm library features.
namespace | qx::memory
| QxOrm library memory leak detection (by Wu Yongwei)
## Defines
#define | __PRIVATE private
#define | _STATIC_MEM_POOL_TRACE(_Lck, _Msg) ((void)0)
#define | DECLARE_STATIC_MEM_POOL(_Cls)
#define | DECLARE_STATIC_MEM_POOL__NOTHROW(_Cls)
#define | DECLARE_STATIC_MEM_POOL_GROUPED(_Cls, _Gid)
#define | DECLARE_STATIC_MEM_POOL_GROUPED__NOTHROW(_Cls, _Gid)
#define | PREPARE_STATIC_MEM_POOL(_Cls) std::cerr << "PREPARE_STATIC_MEM_POOL is obsolete!\n";
#define | PREPARE_STATIC_MEM_POOL_GROUPED(_Cls, _Gid) std::cerr << "PREPARE_STATIC_MEM_POOL_GROUPED is obsolete!\n";

## Detailed Description

Header file for the `static' memory pool.

Version:
  1.20, 2007/10/20

Author:
  Wu Yongwei

Definition in file static_mem_pool.h.

## Define Documentation

#define __PRIVATE private

Definition at line 65 of file static_mem_pool.h.

#define _STATIC_MEM_POOL_TRACE | ( |  | _Lck,
|  |  | _Msg
| ) |  | ((void)0)

Definition at line 81 of file static_mem_pool.h.

#define DECLARE_STATIC_MEM_POOL | ( |  | _Cls | ) |

Value:

    public: \
        static void* operator new(size_t __size) \
        { \
            assert(__size == sizeof(_Cls)); \
            void* __ptr; \
            __ptr = static_mem_pool<sizeof(_Cls)>:: \
                                   instance_known().allocate(); \
            if (__ptr == NULL) \
                throw std::bad_alloc(); \
            return __ptr; \
        } \
        static void operator delete(void* __ptr) \
        { \
            if (__ptr) \
                static_mem_pool<sizeof(_Cls)>:: \
                               instance_known().deallocate(__ptr); \
        }

Definition at line 314 of file static_mem_pool.h.

#define DECLARE_STATIC_MEM_POOL__NOTHROW | ( |  | _Cls | ) |

Value:

    public: \
        static void* operator new(size_t __size) throw() \
        { \
            assert(__size == sizeof(_Cls)); \
            return static_mem_pool<sizeof(_Cls)>:: \
                                  instance_known().allocate(); \
        } \
        static void operator delete(void* __ptr) \
        { \
            if (__ptr) \
                static_mem_pool<sizeof(_Cls)>:: \
                               instance_known().deallocate(__ptr); \
        }

Definition at line 333 of file static_mem_pool.h.

#define DECLARE_STATIC_MEM_POOL_GROUPED | ( |  | _Cls,
|  |  | _Gid
| ) |  |

Value:

    public: \
        static void* operator new(size_t __size) \
        { \
            assert(__size == sizeof(_Cls)); \
            void* __ptr; \
            __ptr = static_mem_pool<sizeof(_Cls), (_Gid)>:: \
                                   instance_known().allocate(); \
            if (__ptr == NULL) \
                throw std::bad_alloc(); \
            return __ptr; \
        } \
        static void operator delete(void* __ptr) \
        { \
            if (__ptr) \
                static_mem_pool<sizeof(_Cls), (_Gid)>:: \
                               instance_known().deallocate(__ptr); \
        }

Definition at line 348 of file static_mem_pool.h.

#define DECLARE_STATIC_MEM_POOL_GROUPED__NOTHROW | ( |  | _Cls,
|  |  | _Gid
| ) |  |

Value:

    public: \
        static void* operator new(size_t __size) throw() \
        { \
            assert(__size == sizeof(_Cls)); \
            return static_mem_pool<sizeof(_Cls), (_Gid)>:: \
                                  instance_known().allocate(); \
        } \
        static void operator delete(void* __ptr) \
        { \
            if (__ptr) \
                static_mem_pool<sizeof(_Cls), (_Gid)>:: \
                               instance_known().deallocate(__ptr); \
        }

Definition at line 367 of file static_mem_pool.h.

#define PREPARE_STATIC_MEM_POOL | ( |  | _Cls | ) | std::cerr << "PREPARE_STATIC_MEM_POOL is obsolete!\n";

Definition at line 383 of file static_mem_pool.h.

#define PREPARE_STATIC_MEM_POOL_GROUPED | ( |  | _Cls,
|  |  | _Gid
| ) |  | std::cerr << "PREPARE_STATIC_MEM_POOL_GROUPED is obsolete!\n";

Definition at line 387 of file static_mem_pool.h.