StructuredNode.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_STRUCTUREDNODE_H
00014 #define _STORAGE_STRUCTUREDNODE_H
00015 
00021 #include <storage/IndexedTableNode.h>
00022 
00023 #if _SUPPORTS_NAMESPACE
00024 namespace palmos {
00025 namespace storage {
00026 #endif
00027 
00032 
00033 
00061 class BStructuredNode : public BIndexedDataNode
00062 {
00063 public:
00064     // --------------------------------------------------------------
00068                                     BStructuredNode(const SContext &context,
00069                                                     const char **entries, size_t entryCount,
00070                                                     uint32_t mode = IDatum::READ_ONLY);
00071 protected:
00072     virtual                         ~BStructuredNode();
00073 public:
00074 
00076 
00077     // --------------------------------------------------------------
00082 
00084     virtual ssize_t                 EntryIndexOfLocked(const SString& entry) const;
00086     virtual SString                 EntryNameAtLocked(size_t index) const;
00088     virtual size_t                  CountEntriesLocked() const;
00089 
00091 
00092     // --------------------------------------------------------------
00099 
00100     virtual SValue                  ValueAtLocked(size_t index) const = 0;
00102 
00104     virtual status_t                StoreValueAtLocked(size_t index, const SValue& value);
00105 
00107 
00108 private:
00109                                     BStructuredNode(const BStructuredNode&);
00110             BStructuredNode&        operator=(const BStructuredNode&);
00111 
00112             const char**            m_entries;
00113             const size_t            m_entryCount;
00114 };
00115 
00118 #if _SUPPORTS_NAMESPACE
00119 } } // namespace palmos::storage
00120 #endif
00121 
00122 #endif // _STORAGE_STRUCTUREDNODE_H