<commit_before>/// \file ROOT/THistDrawingOpts.h
/// \ingroup Hist ROOT7
/// \author <NAME> <<EMAIL>>
/// \date 2015-09-04
/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
/// is welcome!

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

#ifndef ROOT7_THistDrawingOpts
#define ROOT7_THistDrawingOpts

#include <ROOT/TDrawingOptsBase.hxx>

namespace ROOT {
namespace Experimental {

namespace Internal {

template <int DIMENSION>
class THistDrawingOptsBase: public TDrawingOptsBase {
   /// Index of the line color in TCanvas's color table.
   size_t fLineColorIndex = (size_t) -1;
   /// The pad containing this Drawable, used to register colors.
   TPadBase& fPad;

public:
   THistDrawingOptsBase(TPadBase& pad) = default;

   void SetLineColor(const TColor& col) {
       fPad.RegisterColor(fLineColorIndex, col);
   }
};

/// Specialization containing 1D hist drawing options.
template <>
struct THistDrawingOptsEnum<1> {
   enum EOpts { kErrors, kBar, kText };
};

/// Specialization containing 2D hist drawing options.
template <>
struct THistDrawingOptsEnum<2> {
   enum EOpts { kBox, kText, kLego };
};

/// Specialization containing 3D hist drawing options.
template <>
struct THistDrawingOptsEnum<3> {
   enum EOpts { kLego, kIso };
};

} // namespace Internal

/** \class THistDrawingOpts
 Drawing options for a histogram with DIMENSIONS
 */
template <int DIMENSION>
class THistDrawingOpts {
   int fOpts;

public:
   THistDrawingOpts() = default;
   constexpr THistDrawingOpts(typename Internal::THistDrawingOptsEnum<DIMENSION>::EOpts opt): fOpts(2 >> opt) {}
};

namespace Hist {<commit_msg>Use THistDrawingOptsBase, add template decl, style.<commit_after>/// \file ROOT/THistDrawingOpts.h
/// \ingroup Hist ROOT7
/// \author <NAME> <<EMAIL>>
/// \date 2015-09-04
/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
/// is welcome!

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

#ifndef ROOT7_THistDrawingOpts
#define ROOT7_THistDrawingOpts

#include <ROOT/TDrawingOptsBase.hxx>

namespace ROOT {
namespace Experimental {

namespace Internal {

template <int DIMENSION>
class THistDrawingOptsBase: public TDrawingOptsBase {
   /// Index of the line color in TCanvas's color table.
   size_t fLineColorIndex = (size_t)-1;
   /// The pad containing this Drawable, used to register colors.
   TPadBase &fPad;

public:
   THistDrawingOptsBase(TPadBase &pad) = default;

   void SetLineColor(const TColor &col) { fPad.RegisterColor(fLineColorIndex, col); }
};

template <int>
class THistDrawingOptsEnum {
};

/// Specialization containing 1D hist drawing options.
template <>
struct THistDrawingOptsEnum<1> {
   enum EOpts { kErrors, kBar, kText };
};

/// Specialization containing 2D hist drawing options.
template <>
struct THistDrawingOptsEnum<2> {
   enum EOpts { kBox, kText, kLego };
};

/// Specialization containing 3D hist drawing options.
template <>
struct THistDrawingOptsEnum<3> {
   enum EOpts { kLego, kIso };
};

} // namespace Internal

/** \class THistDrawingOpts
 Drawing options for a histogram with DIMENSIONS
 */
template <int DIMENSION>
class THistDrawingOpts: public THistDrawingOptsBase {
   int fOpts;

public:
   THistDrawingOpts() = default;
   constexpr THistDrawingOpts(typename Internal::THistDrawingOptsEnum<DIMENSION>::EOpts opt): fOpts(2 >> opt) {}
};

namespace Hist {
{'fraction_non_alphanumeric': 0.16020966271649956, 'fraction_numerical': 0.01276207839562443, 'mean_word_length': 3.0601295097132284, 'pattern_counts': {'":': 0, '<': 34, '<?xml version=': 0, '>': 38, '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': '5205467', 'n_tokens_mistral': 1264, 'n_tokens_neox': 1236, 'n_words': 364}