|
From: lacktrum <la...@in...> - 2009-07-01 23:26:45
|
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?
>
> Thanks,
>
> Truman Lackey
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Swig-user mailing list
> Swi...@li...
> https://lists.sourceforge.net/lists/listinfo/swig-user
>
>
To answer my own question I placed the following in my .i file:
namespace foo {
class Handle
public:
....
};
}
class Handle
public:
....
};
This handles both namespaced references to Handle and non namespace
references.
Is there possible a more elegant way to resolve this?
As it is right now I have a lot of class code replication in my SWIG file.
--
View this message in context: http://www.nabble.com/namespace-alias-in-C%2B%2B-to-C--tp24280964p24294672.html
Sent from the swig-user mailing list archive at Nabble.com.
|