Skip to content

Commit 8314c82

Browse files
committed
Add GetTemplatedMethods to simplify proxy creation
No longer use index based interfaces to retrieve template method info
1 parent 19dcd80 commit 8314c82

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
@@ -1427,6 +1427,11 @@ bool Cppyy::IsConstMethod(TCppMethod_t method)
14271427
return Cpp::IsConstMethod(method);
14281428
}
14291429

1430+
void Cppyy::GetTemplatedMethods(TCppScope_t scope, std::vector<Cppyy::TCppMethod_t> &methods)
1431+
{
1432+
Cpp::GetFunctionTemplatedDecls(scope, methods);
1433+
}
1434+
14301435
Cppyy::TCppIndex_t Cppyy::GetNumTemplatedMethods(TCppScope_t scope, bool accept_namespace)
14311436
{
14321437
std::vector<Cppyy::TCppMethod_t> mc;
@@ -1444,21 +1449,6 @@ std::string Cppyy::GetTemplatedMethodName(TCppScope_t scope, TCppIndex_t imeth)
14441449
return "";
14451450
}
14461451

1447-
//
1448-
// bool Cppyy::IsTemplatedConstructor(TCppScope_t scope, TCppIndex_t imeth)
1449-
// {
1450-
// if (scope == (TCppScope_t)GLOBAL_HANDLE)
1451-
// return false;
1452-
//
1453-
// TClassRef& cr = type_from_handle(scope);
1454-
// if (cr.GetClass()) {
1455-
// TFunctionTemplate* f = (TFunctionTemplate*)cr->GetListOfFunctionTemplates(false)->At((int)imeth);
1456-
// return f->ExtraProperty() & kIsConstructor;
1457-
// }
1458-
//
1459-
// return false;
1460-
// }
1461-
//
14621452
bool Cppyy::ExistsMethodTemplate(TCppScope_t scope, const std::string& name)
14631453
{
14641454
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)