IReferable Class Reference
[Data Model]

#include <storage/IReferable.h>

Inheritance diagram for IReferable:

IInterface SAtom BnReferable BSchemaDatabaseNode BSchemaTableNode BSchemaTableNode::RowNode List of all members.

Detailed Description

Interface to find the unique name for an object in the namespace.

Some objects in the Binder Data Model are placed at well-known locations in the SContext namespace. These objects will implement the IReferable interface, allowing you to retrieve the official path to that object.

The main purpose of IReferable is to enable synchronization. As such, all significant objects under /content will implement the interface (especially those representing first-level synchronization entities, such as a person entry). It is not expected to be implemented by many other objects outside of that part of the namespace, though they are free to do so as desired.

For synchronization purposes, the reference path to a particular piece of data will generally include a GUID so that it is unique across all devices. For example, the reference for a particular person entry may be "/content/pim/people/{GUID}". The GUID is generated the first time that particular person is created, and the same GUID remains associated with it as it moves between devices.

Objects may be published at more than one place in the namespace (corresponding to a Unix filesystem hard link), so the path returned by this interface may be different than the path through which you found the object. Regardless, you are guaranteed that walking the returned path will return you to the same object.

Public Member Functions

status_t LinkReferable (const sptr< IBinder > &to, const SValue &mappings, uint32_t flags=0)
virtual SString Reference () const =0
 Official path to this object.
status_t UnlinkReferable (const sptr< IBinder > &to, const SValue &mappings, uint32_t flags=0)

Protected Member Functions

 IReferable ()
virtual ~IReferable ()

Constructor & Destructor Documentation

IReferable  )  [inline, protected]

virtual ~IReferable  )  [protected, virtual]

Member Function Documentation

status_t LinkReferable const sptr< IBinder > &  to,
const SValue mappings,
uint32_t  flags = 0

virtual SString Reference  )  const [pure 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.

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

Implemented in BSchemaDatabaseNode, BSchemaTableNode, and BSchemaTableNode::RowNode.

status_t UnlinkReferable const sptr< IBinder > &  to,
const SValue mappings,
uint32_t  flags = 0

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