add/fix protected/private bases + template
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6747 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
590c322f99
commit
56e38db2de
2 changed files with 49 additions and 7 deletions
|
|
@ -21,4 +21,42 @@ public:
|
||||||
Spam() { }
|
Spam() { }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
template <class Type>
|
||||||
|
class NRFilter {
|
||||||
|
public:
|
||||||
|
virtual ~NRFilter()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void do_filter() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class Type>
|
||||||
|
class NRRCFilter : public NRFilter<Type>
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
template <class Type>
|
||||||
|
class NRRCFilterpro : protected NRFilter<Type>
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
template <class Type>
|
||||||
|
class NRRCFilterpri : private NRFilter<Type>
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
%template(NRFilter_i) NRFilter<int>;
|
||||||
|
|
||||||
|
%template(NRRCFilter_i) NRRCFilter<int>;
|
||||||
|
|
||||||
|
%template(NRRCFilterpro_i) NRRCFilterpro<int>;
|
||||||
|
|
||||||
|
%template(NRRCFilterpri_i) NRRCFilterpri<int>;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -92,13 +92,17 @@ cparse_template_expand(Node *n, String *tname, String *rname, String *templatear
|
||||||
} else if (Strcmp(nodeType(n),"class") == 0) {
|
} else if (Strcmp(nodeType(n),"class") == 0) {
|
||||||
/* Patch base classes */
|
/* Patch base classes */
|
||||||
{
|
{
|
||||||
List *bases = Getattr(n,"baselist");
|
char *baselists[] = {"baselist","protectedbaselist","privatebaselist"};
|
||||||
if (bases) {
|
int b = 0;
|
||||||
int i;
|
for (b = 0; b < 3; ++b) {
|
||||||
for (i = 0; i < Len(bases); i++) {
|
List *bases = Getattr(n,baselists[b]);
|
||||||
String *name = Copy(Getitem(bases,i));
|
if (bases) {
|
||||||
Setitem(bases,i,name);
|
int i;
|
||||||
Append(typelist,name);
|
for (i = 0; i < Len(bases); i++) {
|
||||||
|
String *name = Copy(Getitem(bases,i));
|
||||||
|
Setitem(bases,i,name);
|
||||||
|
Append(typelist,name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue