Logo ROOT   6.12/07
Reference Guide
List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
ROOT::Experimental::TDrawingAttrRef< PRIMITIVE > Class Template Reference

template<class PRIMITIVE>
class ROOT::Experimental::TDrawingAttrRef< PRIMITIVE >

The TCanvas keep track of TColors, integer and floating point attributes used by the drawing options, making them accessible from other drawing options.

The index into the table of the active attributes is wrapped into TDrawingAttrRef to make them type-safe (i.e. distinct for TColor, long long and double).

Definition at line 32 of file TCanvas.hxx.

Public Member Functions

 TDrawingAttrRef ()=default
 Construct an invalid reference. More...
 
 TDrawingAttrRef (TDrawingOptsBaseNoDefault &opts, const std::string &attrName, const PRIMITIVE &deflt, const std::vector< std::string_view > &optStrings={})
 Construct a reference from its options object, name, default value and set of string options. More...
 
 operator bool () const
 Whether the reference is valid. More...
 
 operator size_t () const
 Get the underlying index. More...
 

Private Member Functions

 TDrawingAttrRef (size_t idx)
 Construct a reference given the index. More...
 

Private Attributes

size_t fIdx = (size_t)-1
 The index in the relevant attribute table of TCanvas. More...
 

Friends

class Internal::TDrawingAttrTable< PRIMITIVE >
 

#include <ROOT/TCanvas.hxx>

Constructor & Destructor Documentation

◆ TDrawingAttrRef() [1/3]

template<class PRIMITIVE>
ROOT::Experimental::TDrawingAttrRef< PRIMITIVE >::TDrawingAttrRef ( size_t  idx)
inlineexplicitprivate

Construct a reference given the index.

Definition at line 51 of file TDrawingAttrs.hxx.

◆ TDrawingAttrRef() [2/3]

template<class PRIMITIVE>
ROOT::Experimental::TDrawingAttrRef< PRIMITIVE >::TDrawingAttrRef ( )
default

Construct an invalid reference.

◆ TDrawingAttrRef() [3/3]

template<class PRIMITIVE>
TDrawingAttrRef::TDrawingAttrRef ( TDrawingOptsBaseNoDefault opts,
const std::string &  attrName,
const PRIMITIVE &  deflt,
const std::vector< std::string_view > &  optStrings = {} 
)

Construct a reference from its options object, name, default value and set of string options.

Initializes the PRIMITIVE to the default value, as available in TDrawingOptsBase::GetDefaultCanvas(), or to deflt if no entry exists under the attribute name. The attribute name is opts.GetName() + "." + attrName. optStrings is only be used if PRIMITIVE is long long; the style setting is expected to be one of the strings, with the attribute's value the index of the string.

Definition at line 67 of file TDrawingAttrs.cxx.

Member Function Documentation

◆ operator bool()

template<class PRIMITIVE>
ROOT::Experimental::TDrawingAttrRef< PRIMITIVE >::operator bool ( ) const
inlineexplicit

Whether the reference is valid.

Definition at line 72 of file TDrawingAttrs.hxx.

◆ operator size_t()

template<class PRIMITIVE>
ROOT::Experimental::TDrawingAttrRef< PRIMITIVE >::operator size_t ( ) const
inline

Get the underlying index.

Definition at line 69 of file TDrawingAttrs.hxx.

Friends And Related Function Documentation

◆ Internal::TDrawingAttrTable< PRIMITIVE >

template<class PRIMITIVE>
friend class Internal::TDrawingAttrTable< PRIMITIVE >
friend

Definition at line 53 of file TDrawingAttrs.hxx.

Member Data Documentation

◆ fIdx

template<class PRIMITIVE>
size_t ROOT::Experimental::TDrawingAttrRef< PRIMITIVE >::fIdx = (size_t)-1
private

The index in the relevant attribute table of TCanvas.

Definition at line 48 of file TDrawingAttrs.hxx.

Libraries for ROOT::Experimental::TDrawingAttrRef< PRIMITIVE >:
[legend]

The documentation for this class was generated from the following files: