« Return to Thread: namespace alias in C++ to C#

Re: namespace alias in C++ to C#

by wsfulton :: Rate this Message:

Reply to Author | View in Thread

tlackey@... wrote:

> I am new to using swig and I am having a problem accessing a class in an
> aliased namespace correctly.
>
> the header file:
>
> namespace bar=foo;
>
> namespace foo {
>    class Handle
>      public:
>       ....
>    };
> }
>
> swig file:
>
>
> class Handle
>     public:
>       ....
> };
>
> When the swig wrapper is created  the code is like:
>
> bar::Handle;
>
> and it creates a generic swig pointer for it:
> SWIGTYPE_p_bar_Handle
>
> It also creates the C# proxy class for the generic pointer
> SWIGTYPE_p_bar_Handle.cs and the Handle.cs class.
>
> How do I get the generic swig pointer and the Handle to be the same?
>
Give SWIG valid C++ code that will compile with a C++ compiler, for example:

%inline %{

namespace foo {
    class Handle {
      public:
//      ....
    };
}
namespace bar=foo;
void func(bar::Handle) {}

%}

William

------------------------------------------------------------------------------
_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user

 « Return to Thread: namespace alias in C++ to C#