File: csharp_attributes.i

package info (click to toggle)
renderdoc 1.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 79,584 kB
  • sloc: cpp: 491,671; ansic: 285,823; python: 12,617; java: 11,345; cs: 7,181; makefile: 6,703; yacc: 5,682; ruby: 4,648; perl: 3,461; php: 2,119; sh: 2,068; lisp: 1,835; tcl: 1,068; ml: 747; xml: 137
file content (62 lines) | stat: -rw-r--r-- 2,104 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
%module(directors="1") csharp_attributes

// Test the inattributes and outattributes typemaps
%typemap(cstype, outattributes="[IntOut]", inattributes="[IntIn]") int "int"
%typemap(imtype, outattributes="[IntegerOut]", inattributes="[IntegerIn]") int "int"

%inline %{
class Stations {
public:
  Stations(int myInt) { }
  int Reading(int myInt) { return myInt; }
  static int Swindon(int myInt) { return myInt; }
};
#define TESTMACRO 10
int GlobalFunction(int myInt) { return myInt; }
%}

//%include "enumsimple.swg"
//%include "enumtypesafe.swg"

// Test the attributes feature
%csattributes MoreStations::MoreStations()      "[InterCity1]"
%csattributes MoreStations::Chippenham()        "[InterCity2]"
%csattributes MoreStations::Bath()              "[InterCity3]"
%csattributes Bristol                           "[InterCity4]"
%csattributes WestonSuperMare                   "[InterCity5]"
%csattributes Wales                             "[InterCity6]"
%csattributes Paddington()                      "[InterCity7]"
%csattributes DidcotParkway                     "[InterCity8]"
%csattributes MoreStations::Cardiff             "[System.ComponentModel.Description(\"Cardiff city station\")]"
%csattributes Swansea                           "[System.ComponentModel.Description(\"Swansea city station\")]"

%typemap(csattributes) MoreStations "[Eurostar1]"
%typemap(csattributes) MoreStations::Wales "[Eurostar2]"
%typemap(csattributes) Cymru "[Eurostar3]"

%inline %{
struct MoreStations {
  MoreStations() : Bristol(0) {}
  void Chippenham() {}
  static void Bath() {}
  int Bristol;
  static double WestonSuperMare;
  enum Wales { Cardiff = 1, Swansea };
};
void Paddington() {}
float DidcotParkway;
enum Cymru { Llanelli };

double MoreStations::WestonSuperMare = 0.0;
%}

// Test directorinattributes and directoroutattributes
%typemap(imtype, directoroutattributes="[DirectorIntegerOut]", directorinattributes="[DirectorIntegerIn]") int "int"
%feature("director") YetMoreStations;

%inline %{
struct YetMoreStations {
  virtual int Slough(int x) { return x; }
  virtual ~YetMoreStations() {}
};
%}