IndexedDataNode.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_INDEXEDDATANODE_H
00014 #define _STORAGE_INDEXEDDATANODE_H
00015 
00021 #include <storage/MetaDataNode.h>
00022 #include <storage/IndexedIterable.h>
00023 #include <storage/DatumGeneratorInt.h>
00024 
00025 #if _SUPPORTS_NAMESPACE
00026 namespace palmos {
00027 namespace storage {
00028 #endif
00029 
00034 
00035 
00056 class BIndexedDataNode : public BMetaDataNode, public BIndexedIterable, public SDatumGeneratorInt
00057 {
00058 public:
00059     // --------------------------------------------------------------
00063                                     BIndexedDataNode(uint32_t mode = IDatum::READ_WRITE);
00064                                     BIndexedDataNode(const SContext& context, uint32_t mode = IDatum::READ_WRITE);
00065 protected:
00066     virtual                         ~BIndexedDataNode();
00067 public:
00068 
00070     virtual lock_status_t           Lock() const;
00072     virtual void                    Unlock() const;
00074     inline  SContext                Context() { return BMetaDataNode::Context(); }
00076     virtual SValue                  Inspect(const sptr<IBinder>& caller, const SValue& which, uint32_t flags);
00077 
00079 
00080     // --------------------------------------------------------------
00084 
00086     virtual status_t                LookupEntry(const SString& entry, uint32_t flags, SValue* node);
00088     virtual status_t                EntryAtLocked(const sptr<IndexedIterator>& it, size_t index, uint32_t flags, SValue* key, SValue* entry);
00090     virtual void                    ReportChangeAtLocked(size_t index, const sptr<IBinder>& editor, uint32_t changes, off_t start=-1, off_t length=-1);
00092 
00094             status_t                FetchEntryAtLocked(size_t index, uint32_t flags, SValue* entry);
00095 
00097 
00102     virtual bool                    AllowDataAtLocked(size_t index) const;
00103 
00105 
00106     // --------------------------------------------------------------
00111 
00113 
00114     virtual ssize_t                 EntryIndexOfLocked(const SString& entry) const = 0;
00116 
00118     virtual SString                 EntryNameAtLocked(size_t index) const = 0;
00119 
00121 
00122     // --------------------------------------------------------------
00127 
00129     virtual size_t                  CountEntriesLocked() const = 0;
00131     virtual SValue                  ValueAtLocked(size_t index) const = 0;
00133     virtual status_t                StoreValueAtLocked(size_t index, const SValue& value) = 0;
00134 
00136 
00137 private:
00138                                     BIndexedDataNode(const BIndexedDataNode&);
00139             BIndexedDataNode&       operator=(const BIndexedDataNode&);
00140 };
00141 
00142 // ==========================================================================
00143 // ==========================================================================
00144 
00147 #if _SUPPORTS_NAMESPACE
00148 } } // namespace palmos::storage
00149 #endif
00150 
00151 #endif // _STORAGE_INDEXEDDATANODE_H
00152