Logo ROOT  
Reference Guide
ROOT::TMetaUtils::AST2SourceTools Namespace Reference

Functions

const std::string Decls2FwdDecls (const std::vector< const clang::Decl * > &decls, bool(*ignoreFiles)(const clang::PresumedLoc &), const cling::Interpreter &interp)
 
int EncloseInNamespaces (const clang::Decl &decl, std::string &defString)
 Take the namespaces which enclose the decl and put them around the definition string. More...
 
const clang::RecordDecl * EncloseInScopes (const clang::Decl &decl, std::string &defString)
 Take the scopes which enclose the decl and put them around the definition string. More...
 
int FwdDeclFromFcnDecl (const clang::FunctionDecl &fcnDecl, const cling::Interpreter &interpreter, std::string &defString)
 
int FwdDeclFromRcdDecl (const clang::RecordDecl &recordDecl, const cling::Interpreter &interpreter, std::string &defString, bool acceptStl=false)
 Convert a rcd decl to its fwd decl If this is a template specialisation, treat in the proper way. More...
 
int FwdDeclFromTmplDecl (const clang::TemplateDecl &tmplDecl, const cling::Interpreter &interpreter, std::string &defString)
 Convert a tmplt decl to its fwd decl. More...
 
int FwdDeclFromTypeDefNameDecl (const clang::TypedefNameDecl &tdnDecl, const cling::Interpreter &interpreter, std::string &fwdDeclString, std::unordered_set< std::string > *fwdDeclSet=nullptr)
 Extract "forward declaration" of a typedef. More...
 
int GetDefArg (const clang::ParmVarDecl &par, std::string &valAsString, const clang::PrintingPolicy &pp)
 Get the default value as string. More...
 
int PrepareArgsForFwdDecl (std::string &templateArgs, const clang::TemplateParameterList &tmplParamList, const cling::Interpreter &interpreter)
 Loop over the template parameters and build a string for template arguments using the fully qualified name There are different cases: Case 1: a simple template parameter E.g. More...
 

Function Documentation

◆ Decls2FwdDecls()

const std::string ROOT::TMetaUtils::AST2SourceTools::Decls2FwdDecls ( const std::vector< const clang::Decl * > &  decls,
bool(*)(const clang::PresumedLoc &)  ignoreFiles,
const cling::Interpreter &  interp 
)

◆ EncloseInNamespaces()

int ROOT::TMetaUtils::AST2SourceTools::EncloseInNamespaces ( const clang::Decl &  decl,
std::string &  defString 
)

Take the namespaces which enclose the decl and put them around the definition string.

For example, if the definition string is "myClass" which is enclosed by the namespaces ns1 and ns2, one would get: namespace ns2{ namespace ns1 { class myClass; } }

Definition at line 5133 of file TClingUtils.cxx.

◆ EncloseInScopes()

const clang::RecordDecl * ROOT::TMetaUtils::AST2SourceTools::EncloseInScopes ( const clang::Decl &  decl,
std::string &  defString 
)

Take the scopes which enclose the decl and put them around the definition string.

If a class is encountered, bail out.

Definition at line 5145 of file TClingUtils.cxx.

◆ FwdDeclFromFcnDecl()

int ROOT::TMetaUtils::AST2SourceTools::FwdDeclFromFcnDecl ( const clang::FunctionDecl &  fcnDecl,
const cling::Interpreter &  interpreter,
std::string &  defString 
)

◆ FwdDeclFromRcdDecl()

int ROOT::TMetaUtils::AST2SourceTools::FwdDeclFromRcdDecl ( const clang::RecordDecl &  recordDecl,
const cling::Interpreter &  interpreter,
std::string &  defString,
bool  acceptStl = false 
)

Convert a rcd decl to its fwd decl If this is a template specialisation, treat in the proper way.

If it is contained in a class, just fwd declare the class.

Definition at line 5335 of file TClingUtils.cxx.

◆ FwdDeclFromTmplDecl()

int ROOT::TMetaUtils::AST2SourceTools::FwdDeclFromTmplDecl ( const clang::TemplateDecl &  tmplDecl,
const cling::Interpreter &  interpreter,
std::string &  defString 
)

Convert a tmplt decl to its fwd decl.

Definition at line 5246 of file TClingUtils.cxx.

◆ FwdDeclFromTypeDefNameDecl()

int ROOT::TMetaUtils::AST2SourceTools::FwdDeclFromTypeDefNameDecl ( const clang::TypedefNameDecl &  tdnDecl,
const cling::Interpreter &  interpreter,
std::string &  fwdDeclString,
std::unordered_set< std::string > *  fwdDeclSetPtr = nullptr 
)

Extract "forward declaration" of a typedef.

If the typedef is contained in a class, just fwd declare the class. If not, fwd declare the typedef and all the dependent typedefs and types if necessary.

Definition at line 5406 of file TClingUtils.cxx.

◆ GetDefArg()

int ROOT::TMetaUtils::AST2SourceTools::GetDefArg ( const clang::ParmVarDecl &  par,
std::string &  valAsString,
const clang::PrintingPolicy &  ppolicy 
)

Get the default value as string.

Limited at the moment to:

  • Integers
  • Booleans

Definition at line 5486 of file TClingUtils.cxx.

◆ PrepareArgsForFwdDecl()

int ROOT::TMetaUtils::AST2SourceTools::PrepareArgsForFwdDecl ( std::string &  templateArgs,
const clang::TemplateParameterList &  tmplParamList,
const cling::Interpreter &  interpreter 
)

Loop over the template parameters and build a string for template arguments using the fully qualified name There are different cases: Case 1: a simple template parameter E.g.

template<typename T> class A; Case 2: a non-type: either an integer or an enum E.g. template<int I, Foo > class A; where Foo is enum Foo {red, blue}; 2 sub cases here: SubCase 2.a: the parameter is an enum: bail out, cannot be treated. SubCase 2.b: use the fully qualified name Case 3: a TemplateTemplate argument E.g. template <template <typename> class T> class container { };

Definition at line 5184 of file TClingUtils.cxx.