Logo ROOT  
Reference Guide
RStyle.cxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2017, Rene Brun and Fons Rademakers. *
3 * All rights reserved. *
4 * *
5 * For the licensing terms see $ROOTSYS/LICENSE. *
6 * For the list of contributors see $ROOTSYS/README/CREDITS. *
7 *************************************************************************/
8
9#include <ROOT/RStyle.hxx>
10
11#include <ROOT/RDrawable.hxx>
12
13// #include "RStyleReader.hxx" // in src/
14
15
16using namespace std::string_literals;
17
18
19///////////////////////////////////////////////////////////////////////////////
20/// Evaluate style
21
22const ROOT::Experimental::RAttrMap::Value_t *ROOT::Experimental::RStyle::Eval(const std::string &field, const RDrawable &drawable) const
23{
24 for (const auto &block : fBlocks) {
25 if (drawable.MatchSelector(block.selector)) {
26 auto res = block.map.Find(field);
27 if (res)
28 return res;
29 }
30 }
31
32 return nullptr;
33}
Base class for drawable entities: objects that can be painted on a RPad.
Definition: RDrawable.hxx:99
bool MatchSelector(const std::string &selector) const
Preliminary method which checks if drawable matches with given selector Following selector are allowe...
Definition: RDrawable.cxx:33
std::list< Block_t > fBlocks
Definition: RStyle.hxx:54
const RAttrMap::Value_t * Eval(const std::string &field, const RDrawable &drawable) const
Evaluate style.
Definition: RStyle.cxx:22
constexpr size_t block
Definition: BatchHelpers.h:29