itpp_sci  1.0.0
it++ based simulation framework for scicoslab, scilab and scipy
_sci_base.hpp
1 /*xxx
2 * \brief - definition of virtual base class
3 * \author maki
4 */
5 
6 #ifndef SCI_BASE_HPP
7 #define SCI_BASE_HPP
8 
9 #include "_sci_enum_def.h"
10 
11 // ---- ITPP ----
12 #include "itpp\itbase.h"
13 #include "sci\_sci_var.hpp"
14 #include "sci\_sci_exception.hpp"
15 
16 using namespace std;
17 using namespace itpp;
18 
19 namespace SCI
20 {
21 
40 class sci_base
41 {
42 public:
43 
48  {
49  };
50 
54  virtual ~sci_base()
55  {
56  };
57 
61  sci_base* create(int sci_type);
62 
66  virtual void destroy()
67  {
68  return;
69  }
70 
76  virtual void set(int param, sci_var* p_v)
77  {
78  throw sci_exception("sci_base::set - should have been overriden");
79  return;
80  }
81 
87  virtual sci_var* get(int param)
88  {
89  sci_var* p_v;
90  p_v = NULL;
91  throw sci_exception("sci_base::get - should have been overriden");
92  return (p_v);
93  }
94 
99  virtual void exec(int command)
100  {
101  throw sci_exception("sci_base::exec - should have been overriden");
102  return;
103  }
104 
110  virtual sci_var* gen(sci_var* p_v_ce)
111  {
112  sci_var *p_y;
113  p_y = NULL;
114  throw sci_exception("sci_base::gen - should have been overriden");
115  return (p_y);
116  }
117 
124  virtual sci_var* proc(sci_var* p_v_ce, sci_var* p_v_x)
125  {
126  sci_var* p_y;
127  p_y = NULL;
128  throw sci_exception("sci_base::proc - should have been overriden");
129  return (p_y);
130  }
131 };
132 
133 
134 }
135 
136 #endif
sci_base()
constructor
Definition: _sci_base.hpp:47
virtual sci_var * proc(sci_var *p_v_ce, sci_var *p_v_x)
process data using a SCI object
Definition: _sci_base.hpp:124
virtual base class SCI_API API functions
Definition: _sci_base.hpp:40
virtual void destroy()
destroy SCI object
Definition: _sci_base.hpp:66
virtual void set(int param, sci_var *p_v)
set parameters of the SCI object
Definition: _sci_base.hpp:76
Definition: _sci_assert.cpp:35
SCI layer implements SCI_API interface as wrappers for SIM layer models.
Definition: _sci_create_sci_var.cpp:8
Abstract base for encapsulation of sci_variables.
Definition: _sci_var.hpp:23
virtual void exec(int command)
execute command for a SCI object
Definition: _sci_base.hpp:99
virtual ~sci_base()
virtual destructor
Definition: _sci_base.hpp:54
virtual sci_var * gen(sci_var *p_v_ce)
generate data using a SCI object
Definition: _sci_base.hpp:110