summaryrefslogtreecommitdiff
path: root/src/lib/efl/interfaces/efl_io_closer.eo
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-08-13 04:50:29 -0300
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-08-22 18:25:14 -0300
commit5d4688679e9d3f9daa00ec53f0302f89d36028bf (patch)
tree0a1ace3e0f6e3a12c85da843e469238edf62ebbb /src/lib/efl/interfaces/efl_io_closer.eo
parent0d96ba973471f03f4d38f1764019751a4a3044ff (diff)
efl.io: introduce basic interfaces and classes.
These interfaces allows generic operations on objects that can store or provide data, such as a file or a buffer. With well defined interfaces and events we can create code such as Efl.Io.Copier, that will link a source with a destination and progressively copy data as they appear.
Diffstat (limited to 'src/lib/efl/interfaces/efl_io_closer.eo')
-rw-r--r--src/lib/efl/interfaces/efl_io_closer.eo49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/lib/efl/interfaces/efl_io_closer.eo b/src/lib/efl/interfaces/efl_io_closer.eo
new file mode 100644
index 0000000..6a27b02
--- /dev/null
+++ b/src/lib/efl/interfaces/efl_io_closer.eo
@@ -0,0 +1,49 @@
1import eina_types;
2
3mixin Efl.Io.Closer {
4 [[Generic interface for objects that can close themselves.
5
6 This interface allows external objects to transparently close an
7 input or output stream, cleaning up its resources.
8
9 Calls to @.close() may or may not block, that's not up to this
10 interface to specify.
11
12 @since 1.19
13 ]]
14
15 data: null;
16
17 methods {
18 close @virtual_pure {
19 [[Closes the Input/Output object.
20
21 This operation will be executed immediately and may or
22 may not block the caller thread for some time. The
23 details of blocking behavior is to be defined by the
24 implementation and may be subject to other parameters
25 such as non-blocking flags, maximum timeout or even
26 retry attempts.
27
28 You can understand this method as close(2) libc function.
29 ]]
30 return: Eina.Error; [[0 on succeed, a mapping of errno otherwise]]
31 }
32
33 @property closed {
34 [[If true will notify object was closed.]]
35 get @virtual_pure { }
36 set {
37 [[If true, calls close()]]
38 return: bool; [[$true if could close, $false if already closed or errors.]]
39 }
40 values {
41 is_closed: bool;
42 }
43 }
44 }
45
46 events {
47 closed; [[Notifies closed, when property is marked as true]]
48 }
49}