Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

vtkContainersAllocatorBase.h

Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
00002  *
00003  * $Id: vtkContainersAllocatorBase.h,v 1.1 2005/07/04 06:29:44 xpxqx Exp $
00004  *
00005  * Copyright (c) 2005 Sean McInerney
00006  * All rights reserved.
00007  *
00008  * See Copyright.txt or http://vtkcontainers.sourceforge.net/Copyright.html
00009  * for details.
00010  *
00011  *    This software is distributed WITHOUT ANY WARRANTY; without even 
00012  *    the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013  *    PURPOSE.  See the above copyright notice for more information.
00014  *
00015  */
00017 // The Loki Library
00018 // Copyright (c) 2001 by Andrei Alexandrescu
00019 // This code accompanies the book:
00020 // Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design 
00021 //     Patterns Applied". Copyright (c) 2001. Addison-Wesley.
00022 // Permission to use, copy, modify, distribute and sell this software for any 
00023 //     purpose is hereby granted without fee, provided that the above copyright 
00024 //     notice appear in all copies and that both that copyright notice and this 
00025 //     permission notice appear in supporting documentation.
00026 // The author or Addison-Wesley Longman make no representations about the 
00027 //     suitability of this software for any purpose. It is provided "as is" 
00028 //     without express or implied warranty.
00030 #ifndef VTK_CONTAINERS_ALLOCATOR_BASE_H_
00031 #  define VTK_CONTAINERS_ALLOCATOR_BASE_H_
00032 #  include "vtkContainersAllocatorBaseManager.h" // Singleton initialization.
00033 
00034 #  ifndef VTK_DEFAULT_CHUNK_SIZE
00035 #    define VTK_DEFAULT_CHUNK_SIZE 4096
00036 #  endif
00037 
00038 #  ifndef VTK_MAX_SMALL_OBJECT_SIZE
00039 #    define VTK_MAX_SMALL_OBJECT_SIZE 64
00040 #  endif
00041 
00042 class VTK_CONTAINERS_EXPORT vtkContainersAllocatorBase
00043 {
00044 protected:
00045   static vtkContainersAllocatorBase* Instance;
00046 
00047   vtkContainersAllocatorBase (void);
00048   ~vtkContainersAllocatorBase();
00049     
00050   void* _allocate (size_t numBytes);
00051   void  _deallocate (void* p, size_t size);
00052 
00053 private:
00054   // Singleton management functions.
00055   static void   ClassInitialize (void);
00056   static void   ClassFinalize (void);
00057 
00058   //BTX
00059   friend class vtkContainersAllocatorBaseManager;
00060   //ETX
00061 };
00062 
00063 #endif /* VTK_CONTAINERS_ALLOCATOR_BASE_H_ */
00064 /* 
00065  * End of: $Id: vtkContainersAllocatorBase.h,v 1.1 2005/07/04 06:29:44 xpxqx Exp $.
00066  * 
00067  */

Generated on Thu Jul 14 14:39:37 2005 for vtkContainers by doxygen 1.3.6