Revision 412, 1.6 KB
(checked in by trnewman, 15 years ago)
|
Adding Apache license information.
|
Line | |
---|
1 | /* |
---|
2 | Copyright 2009 Virginia Polytechnic Institute and State University |
---|
3 | |
---|
4 | Licensed under the Apache License, Version 2.0 (the "License"); |
---|
5 | you may not use this file except in compliance with the License. |
---|
6 | You may obtain a copy of the License at |
---|
7 | |
---|
8 | http://www.apache.org/licenses/LICENSE-2.0 |
---|
9 | |
---|
10 | Unless required by applicable law or agreed to in writing, software |
---|
11 | distributed under the License is distributed on an "AS IS" BASIS, |
---|
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
13 | See the License for the specific language governing permissions and |
---|
14 | limitations under the License. |
---|
15 | */ |
---|
16 | |
---|
17 | %module cross |
---|
18 | %{ |
---|
19 | #include "libvtcross.h" |
---|
20 | #include "containers.h" |
---|
21 | %} |
---|
22 | |
---|
23 | %typemap(in) uint32_t = int; |
---|
24 | |
---|
25 | %include "std_string.i" |
---|
26 | |
---|
27 | %include "containers.h" |
---|
28 | %include "libvtcross.h" |
---|
29 | |
---|
30 | %apply const std::string & { std::string * }; |
---|
31 | |
---|
32 | %extend Parameter { |
---|
33 | |
---|
34 | Parameter(int nparameters) { |
---|
35 | Parameter * p = new Parameter[nparameters]; |
---|
36 | return p; |
---|
37 | }; |
---|
38 | |
---|
39 | ~Parameter() { |
---|
40 | delete [] $self; |
---|
41 | }; |
---|
42 | |
---|
43 | Parameter *__getitem__(int i) { |
---|
44 | return self+i; |
---|
45 | }; |
---|
46 | |
---|
47 | |
---|
48 | }; |
---|
49 | |
---|
50 | %extend Observable { |
---|
51 | Observable(int nobservables) { |
---|
52 | Observable * o = new Observable[nobservables]; |
---|
53 | return o; |
---|
54 | }; |
---|
55 | |
---|
56 | ~Observable() { |
---|
57 | delete [] $self; |
---|
58 | }; |
---|
59 | |
---|
60 | Observable *__getitem__(int i) { |
---|
61 | return self+i; |
---|
62 | }; |
---|
63 | }; |
---|
64 | |
---|
65 | %extend Utility { |
---|
66 | Utility(int nutilities) { |
---|
67 | Utility * u = new Utility[nutilities]; |
---|
68 | return u; |
---|
69 | }; |
---|
70 | |
---|
71 | ~Utility() { |
---|
72 | delete [] $self; |
---|
73 | }; |
---|
74 | |
---|
75 | Utility *__getitem__(int i) { |
---|
76 | return self+i; |
---|
77 | }; |
---|
78 | }; |
---|