06 Jun 2022 15:42:39 UTC
- Distribution: Tangence
- Module version: 0.29
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (5)
- Testers (300 / 0 / 45)
- KwaliteeBus factor: 1
- 87.88% Coverage
- License: perl_5
- Perl: v5.26.0
- Download (88.47KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:2 non-PAUSE users
Tangence::Object- base class for accessible objects in a
This class acts as a base class for the accessible objects in a Tangence server. All the objects actually created and made accessible to clients will be subclasses of this one, including internally-created objects such as Tangence::Registry.
These objects are not directly constructed by calling the
newclass method; instead the
Tangence::Registryshould be used to construct one.
Requests that the object destroy itself, informing all clients that are aware of it. Once they all report that they have dropped the object, the object is deconstructed for real.
Not to be confused with Perl's own
$id = $obj->id
Returns the object's
$description = $obj->describe
Returns a textual description of the object, for internal debugging purposes. Subclasses are encouraged to override this method to return something more descriptive within their domain of interest
$registry = $obj->registry
Returns the Tangence::Registry that constructed this object.
$class = $obj->class
Returns the Tangence::Meta::Class object representing the class of this object.
$method = $obj->can_method( $name )
Returns the Tangence::Meta::Method object representing the named method, or
undefif no such method exists.
$event = $obj->can_event( $name )
Returns the Tangence::Meta::Event object representing the named event, or
undefif no such event exists.
$property = $obj->can_property( $name )
Returns the Tangence::Meta::Property object representing the named property, or
undefif no such property exists.
$obj->fire_event( $event, @args )
Fires the named event on the object. Each event subscription function will be invoked with the given arguments.
$id = $obj->subscribe_event( $event, $callback )
Subscribes an event-handling callback CODE ref to the named event. When the event is fired by
fire_eventthis callback will be invoked, being passed the object reference and the event's arguments.
$callback->( $obj, @args )
Returns an opaque ID value that can be used to remove this subscription by calling
$obj->unsubscribe_event( $event, $id )
Removes an event-handling callback previously registered with
$id = $obj->watch_property( $prop, %callbacks )
Watches a named property for changes, registering a set of callback functions to be invoked when the property changes in certain ways. The set of callbacks required depends on the dimension of the property being watched.
For all property types:
$on_set->( $obj, $value )
For hash properties:
$on_add->( $obj, $key, $value ) $on_del->( $obj, $key )
For queue properties:
$on_push->( $obj, @values ) $on_shift->( $obj, $count )
For array properties:
$on_push->( $obj, @values ) $on_shift->( $obj, $count ) $on_splice->( $obj, $index, $count, @values ) $on_move->( $obj, $index, $delta )
For objset properties:
$on_add->( $obj, $added_object ) $on_del->( $obj, $deleted_object_id )
Alternatively, a single callback may be installed that is invoked after any change of the property, being passed the new value entirely:
$on_updated->( $obj, $value )
Returns an opaque ID value that can be used to remove this watch by calling
$obj->unwatch_property( $prop, $id )
Removes the set of callback functions previously registered with
Paul Evans <firstname.lastname@example.org>
|s||Focus search bar|
|?||Bring up this help dialog|
|g p||Go to pull requests|
|g i||go to github issues (only if github is preferred repository)|
|g a||Go to author|
|g c||Go to changes|
|g i||Go to issues|
|g d||Go to dist|
|g r||Go to repository/SCM|
|g s||Go to source|
|g b||Go to file browse|