#include <support/Catalog.h>
Inheritance diagram for BCatalog:
Public Member Functions | |
virtual status_t | AddEntry (const SString &name, const SValue &entry) |
virtual ssize_t | AddEntryLocked (const SString &name, const SValue &entry, sptr< IBinder > *outEntry, bool *replaced) |
BCatalog (const SContext &context) | |
BCatalog () | |
virtual size_t | CountEntriesLocked () const |
Return the number of entries in this catalog. | |
virtual sptr< IDatum > | CreateDatum (SString *name, uint32_t flags, status_t *err) |
Create a new IDatum object inside of this catalog. | |
virtual sptr< INode > | CreateNode (SString *name, status_t *err) |
Create a new INode in this catalog. | |
virtual status_t | EntryAtLocked (size_t index, uint32_t flags, SValue *key, SValue *entry) |
Return the entry at the given index. | |
virtual void | InitAtom () |
Called the first time a strong reference is acquired. All significant object initialization should go here. | |
virtual lock_status_t | Lock () const |
Tie together the locks. | |
virtual status_t | LookupEntry (const SString &entry, uint32_t flags, SValue *node) |
Lookup an entry in this catalog. | |
virtual status_t | RemoveEntry (const SString &name) |
Remove an existing entry from the catalog. | |
virtual status_t | RenameEntry (const SString &entry, const SString &name) |
virtual status_t | StoreValueAtLocked (size_t index, const SValue &value) |
Change a value in the catalog. | |
virtual void | Unlock () const |
Unlock the datum's state. | |
virtual SValue | ValueAtLocked (size_t index) const |
Return the current value in the catalog. | |
Protected Member Functions | |
virtual sptr< INode > | InstantiateNodeLocked (const SString &name, status_t *err) |
You can override this to create something other than a BCatalog. | |
virtual void | OnEntryCreated (const SString &name, const sptr< IBinder > &entry) |
these are hook functions that get called when things happen | |
virtual void | OnEntryModified (const SString &name, const sptr< IBinder > &entry) |
virtual void | OnEntryRemoved (const SString &name) |
virtual void | OnEntryRenamed (const SString &old_name, const SString &new_name, const sptr< IBinder > &entry) |
virtual | ~BCatalog () |
|
|
|
|
|
|
|
Implements ICatalog. |
|
|
|
Return the number of entries in this catalog.
Implements BIndexedIterable. |
|
Create a new IDatum object inside of this catalog.
Note that the returned object may very well support other interfaces (including INode), however its main purpose is to hold data for you. Reimplemented from BIndexedCatalog. |
|
Create a new INode in this catalog.
This, along with CreateDatum(), is the mechanism you should normally use when entries in a particular catalog, because they allow the catalog to ensure that objects with the correct implementation are created. For example, if the catalog is on a filesystem, it will need to modify the filesystem data to hold the new structure and create and return a proxy object for the new entry it just created. Even in a generic catalog the use of this function is important, since it ensures objects are created in the same process as the parent directory. Consider, for example, an application that wishes to create a node with some data that will stay around after the application itself exits. Contrast this with AddEntry(), which if called with an IBinder object will place a reference to that object in the catalog. Reimplemented from BIndexedCatalog. |
|
Return the entry at the given index.
Implements BIndexedCatalog. |
|
Called the first time a strong reference is acquired. All significant object initialization should go here. You can override it and do any setup you need. Note that you do not need to call the SAtom implementation. (So you can derive from two different SAtom implementations and safely call down to both of their IncStrong() methods.)
Reimplemented from SAtom. Reimplemented in BPackageManager. |
|
You can override this to create something other than a BCatalog.
|
|
Tie together the locks.
Reimplemented from SDatumGeneratorInt. |
|
Lookup an entry in this catalog.
Implements BGenericNode. |
|
these are hook functions that get called when things happen
|
|
|
|
|
|
|
|
Remove an existing entry from the catalog.
Implements ICatalog. |
|
Implements ICatalog. |
|
Change a value in the catalog.
Implements SDatumGeneratorInt. |
|
Unlock the datum's state.
Reimplemented from SDatumGeneratorInt. |
|
Return the current value in the catalog.
Implements SDatumGeneratorInt. |