~nizamov-shawkat/python-meep/devel

« back to all changes in this revision

Viewing changes to meep_mpi_wrap.h

  • Committer: Nizamov Shawkat
  • Date: 2009-11-10 09:52:59 UTC
  • Revision ID: nizamov.shawkat@gmail.com-20091110095259-721br1mtx42jye2u
merging, step by step 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* ----------------------------------------------------------------------------
2
 
 * This file was automatically generated by SWIG (http://www.swig.org).
3
 
 * Version 1.3.39
4
 
 * 
5
 
 * This file is not intended to be easily readable and contains a number of 
6
 
 * coding conventions designed to improve portability and efficiency. Do not make
7
 
 * changes to this file unless you know what you are doing--modify the SWIG 
8
 
 * interface file instead. 
9
 
 * ----------------------------------------------------------------------------- */
10
 
 
11
 
#ifndef SWIG_meep_mpi_WRAP_H_
12
 
#define SWIG_meep_mpi_WRAP_H_
13
 
 
14
 
#include <map>
15
 
#include <string>
16
 
 
17
 
 
18
 
class SwigDirector_Callback : public meep::Callback, public Swig::Director {
19
 
 
20
 
public:
21
 
    SwigDirector_Callback(PyObject *self);
22
 
    virtual ~SwigDirector_Callback();
23
 
    virtual void double_vec(meep::vec const &x);
24
 
    virtual void complex_vec(meep::vec const &x);
25
 
    virtual void complex_time(double const &t);
26
 
 
27
 
 
28
 
/* Internal Director utilities */
29
 
public:
30
 
    bool swig_get_inner(const char* name) const {
31
 
      std::map<std::string, bool>::const_iterator iv = inner.find(name);
32
 
      return (iv != inner.end() ? iv->second : false);
33
 
    }
34
 
 
35
 
    void swig_set_inner(const char* name, bool val) const
36
 
    { inner[name] = val;}
37
 
 
38
 
private:
39
 
    mutable std::map<std::string, bool> inner;
40
 
 
41
 
 
42
 
#if defined(SWIG_PYTHON_DIRECTOR_VTABLE)
43
 
/* VTable implementation */
44
 
    PyObject *swig_get_method(size_t method_index, const char *method_name) const {
45
 
      PyObject *method = vtable[method_index];
46
 
      if (!method) {
47
 
        swig::SwigVar_PyObject name = SWIG_Python_str_FromChar(method_name);
48
 
        method = PyObject_GetAttr(swig_get_self(), name);
49
 
        if (method == NULL) {
50
 
          std::string msg = "Method in class Callback doesn't exist, undefined ";
51
 
          msg += method_name;
52
 
          Swig::DirectorMethodException::raise(msg.c_str());
53
 
        }
54
 
        vtable[method_index] = method;
55
 
      };
56
 
      return method;
57
 
    }
58
 
private:
59
 
    mutable swig::SwigVar_PyObject vtable[3];
60
 
#endif
61
 
 
62
 
};
63
 
 
64
 
 
65
 
#endif