diff options
author | Bruno JOFRET <bruno.jofret@scilab.org> | 2010-03-01 11:08:02 +0100 |
---|---|---|
committer | Bruno JOFRET <bruno.jofret@scilab.org> | 2010-03-01 11:08:02 +0100 |
commit | a37ea64a3599e3dec253e02a1e66230a7a7c4450 (patch) | |
tree | b12d643ed5eed2816d61a27a6eab8fd59d1e02cd | |
parent | 77fefcdb12cc14b1f5ace2892a7b46e4ad8c58a0 (diff) | |
download | scilab-object.zip scilab-object.tar.gz |
Adding virtual functions that now need implementationobject
-rw-r--r-- | scilab/modules/types/includes/objectmatrix.hxx | 2 | ||||
-rw-r--r-- | scilab/modules/types/includes/ooutils.hxx | 9 | ||||
-rw-r--r-- | scilab/modules/types/src/cpp/class.cpp | 4 | ||||
-rw-r--r-- | scilab/modules/types/src/cpp/objectmatrix.cpp | 2 | ||||
-rw-r--r-- | scilab/modules/types/src/cpp/ooutils-private.hxx | 17 |
5 files changed, 26 insertions, 8 deletions
diff --git a/scilab/modules/types/includes/objectmatrix.hxx b/scilab/modules/types/includes/objectmatrix.hxx index f680a7e..dbcdfd7 100644 --- a/scilab/modules/types/includes/objectmatrix.hxx +++ b/scilab/modules/types/includes/objectmatrix.hxx | |||
@@ -28,7 +28,7 @@ namespace types | |||
28 | Object **GetElems() { return m_pObj; } | 28 | Object **GetElems() { return m_pObj; } |
29 | bool SetElem(int pos, Object *val); | 29 | bool SetElem(int pos, Object *val); |
30 | bool SetElem(int row, int col, Object *val); | 30 | bool SetElem(int row, int col, Object *val); |
31 | bool Insert(int row, int col, const ObjectMatrix *other); | 31 | bool Insert(int row, int col, ObjectMatrix *other); |
32 | 32 | ||
33 | std::string toString(int, int); | 33 | std::string toString(int, int); |
34 | void whoAmI() { std::cout << "types::Object"; } | 34 | void whoAmI() { std::cout << "types::Object"; } |
diff --git a/scilab/modules/types/includes/ooutils.hxx b/scilab/modules/types/includes/ooutils.hxx index 628867d..7d1ecaad 100644 --- a/scilab/modules/types/includes/ooutils.hxx +++ b/scilab/modules/types/includes/ooutils.hxx | |||
@@ -29,6 +29,15 @@ namespace types | |||
29 | 29 | ||
30 | typedef Callable::ReturnValue (*GW_METH)(typed_list &_in, int _iRetCount, typed_list &_out, const MethodCallCtx &_ctx); | 30 | typedef Callable::ReturnValue (*GW_METH)(typed_list &_in, int _iRetCount, typed_list &_out, const MethodCallCtx &_ctx); |
31 | 31 | ||
32 | std::string toString(int _iPrecision, int _iLineLen) | ||
33 | { | ||
34 | // FIXME : Return something usable | ||
35 | return "FIXME : Method"; | ||
36 | } | ||
37 | |||
38 | // FIXME : Should not return NULL; | ||
39 | Method* clone() { return NULL; } | ||
40 | |||
32 | Callable::ReturnValue call(typed_list &_in, int _iRetCount, typed_list &_out); | 41 | Callable::ReturnValue call(typed_list &_in, int _iRetCount, typed_list &_out); |
33 | Callable::ReturnValue call(typed_list &_in, int _iRetCount, typed_list &_out, const MethodCallCtx &_ctx) | 42 | Callable::ReturnValue call(typed_list &_in, int _iRetCount, typed_list &_out, const MethodCallCtx &_ctx) |
34 | { | 43 | { |
diff --git a/scilab/modules/types/src/cpp/class.cpp b/scilab/modules/types/src/cpp/class.cpp index c03362c..df93ab6 100644 --- a/scilab/modules/types/src/cpp/class.cpp +++ b/scilab/modules/types/src/cpp/class.cpp | |||
@@ -71,7 +71,7 @@ namespace types | |||
71 | { | 71 | { |
72 | if(m_instanceSlots.find(p_slotName) != m_instanceSlots.end()) | 72 | if(m_instanceSlots.find(p_slotName) != m_instanceSlots.end()) |
73 | { | 73 | { |
74 | printf("Error: slot already exists\n"); | 74 | std::cerr <<"Error: slot already exists" << std::endl; |
75 | return; | 75 | return; |
76 | } | 76 | } |
77 | 77 | ||
@@ -108,7 +108,7 @@ namespace types | |||
108 | { | 108 | { |
109 | if(m_instanceSlots.find(p_slotName) != m_instanceSlots.end()) | 109 | if(m_instanceSlots.find(p_slotName) != m_instanceSlots.end()) |
110 | { | 110 | { |
111 | printf("Error: slot already exists\n"); | 111 | std::cerr << "Error: slot already exists" << std::endl; |
112 | return; | 112 | return; |
113 | } | 113 | } |
114 | 114 | ||
diff --git a/scilab/modules/types/src/cpp/objectmatrix.cpp b/scilab/modules/types/src/cpp/objectmatrix.cpp index f748ccc..ca99c6c 100644 --- a/scilab/modules/types/src/cpp/objectmatrix.cpp +++ b/scilab/modules/types/src/cpp/objectmatrix.cpp | |||
@@ -133,7 +133,7 @@ namespace types | |||
133 | return true; | 133 | return true; |
134 | } | 134 | } |
135 | 135 | ||
136 | bool ObjectMatrix::Insert(int row, int col, const ObjectMatrix *other) | 136 | bool ObjectMatrix::Insert(int row, int col, ObjectMatrix *other) |
137 | { | 137 | { |
138 | /* Out of bounds check */ | 138 | /* Out of bounds check */ |
139 | if(row + other->rows_get() > m_iRows || col + other->cols_get() > m_iCols) | 139 | if(row + other->rows_get() > m_iRows || col + other->cols_get() > m_iCols) |
diff --git a/scilab/modules/types/src/cpp/ooutils-private.hxx b/scilab/modules/types/src/cpp/ooutils-private.hxx index ff055ad..9e29664 100644 --- a/scilab/modules/types/src/cpp/ooutils-private.hxx +++ b/scilab/modules/types/src/cpp/ooutils-private.hxx | |||
@@ -20,11 +20,20 @@ namespace types | |||
20 | class BoundMethod: public Callable | 20 | class BoundMethod: public Callable |
21 | { | 21 | { |
22 | public: | 22 | public: |
23 | BoundMethod(Callable *_pFunc, Object *_pSelf, Object *_pLevel, ObjectMatrix *_pSender); | 23 | BoundMethod(Callable *_pFunc, Object *_pSelf, Object *_pLevel, ObjectMatrix *_pSender); |
24 | virtual ~BoundMethod(); | 24 | virtual ~BoundMethod(); |
25 | |||
26 | std::string toString(int _iPrecision, int _iLineLen) | ||
27 | { | ||
28 | // FIXME : Return something usable | ||
29 | return "FIXME : BoundMethod"; | ||
30 | } | ||
31 | |||
32 | // FIXME : Should not return NULL; | ||
33 | BoundMethod* clone() { return NULL; } | ||
25 | 34 | ||
26 | Callable::ReturnValue call(typed_list &_in, int _iRetCount, typed_list &_out); | 35 | Callable::ReturnValue call(typed_list &_in, int _iRetCount, typed_list &_out); |
27 | virtual Callable::ReturnValue InnerCall(typed_list &_in, int _iRetCount, typed_list &_out); | 36 | virtual Callable::ReturnValue InnerCall(typed_list &_in, int _iRetCount, typed_list &_out); |
28 | 37 | ||
29 | protected: | 38 | protected: |
30 | Callable *m_pFunc; | 39 | Callable *m_pFunc; |