Skip to content

Commit 12d2a8e

Browse files
committed
Add GetTemplatedMethods to simplify proxy creation
No longer use index based interfaces to retrieve template method info
1 parent 51257cb commit 12d2a8e

File tree

2 files changed

+8
-18
lines changed

2 files changed

+8
-18
lines changed

clingwrapper/src/clingwrapper.cxx

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,6 +1429,11 @@ bool Cppyy::IsConstMethod(TCppMethod_t method)
14291429
return Cpp::IsConstMethod(method);
14301430
}
14311431

1432+
void Cppyy::GetTemplatedMethods(TCppScope_t scope, std::vector<Cppyy::TCppMethod_t> &methods)
1433+
{
1434+
Cpp::GetFunctionTemplatedDecls(scope, methods);
1435+
}
1436+
14321437
Cppyy::TCppIndex_t Cppyy::GetNumTemplatedMethods(TCppScope_t scope, bool accept_namespace)
14331438
{
14341439
std::vector<Cppyy::TCppMethod_t> mc;
@@ -1446,21 +1451,6 @@ std::string Cppyy::GetTemplatedMethodName(TCppScope_t scope, TCppIndex_t imeth)
14461451
return "";
14471452
}
14481453

1449-
//
1450-
// bool Cppyy::IsTemplatedConstructor(TCppScope_t scope, TCppIndex_t imeth)
1451-
// {
1452-
// if (scope == (TCppScope_t)GLOBAL_HANDLE)
1453-
// return false;
1454-
//
1455-
// TClassRef& cr = type_from_handle(scope);
1456-
// if (cr.GetClass()) {
1457-
// TFunctionTemplate* f = (TFunctionTemplate*)cr->GetListOfFunctionTemplates(false)->At((int)imeth);
1458-
// return f->ExtraProperty() & kIsConstructor;
1459-
// }
1460-
//
1461-
// return false;
1462-
// }
1463-
//
14641454
bool Cppyy::ExistsMethodTemplate(TCppScope_t scope, const std::string& name)
14651455
{
14661456
return Cpp::ExistsFunctionTemplate(name, scope);

clingwrapper/src/cpp_cppyy.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,14 +300,14 @@ namespace Cppyy {
300300
std::string GetMethodPrototype(TCppMethod_t, bool show_formal_args);
301301
RPY_EXPORTED
302302
bool IsConstMethod(TCppMethod_t);
303-
303+
// // Templated method/function reflection information ------------------------------------
304+
RPY_EXPORTED
305+
void GetTemplatedMethods(TCppScope_t scope, std::vector<TCppMethod_t> &methods);
304306
RPY_EXPORTED
305307
TCppIndex_t GetNumTemplatedMethods(TCppScope_t scope, bool accept_namespace = false);
306308
RPY_EXPORTED
307309
std::string GetTemplatedMethodName(TCppScope_t scope, TCppIndex_t imeth);
308310
RPY_EXPORTED
309-
bool IsTemplatedConstructor(TCppScope_t scope, TCppIndex_t imeth) { assert(0 && "IsTemplatedConstructor"); return 0; }
310-
RPY_EXPORTED
311311
bool ExistsMethodTemplate(TCppScope_t scope, const std::string& name);
312312
RPY_EXPORTED
313313
bool IsTemplatedMethod(TCppMethod_t method);

0 commit comments

Comments
 (0)