Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::TModuleGenerator Class Reference

Definition at line 36 of file TModuleGenerator.h.

Public Types

enum  ESourceFileKind { kSFKNotC , kSFKHeader , kSFKSource , kSFKLinkdef }
 

Public Member Functions

 TModuleGenerator (clang::CompilerInstance *CI, bool inlineHeader, const std::string &shLibFileName, bool isInPCH)
 
 ~TModuleGenerator ()
 
const std::string & GetContentName () const
 
const std::string & GetDemangledDictionaryName () const
 
const std::string & GetDictionaryName () const
 
int GetErrorCount () const
 
const std::vector< std::string > & GetHeaders () const
 
const std::vector< std::string > & GetIncludePaths () const
 
const std::string & GetModuleDirName () const
 
const std::string & GetModuleFileName () const
 
const std::string & GetUmbrellaName () const
 
bool IsPCH () const
 
void ParseArgs (const std::vector< std::string > &args)
 Parse -I -D -U headers.h SomethingLinkdef.h.
 
void WriteContentHeader (std::ostream &out) const
 Write a header file describing the content of this module through a series of variables inside the namespace ROOT::Dict::[DictionaryName].
 
std::ostream & WritePPDefines (std::ostream &out) const
 Write #ifndef FOO # define FOO=bar #endif
 
std::ostream & WritePPUndefines (std::ostream &out) const
 Write #ifdef FOO # undef FOO #endif
 
void WriteRegistrationSource (std::ostream &out, const std::string &fwdDeclnArgsToKeepString, const std::string &headersClassesMapString, const std::string &fwdDeclsString, const std::string &extraIncludes, bool hasCxxModule) const
 
void WriteUmbrellaHeader (std::ostream &out) const
 Write a header file pulling in the content of this module through a series of #defined, #undefs and #includes.
 

Private Types

typedef std::vector< std::pair< std::string, std::string > > StringPairVec_t
 

Private Member Functions

void ConvertToCppString (std::string &text) const
 
bool FindHeader (const std::string &hdrName, std::string &hdrFullPath) const
 Return true if the header is found in the include paths in this case also fill the full path variable with the full path.
 
ESourceFileKind GetSourceFileKind (const char *filename) const
 Check whether the file's extension is compatible with C or C++.
 
std::ostream & WriteDefinesArray (std::ostream &out) const
 
std::ostream & WriteHeaderArray (std::ostream &out) const
 
std::ostream & WriteIncludePathArray (std::ostream &out) const
 
std::ostream & WritePPCode (std::ostream &out) const
 
std::ostream & WritePPIncludes (std::ostream &out) const
 Write #include "header1.h" #include "header2.h" or, if inlining of headers is requested, dump the content of the files.
 
void WriteRegistrationSourceImpl (std::ostream &out, const std::string &dictName, const std::string &demangledDictName, const std::vector< std::string > &headerArray, const std::vector< std::string > &includePathArray, const std::string &fwdDeclStringRAW, const std::string &fwdDeclnArgsToKeepString, const std::string &payloadCodeWrapped, const std::string &headersClassesMapString, const std::string &extraIncludes, bool hasCxxModule) const
 
std::ostream & WriteStringPairVec (const StringPairVec_t &vecP, std::ostream &out) const
 
std::ostream & WriteStringVec (const std::vector< std::string > &vec, std::ostream &out) const
 
std::ostream & WriteUndefinesArray (std::ostream &out) const
 

Private Attributes

clang::CompilerInstance * fCI
 
StringPairVec_t fCompD
 
std::vector< std::string > fCompI
 
std::vector< std::string > fCompU
 
std::string fContentName
 
std::string fDemangledDictionaryName
 
std::string fDictionaryName
 
int fErrorCount
 
std::vector< std::string > fHeaders
 
bool fInlineInputHeaders
 
bool fIsInPCH
 
bool fIsPCH
 
std::string fLinkDefFile
 
std::string fModuleDirName
 
std::string fModuleFileName
 
std::string fUmbrellaName
 

#include </home/sftnight/build/workspace/root-makedoc-v628/rootspi/rdoc/src/v6-28-00-patches/core/dictgen/res/TModuleGenerator.h>

Member Typedef Documentation

◆ StringPairVec_t

typedef std::vector<std::pair<std::string, std::string> > ROOT::TModuleGenerator::StringPairVec_t
private

Definition at line 144 of file TModuleGenerator.h.

Member Enumeration Documentation

◆ ESourceFileKind

Enumerator
kSFKNotC 
kSFKHeader 
kSFKSource 
kSFKLinkdef 

Definition at line 38 of file TModuleGenerator.h.

Constructor & Destructor Documentation

◆ TModuleGenerator()

TModuleGenerator::TModuleGenerator ( clang::CompilerInstance *  CI,
bool  inlineHeader,
const std::string &  shLibFileName,
bool  isInPCH 
)

