Logo ROOT   6.18/05
Reference Guide
List of all members | Public Types | Public Member Functions | Private Attributes | List of all members
ROOT::Experimental::RDrawingAttrHolder Class Reference

A container of (stringified) attributes for which values have been provided.

Definition at line 240 of file RDrawingAttr.hxx.

Public Types

using Map_t = std::unordered_map< std::string, std::string >
 
using Path_t = RDrawingAttrBase::Path
 

Public Member Functions

 RDrawingAttrHolder ()=default
 RDrawingAttrHolder using only the default style. More...
 
 RDrawingAttrHolder (const std::vector< std::string > &styleClasses)
 RDrawingAttrHolder with an ordered collection of styles taking precedence before the default style. More...
 
std::string & At (const Path_t &path)
 Get an attribute value as string, given its name path. More...
 
const std::string * AtIf (const Path_t &path) const
 Get an attribute value as pointer to string, given its name path, or nullptr if the attribute does not exist. More...
 
void CopyAttributesInPath (const Path_t &targetPath, const RDrawingAttrHolder &source, const Path_t &sourcePath)
 Copy attributes within otherPath into. More...
 
bool Equal (const RDrawingAttrHolder &other, const Path_t &thisPath, const Path_t &otherPath)
 Equality compare the attributes within path to those of other within otherpath. More...
 
void EraseAttributesInPath (const Path_t &path)
 Erase all custom set attributes for a given path (including sub-attributes). More...
 
std::string GetAttrFromStyle (const Path_t &path)
 Get the (stringified) value of the named attribute from the Style. More...
 
std::vector< Map_t::const_iterator > GetAttributesInPath (const Path_t &path) const
 Extract contained attributes for a given path (including sub-attributes); returns iterators to a subset of fAttrNameVals. More...
 
const std::vector< std::string > & GetStyleClasses () const
 Get the attribute style classes of these options. More...
 
void SetStyleClasses (const std::vector< std::string > &styles)
 Set the attribute style classes of these options. More...
 

Private Attributes

Map_t fAttrNameVals
 Map attribute paths to their values. More...
 
std::vector< std::string > fStyleClasses
 Attribute style classes of these options that will be "summed" in order, e.g. More...
 

#include <ROOT/RDrawingAttr.hxx>

Member Typedef Documentation

◆ Map_t

using ROOT::Experimental::RDrawingAttrHolder::Map_t = std::unordered_map<std::string, std::string>

Definition at line 243 of file RDrawingAttr.hxx.

◆ Path_t

Definition at line 242 of file RDrawingAttr.hxx.

Constructor & Destructor Documentation

◆ RDrawingAttrHolder() [1/2]

ROOT::Experimental::RDrawingAttrHolder::RDrawingAttrHolder ( )
default

RDrawingAttrHolder using only the default style.

◆ RDrawingAttrHolder() [2/2]

ROOT::Experimental::RDrawingAttrHolder::RDrawingAttrHolder ( const std::vector< std::string > &  styleClasses)
inline

RDrawingAttrHolder with an ordered collection of styles taking precedence before the default style.

Definition at line 259 of file RDrawingAttr.hxx.

Member Function Documentation

◆ At()

std::string & ROOT::Experimental::RDrawingAttrHolder::At ( const Path_t path)
inline

Get an attribute value as string, given its name path.

Definition at line 262 of file RDrawingAttr.hxx.

◆ AtIf()

const std::string * ROOT::Experimental::RDrawingAttrHolder::AtIf ( const Path_t path) const

Get an attribute value as pointer to string, given its name path, or nullptr if the attribute does not exist.

Definition at line 124 of file RDrawingAttr.cxx.

◆ CopyAttributesInPath()

void ROOT::Experimental::RDrawingAttrHolder::CopyAttributesInPath ( const Path_t targetPath,
const RDrawingAttrHolder source,
const Path_t sourcePath 
)

Copy attributes within otherPath into.

Definition at line 188 of file RDrawingAttr.cxx.

◆ Equal()

bool ROOT::Experimental::RDrawingAttrHolder::Equal ( const RDrawingAttrHolder other,
const Path_t thisPath,
const Path_t otherPath 
)

Equality compare the attributes within path to those of other within otherpath.

Takes all sub-attributes contained in the respective paths (i.e. those starting with that path) into account. They compare equal if their set of (sub-)attributes and their respective values are equal.

Definition at line 139 of file RDrawingAttr.cxx.

◆ EraseAttributesInPath()

void ROOT::Experimental::RDrawingAttrHolder::EraseAttributesInPath ( const Path_t path)

Erase all custom set attributes for a given path (including sub-attributes).

Definition at line 179 of file RDrawingAttr.cxx.

◆ GetAttrFromStyle()

std::string ROOT::Experimental::RDrawingAttrHolder::GetAttrFromStyle ( const Path_t path)

Get the (stringified) value of the named attribute from the Style.

Return the empty string if no such value exists - which means that the attribute name is unknown even for the (implicit) default style!

Definition at line 132 of file RDrawingAttr.cxx.

◆ GetAttributesInPath()

std::vector< ROOT::Experimental::RDrawingAttrHolder::Map_t::const_iterator > ROOT::Experimental::RDrawingAttrHolder::GetAttributesInPath ( const Path_t path) const

Extract contained attributes for a given path (including sub-attributes); returns iterators to a subset of fAttrNameVals.

Definition at line 164 of file RDrawingAttr.cxx.

◆ GetStyleClasses()

const std::vector< std::string > & ROOT::Experimental::RDrawingAttrHolder::GetStyleClasses ( ) const
inline

Get the attribute style classes of these options.

Definition at line 289 of file RDrawingAttr.hxx.

◆ SetStyleClasses()

void ROOT::Experimental::RDrawingAttrHolder::SetStyleClasses ( const std::vector< std::string > &  styles)
inline

Set the attribute style classes of these options.

Definition at line 292 of file RDrawingAttr.hxx.

Member Data Documentation

◆ fAttrNameVals

Map_t ROOT::Experimental::RDrawingAttrHolder::fAttrNameVals
private

Map attribute paths to their values.

Definition at line 246 of file RDrawingAttr.hxx.

◆ fStyleClasses

std::vector<std::string> ROOT::Experimental::RDrawingAttrHolder::fStyleClasses
private

Attribute style classes of these options that will be "summed" in order, e.g.

{"trigger", "efficiency"} will look attributes up in the RDrawingAttrHolderBase base class, if not found using the "trigger" style class, and if not found in the "efficiency" style class. Implicitly and as final resort, the attributes from the "default" style class will be used.

Definition at line 252 of file RDrawingAttr.hxx.

Libraries for ROOT::Experimental::RDrawingAttrHolder:
[legend]

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