<commit_before>// @(#)root/meta:$Id$
// Author: <NAME>   08/02/95

/*************************************************************************
 * Copyright (C) 1995-2000, <NAME> and <NAME>.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#include "TBaseClass.h"
#include "TClass.h"
#include "TInterpreter.h"
#include <limits.h>

//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  Each class (see TClass) has a linked list of its base class(es).    //
//  This class describes one single base class.                         //
//  The base class info is obtained via the CINT api.                   //
//     see class TCling.                                                 //
//                                                                      //
//  The base class information is used a.o. in to find all inherited    //
//  methods.                                                            //
//                                                                      //
//////////////////////////////////////////////////////////////////////////


ClassImp(TBaseClass)

//______________________________________________________________________________
TBaseClass::TBaseClass(BaseClassInfo_t *info, TClass *cl) :
TDictionary(), fInfo(info), fClass(cl), fDelta(INT_MAX),
   fProperty(-1), fSTLType(-1)
{
   // Default TBaseClass ctor. TBaseClasses are constructed in TClass
   // via a call to TCling::CreateListOfBaseClasses().

   if (fInfo) SetName(gCling->BaseClassInfo_FullName(fInfo));
}

//______________________________________________________________________________
TBaseClass::~TBaseClass()
{
   // TBaseClass dtor deletes adopted CINT BaseClassInfo object.

   gCling->BaseClassInfo_Delete(fInfo);
}

//______________________________________________________________________________
void TBaseClass::Browse(TBrowser *b)
{
   // Called by the browser, to browse a baseclass.

   TClass *c = GetClassPointer();
   if (c) c->Browse(b);
}

//______________________________________________________________________________
TClass *TBaseClass::GetClassPointer(Bool_t load)
{
   // Get pointer to the base class TClass.

   if (!fClassPtr) {
      if (fInfo) fClassPtr = TClass::GetClass(gCling->BaseClassInfo_ClassInfo(fInfo),load);
      else fClassPtr = TClass::GetClass(fName, load);
   }
   return fClassPtr;
}

//______________________________________________________________________________
Int_t TBaseClass::GetDelta()
{
   // Get offset from "this" to part of base class.

   // Initialized to INT_MAX to signal that it's unset; -1 is a valid value
   // meaning "cannot calculate base offset".
   if (fDelta == INT_MAX)
      fDelta = (Int_t)gCling->BaseClassInfo_Offset(fInfo);
   return fDelta;
}

//______________________________________________________________________________
const char *TBaseClass::GetTitle() const
{
   // Get base class description (comment).

   TClass *c = ((TBaseClass *)this)->GetClassPointer();
   return c ? c->GetTitle() : "";
}

//______________________________________________________________________________
ROOT::ESTLType TBaseClass::IsSTLContainer()
{
   // Return which type (if any) of STL container the data member is.

   // fSTLType is -1 if not yet evaulated.
   // fSTLType is -2 if no fInfo was available.

   if (fSTLType < 0) {
      if (!fInfo) {
         fSTLType = -2;
      } else {
         const char *type = gCling->BaseClassInfo_TmpltName(fInfo);
         if (!type)                          fSTLType = ROOT::kNotSTL;
         else if (!strcmp(type, "vector"))   fSTLType = ROOT::kSTLvector;
         else if (!strcmp(type, "list"))     fSTLType = ROOT::kSTLlist;
         else if (!strcmp(type, "deque"))    fSTLType = ROOT::kSTLdeque;
         else if (!strcmp(type, "map"))      fSTLType = ROOT::kSTLmap;
         else if (!strcmp(type, "multimap")) fSTLType = ROOT::kSTLmultimap;
         else if (!strcmp(type, "set"))      fSTLType = ROOT::kSTLset;
         else if (!strcmp(type, "multiset")) fSTLType = ROOT::kSTLmultiset;
         else                                fSTLType = ROOT::kNotSTL;
      }
   }
   if (fSTLType == -2) return ROOT::kNotSTL;
   return (ROOT::ESTLType) fSTLType;
}

//______________________________________________________________________________
Long_t TBaseClass::Property() const
{
   // Get property description word. For meaning of bits see EProperty.
   if (fProperty == -1)
      fProperty = gCling->BaseClassInfo_Property(fInfo);
   return fProperty;
}

//______________________________________________________________________________
void TBaseClass::Streamer(TBuffer& b) {
   // Stream an object of TBaseClass. Triggers the calculation of the
   // cache variables to store them.
   this->TBaseClass::Streamer(b);
   if (b.IsReading()) {
      b.ReadClassBuffer(Class(), this);
   } else {
      // Writing.
      GetDelta();
      Property();
      IsSTLContainer();
      b.WriteClassBuffer(Class(), this);
   }
}
<commit_msg>Call the proper base class streamer!<commit_after>// @(#)root/meta:$Id$
// Author: <NAME>   08/02/95

/*************************************************************************
 * Copyright (C) 1995-2000, <NAME> and <NAME>.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#include "TBaseClass.h"
#include "TClass.h"
#include "TInterpreter.h"
#include <limits.h>

//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  Each class (see TClass) has a linked list of its base class(es).    //
//  This class describes one single base class.                         //
//  The base class info is obtained via the CINT api.                   //
//     see class TCling.                                                 //
//                                                                      //
//  The base class information is used a.o. in to find all inherited    //
//  methods.                                                            //
//                                                                      //
//////////////////////////////////////////////////////////////////////////


ClassImp(TBaseClass)

//______________________________________________________________________________
TBaseClass::TBaseClass(BaseClassInfo_t *info, TClass *cl) :
TDictionary(), fInfo(info), fClass(cl), fDelta(INT_MAX),
   fProperty(-1), fSTLType(-1)
{
   // Default TBaseClass ctor. TBaseClasses are constructed in TClass
   // via a call to TCling::CreateListOfBaseClasses().

   if (fInfo) SetName(gCling->BaseClassInfo_FullName(fInfo));
}

//______________________________________________________________________________
TBaseClass::~TBaseClass()
{
   // TBaseClass dtor deletes adopted CINT BaseClassInfo object.

   gCling->BaseClassInfo_Delete(fInfo);
}

//______________________________________________________________________________
void TBaseClass::Browse(TBrowser *b)
{
   // Called by the browser, to browse a baseclass.

   TClass *c = GetClassPointer();
   if (c) c->Browse(b);
}

//______________________________________________________________________________
TClass *TBaseClass::GetClassPointer(Bool_t load)
{
   // Get pointer to the base class TClass.

   if (!fClassPtr) {
      if (fInfo) fClassPtr = TClass::GetClass(gCling->BaseClassInfo_ClassInfo(fInfo),load);
      else fClassPtr = TClass::GetClass(fName, load);
   }
   return fClassPtr;
}

//______________________________________________________________________________
Int_t TBaseClass::GetDelta()
{
   // Get offset from "this" to part of base class.

   // Initialized to INT_MAX to signal that it's unset; -1 is a valid value
   // meaning "cannot calculate base offset".
   if (fDelta == INT_MAX)
      fDelta = (Int_t)gCling->BaseClassInfo_Offset(fInfo);
   return fDelta;
}

//______________________________________________________________________________
const char *TBaseClass::GetTitle() const
{
   // Get base class description (comment).

   TClass *c = ((TBaseClass *)this)->GetClassPointer();
   return c ? c->GetTitle() : "";
}

//______________________________________________________________________________
ROOT::ESTLType TBaseClass::IsSTLContainer()
{
   // Return which type (if any) of STL container the data member is.

   // fSTLType is -1 if not yet evaulated.
   // fSTLType is -2 if no fInfo was available.

   if (fSTLType < 0) {
      if (!fInfo) {
         fSTLType = -2;
      } else {
         const char *type = gCling->BaseClassInfo_TmpltName(fInfo);
         if (!type)                          fSTLType = ROOT::kNotSTL;
         else if (!strcmp(type, "vector"))   fSTLType = ROOT::kSTLvector;
         else if (!strcmp(type, "list"))     fSTLType = ROOT::kSTLlist;
         else if (!strcmp(type, "deque"))    fSTLType = ROOT::kSTLdeque;
         else if (!strcmp(type, "map"))      fSTLType = ROOT::kSTLmap;
         else if (!strcmp(type, "multimap")) fSTLType = ROOT::kSTLmultimap;
         else if (!strcmp(type, "set"))      fSTLType = ROOT::kSTLset;
         else if (!strcmp(type, "multiset")) fSTLType = ROOT::kSTLmultiset;
         else                                fSTLType = ROOT::kNotSTL;
      }
   }
   if (fSTLType == -2) return ROOT::kNotSTL;
   return (ROOT::ESTLType) fSTLType;
}

//______________________________________________________________________________
Long_t TBaseClass::Property() const
{
   // Get property description word. For meaning of bits see EProperty.
   if (fProperty == -1)
      fProperty = gCling->BaseClassInfo_Property(fInfo);
   return fProperty;
}

//______________________________________________________________________________
void TBaseClass::Streamer(TBuffer& b) {
   // Stream an object of TBaseClass. Triggers the calculation of the
   // cache variables to store them.
   this->TDictionary::Streamer(b);
   if (b.IsReading()) {
      b.ReadClassBuffer(Class(), this);
   } else {
      // Writing.
      b.WriteClassBuffer(Class(), this);
   }
}

{'fraction_non_alphanumeric': 0.1561801935964259, 'fraction_numerical': 0.004281459419210722, 'mean_word_length': 2.1742983751846383, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 38, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4123529', 'n_tokens_mistral': 2797, 'n_tokens_neox': 2730, 'n_words': 714}