QxOrm  1.4.9
C++ Object Relational Mapping library
mem_pool_base.h
Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
00002 // vim:tabstop=4:shiftwidth=4:expandtab:
00003 
00004 /*
00005  * Copyright (C) 2004-2008 Wu Yongwei <adah at users dot sourceforge dot net>
00006  *
00007  * This software is provided 'as-is', without any express or implied
00008  * warranty.  In no event will the authors be held liable for any
00009  * damages arising from the use of this software.
00010  *
00011  * Permission is granted to anyone to use this software for any purpose,
00012  * including commercial applications, and to alter it and redistribute
00013  * it freely, subject to the following restrictions:
00014  *
00015  * 1. The origin of this software must not be misrepresented; you must
00016  *    not claim that you wrote the original software.  If you use this
00017  *    software in a product, an acknowledgement in the product
00018  *    documentation would be appreciated but is not required.
00019  * 2. Altered source versions must be plainly marked as such, and must
00020  *    not be misrepresented as being the original software.
00021  * 3. This notice may not be removed or altered from any source
00022  *    distribution.
00023  *
00024  * This file is part of Stones of Nvwa:
00025  *      http://sourceforge.net/projects/nvwa
00026  *
00027  */
00028 
00040 #ifndef QT_NO_DEBUG
00041 #ifndef _QX_MODE_RELEASE
00042 #if _QX_USE_MEM_LEAK_DETECTION
00043 
00044 #ifndef _MEM_POOL_BASE_H
00045 #define _MEM_POOL_BASE_H
00046 
00047 #ifdef _MSC_VER
00048 #pragma once
00049 #endif
00050 
00051 #include <stddef.h>
00052 
00053 namespace qx {
00054 namespace memory {
00055 
00059 class QX_DLL_EXPORT mem_pool_base
00060 {
00061 public:
00062     virtual ~mem_pool_base();
00063     virtual void recycle() = 0;
00064     static void* alloc_sys(size_t __size);
00065     static void dealloc_sys(void* __ptr);
00066 
00068     struct _Block_list { _Block_list* _M_next; };
00069 };
00070 
00071 } // namespace memory
00072 } // namespace qx
00073 
00074 #endif // _MEM_POOL_BASE_H
00075 #endif // _QX_USE_MEM_LEAK_DETECTION
00076 #endif // _QX_MODE_RELEASE
00077 #endif // QT_NO_DEBUG