#include <support/ICatalog.h>
Inheritance diagram for ICatalog:
The ICatalog interface provides a generic API for modifying nodes in the Binder Data Model. An object that implements ICatalog will always implement INode -- ICatalog is essentially the write side of INode.
Objects that implement 2d data structures will usually also implement ITable. Some objects may also provide more specialized interfaces for manipulating their contents as well as or in addition to ICatalog. See, for example, IMenuData.
When talking about the data model, we usually refer to objects implementing ICatalog as being "a catalog", and assuming that these objects also implement INode and IIterable. This is by far the most common configuration of a container object in a namespace.
Note that, like INode, entries in a catalog are named by strings only they do not use generic SValue keys. All Unicode characters are valid in an entry name except for "/" (which is the path separator), and a ":" at the beginning of the path (which is used to identify the attributes namespace).
Public Member Functions | |
virtual status_t | AddEntry (const SString &name, const SValue &entry)=0 |
Add or modify an entry in the catalog. | |
virtual sptr< IDatum > | CreateDatum (SString *name, uint32_t flags, status_t *err)=0 |
Create a new IDatum object inside of this catalog. | |
virtual sptr< INode > | CreateNode (SString *name, status_t *err)=0 |
Create a new INode in this catalog. | |
status_t | LinkCatalog (const sptr< IBinder > &to, const SValue &mappings, uint32_t flags=0) |
virtual status_t | RemoveEntry (const SString &name)=0 |
Remove an existing entry from the catalog. | |
virtual status_t | RenameEntry (const SString &entry, const SString &name)=0 |
Change the name of an entry in the catalog. | |
status_t | UnlinkCatalog (const sptr< IBinder > &to, const SValue &mappings, uint32_t flags=0) |
Protected Member Functions | |
ICatalog () | |
virtual | ~ICatalog () |
|
|
|
|
|
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.
Implemented in BSchemaTableNode, BSchemaTableNode::RowNode, BCatalogDelegate, BCatalog, and BCatalogMirror. |
|
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. Implemented in BSchemaTableNode, BSchemaTableNode::RowNode, BCatalogDelegate, BGenericCatalog, BIndexedCatalog, BCatalog, and BCatalogMirror. |
|
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. Implemented in BSchemaTableNode, BSchemaTableNode::RowNode, BCatalogDelegate, BGenericCatalog, BIndexedCatalog, BCatalog, and BCatalogMirror. |
|
|
|
Remove an existing entry from the catalog.
Implemented in BSchemaTableNode, BSchemaTableNode::RowNode, BCatalogDelegate, BCatalog, and BCatalogMirror. |
|
Change the name of an entry in the catalog.
Implemented in BSchemaTableNode, BSchemaTableNode::RowNode, BCatalogDelegate, BCatalog, and BCatalogMirror. |
|
|