BSchemaDatabaseNode Class Reference
[CoreDataManagerProvider]

#include <dmprovider/SchemaDatabaseNode.h>

Inheritance diagram for BSchemaDatabaseNode:

BIndexedDataNode BnReferable BMetaDataNode BIndexedIterable SDatumGeneratorInt IReferable BBinder BGenericNode BGenericIterable SAtom IInterface IBinder BnNode BnIterable SSQLBuilder SAtom SAtom INode BBinder IIterable BBinder IInterface IBinder IInterface IBinder SAtom SAtom SAtom SAtom List of all members.

Detailed Description

INode providing access to a particular Data Manager schema database.

The schema database must have one or more tables, which are accessed as sub-nodes from this one. You can also create iterators directly from this node by specifying the desired table in the iterator arguments.

This class understands one constructor argument (the args SValue, which is typically passed from InstantiateComponent):

Note:
These classes are not a part of the OpenBinder build, but included as an example for other similar implementations.


Bookkeeping

Creation, destruction, locking, etc.

typedef void(* database_missing_func )(const sptr< BSchemaDatabaseNode > &table)
 Call-back function t create a database when it is missing.
 BSchemaDatabaseNode (const SContext &context, const SDatabase &database, const SValue &args=B_UNDEFINED_VALUE)
 Call-back function t create a database when it is missing.
 BSchemaDatabaseNode (const SContext &context, const SString &dbname, uint32_t creator, DmOpenModeType mode=dmModeReadOnly, DbShareModeType share=dbShareReadWrite, database_missing_func missing=NULL, const SValue &args=B_UNDEFINED_VALUE)
 Call-back function t create a database when it is missing.
SContext Context ()
 Disambiguate.
virtual SValue Inspect (const sptr< IBinder > &caller, const SValue &which, uint32_t flags)
 Make BIndexedDataNode and IReferable accessible.
status_t StatusCheck ()
 Returns initialization state of object, such as error code when opening database.
virtual void InitAtom ()
 Open and initialize the database.
virtual ~BSchemaDatabaseNode ()
 Call-back function t create a database when it is missing.

Implementation

Provide default implementation based on new capabilities.

virtual size_t CountEntriesLocked () const
 Return number of tables found.
SDatabase DatabaseLocked () const
 Return the underlying opened SDatabase object.
virtual ssize_t EntryIndexOfLocked (const SString &entry) const
 Return index of a table.
virtual SString EntryNameAtLocked (size_t index) const
 Return name of a table.
virtual sptr< BSchemaTableNodeNewSchemaTableNodeLocked (const SString &table, const SString &refPath)
 Create and return a new BSchemaTableNode.
virtual status_t StoreValueAtLocked (size_t index, const SValue &value)
 Return B_UNSUPPORTED, can't change tables.
sptr< BSchemaTableNodeTableAtLocked (size_t index) const
 Return the table object at a particular index.
sptr< BSchemaTableNodeTableForLocked (const SString &name) const
 Return the table object for a particular name.
virtual SValue ValueAtLocked (size_t index) const
 Retrieve a table at an index.

IReferable Implementation

virtual SString Reference () const
 Official path to this object.


Member Typedef Documentation

typedef void(* database_missing_func)(const sptr< BSchemaDatabaseNode > &table)
 

Call-back function t create a database when it is missing.


Constructor & Destructor Documentation

BSchemaDatabaseNode const SContext context,
const SString dbname,
uint32_t  creator,
DmOpenModeType  mode = dmModeReadOnly,
DbShareModeType  share = dbShareReadWrite,
database_missing_func  missing = NULL,
const SValue args = B_UNDEFINED_VALUE
 

Call-back function t create a database when it is missing.

BSchemaDatabaseNode const SContext context,
const SDatabase database,
const SValue args = B_UNDEFINED_VALUE
 

Call-back function t create a database when it is missing.

~BSchemaDatabaseNode  )  [protected, virtual]
 

Call-back function t create a database when it is missing.


Member Function Documentation

SContext Context  )  [inline]
 

Disambiguate.

Reimplemented from BIndexedDataNode.

size_t CountEntriesLocked  )  const [virtual]
 

Return number of tables found.

Implements BIndexedDataNode.

SDatabase DatabaseLocked  )  const
 

Return the underlying opened SDatabase object.

ssize_t EntryIndexOfLocked const SString entry  )  const [virtual]
 

Return index of a table.

Implements BIndexedDataNode.

SString EntryNameAtLocked size_t  index  )  const [virtual]
 

Return name of a table.

Implements BIndexedDataNode.

void InitAtom  )  [protected, virtual]
 

Open and initialize the database.

Reimplemented from SAtom.

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

Make BIndexedDataNode and IReferable accessible.

Reimplemented from BnReferable.

sptr< BSchemaTableNode > NewSchemaTableNodeLocked const SString table,
const SString refPath
[virtual]
 

Create and return a new BSchemaTableNode.

This is called for each table in the database. The default implementation simply instantiates a BSchemaTableNode with the given arguments (and Context(), Database()).

SString Reference  )  const [virtual]
 

Official path to this object.

This property holds the canonical path at which you can find the object being queried. The returned path is always of the form "/some/path/to/me"; that is, SContext::Lookup() can be used to resolve the path back to the object.

Note:
Currently SContext::Lookup() always uses IDatum::REQUEST_DATA, so it will not work for retrieving IDatum objects. This should be fixed.

Implements IReferable.

status_t StatusCheck  ) 
 

Returns initialization state of object, such as error code when opening database.

status_t StoreValueAtLocked size_t  index,
const SValue value
[virtual]
 

Return B_UNSUPPORTED, can't change tables.

Implements BIndexedDataNode.

sptr< BSchemaTableNode > TableAtLocked size_t  index  )  const
 

Return the table object at a particular index.

sptr< BSchemaTableNode > TableForLocked const SString name  )  const
 

Return the table object for a particular name.

SValue ValueAtLocked size_t  index  )  const [virtual]
 

Retrieve a table at an index.

Implements BIndexedDataNode.


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