00001 #ifndef STATIC_CONTAINER_LIST_H 00002 00003 #define STATIC_CONTAINER_LIST_H 00004 00005 /* 00006 zlib/libpng license 00007 ------------------- 00008 00009 Copyright (C) 2004 &o 00010 00011 This software is provided 'as-is', without any express or implied warranty. In n 00012 o event will the authors be held liable for any damages arising from the use of 00013 this software. 00014 00015 Permission is granted to anyone to use this software for any purpose, including 00016 commercial applications, and to alter it and redistribute it freely, subject to 00017 the following restrictions: 00018 00019 The origin of this software must not be misrepresented; you must not claim that 00020 you wrote the original software. If you use this software in a product, an ackno 00021 wledgment in the product documentation would be appreciated but is not required. 00022 00023 Altered source versions must be plainly marked as such, and must not be misrepre 00024 sented as being the original software. 00025 This notice may not be removed or altered from any source distribution. 00026 00027 project site : https://sourceforge.jp/projects/gslib/ 00028 my site : http://www.game-syokunin.com/ 00029 -------------------------------------------------------------------------------- 00030 00031 法的には、上記の原文のほうが有効なので、より厳密には日本語訳よりも原文を参考にし 00032 てください。日本語訳は、http://opensource.jp/licenses/zlib-license.html から頂い 00033 てきました。 00034 00035 zlib/libpngライセンス ( 日本語訳 ) 00036 00037 Copyright (C) 2004 &o 00038 00039 本ソフトウェアは「現状のまま」で、明示であるか暗黙であるかを問わず、何らの保証も 00040 なく提供されます。本ソフトウェアの使用によって生じるいかなる損害についても、作者 00041 は一切の責任を負わないものとします。 以下の制限に従う限り、商用アプリケーション 00042 を含めて、本ソフトウェアを任意の目的に使用し、自由に改変して再頒布することをすべ 00043 ての人に許可します。 00044 00045 本ソフトウェアの出自について虚偽の表示をしてはなりません。あなたがオリジナルのソ 00046 フトウェアを作成したと主張してはなりません。あなたが本ソフトウェアを製品内で使用 00047 する場合、製品の文書に謝辞をれていただければ幸いですが、必須ではありません。 00048 ソースを変更した場合は、そのことを明示しなければなりません。オリジナルのソフトウ 00049 ェアであるという虚偽の表示をしてはなりません。 00050 ソースの頒布物から、この表示を削除したり、表示の内容を変更したりしてはなりません 00051 。 00052 00053 project site : https://sourceforge.jp/projects/gslib/ 00054 my site : http://www.game-syokunin.com/ 00055 */ 00056 00057 00058 #include <gslib/static_container/lodge_list.h> 00059 #include <boost/utility.hpp> 00060 #include <gslib/static_container/list_node_pool.h> 00061 00062 namespace gslib { 00063 namespace static_container { 00064 00066 00072 template < typename Value, size_t MaxSize > 00073 class list : 00074 private boost::base_from_member< list_node_pool< Value, MaxSize > >, 00075 public lodge_list< Value >, 00076 public compare_methods< list< Value, MaxSize > > { 00077 00078 typedef boost::base_from_member< list_node_pool< Value, MaxSize > > pool; 00079 typedef lodge_list< Value > parent; 00080 public: 00081 list() : parent( pool::member ) {} 00082 00083 list( const list& other ) : parent( pool::member ) { 00084 insert( begin(), other.begin(), other.end() ); 00085 } 00086 list& operator = ( const list& other ) { 00087 if ( this != &other ) { 00088 clear(); 00089 insert( begin(), other.begin(), other.end() ); 00090 } 00091 return *this; 00092 } 00093 00095 bool full() const { 00096 return pool::member.full(); 00097 } 00098 00100 static size_type max_size() { 00101 return MaxSize; 00102 } 00103 }; 00104 } 00105 } 00106 00107 #endif