00001 /* ///////////////////////////////////////////////////////////////////////// 00002 * File: stlsoft/synch/singlethreaded_tss_index.hpp 00003 * 00004 * Purpose: An interface-compatible replacement for the tss_index 00005 * classes defined elsewhere in the libraries, for use in 00006 * single-threaded contexts. 00007 * 00008 * Created: 3rd February 2008 00009 * Updated: 10th August 2009 00010 * 00011 * Home: http://stlsoft.org/ 00012 * 00013 * Copyright (c) 2008-2009, Matthew Wilson and Synesis Software 00014 * All rights reserved. 00015 * 00016 * Redistribution and use in source and binary forms, with or without 00017 * modification, are permitted provided that the following conditions are met: 00018 * 00019 * - Redistributions of source code must retain the above copyright notice, this 00020 * list of conditions and the following disclaimer. 00021 * - Redistributions in binary form must reproduce the above copyright notice, 00022 * this list of conditions and the following disclaimer in the documentation 00023 * and/or other materials provided with the distribution. 00024 * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of 00025 * any contributors may be used to endorse or promote products derived from 00026 * this software without specific prior written permission. 00027 * 00028 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00029 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00030 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00031 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00032 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00033 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00034 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00035 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00036 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00037 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00038 * POSSIBILITY OF SUCH DAMAGE. 00039 * 00040 * ////////////////////////////////////////////////////////////////////// */ 00041 00042 00051 #ifndef STLSOFT_INCL_STLSOFT_SYNCH_HPP_SINGLE_THREADED_TSS_INDEX 00052 #define STLSOFT_INCL_STLSOFT_SYNCH_HPP_SINGLE_THREADED_TSS_INDEX 00053 00054 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION 00055 # define STLSOFT_VER_STLSOFT_SYNCH_HPP_SINGLE_THREADED_TSS_INDEX_MAJOR 1 00056 # define STLSOFT_VER_STLSOFT_SYNCH_HPP_SINGLE_THREADED_TSS_INDEX_MINOR 0 00057 # define STLSOFT_VER_STLSOFT_SYNCH_HPP_SINGLE_THREADED_TSS_INDEX_REVISION 2 00058 # define STLSOFT_VER_STLSOFT_SYNCH_HPP_SINGLE_THREADED_TSS_INDEX_EDIT 3 00059 #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */ 00060 00061 /* ///////////////////////////////////////////////////////////////////////// 00062 * Includes 00063 */ 00064 00065 #ifndef STLSOFT_INCL_STLSOFT_H_UNIXSTL 00066 # include <stlsoft/stlsoft.h> 00067 #endif /* !STLSOFT_INCL_STLSOFT_H_UNIXSTL */ 00068 00069 /* ///////////////////////////////////////////////////////////////////////// 00070 * Namespace 00071 */ 00072 00073 #ifndef _STLSOFT_NO_NAMESPACE 00074 namespace stlsoft 00075 { 00076 #endif /* _STLSOFT_NO_NAMESPACE */ 00077 00078 /* ///////////////////////////////////////////////////////////////////////// 00079 * Classes 00080 */ 00081 00087 class singlethreaded_tss_index 00088 { 00091 public: 00093 typedef singlethreaded_tss_index class_type; 00095 typedef void key_type; 00097 typedef void* value_type; 00099 00102 public: 00104 ss_explicit_k singlethreaded_tss_index() 00105 : m_value(NULL) 00106 {} 00108 ~singlethreaded_tss_index() stlsoft_throw_0() 00109 {} 00111 00114 public: 00116 void set_value(value_type value) 00117 { 00118 m_value = value; 00119 } 00121 value_type get_value() const 00122 { 00123 return m_value; 00124 } 00126 00129 private: 00130 value_type m_value; 00132 00135 private: 00136 singlethreaded_tss_index(class_type const&); 00137 class_type& operator =(class_type const&); 00139 }; 00140 00141 /* ////////////////////////////////////////////////////////////////////// */ 00142 00143 #ifndef _STLSOFT_NO_NAMESPACE 00144 } // namespace stlsoft 00145 #endif /* _STLSOFT_NO_NAMESPACE */ 00146 00147 /* ////////////////////////////////////////////////////////////////////// */ 00148 00149 #endif /* !STLSOFT_INCL_STLSOFT_SYNCH_HPP_SINGLE_THREADED_TSS_INDEX */ 00150 00151 /* ///////////////////////////// end of file //////////////////////////// */