BGenericCatalog Class Reference
[Data Model]

#include <support/Catalog.h>

Inheritance diagram for BGenericCatalog:

BnCatalog BMetaDataNode BnIterable ICatalog BBinder BGenericNode IIterable BBinder IInterface IBinder BnNode IInterface IBinder SAtom SAtom INode BBinder SAtom SAtom IInterface IBinder SAtom SAtom List of all members.

Public Member Functions

 BGenericCatalog (const SContext &context)
 BGenericCatalog ()
const SContextContext () const
virtual sptr< IDatumCreateDatum (SString *name, uint32_t flags, status_t *err)
 Create a new IDatum object inside of this catalog.
virtual sptr< INodeCreateNode (SString *name, status_t *err)
 Create a new INode in this catalog.
virtual SValue Inspect (const sptr< IBinder > &caller, const SValue &which, uint32_t flags)
 Probe binder for interface information.

Protected Member Functions

virtual ~BGenericCatalog ()

Constructor & Destructor Documentation

BGenericCatalog  ) 
 

BGenericCatalog const SContext context  ) 
 

~BGenericCatalog  )  [protected, virtual]
 


Member Function Documentation

const SContext& Context  )  const [inline]
 

Reimplemented from BBinder.

sptr< IDatum > CreateDatum SString name,
uint32_t  flags,
status_t err
[virtual]
 

Create a new IDatum object inside of this catalog.

Parameters:
[in,out] name Incoming, the desired name for the new entry. Outgoing, the actual name that was used. Some catalogs may completely ignore your desired name and use their own. Alternatively, a catalog may use your name as-is, and return an error if an entry with that name already exists.
[in] flags Additional options. Always set to 0.
[out] err B_OK on success, else an error code.
Returns:
The newly created IDatum, or NULL on failure.
This is like CreateNode() (see that API for further details), but creates an object implementing the IDatum interface and thus allowing you to place actual data under this entry.

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.

sptr< INode > CreateNode SString name,
status_t err
[virtual]
 

Create a new INode in this catalog.

Parameters:
[in,out] name Incoming, the desired name for the new entry. Outgoing, the actual name that was used. Some catalogs may completely ignore your desired name and use their own. Alternatively, a catalog may use your name as-is, and return an error if an entry with that name already exists.
[out] err B_OK on success, else an error code.
Returns:
The newly created INode, or NULL on failure.
Use this API to create a new subdirectory kind of object inside of this catalog. The returned object will be at least an INode that can itself contain one or more child entries. However, the details of how the node INode works are entirely dependent on this containing catalog: it could start out empty and have its own ICatalog interface through which you can add any arbitrary entries, start out with a fixed set of entries that can not be changed, etc.

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.

SValue Inspect const sptr< IBinder > &  caller,
const SValue which,
uint32_t  flags
[virtual]
 

Probe binder for interface information.

Return interfaces implemented by this binder object that are requested by which. This is a composition of all interfaces, expressed as { descriptor -> binder } mappings, which are selected through which.

Much more information on Inspect() can be found at Binder Inspect() Details.

Reimplemented from BnCatalog.


The documentation for this class was generated from the following files: