Xcos MVC: Avoid leaking memory and pass the tests
[scilab.git] / scilab / modules / scicos / src / cpp / view_scilab / BlockAdapter.hxx
1 /*
2  *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3  *  Copyright (C) 2014-2014 - Scilab Enterprises - Clement DAVID
4  *
5  *  This file must be used under the terms of the CeCILL.
6  *  This source file is licensed as described in the file COPYING, which
7  *  you should have received as part of this distribution.  The terms
8  *  are also available at
9  *  http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
10  *
11  */
12
13 #ifndef BLOCKADAPTER_HXX_
14 #define BLOCKADAPTER_HXX_
15
16 #include <string>
17 #include <memory>
18
19 #include "utilities.hxx"
20 #include "BaseAdapter.hxx"
21 #include "model/Block.hxx"
22
23 namespace org_scilab_modules_scicos
24 {
25 namespace view_scilab
26 {
27
28 class BlockAdapter : public BaseAdapter<BlockAdapter, org_scilab_modules_scicos::model::Block>
29 {
30 public:
31     BlockAdapter(std::shared_ptr<org_scilab_modules_scicos::model::Block> adaptee);
32     BlockAdapter(const BlockAdapter& adapter);
33     ~BlockAdapter();
34
35     static const std::wstring getSharedTypeStr()
36     {
37         return L"Block";
38     }
39
40     std::wstring getTypeStr();
41     std::wstring getShortTypeStr();
42
43     types::InternalType* getRpar() const;
44     void setRpar(types::InternalType* v);
45
46     types::InternalType* getDocContent() const;
47     void setDocContent(types::InternalType* v);
48
49 private:
50     types::InternalType* rpar_content;
51
52     types::InternalType* doc_content;
53 };
54
55 } /* namespace view_scilab */
56 } /* namespace org_scilab_modules_scicos */
57
58 #endif /* BLOCKADAPTER_HXX_ */