Definition at line 45 of file TModuleGenerator.cxx.

◆ ~TModuleGenerator()

TModuleGenerator::~TModuleGenerator ( )

Definition at line 91 of file TModuleGenerator.cxx.

Member Function Documentation

◆ ConvertToCppString()

void ROOT::TModuleGenerator::ConvertToCppString ( std::string &  text) const
private

◆ FindHeader()

bool TModuleGenerator::FindHeader ( const std::string &  hdrName,
std::string &  hdrFullPath 
) const
private

Return true if the header is found in the include paths in this case also fill the full path variable with the full path.

Definition at line 567 of file TModuleGenerator.cxx.

◆ GetContentName()

const std::string & ROOT::TModuleGenerator::GetContentName ( ) const
inline

Definition at line 79 of file TModuleGenerator.h.

◆ GetDemangledDictionaryName()

const std::string & ROOT::TModuleGenerator::GetDemangledDictionaryName ( ) const
inline

Definition at line 61 of file TModuleGenerator.h.

◆ GetDictionaryName()

const std::string & ROOT::TModuleGenerator::GetDictionaryName ( ) const
inline

Definition at line 57 of file TModuleGenerator.h.

◆ GetErrorCount()

int ROOT::TModuleGenerator::GetErrorCount ( ) const
inline

Definition at line 72 of file TModuleGenerator.h.

◆ GetHeaders()

const std::vector< std::string > & ROOT::TModuleGenerator::GetHeaders ( ) const
inline

Definition at line 83 of file TModuleGenerator.h.

◆ GetIncludePaths()

const std::vector< std::string > & ROOT::TModuleGenerator::GetIncludePaths ( ) const
inline

Definition at line 87 of file TModuleGenerator.h.

◆ GetModuleDirName()

const std::string & ROOT::TModuleGenerator::GetModuleDirName ( ) const
inline

Definition at line 68 of file TModuleGenerator.h.

◆ GetModuleFileName()

const std::string & ROOT::TModuleGenerator::GetModuleFileName ( ) const
inline

Definition at line 65 of file TModuleGenerator.h.

◆ GetSourceFileKind()

TModuleGenerator::ESourceFileKind TModuleGenerator::GetSourceFileKind ( const char *  filename) const
private

Check whether the file's extension is compatible with C or C++.

Return whether source, header, Linkdef or nothing.

Definition at line 102 of file TModuleGenerator.cxx.

◆ GetUmbrellaName()

const std::string & ROOT::TModuleGenerator::GetUmbrellaName ( ) const
inline

Definition at line 76 of file TModuleGenerator.h.

◆ IsPCH()

bool ROOT::TModuleGenerator::IsPCH ( ) const
inline

Definition at line 52 of file TModuleGenerator.h.

◆ ParseArgs()

void TModuleGenerator::ParseArgs ( const std::vector< std::string > &  args)

Parse -I -D -U headers.h SomethingLinkdef.h.

Definition at line 180 of file TModuleGenerator.cxx.

◆ WriteContentHeader()

void TModuleGenerator::WriteContentHeader ( std::ostream &  out) const

Write a header file describing the content of this module through a series of variables inside the namespace ROOT::Dict::[DictionaryName].

Each variable is an array of string literals, with a const char* of 0 being the last element, e.g. ROOT::Dict::_DictName::arrIncludes[] = { "A.h", "B.h", 0 };

Definition at line 543 of file TModuleGenerator.cxx.

◆ WriteDefinesArray()

std::ostream & ROOT::TModuleGenerator::WriteDefinesArray ( std::ostream &  out) const
inlineprivate

Definition at line 133 of file TModuleGenerator.h.

◆ WriteHeaderArray()

std::ostream & ROOT::TModuleGenerator::WriteHeaderArray ( std::ostream &  out) const
inlineprivate

Definition at line 125 of file TModuleGenerator.h.

◆ WriteIncludePathArray()

std::ostream & ROOT::TModuleGenerator::WriteIncludePathArray ( std::ostream &  out) const
inlineprivate

Definition at line 129 of file TModuleGenerator.h.

◆ WritePPCode()

std::ostream & ROOT::TModuleGenerator::WritePPCode ( std::ostream &  out) const
inlineprivate

Definition at line 117 of file TModuleGenerator.h.

◆ WritePPDefines()

std::ostream & TModuleGenerator::WritePPDefines ( std::ostream &  out) const

Write #ifndef FOO # define FOO=bar #endif

Definition at line 216 of file TModuleGenerator.cxx.

◆ WritePPIncludes()

std::ostream & TModuleGenerator::WritePPIncludes ( std::ostream &  out) const
private

Write #include "header1.h" #include "header2.h" or, if inlining of headers is requested, dump the content of the files.

Definition at line 288 of file TModuleGenerator.cxx.

◆ WritePPUndefines()

