std_db.hpp

См. документацию.
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 
00037 #if !defined( _OESS_1__DB__CLN__IMPL__STD_DB_HPP_ )
00038 #define _OESS_1__DB__CLN__IMPL__STD_DB_HPP_
00039 
00040 #include <auto_ptr_3/h/obj_ptr.hpp>
00041 
00042 #include <oess_1/db/cln/h/db.hpp>
00043 
00044 namespace oess_1 {
00045 
00046 namespace db {
00047 
00048 namespace cln {
00049 
00050 namespace impl {
00051 
00052 class ent_packer_base_t;
00053 class ent_unpacker_base_t;
00054 
00055 //
00056 // std_db_t
00057 //
00058 
00062 class std_db_t :
00063   public db_t
00064 {
00065   public :
00067     std_db_t(
00069       oess_1::db::site::abstract_connector_t * connector );
00070     virtual ~std_db_t();
00071 
00074     virtual void
00075     attach(
00076       const std::string & logic_name );
00077 
00078     virtual void
00079     detach();
00080 
00081     virtual void
00082     slice_create(
00083       const std::string & name );
00084 
00085     virtual void
00086     slice_destroy(
00087       const std::string & name );
00088 
00089     virtual bool
00090     slice_is_exists(
00091       const std::string & name );
00092 
00093     virtual std::set< std::string >
00094     slice_names();
00095 
00096     virtual oess_1::ent_id_t
00097     ent_create(
00098       const std::string & slice_name,
00099       const oess_1::stdsn::serializable_t & ent );
00100 
00101     virtual void
00102     ent_destroy(
00103       const oess_1::ent_id_t & ent_id );
00104 
00105     virtual void
00106     ent_destroy_all(
00107       const std::string & slice_name );
00108 
00109     virtual void
00110     ent_load(
00111       const oess_1::ent_id_t & ent_id,
00112       oess_1::stdsn::serializable_t & ent );
00113 
00114     virtual void
00115     ent_update(
00116       const oess_1::ent_id_t & ent_id,
00117       const oess_1::stdsn::serializable_t & ent );
00118 
00119     virtual oess_1::ent_id_t
00120     ent_find_next(
00121       const std::string & slice_name,
00122       const oess_1::ent_id_t & ent_id );
00123 
00124     virtual oess_1::ent_id_t
00125     ent_raw_create(
00126       const std::string & slice_name,
00127       oess_1::io::ibinstream_t & image,
00128       oess_1::uint_t image_size );
00129 
00130     virtual oess_1::uint_t
00131     ent_raw_load(
00132       const oess_1::ent_id_t & ent_id,
00133       oess_1::io::obinstream_t & to,
00134       oess_1::uint_t length_limit );
00135 
00136     virtual void
00137     ent_raw_update(
00138       const oess_1::ent_id_t & ent_id,
00139       oess_1::io::ibinstream_t & image,
00140       oess_1::uint_t image_size );
00143   protected :
00146     virtual void
00147     transaction_begin();
00148 
00149     virtual void
00150     transaction_commit();
00151 
00152     virtual void
00153     transaction_rollback();
00156   private :
00159     bool  m_is_attached;
00160 
00162 
00163     std::string m_logic_name;
00164 
00166     void
00167     cleanup();
00168 
00170     void
00171     must_be_attached() const;
00172 
00174 
00187     oess_1::ent_id_t
00188     do_ent_create_actions(
00190       const std::string & slice_name,
00192       const ent_packer_base_t & packer );
00193 
00195 
00206     void
00207     do_ent_load_actions(
00209       const oess_1::ent_id_t & ent,
00211       ent_unpacker_base_t & packer );
00212 
00214 
00225     void
00226     do_ent_update_actions(
00228       const oess_1::ent_id_t & ent,
00230       const ent_packer_base_t & packer );
00231 
00233 
00235     void
00236     transmit(
00238       oess_1::db::site::impl::request_t * req,
00239       oess_1::db::site::impl::resp_wrapper_t & resp_wrapper,
00240       oess_1::uint_t awaiting_resp_id );
00241 };
00242 
00243 } /* namespace impl */
00244 
00245 } /* namespace cln */
00246 
00247 } /* namespace db */
00248 
00249 } /* namespace oess_1 */
00250 
00251 #endif

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