PEAR2_Net_RouterOS  1.0.0b5
A MikroTik RouterOS client
 All Data Structures Namespaces Files Functions Variables Pages
Registry Class Reference

Public Member Functions

 __construct ($uri)
 Creates a registry. More...
 
 isTaglessModeOwner ()
 Checks if this instance is the tagless mode owner. More...
 
 setTaglessMode ($taglessMode)
 Sets the "tagless mode" setting. More...
 
 getOwnershipTag ()
 Get the ownership tag for this instance. More...
 
 add (Response $response, $ownershipTag)
 Add a response to the registry. More...
 
 getNextResponse ()
 Gets the next response from this instance's buffer. More...
 
 close ()
 Closes the registry. More...
 
 __destruct ()
 Removes this instance's buffer. More...
 

Static Public Member Functions

static parseTag ($tag)
 Parses a tag. More...
 

Protected Attributes

 $shm
 
 $instanceId
 

Static Protected Attributes

static $requestId = -1
 
static $instanceIdSeed = -1
 

Detailed Description

Definition at line 42 of file Registry.php.

Constructor & Destructor Documentation

__construct (   $uri)

Creates a registry.

Parameters
string$uriAn URI to bind the registry to.

Definition at line 69 of file Registry.php.

__destruct ( )

Removes this instance's buffer.

Definition at line 275 of file Registry.php.

Member Function Documentation

add ( Response  $response,
  $ownershipTag 
)

Add a response to the registry.

Parameters
Response$responseThe response to add. The caller of this function is responsible for ensuring that the ownership tag and the original tag are separated, so that only the original one remains in the response.
string$ownershipTagThe ownership tag that the response had.
Returns
bool TRUE if the request was added to its buffer, FALSE if this instance owns the response, and therefore doesn't need to add the response to its buffer.

Definition at line 170 of file Registry.php.

close ( )

Closes the registry.

Closes the registry, meaning that all buffers are cleared.

Returns
void

Definition at line 250 of file Registry.php.

getNextResponse ( )

Gets the next response from this instance's buffer.

Returns
Response|null The next response, or NULL if there isn't one.

Definition at line 226 of file Registry.php.

getOwnershipTag ( )

Get the ownership tag for this instance.

Returns
string The ownership tag for this registry instance.

Definition at line 152 of file Registry.php.

isTaglessModeOwner ( )

Checks if this instance is the tagless mode owner.

Returns
bool TRUE if this instance is the tagless mode owner, FALSE otherwise.

Definition at line 109 of file Registry.php.

static parseTag (   $tag)
static

Parses a tag.

Parses a tag to reveal the ownership part of it, and the original tag.

Parameters
string$tagThe tag (as received) to parse.
Returns
array An array with the first member being the ownership tag, and the second one being the original tag.

Definition at line 90 of file Registry.php.

setTaglessMode (   $taglessMode)

Sets the "tagless mode" setting.

While in tagless mode, this instance will claim owhership of any responses without a tag. While not in this mode, any requests without a tag will be given to all instances.

Regardless of mode, if the type of the response is Response::TYPE_FATAL, it will be given to all instances.

Parameters
bool$taglessModeTRUE to claim tagless ownership, FALSE to release such ownership, if taken.
Returns
bool TRUE on success, FALSE on failure.

Definition at line 133 of file Registry.php.

Field Documentation

$instanceId
protected

Definition at line 62 of file Registry.php.

$instanceIdSeed = -1
staticprotected

Definition at line 57 of file Registry.php.

$requestId = -1
staticprotected

Definition at line 52 of file Registry.php.

$shm
protected

Definition at line 47 of file Registry.php.


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