std::ostream & TModuleGenerator::WritePPUndefines ( std::ostream &  out) const

Write #ifdef FOO # undef FOO #endif

Definition at line 238 of file TModuleGenerator.cxx.

◆ WriteRegistrationSource()

void TModuleGenerator::WriteRegistrationSource ( std::ostream &  out,
const std::string &  fwdDeclnArgsToKeepString,
const std::string &  headersClassesMapString,
const std::string &  fwdDeclsString,
const std::string &  extraIncludes,
bool  hasCxxModule 
) const

Definition at line 399 of file TModuleGenerator.cxx.

◆ WriteRegistrationSourceImpl()

void TModuleGenerator::WriteRegistrationSourceImpl ( std::ostream &  out,
const std::string &  dictName,
const std::string &  demangledDictName,
const std::vector< std::string > &  headerArray,
const std::vector< std::string > &  includePathArray,
const std::string &  fwdDeclStringRAW,
const std::string &  fwdDeclnArgsToKeepString,
const std::string &  payloadCodeWrapped,
const std::string &  headersClassesMapString,
const std::string &  extraIncludes,
bool  hasCxxModule 
) const
private

Definition at line 348 of file TModuleGenerator.cxx.

◆ WriteStringPairVec()

std::ostream & TModuleGenerator::WriteStringPairVec ( const StringPairVec_t vecP,
std::ostream &  out 
) const
private

Definition at line 325 of file TModuleGenerator.cxx.

◆ WriteStringVec()

std::ostream & TModuleGenerator::WriteStringVec ( const std::vector< std::string > &  vec,
std::ostream &  out 
) const
private

Definition at line 313 of file TModuleGenerator.cxx.

◆ WriteUmbrellaHeader()

void TModuleGenerator::WriteUmbrellaHeader ( std::ostream &  out) const

Write a header file pulling in the content of this module through a series of #defined, #undefs and #includes.

The sequence corrsponds to a rootcling invocation with -c -DFOO -UBAR header.h I.e. defines, undefines and finally includes.

Definition at line 603 of file TModuleGenerator.cxx.

◆ WriteUndefinesArray()

std::ostream & ROOT::TModuleGenerator::WriteUndefinesArray ( std::ostream &  out) const
inlineprivate

Definition at line 137 of file TModuleGenerator.h.

Member Data Documentation

◆ fCI

clang::CompilerInstance* ROOT::TModuleGenerator::fCI
private

Definition at line 152 of file TModuleGenerator.h.

◆ fCompD

StringPairVec_t ROOT::TModuleGenerator::fCompD
private

Definition at line 168 of file TModuleGenerator.h.

◆ fCompI

std::vector<std::string> ROOT::TModuleGenerator::fCompI
private

Definition at line 166 of file TModuleGenerator.h.

◆ fCompU

std::vector<std::string> ROOT::TModuleGenerator::fCompU
private

Definition at line 169 of file TModuleGenerator.h.

◆ fContentName

std::string ROOT::TModuleGenerator::fContentName
private

Definition at line 162 of file TModuleGenerator.h.

◆ fDemangledDictionaryName

std::string ROOT::TModuleGenerator::fDemangledDictionaryName
private

Definition at line 158 of file TModuleGenerator.h.

◆ fDictionaryName

std::string ROOT::TModuleGenerator::fDictionaryName
private

Definition at line 157 of file TModuleGenerator.h.

◆ fErrorCount

int ROOT::TModuleGenerator::fErrorCount
mutableprivate

Definition at line 170 of file TModuleGenerator.h.

◆ fHeaders

std::vector<std::string> ROOT::TModuleGenerator::fHeaders
private

Definition at line 164 of file TModuleGenerator.h.

◆ fInlineInputHeaders

bool ROOT::TModuleGenerator::fInlineInputHeaders
private

Definition at line 155 of file TModuleGenerator.h.

◆ fIsInPCH

bool ROOT::TModuleGenerator::fIsInPCH
private

Definition at line 154 of file TModuleGenerator.h.

◆ fIsPCH

bool ROOT::TModuleGenerator::fIsPCH
private

Definition at line 153 of file TModuleGenerator.h.

◆ fLinkDefFile

std::string ROOT::TModuleGenerator::fLinkDefFile
private

Definition at line 165 of file TModuleGenerator.h.

◆ fModuleDirName

std::string ROOT::TModuleGenerator::fModuleDirName
private

Definition at line 160 of file TModuleGenerator.h.

◆ fModuleFileName

std::string ROOT::TModuleGenerator::fModuleFileName
private

Definition at line 159 of file TModuleGenerator.h.

◆ fUmbrellaName

std::string ROOT::TModuleGenerator::fUmbrellaName
private

Definition at line 161 of file TModuleGenerator.h.

  • core/dictgen/res/TModuleGenerator.h
  • core/dictgen/src/TModuleGenerator.cxx