- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages
- Examples

# fastformat/util/memory/auto_buffer_selector.hpp

Go to the documentation of this file.

    00001 /* /////////////////////////////////////////////////////////////////////////
    00002  * File:        fastformat/util/memory/auto_buffer_selector.hpp
    00003  *
    00004  * Purpose:     Type generator template for defining stlsoft::auto_buffer
    00005  *              specialisations.
    00006  *
    00007  * Created:     22nd April 2008
    00008  * Updated:     7th March 2010
    00009  *
    00010  * Home:        http://www.fastformat.org/
    00011  *
    00012  * Copyright (c) 2008-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 FASTFORMAT_INCL_FASTFORMAT_UTIL_MEMORY_HPP_AUTO_BUFFER_SELECTOR
    00051 #define FASTFORMAT_INCL_FASTFORMAT_UTIL_MEMORY_HPP_AUTO_BUFFER_SELECTOR
    00052
    00053 /* /////////////////////////////////////////////////////////////////////////
    00054  * Version information
    00055  */
    00056
    00057 #ifndef FASTFORMAT_DOCUMENTATION_SKIP_SECTION
    00058 # define FASTFORMAT_VER_FASTFORMAT_UTIL_MEMORY_HPP_AUTO_BUFFER_SELECTOR_MAJOR     2
    00059 # define FASTFORMAT_VER_FASTFORMAT_UTIL_MEMORY_HPP_AUTO_BUFFER_SELECTOR_MINOR     0
    00060 # define FASTFORMAT_VER_FASTFORMAT_UTIL_MEMORY_HPP_AUTO_BUFFER_SELECTOR_REVISION  2
    00061 # define FASTFORMAT_VER_FASTFORMAT_UTIL_MEMORY_HPP_AUTO_BUFFER_SELECTOR_EDIT      12
    00062 #endif /* !FASTFORMAT_DOCUMENTATION_SKIP_SECTION */
    00063
    00064 /* /////////////////////////////////////////////////////////////////////////
    00065  * Includes
    00066  */
    00067
    00068 #ifndef FASTFORMAT_INCL_FASTFORMAT_H_FASTFORMAT
    00069 # include <fastformat/fastformat.h>
    00070 #endif /* !FASTFORMAT_INCL_FASTFORMAT_H_FASTFORMAT */
    00071
    00072 #ifndef FASTFORMAT_INCL_FASTFORMAT_INTERNAL_HPP_STLSOFT
    00073 # include <fastformat/internal/stlsoft.h>
    00074 #endif /* !FASTFORMAT_INCL_FASTFORMAT_INTERNAL_HPP_STLSOFT */
    00075
    00076 #if defined(STLSOFT_COMPILER_IS_MSVC) && \
    00077     _MSC_VER >= 1400
    00078 # define FASTFORMAT_COMPILER_CF_STD_ALLOCATOR_SYMBOLS_MULTIPLY_DEFINED
    00079 #endif /* compiler */
    00080
    00081 #ifndef FASTFORMAT_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 /* !FASTFORMAT_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 FASTFORMAT_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 /* FASTFORMAT_COMPILER_CF_STD_ALLOCATOR_SYMBOLS_MULTIPLY_DEFINED */
    00094
    00095 /* /////////////////////////////////////////////////////////////////////////
    00096  * Namespace
    00097  */
    00098
    00099 #if !defined(FASTFORMAT_NO_NAMESPACE)
    00100 namespace fastformat
    00101 {
    00102 namespace util
    00103 {
    00104 #endif /* !FASTFORMAT_NO_NAMESPACE */
    00105
    00106 /* /////////////////////////////////////////////////////////////////////////
    00107  * Classes
    00108  */
    00109
    00125 template<   typename    T
    00126         ,   size_t      N
    00127 #ifdef FASTFORMAT_COMPILER_CF_STD_ALLOCATOR_SYMBOLS_MULTIPLY_DEFINED
    00128         ,   typename    A = stlsoft::malloc_allocator<T>
    00129 #else /* ? FASTFORMAT_COMPILER_CF_STD_ALLOCATOR_SYMBOLS_MULTIPLY_DEFINED */
    00130         ,   typename    A = ss_typename_type_def_k stlsoft::allocator_selector<T>::allocator_type
    00131 #endif /* FASTFORMAT_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(FASTFORMAT_NO_NAMESPACE)
    00148 } /* namespace util */
    00149 } /* namespace fastformat */
    00150 #endif /* !FASTFORMAT_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 /* !FASTFORMAT_INCL_FASTFORMAT_UTIL_MEMORY_HPP_AUTO_BUFFER_SELECTOR */
    00163
    00164 /* ///////////////////////////// end of file //////////////////////////// */

FastFormat Library documentation © Matthew Wilson, 2006-2009 |