std_entity_stream.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 
00036 #if !defined( _OESS_1__DB__STORAGE__IMPL__STD_ENTITY_STREAM_HPP_ )
00037 #define _OESS_1__DB__STORAGE__IMPL__STD_ENTITY_STREAM_HPP_
00038 
00039 #include <oess_1/stdsn/h/serializable.hpp>
00040 
00041 #include <oess_1/db/storage/h/entity_stream.hpp>
00042 
00043 namespace oess_1 {
00044 
00045 namespace db {
00046 
00047 namespace storage {
00048 
00049 namespace impl {
00050 
00051 //
00052 // stream_desc_t
00053 //
00054 
00063 class OESS_1__DB__TYPE  stream_desc_t
00064   : public oess_1::stdsn::serializable_t
00065   {
00066     typedef oess_1::stdsn::serializable_t base_type_t;
00067     OESS_SERIALIZER( stream_desc_t )
00068 
00069   public :
00071     stream_desc_t();
00073     stream_desc_t(
00074       const stream_desc_t & o );
00075     virtual ~stream_desc_t();
00076 
00078     stream_desc_t &
00079     operator=(
00080       const stream_desc_t & o );
00081 
00083     chain_id_t
00084     first() const;
00085 
00087     void
00088     set_first(
00089       const chain_id_t & chain );
00090 
00092     chain_id_t
00093     last() const;
00094 
00096     void
00097     set_last(
00098       const chain_id_t & chain );
00099 
00100   private :
00102     chain_id_t  m_first;
00104     chain_id_t  m_last;
00105   };
00106 
00107 //
00108 // stream_item_t
00109 //
00110 
00120 class OESS_1__DB__TYPE  stream_item_t
00121   : public oess_1::stdsn::serializable_t
00122   {
00123     typedef oess_1::stdsn::serializable_t base_type_t;
00124     OESS_SERIALIZER( stream_item_t )
00125 
00126   public :
00128     stream_item_t();
00130     stream_item_t(
00132       const chain_id_t & description_chain,
00134       const chain_id_t & prev,
00136       oess_1::uint_t & length,
00138       const chain_id_t & entity_chain );
00140     stream_item_t(
00141       const stream_item_t & o );
00142     virtual ~stream_item_t();
00143 
00144     enum
00145       {
00147 
00151         length_limit = 32
00152       };
00153   
00155     stream_item_t &
00156     operator=(
00157       const stream_item_t & o );
00158 
00160     chain_id_t
00161     description_chain() const;
00162 
00164     void
00165     set_description_chain(
00166       const chain_id_t & chain );
00167 
00169     chain_id_t
00170     prev() const;
00171 
00173     void
00174     set_prev(
00175       const chain_id_t & chain );
00176 
00178     chain_id_t
00179     next() const;
00180 
00182     void
00183     set_next(
00184       const chain_id_t & chain );
00185 
00187     void
00188     set_entity_params(
00190       oess_1::uint_t length,
00192       const chain_id_t & chain );
00193 
00195     oess_1::uint_t
00196     length() const;
00197 
00199     const chain_id_t &
00200     entity_chain() const;
00201 
00202   private :
00204     chain_id_t  m_description_chain;
00206     chain_id_t  m_prev;
00208     chain_id_t  m_next;
00210     oess_1::uint_t  m_length;
00212     chain_id_t  m_entity_chain;
00213   };
00214 
00215 /*
00216 ** std_entity_stream_t
00217 */
00218 
00229 class std_entity_stream_t
00230   : public entity_stream_t
00231   {
00232   public :
00234     std_entity_stream_t(
00236       chain_storage_t & storage,
00238       oess_1::uint_t id,
00241       const chain_id_t & description_chain );
00242     virtual ~std_entity_stream_t();
00243 
00246     virtual oess_1::uint_t
00247     id() const;
00248 
00249     virtual chain_id_t
00250     entity_create(
00251       oess_1::io::istream_t & ent_value,
00252       oess_1::uint_t ent_size );
00253 
00254     virtual void
00255     entity_load(
00256       const chain_id_t & ent_id,
00257       oess_1::io::ostream_t & ent_value ) const;
00258 
00259     virtual void
00260     entity_update(
00261       const chain_id_t & ent_id,
00262       oess_1::io::istream_t & ent_value,
00263       oess_1::uint_t ent_size );
00264 
00265     virtual void
00266     entity_destroy(
00267       const chain_id_t & ent_id );
00268 
00269     virtual void
00270     entity_destroy_all();
00271 
00272     virtual chain_id_t 
00273     entity_find_next(
00274       const chain_id_t & ent_id ) const;
00276 
00277   private :
00279     chain_storage_t & m_storage;
00281     oess_1::uint_t m_id;
00284     chain_id_t  m_description_chain;
00285 
00287     stream_desc_t m_desc;
00288   };
00289 
00290 } /* namespace impl */
00291 
00292 } /* namespace storage */
00293 
00294 } /* namespace db */
00295 
00296 } /* namespace oess_1 */
00297 
00298 #endif
00299 

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