Logo ROOT  
Reference Guide
ROOT::Experimental::RAttrValue< T > Class Template Reference

template<typename T>
class ROOT::Experimental::RAttrValue< T >

Template class to access single value from drawable or other attributes.

Author
Sergey Linev s.lin.nosp@m.ev@g.nosp@m.si.de
Date
2020-06-24
Warning
This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!

Definition at line 27 of file RAttrValue.hxx.

Public Member Functions

 RAttrValue ()=default
 
 RAttrValue (RAttrBase *parent, const std::string &name, const T &dflt=T())
 
 RAttrValue (RDrawable *drawable, const std::string &name, const T &dflt=T())
 
void Clear ()
 
Get () const
 
bool Has () const
 
 operator T () const
 
RAttrValueoperator= (const T &v)
 
void Set (const T &v)
 
- Public Member Functions inherited from ROOT::Experimental::RAttrBase
 RAttrBase ()=default
 
virtual ~RAttrBase ()=default
 

Protected Member Functions

const RAttrMapGetDefaults () const override
 Return default values for attributes, empty for base class. More...
 
bool IsValue () const override
 
- Protected Member Functions inherited from ROOT::Experimental::RAttrBase
 RAttrBase (const RAttrBase &src)
 
 RAttrBase (RAttrBase *parent, const std::string &prefix)
 
 RAttrBase (RDrawable *drawable, const std::string &prefix)
 
const Rec_t AccessAttr (const std::string &name) const
 Find attributes container and full-qualified name for value. More...
 
const Val_t AccessValue (const std::string &name, bool use_style=true) const
 Search value with given name in attributes. More...
 
void AssignDrawable (RDrawable *drawable, const std::string &prefix)
 Return value from attributes container - no style or defaults are used. More...
 
void AssignParent (RAttrBase *parent, const std::string &prefix)
 Assign parent object for this RAttrBase. More...
 
void Clear ()
 Clear all respective values from drawable. Only defaults can be used. More...
 
void ClearValue (const std::string &name)
 Clear value if any with specified name. More...
 
virtual RAttrMap CollectDefaults () const
 Collect all attributes in derived class Works only if such class has dictionary. More...
 
void CopyTo (RAttrBase &tgt, bool use_style=true) const
 Copy attributes into target object. More...
 
bool CopyValue (const std::string &name, const RAttrMap::Value_t &value, bool check_type=true)
 Copy attributes from other object. More...
 
Rec_t EnsureAttr (const std::string &name)
 Ensure attribute with give name exists - creates container for attributes if required. More...
 
template<typename RET_TYPE , typename MATCH_TYPE = void>
auto Eval (const std::string &name, bool use_dflts=true) const
 Evaluate attribute value. More...
 
const std::string & GetPrefix () const
 
template<typename T >
GetValue (const std::string &name) const
 
template<typename T = void>
bool HasValue (const std::string &name, bool check_defaults=false) const
 
bool IsSame (const RAttrBase &src, bool use_style=true) const
 Check if all values which are evaluated in this object are exactly the same as in tgt object. More...
 
bool IsValueEqual (const std::string &name, const RAttrMap::Value_t &value, bool use_style=false) const
 Check if provided value equal to attribute in the map. More...
 
void MoveTo (RAttrBase &tgt)
 Move all fields into target object. More...
 
RAttrBaseoperator= (const RAttrBase &src)
 
void SetNoValue (const std::string &name)
 Set <NoValue> for attribute. More...
 
void SetValue (const std::string &name, bool value)
 Set boolean value. More...
 
void SetValue (const std::string &name, const RPadLength &value)
 Set PadLength value. More...
 
void SetValue (const std::string &name, const std::string &value)
 Set string value. More...
 
void SetValue (const std::string &name, double value)
 Set double value. More...
 
void SetValue (const std::string &name, int value)
 Set integer value. More...
 

Protected Attributes

RAttrMap fDefaults
 ! map with default values More...
 

#include <ROOT/RAttrValue.hxx>

Inheritance diagram for ROOT::Experimental::RAttrValue< T >:
[legend]

Constructor & Destructor Documentation

◆ RAttrValue() [1/3]

template<typename T >
ROOT::Experimental::RAttrValue< T >::RAttrValue ( )
default

◆ RAttrValue() [2/3]

template<typename T >
ROOT::Experimental::RAttrValue< T >::RAttrValue ( RDrawable drawable,
const std::string &  name,
const T &  dflt = T() 
)
inline

Definition at line 40 of file RAttrValue.hxx.

◆ RAttrValue() [3/3]

template<typename T >
ROOT::Experimental::RAttrValue< T >::RAttrValue ( RAttrBase parent,
const std::string &  name,
const T &  dflt = T() 
)
inline

Definition at line 46 of file RAttrValue.hxx.

Member Function Documentation

◆ Clear()

template<typename T >
void ROOT::Experimental::RAttrValue< T >::Clear ( )
inline

Definition at line 54 of file RAttrValue.hxx.

◆ Get()

template<typename T >
T ROOT::Experimental::RAttrValue< T >::Get ( ) const
inline

Definition at line 53 of file RAttrValue.hxx.

◆ GetDefaults()

template<typename T >
const RAttrMap& ROOT::Experimental::RAttrValue< T >::GetDefaults ( ) const
inlineoverrideprotectedvirtual

Return default values for attributes, empty for base class.

Reimplemented from ROOT::Experimental::RAttrBase.

Definition at line 32 of file RAttrValue.hxx.

◆ Has()

template<typename T >
bool ROOT::Experimental::RAttrValue< T >::Has ( ) const
inline

Definition at line 55 of file RAttrValue.hxx.

◆ IsValue()

template<typename T >
bool ROOT::Experimental::RAttrValue< T >::IsValue ( ) const
inlineoverrideprotectedvirtual

Reimplemented from ROOT::Experimental::RAttrBase.

Definition at line 34 of file RAttrValue.hxx.

◆ operator T()

template<typename T >
ROOT::Experimental::RAttrValue< T >::operator T ( ) const
inline

Definition at line 59 of file RAttrValue.hxx.

◆ operator=()

template<typename T >
RAttrValue& ROOT::Experimental::RAttrValue< T >::operator= ( const T &  v)
inline

Definition at line 57 of file RAttrValue.hxx.

◆ Set()

template<typename T >
void ROOT::Experimental::RAttrValue< T >::Set ( const T &  v)
inline

Definition at line 52 of file RAttrValue.hxx.

Member Data Documentation

◆ fDefaults

template<typename T >
RAttrMap ROOT::Experimental::RAttrValue< T >::fDefaults
protected

! map with default values

Definition at line 30 of file RAttrValue.hxx.


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