1tcl::chan::events(n) Reflected/virtual channel support tcl::chan::events(n)
2
3
4
5______________________________________________________________________________
6
8 tcl::chan::events - Event support for reflected/virtual channels
9
11 package require Tcl 8.5
12
13 package require TclOO
14
15 package require tcl::chan::core ?1?
16
17 package require tcl::chan::events ?1?
18
19 ::tcl::chan::events objectName
20
21 objectName finalize thechannel
22
23 objectName watch thechannel eventmask
24
25 objectName allow eventname...
26
27 objectName disallow eventname...
28
29______________________________________________________________________________
30
32 The tcl::chan::events package provides a TclOO class implementing com‐
33 mon behaviour needed by virtually every reflected or virtual channel
34 supporting event driven IO. It is a sub-class of tcl::chan::core,
35 inheriting all of its behaviour.
36
37 This class expects to be used as either superclass of a concrete chan‐
38 nel class, or to be mixed into such a class.
39
41 ::tcl::chan::events objectName
42 This command creates a new channel event core object with an
43 associated global Tcl command whose name is objectName. This
44 command may be used to invoke various operations on the object,
45 as described in the section for the Instance API.
46
48 The API of channel event core instances provides only four methods, two
49 corresponding to channel handler commands (For reference see TIP 219
50 [http:/tip.tcl.tk/219]), and the other two for use by sub-classes to
51 control event generation. They former expect to be called from which‐
52 ever object instance the channel event core was made a part of.
53
54 objectName finalize thechannel
55 This method implements standard behaviour for the finalize
56 method of channel handlers. It overrides the behaviour inherited
57 from tcl::chan::core and additionally disables any and all event
58 generation before destroying itself.
59
60 objectName watch thechannel eventmask
61 This method implements standard behaviour for the watch method
62 of channel handlers. Called by the IO system whenever the inter‐
63 est in event changes it updates the instance state to activate
64 and/or suppress the generation of the events of (non-)interest.
65
66 objectName allow eventname...
67
68 objectName disallow eventname...
69 These two methods are exported to sub-classes, so that their
70 instances can notify their event core of the events the channel
71 they implement can (allow) or cannot (disallow) generate.
72 Together with the information about the events requested by
73 Tcl's IO system coming in through the watch method the event
74 core is able to determine which events it should (not) generate
75 and act accordingly.
76
78 This document, and the package it describes, will undoubtedly contain
79 bugs and other problems. Please report such in the category virtchan‐
80 nel of the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist].
81 Please also report any ideas for enhancements you may have for either
82 package and/or documentation.
83
84 When proposing code changes, please provide unified diffs, i.e the out‐
85 put of diff -u.
86
87 Note further that attachments are strongly preferred over inlined
88 patches. Attachments can be made by going to the Edit form of the
89 ticket immediately after its creation, and then using the left-most
90 button in the secondary navigation bar.
91
93 event management, reflected channel, tip 219, virtual channel
94
96 Channels
97
99 Copyright (c) 2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>
100
101
102
103
104tcllib 1 tcl::chan::events(n)