2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2008-2008 - DIGITEO - Antoine ELIAS
4 * Copyright (C) 2010-2010 - DIGITEO - Bruno JOFRET
6 * Copyright (C) 2012 - 2016 - Scilab Enterprises
8 * This file is hereby licensed under the terms of the GNU GPL v2.0,
9 * pursuant to article 5.3.4 of the CeCILL v.2.1.
10 * This file was originally licensed under the terms of the CeCILL v2.1,
11 * and continues to be available under such terms.
12 * For more information, see the COPYING file which you should have received
13 * along with this program.
17 #ifndef __CALLABLE_HXX__
18 #define __CALLABLE_HXX__
21 #include "internal.hxx"
23 #include "visitor.hxx"
25 //disable warnings about exports STL items
27 #pragma warning (disable : 4251)
32 class EXTERN_AST Callable : public InternalType
42 Callable(): InternalType()
47 virtual ~Callable() {}
49 bool isCallable() override
54 virtual ReturnValue call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out) = 0;
56 virtual bool invoke(typed_list & in, optional_list & opt, int _iRetCount, typed_list & out, const ast::Exp & e) override;
58 virtual bool isInvokable() const override
63 virtual bool hasInvokeOption() const override
68 virtual int getInvokeNbIn() override
70 return getNbInputArgument();
73 virtual int getInvokeNbOut() override
75 return getNbOutputArgument();
78 void setName(const std::wstring& _wstName)
82 const std::wstring& getName()
86 void setModule(const std::wstring& _wstModule)
88 m_wstModule = _wstModule;
90 std::wstring getModule()
95 /* return type as string ( double, int, cell, list, ... )*/
96 virtual std::wstring getTypeStr() const override
100 /* return type as short string ( s, i, ce, l, ... )*/
101 virtual std::wstring getShortTypeStr() const override = 0;
102 virtual InternalType* clone(void) override = 0;
104 virtual bool isAssignable(void) override
109 virtual int getNbInputArgument(void)
114 virtual int getNbOutputArgument(void)
119 virtual int getFirstLine(void)
124 virtual int getLastLine(void)
129 virtual void setLines(int _iFirstLine, int _iLastLine)
131 m_iFirstLine = _iFirstLine;
132 m_iLastLine = _iLastLine;
136 std::wstring m_wstName;
137 std::string m_stName;
138 std::wstring m_wstModule;
145 #endif /* !__CALLABLE_HXX__ */