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

« back to all changes in this revision

Viewing changes to Examples/test-suite/ruby/track_objects_directors.i

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:16:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205011604-ygx904it6413k3go
Tags: 1.3.27-1ubuntu1
Resynchronise with Debian again, for the new subversion packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%module(directors="1") track_objects_directors
 
2
 
 
3
%{
 
4
#include <string>
 
5
%}
 
6
 
 
7
%include "std_string.i";
 
8
%feature("director") Foo;
 
9
 
 
10
%trackobjects;
 
11
 
 
12
%inline %{
 
13
 
 
14
class Foo {
 
15
public:
 
16
        Foo() {}
 
17
        virtual ~Foo() {}
 
18
        virtual std::string ping() 
 
19
        {
 
20
                return "Foo::ping()";
 
21
        }
 
22
 
 
23
        virtual std::string pong()
 
24
        {
 
25
                return "Foo::pong();" + ping();
 
26
        }
 
27
};
 
28
 
 
29
 
 
30
class Container {
 
31
        Foo* foo_;
 
32
public:
 
33
        Foo* get_foo() 
 
34
        {
 
35
                return foo_;
 
36
        }
 
37
 
 
38
        void set_foo(Foo *foo)
 
39
        {
 
40
                foo_ = foo;
 
41
        }
 
42
};
 
43
 
 
44
%}