SNode Class Reference
[Data Model]

#include <support/Node.h>

List of all members.


Detailed Description

Convenience class for operating on the INode interface.

This class provides some convenience methods for making calls on an INode, to provide a more convenience API. In general you will create an SNode wrapper around an INode you have and call the SNode methods instead of making direct calls on the INode. For example:

    void get_something(const sptr<INode>& node)
    {
        SNode n(node).
        SValue v = n.Walk(SString("some/path"));
    }

When using the constructor that takes an SValue, the class will automatically try to retrieve an INode from the value. If that fails, and the SValue contains mappings, then Walk() will look up the mappings inside of it. This allows you to use INode::COLLAPSE_CATALOG without worrying about whether or not the returned item is collapsed.

Todo:
Need to clean up the Walk() methods to get rid of amiguities between them.


ICatalog

If this is also an ICatalog, call the appropriate methods.
Todo:
Should be moved to a new SCatalog class.


status_t AddEntry (const SString &name, const SValue &entry) const
status_t RemoveEntry (const SString &name) const
status_t RenameEntry (const SString &entry, const SString &name) const

Bookkeeping

Creation, destruction, copying, comparing, etc.

SValue CollapsedNode () const
 Retrieve the SValue mappings being used.
status_t ErrorCheck () const
sptr< INodeNode () const
 Retrieve the INode object being used.
bool operator!= (const SNode &o) const
 Retrieve the SValue mappings being used.
bool operator< (const SNode &o) const
 Retrieve the SValue mappings being used.
bool operator<= (const SNode &o) const
 Retrieve the SValue mappings being used.
SNodeoperator= (const SNode &o)
 Replace this SNode with o.
bool operator== (const SNode &o) const
 Retrieve the SValue mappings being used.
bool operator> (const SNode &o) const
 Retrieve the SValue mappings being used.
bool operator>= (const SNode &o) const
 Retrieve the SValue mappings being used.
 SNode (const SNode &node)
 Copy from another SNode.
 SNode (const sptr< INode > &node)
 Initialize directly from an INode.
 SNode (const sptr< IBinder > &binder)
 Retrieve a node from an IBinder, casting to an INode interface.
 SNode (const SValue &value)
 Retrieve a node from a generic SValue.
 SNode (const SContext &context, const SString &path, uint32_t node_flags=0)
 Retrieve a node from the given path in context.
 SNode ()
 Create a new, empty node.
status_t StatusCheck () const
 Returns B_OK if we hold a value INode or SValue of mappings.
 ~SNode ()
 Release reference on INode.

Path Walking

Call INode::Walk() to resolve a path. If this SNode contains a collapsed SValue, walk through that instead. These functions take care of repeatedly calling INode::Walk() until the path is fully resolved or an error occurs.

SValue Walk (SString *path, status_t *outErr, uint32_t flags=INode::REQUEST_DATA) const
SValue Walk (const SString &path, status_t *outErr, uint32_t flags=INode::REQUEST_DATA) const
SValue Walk (SString *path, uint32_t flags=INode::REQUEST_DATA) const
SValue Walk (const SString &path, uint32_t flags=INode::REQUEST_DATA) const


Constructor & Destructor Documentation

SNode  ) 
 

Create a new, empty node.

SNode const SContext context,
const SString path,
uint32_t  node_flags = 0
 

Retrieve a node from the given path in context.

The node_flags are as per the INode::Walk() flags.

SNode const SValue value  ) 
 

Retrieve a node from a generic SValue.

If the SValue contains an INode object, that will be used directly. Otherwise, if the SValue contains mappings, Walk() will perform a lookup on it. This allows convenient manipulation of INode::COLLAPSE_NODE results.

SNode const sptr< IBinder > &  binder  ) 
 

Retrieve a node from an IBinder, casting to an INode interface.

SNode const sptr< INode > &  node  ) 
 

Initialize directly from an INode.

SNode const SNode node  ) 
 

Copy from another SNode.

~SNode  ) 
 

Release reference on INode.


Member Function Documentation

status_t AddEntry const SString name,
const SValue entry
const
 

SValue CollapsedNode  )  const
 

Retrieve the SValue mappings being used.

status_t ErrorCheck  )  const
 

Deprecated:
Use StatusCheck() instead.

sptr< INode > Node  )  const
 

Retrieve the INode object being used.

bool operator!= const SNode o  )  const
 

Retrieve the SValue mappings being used.

bool operator< const SNode o  )  const
 

Retrieve the SValue mappings being used.

bool operator<= const SNode o  )  const
 

Retrieve the SValue mappings being used.

SNode & operator= const SNode o  ) 
 

Replace this SNode with o.

bool operator== const SNode o  )  const
 

Retrieve the SValue mappings being used.

bool operator> const SNode o  )  const
 

Retrieve the SValue mappings being used.

bool operator>= const SNode o  )  const
 

Retrieve the SValue mappings being used.

status_t RemoveEntry const SString name  )  const
 

status_t RenameEntry const SString entry,
const SString name
const
 

status_t StatusCheck  )  const
 

Returns B_OK if we hold a value INode or SValue of mappings.

SValue Walk SString path,
status_t outErr,
uint32_t  flags = INode::REQUEST_DATA
const
 

SValue Walk const SString path,
status_t outErr,
uint32_t  flags = INode::REQUEST_DATA
const
 

SValue Walk SString path,
uint32_t  flags = INode::REQUEST_DATA
const
 

SValue Walk const SString path,
uint32_t  flags = INode::REQUEST_DATA
const
 


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