ValueDatum.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2005 Palmsource, Inc.
00003  * 
00004  * This software is licensed as described in the file LICENSE, which
00005  * you should have received as part of this distribution. The terms
00006  * are also available at http://www.openbinder.org/license.html.
00007  * 
00008  * This software consists of voluntary contributions made by many
00009  * individuals. For the exact contribution history, see the revision
00010  * history and logs, available at http://www.openbinder.org
00011  */
00012 
00013 #ifndef _STORAGE_VALUEDATUM_H
00014 #define _STORAGE_VALUEDATUM_H
00015 
00021 #include <storage/StreamDatum.h>
00022 
00023 #if _SUPPORTS_NAMESPACE
00024 namespace palmos {
00025 namespace storage {
00026 #endif
00027 
00032 // ==========================================================================
00033 // ==========================================================================
00034 
00036 
00050 class BValueDatum : public BStreamDatum
00051 {
00052 public:
00053     // --------------------------------------------------------------
00057                                     BValueDatum(uint32_t mode = IDatum::READ_WRITE);
00058                                     BValueDatum(const SContext& context, uint32_t mode = IDatum::READ_WRITE);
00059                                     BValueDatum(const SValue& value, uint32_t mode = IDatum::READ_WRITE);
00060                                     BValueDatum(const SContext& context, const SValue& value, uint32_t mode = IDatum::READ_WRITE);
00061 protected:
00062     virtual                         ~BValueDatum();
00063 public:
00064 
00066 
00067     // --------------------------------------------------------------
00072 
00074     virtual uint32_t                ValueTypeLocked() const;
00076 
00079     virtual status_t                StoreValueTypeLocked(uint32_t type);
00081     virtual off_t                   SizeLocked() const;
00083     virtual status_t                StoreSizeLocked(off_t size);
00085     virtual SValue                  ValueLocked() const;
00087     virtual status_t                StoreValueLocked(const SValue& value);
00088 
00090     virtual const void*             StartReadingLocked( const sptr<Stream>& stream, off_t position,
00091                                                         ssize_t* inoutSize, uint32_t flags) const;
00093     virtual void                    FinishReadingLocked(const sptr<Stream>& stream, const void* data) const;
00095     virtual void*                   StartWritingLocked( const sptr<Stream>& stream, off_t position,
00096                                                         ssize_t* inoutSize, uint32_t flags);
00098     virtual void                    FinishWritingLocked(const sptr<Stream>& stream, void* data);
00099 
00100 private:
00101                                     BValueDatum(const BValueDatum&);
00102             BValueDatum&            operator=(const BValueDatum&);
00103 
00104             SValue                  m_value;
00105             size_t                  m_writeLen;
00106 };
00107 
00108 // ==========================================================================
00109 // ==========================================================================
00110 
00113 #if _SUPPORTS_NAMESPACE
00114 } } // namespace palmos::storage
00115 #endif
00116 
00117 #endif // _STORAGE_VALUEDATUM_H