2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2010-2010 - DIGITEO - Bruno JOFRET
5 * Copyright (C) 2012 - 2016 - Scilab Enterprises
7 * This file is hereby licensed under the terms of the GNU GPL v2.0,
8 * pursuant to article 5.3.4 of the CeCILL v.2.1.
9 * This file was originally licensed under the terms of the CeCILL v2.1,
10 * and continues to be available under such terms.
11 * For more information, see the COPYING file which you should have received
12 * along with this program.
20 #include "container.hxx"
24 class EXTERN_AST List : public Container
31 std::vector<InternalType *>* getData();
32 List(List *_oListCopyMe);
34 int getSize() const override;
36 void whoAmI(void) override
38 std::cout << "types::List";
41 inline ScilabType getType(void) override
45 inline ScilabId getId(void) override
50 bool getMemory(long long* _piSize, long long* _piSizePlusType) override;
53 ** append(InternalType *_typedValue)
54 ** Append the given value to the end of the List
56 List* append(InternalType *_typedValue);
60 ** Create a new List and Copy all values.
62 virtual List* clone() override;
64 bool toString(std::wostringstream& ostr) override;
66 bool isList() override
71 List* insert(typed_list* _pArgs, InternalType* _pSource) override;
72 InternalType* extract(typed_list* _pArgs) override;
74 virtual bool invoke(typed_list & in, optional_list & /*opt*/, int /*_iRetCount*/, typed_list & out, const ast::Exp & /*e*/) override
82 InternalType * _out = extract(&in);
89 List* pList = _out->getAs<types::List>();
90 for (int i = 0; i < pList->getSize(); i++)
92 out.push_back(pList->get(i));
100 virtual bool isInvokable() const override
105 virtual bool hasInvokeOption() const override
110 virtual int getInvokeNbIn() override
115 virtual int getInvokeNbOut() override
120 virtual InternalType* get(const int _iIndex);
121 virtual List* set(const int _iIndex, InternalType* _pIT);
123 /* return type as string ( double, int, cell, list, ... )*/
124 virtual std::wstring getTypeStr() const override
128 /* return type as short string ( s, i, ce, l, ... )*/
129 virtual std::wstring getShortTypeStr() const override
134 virtual bool operator==(const InternalType& it) override;
137 std::vector<InternalType *>* m_plData;
141 #endif /* __LIST_HH__ */