Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Examples

VOS::LocalVobject Class Reference

This class contains the code to respond to messages from remote objects inquiring about the Vobject's state. More...

#include <vos/corelibs/vos/localvobject.hh>

Inheritance diagram for VOS::LocalVobject:

VOS::VobjectImplementation VOS::Vobject VOS::ObjectExciseListener VOS::RefCounted VOS::LocalMetaObject VOS::LocalSite VOS::LocalSocketSite List of all members.

Public Member Functions

Static Public Member Functions


Detailed Description

This class contains the code to respond to messages from remote objects inquiring about the Vobject's state.

Definition at line 49 of file localvobject.hh.


Constructor & Destructor Documentation

VOS::LocalVobject::LocalVobject const string &  name,
LocalSite s,
VobjectAccessControl accesscontrol
 


Member Function Documentation

virtual void VOS::LocalVobject::addType const string &  s  )  [virtual]
 

Adds a new type to this object's type set.

This only changes the stored set of type name strings and does not necessarily affect the actual code behind the object. See the Local Site class for information about extending the actual functionality of an existing meta objects.

Parameters:
s the type string

Implements VOS::Vobject.

Reimplemented in VOS::LocalMetaObject.

virtual const deque<VobjectAccessControl*>& VOS::LocalVobject::getAccessControls  )  [virtual]
 

Returns:
the current access control policy list.
See also:
insertAccessControl

void VOS::LocalVobject::initReply Vobject v,
Message reply,
Message m,
const string &  method
[static]
 

Convenience function which initializes various message fields when replying to a message.

Parameters:
v the 'from' object
reply the message whose fields will be filled in
m the message we're replying to, to set the 'to' field
method the method to use
Note:
Here is what this method actually does:
        reply->setType("update");
        reply->setMethod(method);
        reply->setTo(m->getFrom());
        reply->setFrom(v->getURL().getString());
        reply->setNonce(m->getNonce());
See also RemoteVobject::initReply()

Referenced by VOS::LocalSocketSite::sendMessage().

virtual void VOS::LocalVobject::insertAccessControl int  pos,
const string &  policyname
[virtual]
 

Add a named policy.

See also:
VobjectAccessControl::getPolicy

virtual void VOS::LocalVobject::insertAccessControl int  pos,
VobjectAccessControl ac
[virtual]
 

Insert a new policy into the access policy list.

The access policy list is traversed from beginning to end, calling each access control policy in order until either a policy returns false (deny) or the end of the list is reached. If access is denied, list traversal immediately stops and the requested action is denied. If the end of the list is reached without a denial, the requested action is permitted.

Parameters:
pos The position to be inserted into. As with most other parts of VOS, a positive value counts from the beginning and a negative value counts from the end. In particular, a position of 0 will insert at the head of the list, making it the the first policy to be consulted. A position of -1 will insert at the end of the list, making it the last policy to be consulted.
ac the access control policy

virtual void VOS::LocalVobject::insertChild int  position,
const string &  contextual_name,
Vobject child
throw (AccessControlError, RemoteError) [virtual]
 

Insert a child at some position with a new object.

If the position is positive, the object is inserted such that it now occupies that position, and all objects starting from the previous occupant of that position onward are moved up one. If the position in negative, the object is similarly inserted so that it now occupies that position. For example, position -1 will append the object to the end of the list, position -2 will insert the object in the second-to-last position, etc. See setChild() for more information on positions.

Parameters:
position the position
contextual_name This is the name, specific to this parent-child relation, used for refering to this object by path.
child the child object, in question
Exceptions:
AccessControl if this object (when it is remote) doesn't approve of this action.

Implements VOS::Vobject.

Reimplemented in VOS::LocalMetaObject, and VOS::LocalSite.

virtual void VOS::LocalVobject::removeAccessControl const string &  policyname  )  [virtual]
 

Remove all policies matching this name.

virtual void VOS::LocalVobject::removeAccessControl VobjectAccessControl m  )  [virtual]
 

Remove all instances of the specified access policy from the policy list.

Parameters:
m the access control policy to remove
See also:
insertAccessControl

virtual void VOS::LocalVobject::removeAccessControl int  pos  )  [virtual]
 

Remove the access policy at the specified position.

Parameters:
pos the position of the policy in the policy list
See also:
insertAccessControl

virtual void VOS::LocalVobject::removeChild int  position  )  throw (AccessControlError, RemoteError) [virtual]
 

Remove the child at some position.

See setChild() for more information on positions.

Parameters:
position the position
Exceptions:
AccessControl if this object (when it is remote) doesn't approve of this action.

Implements VOS::Vobject.

Reimplemented in VOS::LocalMetaObject, and VOS::LocalSite.

virtual void VOS::LocalVobject::sendMessage MessageBlock m  )  [virtual]
 

Sends a block of messages to the object.

This may trigger immediate processing of the message if the object is local.

Parameters:
m A pointer to the message which is being sent. Its reference count will be increased as necssary.

Implements VOS::Vobject.

Reimplemented in VOS::LocalMetaObject, and VOS::LocalSite.

virtual void VOS::LocalVobject::sendMessage Message m  )  [virtual]
 

Sends a message to the object.

This may trigger immediate processing of the message if the object is local.

Parameters:
m A pointer to the message which is being sent. Its reference count will be increased as necssary.

Implements VOS::Vobject.

Reimplemented in VOS::LocalMetaObject, VOS::LocalSite, and VOS::LocalSocketSite.

virtual void VOS::LocalVobject::setChild int  position,
const string &  contextual_name,
Vobject child
throw (AccessControlError, RemoteError) [virtual]
 

Replace a child at some position with a new object.

Note:
On positions: if a position is zero or positive, its meaning is as you would expect, expressing the offset into an array of children. However, if the position is negative, it expresses the offset from the end of the list. This means for a list of length n, -1 is the last item in the list (equal to position position n - 1) and -n is the first item (equal to positive position 0). This position notation is used in setChild() findObject(), findObjectFromRoot(), insertChild(), and removeChild(); it should also be available with any methods who make use of the previously-mentioned methods.
Parameters:
position the position
contextual_name This is the name, specific to this parent-child relation, used for refering to this object by path.
child the child object, in question
Exceptions:
AccessControl if this object (when it is remote) doesn't approve of this action.

Implements VOS::Vobject.

Reimplemented in VOS::LocalMetaObject, and VOS::LocalSite.

virtual void VOS::LocalVobject::setURL const URL u  )  [inline, virtual]
 

Reimplemented in VOS::LocalSite.

Definition at line 67 of file localvobject.hh.

virtual bool VOS::LocalVobject::validateAccess VobjectEvent e,
string &  message
[virtual]
 

Traverse the access policy list and determine whether to allow this event.

Parameters:
e the event to permit
Returns:
true if the event is permitted, false to deny this event

Message* VOS::LocalVobject::waitFor const string &  nonce,
RemoteSite from,
double  timeout = VOS_DEFAULT_TIMEOUT
 

Block until a message bearing a specific nonce is received, and return that message.

Parameters:
nonce the nonce string to wait for
timeout maximum time to wait, in seconds, before failing (will throw a TimeoutError)
from the remote site the message is expected from.
Exceptions:
TimeoutError 
Returns:
the message which matched this nonce. NOTE YOU MUST CALL release() WHEN DONE OR USE A pREF() BLOCK

Referenced by VOS::RemoteSocketSite::secureConnection().


The documentation for this class was generated from the following file:
Generated on Tue Aug 12 03:56:04 2003 for Interreality Project - VOS by doxygen 1.3.2