Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake/MacroRootDict.cmake adding std:: containing struct to dictionary #356

Merged
merged 4 commits into from
Dec 28, 2022
Merged
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
49 changes: 47 additions & 2 deletions cmake/MacroRootDict.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,58 @@ MACRO(GEN_ROOT_DICT_LINKDEF_HEADER _namespace)
SET(_input_headers ${ARGN})
SET(_linkdef_header "${ROOT_DICT_OUTPUT_DIR}/${_namespace}_Linkdef.h")

#message ( STATUS "${_input_headers}" )

######### This code is used to identify and add std:: lists that use a struct to LinkDef
file (STRINGS "${_input_headers}" lines)
string(FIND "${lines}" "struct" FOUND_STRUCT )
set ( _structName "NONE" )
if ( FOUND_STRUCT GREATER 0 )
string(SUBSTRING "${lines}" ${FOUND_STRUCT} 50 subline)
string(FIND "${subline}" "{" FOUND_OPEN_BRACE )
# It helps to filter some undesired occurences of struct. But it limits the size of the struct name
if ( FOUND_OPEN_BRACE GREATER 0 AND FOUND_OPEN_BRACE LESS 30 )
string( SUBSTRING "${subline}" 7 ${FOUND_OPEN_BRACE} _structName)
string( FIND "${_structName}" " {" FOUND_OPEN_BRACE )
string( SUBSTRING "${_structName}" 0 ${FOUND_OPEN_BRACE} _structName)
endif ( FOUND_OPEN_BRACE GREATER 0 AND FOUND_OPEN_BRACE LESS 30 )
endif ( FOUND_STRUCT GREATER 0 )

set ( FOUND_STD_STRUCT "NO" )
if( NOT _structName MATCHES "NONE" )
#message( STATUS "Found::${_structName}::" )
while(lines)
list(POP_FRONT lines LINE)
# message( STATUS "This is line::${LINE}::" )
string( FIND "${LINE}" "${_structName}" FOUND_STRUCT_NAME )
string( FIND "${LINE}" "std::" FOUND_STD )
if ( FOUND_STRUCT_NAME GREATER 0 AND FOUND_STD GREATER 0 )
string( SUBSTRING "${LINE}" ${FOUND_STD} -1 LINE)
string( FIND "${LINE}" ">" FOUND_END REVERSE)
if ( FOUND_END GREATER 0 AND FOUND_END LESS 80 )
MATH(EXPR FOUND_END "${FOUND_END}+1")
string( SUBSTRING "${LINE}" 0 ${FOUND_END} LINE)
message( STATUS "Adding ${LINE} to the dictionary!" )
set ( FOUND_STD_STRUCT "${LINE}" )
endif ( FOUND_END GREATER 0 AND FOUND_END LESS 80 )
endif ( FOUND_STRUCT_NAME GREATER 0 AND FOUND_STD GREATER 0 )

string(FIND LINE "${_structName}" FOUND_STRUCT_NAME )
endwhile()
endif( NOT _structName MATCHES "NONE" )
######### This code is used to identify and add std:: lists that use a struct to LinkDef

FOREACH (_header ${_input_headers})
SET(${_namespace}_file_contents "${${_namespace}_file_contents}#ifdef __CINT__" \n)
SET(${_namespace}_file_contents "${${_namespace}_file_contents}#ifdef __ROOTCLING__" \n)
SET(${_namespace}_file_contents "${${_namespace}_file_contents}#pragma link off all globals\;" \n)
SET(${_namespace}_file_contents "${${_namespace}_file_contents}#pragma link off all classes\;" \n)
SET(${_namespace}_file_contents "${${_namespace}_file_contents}#pragma link off all functions\;" \n)
SET(${_namespace}_file_contents "${${_namespace}_file_contents}#pragma link C++ nestedclasses\;" \n)
SET(${_namespace}_file_contents "${${_namespace}_file_contents}#pragma link C++ nestedclasses\;" \n)
SET(${_namespace}_file_contents "${${_namespace}_file_contents}#pragma link C++ nestedtypedef\;" \n)
if( NOT FOUND_STD_STRUCT MATCHES "NO" )
SET(${_namespace}_file_contents "${${_namespace}_file_contents}#pragma link C++ class ${_structName}+\;" \n)
SET(${_namespace}_file_contents "${${_namespace}_file_contents}#pragma link C++ class ${FOUND_STD_STRUCT}+\;" \n)
endif( NOT FOUND_STD_STRUCT MATCHES "NO" )
SET(${_namespace}_file_contents "${${_namespace}_file_contents}#pragma link C++ class ${_namespace}+\;" \n)
SET(${_namespace}_file_contents "${${_namespace}_file_contents}#endif" \n)
ENDFOREACH ()
Expand Down
2 changes: 0 additions & 2 deletions source/framework/core/inc/TRestAnalysisPlot.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,11 @@ class TRestAnalysisPlot : public TRestMetadata {

std::vector<std::string> fPlotNamesCheck; //!

#ifndef __CINT__
TRestRun* fRun; //! TRestRun to handle output file
std::vector<TString> fRunInputFileName; //! TRestRun to handle input file
TCanvas* fCombinedCanvas; //! Output canvas
Long64_t fDrawNEntries; //!
Long64_t fDrawFirstEntry; //!
#endif

void AddFileFromExternalRun();
void AddFileFromEnv();
Expand Down
8 changes: 2 additions & 6 deletions source/framework/core/inc/TRestBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
/// Event browser for different input file
class TRestBrowser {
protected:
#ifndef __CINT__
TGMainFrame* frmMain = nullptr; //!
TGMainFrame* frmBot = nullptr; //!

Expand Down Expand Up @@ -62,12 +61,10 @@ class TRestBrowser {

TBrowser* fBrowser = nullptr; //!
TRestRun* fRestRun = nullptr; //!
#endif

private:
#ifndef __CINT__
Bool_t pureAnalysis;
TString fInputFileName;
Bool_t pureAnalysis; //!
TString fInputFileName; //!

TRestEventViewer* fEventViewer = nullptr; //!

Expand All @@ -77,7 +74,6 @@ class TRestBrowser {
void SetBottomPanelButtons();
Bool_t LoadEventId(Int_t eventID, Int_t subEventID = -1);
Bool_t LoadEventEntry(Int_t n);
#endif

public:
// tool method
Expand Down
2 changes: 0 additions & 2 deletions source/framework/core/inc/TRestEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@ class TRestEvent : public TObject {
Bool_t fOk; ///< Flag to be used by processes to define an event status. fOk=true is the default.

TRestRun* fRun = nullptr; //!
#ifndef __CINT__

TPad* fPad; //!
#endif

void RestartPad(Int_t nElements);

Expand Down