<commit_before>// @(#)root/hist:$Id$
// Author: <NAME>   12/11/09

/*************************************************************************
 * 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 "TFitResultPtr.h"
#include "TFitResult.h"
#include "TError.h"

/**
TFitResultPtr provides an indirection to the TFitResult class and with a semantics
identical to a TFitResult pointer, i.e. it is like a smart pointer to a TFitResult. 
In addition it provides an automatic comversion to an integer. In this way it can be 
returned from the TH1::Fit method and the change in TH1::Fit be backward compatible. 
The class 

 */

ClassImp(TFitResultPtr)

TFitResultPtr::TFitResultPtr(TFitResult * p) :  
   fStatus(-1), 
   fPointer(p) 
{
   // constructor from a TFitResult pointer
   if (fPointer != 0) fStatus = fPointer->Status(); 
}

TFitResultPtr::TFitResultPtr(const TFitResultPtr& rhs) : 
   fStatus(rhs.fStatus), fPointer(0)
{
   // copy constructor - create a new TFitResult if needed
   if (rhs.fPointer != 0)  fPointer = new TFitResult(*rhs);
}

TFitResultPtr::~TFitResultPtr()
{
   // destructor - delete the contained TFitResult pointer if needed
   if ( fPointer != 0)
      delete fPointer;
}


TFitResult& TFitResultPtr::operator*() const
{
   // impelment the de-reference operator to make the class acts as a pointer to a TFitResult
   // assert in case the class does not contain a pointer to TFitResult
   if  (fPointer == 0) { 
      Error("TFitResultPtr","TFitResult is empty - use the fit option S");
      return *(new TFitResult() );
   }
   return *fPointer;
}

TFitResult* TFitResultPtr::operator->() const
{
   // implement the -> operator to make the class acts as a pointer to a TFitResult
   // assert in case the class does not contain a pointer to TFitResult
   if  (fPointer == 0) { 
      Error("TFitResultPtr","TFitResult is empty - use the fit option S");
      return new TFitResult();
   }
   return fPointer;
}


TFitResultPtr & TFitResultPtr::operator=(const TFitResultPtr& rhs) 
{ 
   // assignment operator<commit_msg>fix minor typo<commit_after>// @(#)root/hist:$Id$
// Author: <NAME>   12/11/09

/*************************************************************************
 * 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 "TFitResultPtr.h"
#include "TFitResult.h"
#include "TError.h"

/**
TFitResultPtr provides an indirection to the TFitResult class and with a semantics
identical to a TFitResult pointer, i.e. it is like a smart pointer to a TFitResult. 
In addition it provides an automatic comversion to an integer. In this way it can be 
returned from the TH1::Fit method and the change in TH1::Fit be backward compatible. 
The class 

 */

ClassImp(TFitResultPtr)

TFitResultPtr::TFitResultPtr(TFitResult * p) :  
   fStatus(-1), 
   fPointer(p) 
{
   // constructor from a TFitResult pointer
   if (fPointer != 0) fStatus = fPointer->Status(); 
}

TFitResultPtr::TFitResultPtr(const TFitResultPtr& rhs) : 
   fStatus(rhs.fStatus), fPointer(0)
{
   // copy constructor - create a new TFitResult if needed
   if (rhs.fPointer != 0)  fPointer = new TFitResult(*rhs);
}

TFitResultPtr::~TFitResultPtr()
{
   // destructor - delete the contained TFitResult pointer if needed
   if ( fPointer != 0)
      delete fPointer;
}


TFitResult& TFitResultPtr::operator*() const
{
   // implement the de-reference operator to make the class acts as a pointer to a TFitResult
   // assert in case the class does not contain a pointer to TFitResult
   if  (fPointer == 0) { 
      Error("TFitResultPtr","TFitResult is empty - use the fit option S");
      return *(new TFitResult() );
   }
   return *fPointer;
}

TFitResult* TFitResultPtr::operator->() const
{
   // implement the -> operator to make the class acts as a pointer to a TFitResult
   // assert in case the class does not contain a pointer to TFitResult
   if  (fPointer == 0) { 
      Error("TFitResultPtr","TFitResult is empty - use the fit option S");
      return new TFitResult();
   }
   return fPointer;
}


TFitResultPtr & TFitResultPtr::operator=(const TFitResultPtr& rhs) 
{ 
   // assignment operator
{'fraction_non_alphanumeric': 0.15199182839632278, 'fraction_numerical': 0.009397344228804902, 'mean_word_length': 2.7982932505818465, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6864247', 'n_tokens_mistral': 1440, 'n_tokens_neox': 1367, 'n_words': 473}