NDObjectAuthority Class Reference
Provides an interface for server validation of object-related events, such as object updates, publishes, and deletes.
More...
List of all members.
Public Member Functions |
| virtual NDResult | ndValidatePublishObject (NDObject *obj, NDNodeID node)=0 |
| | This callback is called on the server each time an object is about to be published.
|
| virtual NDObjectID | ndAllocateObjectID (void)=0 |
| | This callback is called on the server when a new objectID is needed and specifies what the next ID will be.
|
| virtual NDResult | ndValidateUpdateObject (NDObject *obj, NDObjectChanges *changed, NDNodeID node)=0 |
| | This callback is called on the server each time an object is about to be updated.
|
| virtual NDResult | ndValidateDeleteObject (NDObject *obj, NDNodeID node)=0 |
| | This callback is called on the server each time an object is about to be deleted.
|
Detailed Description
To use this class, create a subclass which implements all the functions in this interface. Then, register the handler by calling NDChannel::becomeObjectAuthority.
Member Function Documentation
| NDObjectAuthority::ndAllocateObjectID |
( |
void |
|
) |
[pure virtual] |
Generally, this can simply return a sequentially increasing number each time it is called.
- Returns:
- the objectID which was allocated
| NDObjectAuthority::ndValidateDeleteObject |
( |
NDObject * |
obj, |
|
|
NDNodeID |
node | |
|
) |
| | [pure virtual] |
The object authority (e.g. server) determines whether the proposed delete should occur, and returns the appropriate value to allow or deny the deletion.
- Parameters:
-
| obj | the object which is about to be deleted |
| node | the nodeID of the node which is attempting to delete this object |
- Returns:
- NDRES_OK if the publish is to be allowed, NDRES_IGNORE otherwise
| NDObjectAuthority::ndValidatePublishObject |
( |
NDObject * |
obj, |
|
|
NDNodeID |
node | |
|
) |
| | [pure virtual] |
The object authority (e.g. server) determines whether the proposed publish should occur, and returns the appropriate value to allow or deny the publish.
- Parameters:
-
| obj | the object which is about to be published |
| node | the nodeID of the node which is attempting to publish this object |
- Returns:
- NDRES_OK if the publish is to be allowed, NDRES_IGNORE otherwise
| NDObjectAuthority::ndValidateUpdateObject |
( |
NDObject * |
obj, |
|
|
NDObjectChanges * |
changed, |
|
|
NDNodeID |
node | |
|
) |
| | [pure virtual] |
The object authority (e.g. server) determines whether the proposed updates should occur, and returns the appropriate value to allow or deny the updates. The updated values can also be modified at this point, and the updated values will then be used.
- Parameters:
-
| obj | the object which is about to be updated |
| changed | an iterator containing the list of proposed updates to the object |
| node | the nodeID of the node which is attempting to update this object |
- Returns:
- NDRES_OK if the publish is to be allowed, NDRES_IGNORE otherwise