~ubuntu-branches/ubuntu/hoary/swig1.3/hoary

« back to all changes in this revision

Viewing changes to Examples/test-suite/smart_pointer_multi.i

  • Committer: Bazaar Package Importer
  • Author(s): Thom May
  • Date: 2004-08-02 15:57:10 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040802155710-bm292q1d6x6tw7gc
Tags: 1.3.21-5ubuntu1
Fix linking for ruby, python, perl and tcl bindings

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Test cases for classes that do *NOT* result in smart-pointer wrapping
 
2
%module smart_pointer_multi
 
3
 
 
4
%inline %{
 
5
struct Foo {
 
6
   int x;
 
7
   int getx() { return x; }
 
8
};
 
9
 
 
10
class Bar {
 
11
   Foo *f;
 
12
public:
 
13
   Bar(Foo *f) : f(f) { }
 
14
   Foo *operator->() {
 
15
      return f;
 
16
   }
 
17
};
 
18
 
 
19
class Spam {
 
20
   Bar *b;
 
21
public:
 
22
   Spam(Bar *b) : b(b) { }
 
23
   Bar operator->() {
 
24
      return *b;
 
25
   }
 
26
};
 
27
 
 
28
class Grok {
 
29
   Bar *b;
 
30
public:
 
31
   Grok(Bar *b) : b(b) { }
 
32
   Bar &operator->() {
 
33
      return *b;
 
34
   }
 
35
};
 
36
   
 
37
%}
 
38
 
 
39