slice_image_base.hpp

См. документацию.
00001 /*
00002 
00003 Copyright (c) 2002-2006, 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 
00043 #if !defined( _OESS_1__DB__CLN__SLICE_IMAGE_BASE_HPP_ )
00044 #define _OESS_1__DB__CLN__SLICE_IMAGE_BASE_HPP_
00045 
00046 #include <exception>
00047 
00048 #include <oess_1/db/h/declspec.hpp>
00049 
00050 #include <oess_1/db/cln/h/db.hpp>
00051 
00052 namespace oess_1
00053 {
00054 
00055 namespace db
00056 {
00057 
00058 namespace cln
00059 {
00060 
00061 namespace impl
00062 {
00063   struct  slice_image_base_data_t;
00064 } /* namespace impl */
00065 
00066 class slice_index_base_t;
00067 
00080 class OESS_1__DB__TYPE  slice_image_base_t
00081 {
00082 public:
00083     virtual ~slice_image_base_t();
00084 
00087   enum
00088   {
00091     auto_load = 0x1,
00094     auto_destroy_index = 0x2
00095   };
00096 
00102   virtual void
00103   attach(
00104     slice_index_base_t & index,
00109     unsigned int flags );
00110 
00116   virtual void
00117   detach(
00118     slice_index_base_t & index );
00119 
00121   oess_1::db::cln::db_t &
00122   query_db() const;
00123 
00125   const std::string &
00126   slice_name() const;
00127 
00128 protected :
00135   slice_image_base_t(
00136     oess_1::db::cln::db_t & db,
00137     const std::string & slice_name,
00140     unsigned int flags )
00141   throw( std::exception );
00142 
00148   void
00149   lo_clear();
00150 
00153   ent_id_t
00154   lo_insert( const oess_1::stdsn::serializable_t & o )
00155   throw( std::exception );
00156 
00159   void
00160   lo_erase( const oess_1::ent_id_t & id )
00161   throw( std::exception );
00162 
00165   void
00166   lo_update( const oess_1::ent_id_t & id,
00167     const oess_1::stdsn::serializable_t & o )
00168   throw( std::exception );
00169 
00172   void
00173   lo_refresh_indexes(
00174     const oess_1::ent_id_t & id,
00175     const oess_1::stdsn::serializable_t & o );
00176 
00177 private :
00179   auto_ptr_3::obj_ptr_t< impl::slice_image_base_data_t >  m_data;
00180 
00181 private :
00184   slice_image_base_t(
00185     const slice_image_base_t & o );
00186   slice_image_base_t &
00187   operator=(
00188     const slice_image_base_t & o );
00189 /* \} */
00190 };
00191 
00196 template< class Item >
00197 class slice_image_iface_t :
00198   public slice_image_base_t
00199 {
00200 public :
00201   virtual ~slice_image_iface_t()
00202   {}
00203 
00206   virtual oess_1::ent_id_t
00207   insert( const Item & o ) = 0;
00208 
00210   virtual void
00211   erase( const oess_1::ent_id_t & id ) = 0;
00212 
00215   virtual void
00216   update(
00217     const ent_id_t & id,
00218     const Item & o ) = 0;
00219 
00221   virtual void
00222   get(
00223     const ent_id_t & id,
00224     auto_ptr_3::soft_obj_ptr_t< Item > & o ) const = 0;
00225   
00234   virtual oess_1::ent_id_t
00235   next(
00236     const oess_1::ent_id_t & id ) const = 0;
00237 
00238 protected :
00239   slice_image_iface_t(
00240     oess_1::db::cln::db_t & db,
00241     const std::string & slice_name,
00244     unsigned int flags )
00245   throw( std::exception )
00246   :
00247     slice_image_base_t( db, slice_name, flags )
00248   {}
00249 };
00250 
00251 } /* namespace cln */
00252 
00253 } /* namespace db */
00254 
00255 } /* namespace oess_1 */
00256 
00257 #endif
00258 

Документация по ObjESSty. Последние изменения: Fri Oct 13 18:35:35 2006. Создано системой  doxygen 1.4.7
Hosted by uCoz