Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions clingwrapper/src/clingwrapper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,11 @@ Cppyy::TCppScope_t Cppyy::GetTypeScope(TCppScope_t var)
Cpp::GetVariableType(var));
}

std::string Cppyy::GetDoc(Cppyy::TCppScope_t scope)
{
return Cpp::GetDocString(scope);
}

Cppyy::TCppScope_t Cppyy::GetNamed(const std::string& name,
TCppScope_t parent_scope)
{
Expand All @@ -809,6 +814,19 @@ Cppyy::TCppScope_t Cppyy::GetGlobalScope()
return Cpp::GetGlobalScope();
}

bool Cppyy::IsMethod(TCppScope_t handle) {
return Cpp::IsMethod(handle);
}

bool Cppyy::IsFunction(TCppScope_t handle) {
return Cpp::IsFunction(handle);
}

bool Cppyy::IsTemplateClass(TCppScope_t handle)
{
return Cpp::IsTemplateClass(handle);
}

bool Cppyy::IsTemplate(TCppScope_t handle)
{
return Cpp::IsTemplate(handle);
Expand Down Expand Up @@ -1105,6 +1123,13 @@ bool Cppyy::IsNamespace(TCppScope_t scope)
return Cpp::IsNamespace(scope) || Cpp::GetGlobalScope() == scope;
}

bool Cppyy::IsPureNamespace(TCppScope_t scope)
{
if (!scope)
return false;
return Cpp::IsNamespace(scope);
}

bool Cppyy::IsClass(TCppScope_t scope)
{
// Test if this scope represents a namespace.
Expand Down Expand Up @@ -1475,6 +1500,11 @@ std::string Cppyy::GetMethodReturnTypeAsString(TCppMethod_t method)
Cpp::GetFunctionReturnType(method)));
}

Cppyy::TCppIndex_t Cppyy::GetTemplateNumArgs(Cpp::TCppScope_t method)
{
return Cpp::GetTemplateNumArgs(method);
}

Cppyy::TCppIndex_t Cppyy::GetMethodNumArgs(TCppMethod_t method)
{
return Cpp::GetFunctionNumArgs(method);
Expand All @@ -1485,6 +1515,9 @@ Cppyy::TCppIndex_t Cppyy::GetMethodReqArgs(TCppMethod_t method)
return Cpp::GetFunctionRequiredArgs(method);
}

std::string Cppyy::GetTemplateArgName(TCppScope_t scope, TCppIndex_t iarg) {
return Cpp::GetTemplateArgName(scope, iarg);
}
std::string Cppyy::GetMethodArgName(TCppMethod_t method, TCppIndex_t iarg)
{
if (!method)
Expand Down Expand Up @@ -1609,6 +1642,11 @@ bool Cppyy::ExistsMethodTemplate(TCppScope_t scope, const std::string& name)
}

bool Cppyy::IsTemplatedMethod(TCppMethod_t method)
{
return Cpp::IsTemplatedFunction(method) || Cpp::IsTemplateInstantiationOrSpecialization(method);
}

bool Cppyy::IsPureTemplatedMethod(TCppMethod_t method)
{
return Cpp::IsTemplatedFunction(method);
}
Expand Down Expand Up @@ -1901,6 +1939,14 @@ Cppyy::TCppScope_t Cppyy::AdaptFunctionForLambdaReturn(TCppScope_t fn) {
// return count;
// }

void Cppyy::GetMemberInNamespace(TCppScope_t ns, std::vector<TCppScope_t>& members) {
Cpp::GetDatamembersInNamespace(ns, members);
Cpp::GetFunctionsInNamespace(ns, members);
Cpp::GetClassInNamespace(ns, members);
Cpp::GetTemplatedClassInNamespace(ns, members);
Cpp::GetTemplatedFunctionsInNamespace(ns, members);
}

Cppyy::TCppType_t Cppyy::GetDatamemberType(TCppScope_t var)
{
return Cpp::GetVariableType(Cpp::GetUnderlyingScope(var));
Expand Down
18 changes: 18 additions & 0 deletions clingwrapper/src/cpp_cppyy.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ namespace Cppyy {
RPY_EXPORTED
TCppScope_t GetFullScope(const std::string& scope_name);
RPY_EXPORTED
std::string GetDoc(TCppScope_t scope);
RPY_EXPORTED
TCppScope_t GetTypeScope(TCppScope_t klass);
RPY_EXPORTED
TCppScope_t GetNamed(const std::string& scope_name,
Expand Down Expand Up @@ -203,8 +205,16 @@ namespace Cppyy {
RPY_EXPORTED
bool IsNamespace(TCppScope_t scope);
RPY_EXPORTED
bool IsPureNamespace(TCppScope_t scope);
RPY_EXPORTED
bool IsClass(TCppScope_t scope);
RPY_EXPORTED
bool IsMethod(TCppScope_t handle);
RPY_EXPORTED
bool IsFunction(TCppScope_t handle);
RPY_EXPORTED
bool IsTemplateClass(TCppScope_t scope);
RPY_EXPORTED
bool IsTemplate(TCppScope_t scope);
RPY_EXPORTED
bool IsTemplateInstantiation(TCppScope_t scope);
Expand Down Expand Up @@ -288,10 +298,14 @@ namespace Cppyy {
RPY_EXPORTED
std::string GetMethodReturnTypeAsString(TCppMethod_t);
RPY_EXPORTED
TCppIndex_t GetTemplateNumArgs(TCppScope_t);
RPY_EXPORTED
TCppIndex_t GetMethodNumArgs(TCppMethod_t);
RPY_EXPORTED
TCppIndex_t GetMethodReqArgs(TCppMethod_t);
RPY_EXPORTED
std::string GetTemplateArgName(TCppMethod_t, TCppIndex_t iarg);
RPY_EXPORTED
std::string GetMethodArgName(TCppMethod_t, TCppIndex_t iarg);
RPY_EXPORTED
TCppType_t GetMethodArgType(TCppMethod_t, TCppIndex_t iarg);
Expand Down Expand Up @@ -320,6 +334,8 @@ namespace Cppyy {
RPY_EXPORTED
bool ExistsMethodTemplate(TCppScope_t scope, const std::string& name);
RPY_EXPORTED
bool IsPureTemplatedMethod(TCppMethod_t method);
RPY_EXPORTED
bool IsTemplatedMethod(TCppMethod_t method);
RPY_EXPORTED
bool IsStaticTemplate(TCppScope_t scope, const std::string& name);
Expand Down Expand Up @@ -365,6 +381,8 @@ namespace Cppyy {
RPY_EXPORTED
TCppScope_t AdaptFunctionForLambdaReturn(TCppScope_t fn);
RPY_EXPORTED
void GetMemberInNamespace(TCppScope_t ns, std::vector<TCppScope_t>& members);
RPY_EXPORTED
TCppType_t GetDatamemberType(TCppScope_t data);
RPY_EXPORTED
std::string GetDatamemberTypeAsString(TCppScope_t var);
Expand Down
Loading