Skip to content

Commit d88ab8b

Browse files
WIP
1 parent 960b35c commit d88ab8b

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

clingwrapper/src/clingwrapper.cxx

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,19 @@ Cppyy::TCppScope_t Cppyy::GetGlobalScope()
809809
return Cpp::GetGlobalScope();
810810
}
811811

812+
bool Cppyy::IsMethod(TCppScope_t handle) {
813+
return Cpp::IsMethod(handle);
814+
}
815+
816+
bool Cppyy::IsFunction(TCppScope_t handle) {
817+
return Cpp::IsFunction(handle);
818+
}
819+
820+
bool Cppyy::IsTemplateClass(TCppScope_t handle)
821+
{
822+
return Cpp::IsTemplateClass(handle);
823+
}
824+
812825
bool Cppyy::IsTemplate(TCppScope_t handle)
813826
{
814827
return Cpp::IsTemplate(handle);
@@ -1105,6 +1118,13 @@ bool Cppyy::IsNamespace(TCppScope_t scope)
11051118
return Cpp::IsNamespace(scope) || Cpp::GetGlobalScope() == scope;
11061119
}
11071120

1121+
bool Cppyy::IsPureNamespace(TCppScope_t scope)
1122+
{
1123+
if (!scope)
1124+
return false;
1125+
return Cpp::IsNamespace(scope);
1126+
}
1127+
11081128
bool Cppyy::IsClass(TCppScope_t scope)
11091129
{
11101130
// Test if this scope represents a namespace.
@@ -1475,6 +1495,11 @@ std::string Cppyy::GetMethodReturnTypeAsString(TCppMethod_t method)
14751495
Cpp::GetFunctionReturnType(method)));
14761496
}
14771497

1498+
Cppyy::TCppIndex_t Cppyy::GetTemplateNumArgs(Cpp::TCppScope_t method)
1499+
{
1500+
return Cpp::GetTemplateNumArgs(method);
1501+
}
1502+
14781503
Cppyy::TCppIndex_t Cppyy::GetMethodNumArgs(TCppMethod_t method)
14791504
{
14801505
return Cpp::GetFunctionNumArgs(method);
@@ -1485,6 +1510,9 @@ Cppyy::TCppIndex_t Cppyy::GetMethodReqArgs(TCppMethod_t method)
14851510
return Cpp::GetFunctionRequiredArgs(method);
14861511
}
14871512

1513+
std::string Cppyy::GetTemplateArgName(TCppScope_t scope, TCppIndex_t iarg) {
1514+
return Cpp::GetTemplateArgName(scope, iarg);
1515+
}
14881516
std::string Cppyy::GetMethodArgName(TCppMethod_t method, TCppIndex_t iarg)
14891517
{
14901518
if (!method)
@@ -1609,6 +1637,11 @@ bool Cppyy::ExistsMethodTemplate(TCppScope_t scope, const std::string& name)
16091637
}
16101638

16111639
bool Cppyy::IsTemplatedMethod(TCppMethod_t method)
1640+
{
1641+
return Cpp::IsTemplatedFunction(method) || Cpp::IsTemplateInstantiationOrSpecialization(method);
1642+
}
1643+
1644+
bool Cppyy::IsPureTemplatedMethod(TCppMethod_t method)
16121645
{
16131646
return Cpp::IsTemplatedFunction(method);
16141647
}
@@ -1901,6 +1934,14 @@ Cppyy::TCppScope_t Cppyy::AdaptFunctionForLambdaReturn(TCppScope_t fn) {
19011934
// return count;
19021935
// }
19031936

1937+
void Cppyy::GetMemberInNamespace(TCppScope_t ns, std::vector<TCppScope_t>& members) {
1938+
Cpp::GetDatamembersInNamespace(ns, members);
1939+
Cpp::GetFunctionsInNamespace(ns, members);
1940+
Cpp::GetClassInNamespace(ns, members);
1941+
Cpp::GetTemplatedClassInNamespace(ns, members);
1942+
Cpp::GetTemplatedFunctionsInNamespace(ns, members);
1943+
}
1944+
19041945
Cppyy::TCppType_t Cppyy::GetDatamemberType(TCppScope_t var)
19051946
{
19061947
return Cpp::GetVariableType(Cpp::GetUnderlyingScope(var));

clingwrapper/src/cpp_cppyy.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,16 @@ namespace Cppyy {
203203
RPY_EXPORTED
204204
bool IsNamespace(TCppScope_t scope);
205205
RPY_EXPORTED
206+
bool IsPureNamespace(TCppScope_t scope);
207+
RPY_EXPORTED
206208
bool IsClass(TCppScope_t scope);
207209
RPY_EXPORTED
210+
bool IsMethod(TCppScope_t handle);
211+
RPY_EXPORTED
212+
bool IsFunction(TCppScope_t handle);
213+
RPY_EXPORTED
214+
bool IsTemplateClass(TCppScope_t scope);
215+
RPY_EXPORTED
208216
bool IsTemplate(TCppScope_t scope);
209217
RPY_EXPORTED
210218
bool IsTemplateInstantiation(TCppScope_t scope);
@@ -288,10 +296,14 @@ namespace Cppyy {
288296
RPY_EXPORTED
289297
std::string GetMethodReturnTypeAsString(TCppMethod_t);
290298
RPY_EXPORTED
299+
TCppIndex_t GetTemplateNumArgs(TCppScope_t);
300+
RPY_EXPORTED
291301
TCppIndex_t GetMethodNumArgs(TCppMethod_t);
292302
RPY_EXPORTED
293303
TCppIndex_t GetMethodReqArgs(TCppMethod_t);
294304
RPY_EXPORTED
305+
std::string GetTemplateArgName(TCppMethod_t, TCppIndex_t iarg);
306+
RPY_EXPORTED
295307
std::string GetMethodArgName(TCppMethod_t, TCppIndex_t iarg);
296308
RPY_EXPORTED
297309
TCppType_t GetMethodArgType(TCppMethod_t, TCppIndex_t iarg);
@@ -320,6 +332,8 @@ namespace Cppyy {
320332
RPY_EXPORTED
321333
bool ExistsMethodTemplate(TCppScope_t scope, const std::string& name);
322334
RPY_EXPORTED
335+
bool IsPureTemplatedMethod(TCppMethod_t method);
336+
RPY_EXPORTED
323337
bool IsTemplatedMethod(TCppMethod_t method);
324338
RPY_EXPORTED
325339
bool IsStaticTemplate(TCppScope_t scope, const std::string& name);
@@ -365,6 +379,8 @@ namespace Cppyy {
365379
RPY_EXPORTED
366380
TCppScope_t AdaptFunctionForLambdaReturn(TCppScope_t fn);
367381
RPY_EXPORTED
382+
void GetMemberInNamespace(TCppScope_t ns, std::vector<TCppScope_t>& members);
383+
RPY_EXPORTED
368384
TCppType_t GetDatamemberType(TCppScope_t data);
369385
RPY_EXPORTED
370386
std::string GetDatamemberTypeAsString(TCppScope_t var);

0 commit comments

Comments
 (0)