changes: TINF-175 TZPC-4722
[platform/upstream/libgee.git] / gee / abstractbidirlist.vala
1 /* bidirlistiterator.vala
2  *
3  * Copyright (C) 2011  Maciej Piechotka
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
18  *
19  * Author:
20  *      Maciej Piechotka <uzytkownik2@gmail.com>
21  */
22
23 public abstract class Gee.AbstractBidirList<G> : AbstractList<G>, BidirList<G> {
24         /**
25          * {@inheritDoc}
26          */
27         public abstract BidirListIterator<G> bidir_list_iterator ();
28
29         private weak BidirList<G> _read_only_view;
30
31         /**
32          * {@inheritDoc}
33          */
34         public virtual new BidirList<G> read_only_view {
35                 owned get {
36                         BidirList<G> instance = _read_only_view;
37                         if (_read_only_view == null) {
38                                 instance = new ReadOnlyBidirList<G> (this);
39                                 _read_only_view = instance;
40                                 instance.add_weak_pointer ((void**) (&_read_only_view));
41                         }
42                         return instance;
43                 }
44         }
45
46         // Future-proofing
47         internal new virtual void reserved0() {}
48         internal new virtual void reserved1() {}
49         internal new virtual void reserved2() {}
50         internal new virtual void reserved3() {}
51         internal new virtual void reserved4() {}
52         internal new virtual void reserved5() {}
53         internal new virtual void reserved6() {}
54         internal new virtual void reserved7() {}
55         internal new virtual void reserved8() {}
56         internal new virtual void reserved9() {}
57 }
58