PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/wrappers/common/library/reference_counted.e

http://github.com/tybor/Liberty
Specman e | 48 lines | 35 code | 8 blank | 5 comment | 2 complexity | 8e5e7d6a6abcd811cfa5800e9c507d75 MD5 | raw file
 1note
 2   copyright:
 3      "[
 4               Copyright (C) 2008-2017: Paolo Redaelli
 5
 6               This library is free software; you can redistribute it and/or
 7               modify it under the terms of the GNU Lesser General Public License
 8               as published by the Free Software Foundation; either version 2.1 of
 9               the License, or (at your option) any later version.
10
11               This library is distributed in the hope that it will be useful, but
12               WITHOUT ANY WARRANTY; without even the implied warranty of
13               MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14               Lesser General Public License for more details.
15
16               You should have received a copy of the GNU Lesser General Public
17               License along with this library; if not, write to the Free Software
18               Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19               02110-1301 USA
20         ]"
21deferred class REFERENCE_COUNTED
22   -- A wrapper for a C object whose memory is handled throught
23   -- reference counting, i.e. GObject
24
25inherit
26   WRAPPER
27      undefine from_external_pointer
28      end
29
30feature {WRAPPER, WRAPPER_HANDLER}
31   ref
32         -- Increase the reference count
33      deferred
34      end
35
36   unref
37         -- Decrease the reference count
38      deferred
39      end
40
41   dispose
42         --
43      do
44         unref
45         handle := default_pointer
46      end
47
48end -- class REFERENCE_COUNTED