gstreamer-pbutils-0.10: Ownership transfer fixes
[vala-lang.git] / vala / valaobjecttypesymbol.vala
blob6f51e9751a72689a19f59a0e9768e4f37256d7fd
1 /* valaobjecttypesymbol.vala
3 * Copyright (C) 2008 Jürg Billeter
4 * Copyright (C) 2008 Philip Van Hoof
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but 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.
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 02110-1301 USA
20 * Author:
21 * Jürg Billeter <j@bitron.ch>
22 * Philip Van Hoof <pvanhoof@gnome.org>
25 using Gee;
27 /**
28 * Represents a runtime data type for objects and interfaces. This data type may
29 * be defined in Vala source code or imported from an external library with a
30 * Vala API file.
32 public abstract class Vala.ObjectTypeSymbol : TypeSymbol {
33 private Gee.List<TypeParameter> type_parameters = new ArrayList<TypeParameter> ();
35 public ObjectTypeSymbol (string name, SourceReference? source_reference = null) {
36 base (name, source_reference);
39 public abstract Gee.List<Method> get_methods ();
40 public abstract Gee.List<Signal> get_signals ();
41 public abstract Gee.List<Property> get_properties ();
43 /**
44 * Appends the specified parameter to the list of type parameters.
46 * @param p a type parameter
48 public void add_type_parameter (TypeParameter p) {
49 type_parameters.add (p);
50 p.type = this;
51 scope.add (p.name, p);
54 /**
55 * Returns a copy of the type parameter list.
57 * @return list of type parameters
59 public Gee.List<TypeParameter> get_type_parameters () {
60 return new ReadOnlyList<TypeParameter> (type_parameters);
63 public override int get_type_parameter_index (string name) {
64 int i = 0;
65 foreach (TypeParameter parameter in type_parameters) {
66 if (parameter.name == name) {
67 return i;
69 i++;
71 return -1;