git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9881 626c5289-ae23-0410-ae9c-e8d60b6d4f22
52 lines
900 B
OpenEdge ABL
52 lines
900 B
OpenEdge ABL
|
|
%module smart_pointer_templatemethods
|
|
|
|
%inline %{
|
|
namespace ns {
|
|
|
|
template <typename T>
|
|
class Ptr
|
|
{
|
|
public:
|
|
Ptr () {}
|
|
T *operator -> () { return 0; }
|
|
};
|
|
|
|
typedef unsigned short uint16_t;
|
|
class InterfaceId
|
|
{
|
|
public:
|
|
InterfaceId (uint16_t iid) {}
|
|
InterfaceId() {}
|
|
};
|
|
|
|
template <typename K> class Objekt
|
|
{
|
|
public:
|
|
Objekt () {}
|
|
virtual ~Objekt () {}
|
|
Ptr<K> QueryInterface (InterfaceId iid) const { return Ptr<K>(); }
|
|
void DisposeObjekt (void) {}
|
|
};
|
|
|
|
class Object
|
|
{
|
|
public:
|
|
Object () {}
|
|
virtual ~Object () {}
|
|
template <typename T> Ptr<T> QueryInterface (InterfaceId iid) const { return Ptr<T>(); }
|
|
void DisposeObject (void) {}
|
|
};
|
|
|
|
#ifdef SWIG
|
|
%template(PtrObject) Ptr<Object>;
|
|
%template(PtrInt) Ptr<int>;
|
|
%template(ObjektInt) Objekt<int>;
|
|
%template(PtrObjektInt) Ptr<Objekt<int> >;
|
|
%template(QueryInterfaceObject) Object::QueryInterface<Object>;
|
|
#endif
|
|
|
|
}; // namespace
|
|
|
|
%}
|
|
|