Statistics
| Branch: | Revision:

root / src / org.omnetpp.ide.nativelibs / scave-plove.i @ 0418c1a0

History | View | Annotate | Download (1.92 KB)

1
%{
2
#include "node.h"
3
#include "dataflowmanager.h"
4
#include "nodetype.h"
5
#include "nodetyperegistry.h"
6
#include "arraybuilder.h"
7
#include "xyarray.h"
8
%}
9

    
10
// covariant return type warning disabled
11
#pragma SWIG nowarn=822
12

    
13
%include "commondefs.i"
14
%include "std_common.i"
15
%include "std_string.i"
16
%include "std_map.i"
17
%include "std_vector.i"
18
%include "std_list.i"    // our custom version
19

    
20
namespace std {
21

    
22
   //
23
   // Without the following macro (defined in std_map.i in the swig library),
24
   // get() returns string *pointer* (because of T& retval); this macro defines
25
   // get() to return T so it'll be just string. Same with NodeType*.
26
   //
27
   specialize_std_map_on_both(std::string,,,,std::string,,,);
28

    
29
   // generate needed template specializations
30
   %template(StringMap) map<string,string>;
31
   %template(NodeTypeVector) vector<NodeType*>;
32
};
33

    
34
//
35
// We publish very little of the Node and Port classes into Java,
36
// just enough to assemble the data-flow engine. We hide Channel and
37
// Datum altogether.
38
//
39

    
40
class NodeType;
41
class XYArray;
42

    
43
class Port
44
{
45
  private:
46
    Port(); // prevent generating a default public one
47
    ~Port();
48
  public:
49
    Node *getNode();
50
};
51

    
52
%newobject Node::getArray;
53

    
54
class Node
55
{
56
  private:
57
    Node(); // prevent generating a default public one
58
    ~Node();
59
  public:
60
    NodeType *getNodeType() const;
61
    %extend {
62
        XYArray *getArray() {
63
            ArrayBuilderNode *abNode = dynamic_cast<ArrayBuilderNode *>(self);
64
            return abNode ? abNode->getArray() : NULL;
65
        }
66
    }
67
};
68

    
69

    
70
%ignore DataflowManager::addNode; // it's included in NodeType::create()
71

    
72
%ignore XYArray::XYArray;
73

    
74
%ignore NodeTypeRegistry::parseFilterSpec;
75
//
76
// NodeType, NodeTypeRegistry and DataflowManager are published in their entirety
77
// to Java.
78
//
79
%include "nodetype.h"
80
%include "nodetyperegistry.h"
81
%include "dataflowmanager.h"
82
%include "xyarray.h"
83

    
84