db_content.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 
00038 #if !defined( _OESS_1__DB__IMPL__DB_CONTENT__DB_CONTENT_HPP_ )
00039 #define _OESS_1__DB__IMPL__DB_CONTENT__DB_CONTENT_HPP_
00040 
00041 #include <string>
00042 #include <set>
00043 #include <memory>
00044 
00045 #include <cpp_util_2/h/nocopy.hpp>
00046 
00047 #include <oess_1/defs/h/types.hpp>
00048 #include <oess_1/defs/h/ent_id.hpp>
00049 
00050 #include <oess_1/io/h/stream.hpp>
00051 
00052 #include <oess_1/db/h/declspec.hpp>
00053 
00054 #include <oess_1/db/storage/h/config.hpp>
00055 
00056 namespace oess_1 {
00057 
00058 namespace db {
00059 
00060 namespace impl {
00061 
00062 namespace db_content {
00063 
00064 //
00065 // db_content_t
00066 //
00067 
00072 class OESS_1__DB__TYPE  db_content_t
00073   : private cpp_util_2::nocopy_t
00074   {
00075   public :
00076     virtual ~db_content_t();
00077 
00079 
00080     static void
00081     db_create(
00083       const std::string & name,
00085       const oess_1::db::storage::config_t & config );
00086 
00088     static void
00089     db_destroy(
00090       const std::string & name );
00091 
00093     static bool
00094     db_is_exists(
00095       const std::string & name );
00096 
00100     virtual void
00101     open(
00103       const std::string & name,
00105       const oess_1::db::storage::config_t & config,
00107       bool is_read_only,
00111       bool is_auto_repair_enabled ) = 0;
00112 
00114     virtual void
00115     client_attach(
00116       const std::string & client_id ) = 0;
00117 
00119 
00126     virtual void
00127     client_detach(
00128       const std::string & client_id ) = 0;
00129 
00131     virtual oess_1::uint_t
00132     client_count() const = 0;
00133 
00135     virtual void
00136     slice_create(
00138       const std::string & client_id,
00140       const std::string & name ) = 0;
00141 
00143 
00146     virtual void
00147     slice_destroy(
00149       const std::string & client_id,
00151       const std::string & name ) = 0;
00152 
00154 
00158     virtual bool
00159     slice_is_exists(
00161       const std::string & client_id,
00163       const std::string & name ) = 0;
00164 
00166 
00169     virtual std::set< std::string >
00170     slice_names(
00172       const std::string & client_id ) = 0;
00173 
00175     virtual oess_1::ent_id_t
00176     ent_create(
00178       const std::string & client_id,
00180       const std::string & slice_name,
00182       oess_1::io::istream_t & ent_value,
00184       oess_1::uint_t ent_size ) = 0;
00185 
00187     virtual void
00188     ent_destroy(
00190       const std::string & client_id,
00192       const oess_1::ent_id_t & ent_id ) = 0;
00193 
00195     virtual void
00196     ent_destroy_all(
00198       const std::string & client_id,
00200       const std::string & slice_name ) = 0;
00201 
00203     virtual void
00204     ent_load(
00206       const std::string & client_id,
00208       const oess_1::ent_id_t & ent_id,
00210       oess_1::io::ostream_t & ent_value ) = 0;
00211 
00213     virtual void
00214     ent_update(
00216       const std::string & client_id,
00218       const oess_1::ent_id_t & ent_id,
00220       oess_1::io::istream_t & ent_value,
00222       oess_1::uint_t ent_size ) = 0;
00223 
00225 
00232     virtual oess_1::ent_id_t
00233     ent_find_next(
00235       const std::string & client_id,
00237       const std::string & slice_name,
00239       const oess_1::ent_id_t & ent_id ) = 0;
00240 
00242 
00243     virtual void
00244     transaction_begin(
00245       const std::string & client_id ) = 0;
00246 
00248 
00249     virtual void
00250     transaction_commit(
00251       const std::string & client_id ) = 0;
00252 
00254 
00255     virtual void
00256     transaction_rollback(
00257       const std::string & client_id ) = 0;
00258 };
00259 
00260 //
00261 // create_std_db_content
00262 //
00263 
00270 std::auto_ptr< db_content_t >
00271 create_std_db_content();
00272 
00273 } /* namespace db_content */
00274 
00275 } /* namespace impl */
00276 
00277 } /* namespace db */
00278 
00279 } /* namespace oess_1 */
00280 
00281 #endif

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