Synesis Software STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ...

pantheios/util/memory/auto_buffer_selector.hpp

Go to the documentation of this file.
00001 /* /////////////////////////////////////////////////////////////////////////
00002  * File:        pantheios/util/memory/auto_buffer_selector.hpp
00003  *
00004  * Purpose:     Type generator template for defining stlsoft::auto_buffer
00005  *              specialisations.
00006  *
00007  * Created:     9th November 2007
00008  * Updated:     14th February 2010
00009  *
00010  * Home:        http://www.pantheios.org/
00011  *
00012  * Copyright (c) 2007-2010, Matthew Wilson and Synesis Software
00013  * All rights reserved.
00014  *
00015  * Redistribution and use in source and binary forms, with or without
00016  * modification, are permitted provided that the following conditions are
00017  * met:
00018  *
00019  * - Redistributions of source code must retain the above copyright notice,
00020  *   this list of conditions and the following disclaimer.
00021  * - Redistributions in binary form must reproduce the above copyright
00022  *   notice, this list of conditions and the following disclaimer in the
00023  *   documentation and/or other materials provided with the distribution.
00024  * - Neither the names of Matthew Wilson and Synesis Software nor the names
00025  *   of any contributors may be used to endorse or promote products derived
00026  *   from this software without specific prior written permission.
00027  *
00028  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
00029  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00030  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00031  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
00032  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00033  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00034  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00035  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00036  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00037  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00038  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00039  *
00040  * ////////////////////////////////////////////////////////////////////// */
00041 
00042 
00050 #ifndef PANTHEIOS_INCL_PANTHEIOS_UTIL_MEMORY_HPP_AUTO_BUFFER_SELECTOR
00051 #define PANTHEIOS_INCL_PANTHEIOS_UTIL_MEMORY_HPP_AUTO_BUFFER_SELECTOR
00052 
00053 /* /////////////////////////////////////////////////////////////////////////
00054  * Version information
00055  */
00056 
00057 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00058 # define PANTHEIOS_VER_PANTHEIOS_UTIL_MEMORY_HPP_AUTO_BUFFER_SELECTOR_MAJOR     1
00059 # define PANTHEIOS_VER_PANTHEIOS_UTIL_MEMORY_HPP_AUTO_BUFFER_SELECTOR_MINOR     2
00060 # define PANTHEIOS_VER_PANTHEIOS_UTIL_MEMORY_HPP_AUTO_BUFFER_SELECTOR_REVISION  2
00061 # define PANTHEIOS_VER_PANTHEIOS_UTIL_MEMORY_HPP_AUTO_BUFFER_SELECTOR_EDIT      10
00062 #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
00063 
00064 /* /////////////////////////////////////////////////////////////////////////
00065  * Includes
00066  */
00067 
00068 #ifndef PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS
00069 # include <pantheios/pantheios.h>
00070 #endif /* !PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS */
00071 
00072 #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
00073 # include <stlsoft/stlsoft.h>
00074 #endif /* !STLSOFT_INCL_STLSOFT_H_STLSOFT */
00075 
00076 #if defined(STLSOFT_COMPILER_IS_MSVC) && \
00077     _MSC_VER >= 1400
00078 # define PANTHEIOS_COMPILER_CF_STD_ALLOCATOR_SYMBOLS_MULTIPLY_DEFINED
00079 #endif /* compiler */
00080 
00081 #ifndef PANTHEIOS_COMPILER_CF_STD_ALLOCATOR_SYMBOLS_MULTIPLY_DEFINED
00082 # ifndef STLSOFT_INCL_STLSOFT_MEMORY_HPP_ALLOCATOR_SELECTOR
00083 #  include <stlsoft/memory/allocator_selector.hpp>
00084 # endif /* !STLSOFT_INCL_STLSOFT_MEMORY_HPP_ALLOCATOR_SELECTOR */
00085 #endif /* !PANTHEIOS_COMPILER_CF_STD_ALLOCATOR_SYMBOLS_MULTIPLY_DEFINED */
00086 #ifndef STLSOFT_INCL_STLSOFT_MEMORY_HPP_AUTO_BUFFER
00087 # include <stlsoft/memory/auto_buffer.hpp>
00088 #endif /* !STLSOFT_INCL_STLSOFT_MEMORY_HPP_AUTO_BUFFER */
00089 #ifdef PANTHEIOS_COMPILER_CF_STD_ALLOCATOR_SYMBOLS_MULTIPLY_DEFINED
00090 # ifndef STLSOFT_INCL_STLSOFT_MEMORY_HPP_MALLOC_ALLOCATOR
00091 #  include <stlsoft/memory/malloc_allocator.hpp>
00092 # endif /* !STLSOFT_INCL_STLSOFT_MEMORY_HPP_MALLOC_ALLOCATOR */
00093 #endif /* PANTHEIOS_COMPILER_CF_STD_ALLOCATOR_SYMBOLS_MULTIPLY_DEFINED */
00094 
00095 /* /////////////////////////////////////////////////////////////////////////
00096  * Namespace
00097  */
00098 
00099 #if !defined(PANTHEIOS_NO_NAMESPACE)
00100 namespace pantheios
00101 {
00102 namespace util
00103 {
00104 #endif /* !PANTHEIOS_NO_NAMESPACE */
00105 
00106 /* /////////////////////////////////////////////////////////////////////////
00107  * Classes
00108  */
00109 
00125 template<   typename    T
00126         ,   size_t      N
00127 #ifdef PANTHEIOS_COMPILER_CF_STD_ALLOCATOR_SYMBOLS_MULTIPLY_DEFINED
00128         ,   typename    A = stlsoft::malloc_allocator<T>
00129 #else /* ? PANTHEIOS_COMPILER_CF_STD_ALLOCATOR_SYMBOLS_MULTIPLY_DEFINED */
00130         ,   typename    A = ss_typename_type_def_k stlsoft::allocator_selector<T>::allocator_type
00131 #endif /* PANTHEIOS_COMPILER_CF_STD_ALLOCATOR_SYMBOLS_MULTIPLY_DEFINED */
00132         >
00133 struct auto_buffer_selector
00134 {
00136 #ifdef STLSOFT_AUTO_BUFFER_NEW_FORM
00137     typedef stlsoft::auto_buffer<T, N, A>           type;
00138 #else /* ? STLSOFT_AUTO_BUFFER_NEW_FORM */
00139     typedef stlsoft::auto_buffer<T, A, N>           type;
00140 #endif /* STLSOFT_AUTO_BUFFER_NEW_FORM */
00141 };
00142 
00143 /* /////////////////////////////////////////////////////////////////////////
00144  * Namespace
00145  */
00146 
00147 #if !defined(PANTHEIOS_NO_NAMESPACE)
00148 } /* namespace util */
00149 } /* namespace pantheios */
00150 #endif /* !PANTHEIOS_NO_NAMESPACE */
00151 
00152 /* /////////////////////////////////////////////////////////////////////////
00153  * Inclusion
00154  */
00155 
00156 #ifdef STLSOFT_PPF_pragma_once_SUPPORT
00157 # pragma once
00158 #endif /* STLSOFT_PPF_pragma_once_SUPPORT */
00159 
00160 /* ////////////////////////////////////////////////////////////////////// */
00161 
00162 #endif /* !PANTHEIOS_INCL_PANTHEIOS_UTIL_MEMORY_HPP_AUTO_BUFFER_SELECTOR */
00163 
00164 /* ///////////////////////////// end of file //////////////////////////// */

pantheios Library documentation Matthew Wilson & Synesis Software, 2006-2011 SourceForge.net Logo