]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Add common Callable interface for Method, Delegate and Signal.
authorLuca Bruno <lucabru@src.gnome.org>
Mon, 10 Jan 2011 09:31:19 +0000 (10:31 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 11 Oct 2016 09:06:50 +0000 (11:06 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=639124

vala/Makefile.am
vala/valacallable.vala [new file with mode: 0644]
vala/valadelegate.vala
vala/valamethod.vala
vala/valasignal.vala

index bd16142d7ac72fd69ca98a4d616ed5e0440894a2..134d732aa9cd42ca749844af778fee77c9414c61 100644 (file)
@@ -32,6 +32,7 @@ libvalacore_la_VALASOURCES = \
        valabooleanliteral.vala \
        valabooleantype.vala \
        valabreakstatement.vala \
+       valacallable.vala \
        valacastexpression.vala \
        valacatchclause.vala \
        valacharacterliteral.vala \
diff --git a/vala/valacallable.vala b/vala/valacallable.vala
new file mode 100644 (file)
index 0000000..5b29aa9
--- /dev/null
@@ -0,0 +1,45 @@
+/* valacallable.vala
+ *
+ * Copyright (C) 2011  Luca Bruno
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ *
+ * Author:
+ *     Luca Bruno <lucabru@src.gnome.org>
+ */
+
+using GLib;
+
+/**
+ * Interface for all callable types.
+ */
+public interface Vala.Callable : CodeNode {
+       /**
+        * The return type of this callable.
+        */
+       public abstract DataType return_type { get; set; }
+
+       /**
+        * Appends parameter to this callable.
+        *
+        * @param param a formal parameter
+        */
+       public abstract void add_parameter (Parameter param);
+
+       /**
+        * Returns the parameter list.
+        */
+       public abstract List<Parameter> get_parameters ();
+}
index 73af358fcf2a1e44fc6f725d186d2f7ad6f8e1c9..6f4ae3b7cf3d580b7f291b039d9468f1cf1ed1f9 100644 (file)
@@ -25,7 +25,7 @@ using GLib;
 /**
  * Represents a function callback type.
  */
-public class Vala.Delegate : TypeSymbol {
+public class Vala.Delegate : TypeSymbol, Callable {
        /**
         * The return type of this callback.
         */
index 7c883b5cdadf35050bf0764877f471edfa960da4..f0f19809fecf04db190159a45a46d576fef92dd7 100644 (file)
@@ -27,7 +27,7 @@ using GLib;
 /**
  * Represents a type or namespace method.
  */
-public class Vala.Method : Subroutine {
+public class Vala.Method : Subroutine, Callable {
        List<TypeParameter> type_parameters;
 
        /**
index 6b05a092632621dba82e5a5278e7213efe7a5de9..17e858fd1d445fb957ceafe57d4a202d937f02d3 100644 (file)
@@ -25,7 +25,7 @@ using GLib;
 /**
  * Represents an object signal. Signals enable objects to provide notifications.
  */
-public class Vala.Signal : Symbol, Lockable {
+public class Vala.Signal : Symbol, Lockable, Callable {
        /**
         * The return type of handlers of this signal.
         */