Commit c68490ab authored by Luca Bruno's avatar Luca Bruno Committed by Rico Tzschichholz

vala: Add common Callable interface for Method, Delegate and Signal.

https://bugzilla.gnome.org/show_bug.cgi?id=639124
parent 99aeafe6
......@@ -32,6 +32,7 @@ libvalacore_la_VALASOURCES = \
valabooleanliteral.vala \
valabooleantype.vala \
valabreakstatement.vala \
valacallable.vala \
valacastexpression.vala \
valacatchclause.vala \
valacharacterliteral.vala \
......
/* 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 ();
}
......@@ -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.
*/
......
......@@ -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;
/**
......
......@@ -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.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment