remove obsolete ref modifier and callback keyword
[vala-lang.git] / vala / valapointer.vala
blob34d02098d998c91ed3503f85a72244100eabd81b
1 /* valapointer.vala
3 * Copyright (C) 2007 Jürg Billeter
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 of the License, or (at your option) any later version.
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.
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
19 * Author:
20 * Jürg Billeter <j@bitron.ch>
23 using GLib;
25 /**
26 * Represents a pointer-type.
28 public class Vala.Pointer : DataType {
29 /**
30 * The type to which this pointer type points.
32 public DataType! referent_type { get; set construct; }
34 private string cname;
36 public Pointer (construct DataType! referent_type, construct SourceReference source_reference = null) {
39 construct {
40 name = referent_type.name + "*";
43 public override string get_cname (bool const_type = false) {
44 if (cname == null) {
45 if (referent_type.is_reference_type ()) {
46 cname = "%s**".printf (referent_type.get_cname ());
47 } else {
48 cname = "%s*".printf (referent_type.get_cname ());
52 return cname;
55 public override bool is_reference_type () {
56 return false;
59 public override string get_upper_case_cname (string infix) {
60 return null;
63 public override string get_lower_case_cname (string infix) {
64 return null;
67 public override string get_free_function () {
68 return null;
71 public override List<string> get_cheader_filenames () {
72 return referent_type.get_cheader_filenames ();
75 public override string get_type_id () {
76 return "G_TYPE_POINTER";
79 public override string get_marshaller_type_name () {
80 return "POINTER";
83 public override string get_get_value_function () {
84 return "g_value_get_pointer";
87 public override string get_set_value_function () {
88 return "g_value_set_pointer";