#include <storage/CatalogDelegate.h>
Inheritance diagram for BCatalogDelegate:
Given an existing object that implements one or more of the INode, IIterable, and ICatalog interfaces, provides a new object that delegates to the existing implementation. This gives you a base class from which you can implement modifications to the data supplied by existing data objects.
ICatalog | |
Delegation to ICatalog interface. | |
virtual status_t | AddEntry (const SString &name, const SValue &entry) |
Add or modify an entry in the catalog. | |
sptr< ICatalog > | BaseCatalog () const |
Returns original ICatalog object, or NULL if that interface was not available. | |
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 | RemoveEntry (const SString &name) |
Remove an existing entry from the catalog. | |
virtual status_t | RenameEntry (const SString &entry, const SString &name) |
Change the name of an entry in the catalog. | |
IIterable | |
Delegation to IIterable interface. | |
sptr< IIterable > | BaseIterable () const |
Returns original IIterable object, or NULL if that interface was not available. | |
virtual sptr< GenericIterator > | NewGenericIterator (const SValue &args) |
Returns original IIterable object, or NULL if that interface was not available. | |
Bookkeeping | |
Creation, destruction, locking, etc. | |
BCatalogDelegate (const SContext &context, const sptr< IBinder > &base) | |
SContext | Context () |
Disambiguate. | |
virtual SValue | Inspect (const sptr< IBinder > &caller, const SValue &which, uint32_t flags) |
Make INode, IIterable, and ICatalog interfaces visible based on delegate. | |
virtual lock_status_t | Lock () const |
Disambiguate. | |
virtual void | Unlock () const |
Disambiguate. | |
virtual | ~BCatalogDelegate () |
Classes | |
class | IteratorDelegate |
Generic base class implementation of a BGenericIterable's iterator. More... |
|
|
|
|
|
Add or modify an entry in the catalog.
The second reason for using this API is to add new types of objects to the catalog – if the SValue contains an IBinder object, the given object will be directly added as the new entry. This latter approach allows you to create places where the namespace crosses processes, mount new types of directories in the namespace, etc. Note, however, that many catalogs (such as one representing a filesystem) will not be able to host references to external objects. Contrast this with CreateNode() and CreateDatum(), which creates new entry objects that are owned and managed by the catalog.
Implements ICatalog. |
|
Returns original ICatalog object, or NULL if that interface was not available.
|
|
Returns original IIterable object, or NULL if that interface was not available.
|
|
Disambiguate.
Reimplemented from BNodeDelegate. |
|
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. Implements ICatalog. |
|
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. Implements ICatalog. |
|
Make INode, IIterable, and ICatalog interfaces visible based on delegate. This will allow you to cast to the same interfaces that are supported by the base object, but returning the new delegate implementations. Reimplemented from BnCatalog. |
|
Disambiguate.
Reimplemented from BGenericIterable. |
|
Returns original IIterable object, or NULL if that interface was not available.
Implements BGenericIterable. |
|
Remove an existing entry from the catalog.
Implements ICatalog. |
|
Change the name of an entry in the catalog.
Implements ICatalog. |
|
Disambiguate.
Reimplemented from BGenericIterable. |