%module template_typedef_inherit // Bug 3378145 %include std_string.i %inline %{ #include // for std::string typedef std::string String; namespace Type { template class TypedInterfaceObject { public: virtual ~TypedInterfaceObject() {} }; template class TypedCollectionInterfaceObject : public TypedInterfaceObject { public: typedef T ImplementationType; typedef typename ImplementationType::ElementType ImplementationElementType; /** Method add() appends an element to the collection */ void add(const ImplementationElementType & elt) {} }; template class PersistentCollection { public: typedef T ElementType; /** Method add() appends an element to the collection */ inline virtual void add(const T & elt) {} virtual ~PersistentCollection() {} }; } %} %template(StringPersistentCollection) Type::PersistentCollection; %inline %{ namespace Type { class DescriptionImplementation : public PersistentCollection { public: typedef PersistentCollection::ElementType ElementType; DescriptionImplementation() {} }; } %} %template(DescriptionImplementationTypedInterfaceObject) Type::TypedInterfaceObject; %template(DescriptionImplementationTypedCollectionInterfaceObject) Type::TypedCollectionInterfaceObject;