00001 /* 00002 00003 Copyright (c) 2002-2005, Yauheni Akhotnikau 00004 All rights reserved. 00005 00006 Redistribution and use in source and binary forms, with or without 00007 modification, are permitted provided that the following conditions are met: 00008 00009 - Redistributions of source code must retain the above copyright notice, this 00010 list of conditions and the following disclaimer. 00011 00012 - Redistributions in binary form must reproduce the above copyright notice, this 00013 list of conditions and the following disclaimer in the documentation and/or 00014 other materials provided with the distribution. 00015 00016 - The name of the author may not be used to endorse or promote products derived 00017 from this software without specific prior written permission. 00018 00019 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 00020 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00021 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 00022 EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00023 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 00024 OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00025 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00026 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 00027 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 00028 OF SUCH DAMAGE. 00029 00030 */ 00031 00032 /* 00033 ObjESSty-1 00034 */ 00035 #if !defined( _OESS_1__DB__STORAGE__IMPL__MEM_DIRTY_PAGE_STORAGE_HPP_ ) 00036 #define _OESS_1__DB__STORAGE__IMPL__MEM_DIRTY_PAGE_STORAGE_HPP_ 00037 00038 #include <map> 00039 00040 #include <oess_1/db/storage/h/dirty_page_storage.hpp> 00041 00042 namespace oess_1 { 00043 00044 namespace db { 00045 00046 namespace storage { 00047 00048 namespace impl { 00049 00050 // 00051 // mem_dirty_page_storage_t 00052 // 00053 00061 class mem_dirty_page_storage_t 00062 : public dirty_page_storage_t 00063 { 00064 public : 00065 mem_dirty_page_storage_t(); 00066 virtual ~mem_dirty_page_storage_t(); 00067 00070 virtual void 00071 put( 00072 const ref_loaded_page_t & page ); 00073 00074 virtual bool 00075 find( 00076 oess_1::uint_t page_ordinal, 00077 ref_loaded_page_t & receiver ) const; 00078 00079 virtual void 00080 for_each( dirty_page_actor_t & actor ) const; 00081 00082 virtual void 00083 clear(); 00084 00085 virtual oess_1::uint_t 00086 size() const; 00088 00089 private : 00091 typedef std::map< oess_1::uint_t, ref_loaded_page_t > pages_map_t; 00092 00094 pages_map_t m_pages; 00095 }; 00096 00097 } /* namespace impl */ 00098 00099 } /* namespace storage */ 00100 00101 } /* namespace db */ 00102 00103 } /* namespace oess */ 00104 00105 #endif 00106