Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
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 26 of file RAttrValue.hxx.

Classes

struct  ValueExtractor
struct  ValueExtractor< Q, false >

Public Member Functions

 RAttrValue ()
 RAttrValue (const RAttrValue &src)
 RAttrValue (const T &dflt)
 RAttrValue (RAttrBase *parent, const char *name, const T &dflt=T())
 RAttrValue (RDrawable *drawable, const char *name, const T &dflt=T())
void Clear () override
Get () const
GetDefault () const
const char * GetName () const
bool Has () const
 operator T () const
RAttrValueoperator= (const RAttrValue &v)
RAttrValueoperator= (const T &v)
void Set (const T &v)

Protected Member Functions

const Rec_t AccessAttr (const std::string &name) const
 Find attributes container and full-qualified name for value.
const Val_t AccessValue (const std::string &name, bool use_style=true) const
 Search value with given name in attributes.
void ClearValue (const std::string &name)
 Clear value if any with specified name.
RAttrMap CollectDefaults () const override
Rec_t EnsureAttr (const std::string &name)
 Ensure attribute with give name exists - creates container for attributes if required.
RDrawableGetDrawable () const
RAttrMapGetOwnAttr () const
RAttrBaseGetParent () const
const char * GetPrefix () const
virtual bool IsAggregation () const
void MoveTo (RAttrBase &tgt)
 Move all fields into target object.
void SetNoValue (const std::string &name)
 Set <NoValue> for attribute.

Protected Attributes

fDefault {}
 ! default value

Private Types

enum  { kDrawable , kParent , kOwnAttr }

Private Member Functions

void ClearData ()
 Clear internal data.
RAttrMapCreateOwnAttr ()
 Creates own attribute - only if no drawable and no parent are assigned.

Private Attributes

const char * fPrefix {nullptr}
 ! name prefix for all attributes values
enum ROOT::Experimental::RAttrBase:: { ... }  kDrawable
 ! kind of data
union { 
   RDrawable *   drawable 
   RAttrMap *   ownattr 
   RAttrBase *   parent 
nullptr
 ! data

Friends

bool operator!= (const RAttrValue &lhs, const RAttrValue &rhs)
bool operator!= (const RAttrValue &lhs, const T &rhs)
bool operator== (const RAttrValue &lhs, const RAttrValue &rhs)
bool operator== (const RAttrValue &lhs, const T &rhs)

#include <ROOT/RAttrValue.hxx>

Inheritance diagram for ROOT::Experimental::RAttrValue< T >:
ROOT::Experimental::RAttrBase

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
privateinherited
Enumerator
kDrawable 
kParent 
kOwnAttr 

Definition at line 37 of file RAttrBase.hxx.

Constructor & Destructor Documentation

◆ RAttrValue() [1/5]

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

Definition at line 54 of file RAttrValue.hxx.

◆ RAttrValue() [2/5]

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

Definition at line 56 of file RAttrValue.hxx.

◆ RAttrValue() [3/5]

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

Definition at line 58 of file RAttrValue.hxx.

◆ RAttrValue() [4/5]

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

Definition at line 60 of file RAttrValue.hxx.

◆ RAttrValue() [5/5]

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

Definition at line 62 of file RAttrValue.hxx.

Member Function Documentation

◆ AccessAttr()

const Rec_t ROOT::Experimental::RAttrBase::AccessAttr ( const std::string & name) const
inlineprotectedinherited

Find attributes container and full-qualified name for value.

Definition at line 70 of file RAttrBase.hxx.

◆ AccessValue()

const Val_t ROOT::Experimental::RAttrBase::AccessValue ( const std::string & name,
bool use_style = true ) const
inlineprotectedinherited

Search value with given name in attributes.

Definition at line 95 of file RAttrBase.hxx.

◆ Clear()

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

Implements ROOT::Experimental::RAttrBase.

Definition at line 85 of file RAttrValue.hxx.

◆ ClearData()

void RAttrBase::ClearData ( )
privateinherited

Clear internal data.

Definition at line 26 of file RAttrBase.cxx.

◆ ClearValue()

void RAttrBase::ClearValue ( const std::string & name)
protectedinherited

Clear value if any with specified name.

Definition at line 54 of file RAttrBase.cxx.

◆ CollectDefaults()

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

Implements ROOT::Experimental::RAttrBase.

Definition at line 47 of file RAttrValue.hxx.

◆ CreateOwnAttr()

RAttrMap * RAttrBase::CreateOwnAttr ( )
privateinherited

Creates own attribute - only if no drawable and no parent are assigned.

Definition at line 37 of file RAttrBase.cxx.

◆ EnsureAttr()

Rec_t ROOT::Experimental::RAttrBase::EnsureAttr ( const std::string & name)
inlineprotectedinherited

Ensure attribute with give name exists - creates container for attributes if required.

Definition at line 112 of file RAttrBase.hxx.

◆ Get()

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

Definition at line 76 of file RAttrValue.hxx.

◆ GetDefault()

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

Definition at line 68 of file RAttrValue.hxx.

◆ GetDrawable()

RDrawable * ROOT::Experimental::RAttrBase::GetDrawable ( ) const
inlineprotectedinherited

Definition at line 52 of file RAttrBase.hxx.

◆ GetName()

template<typename T>
const char * ROOT::Experimental::RAttrValue< T >::GetName ( ) const
inline

Definition at line 83 of file RAttrValue.hxx.

◆ GetOwnAttr()

RAttrMap * ROOT::Experimental::RAttrBase::GetOwnAttr ( ) const
inlineprotectedinherited

Definition at line 54 of file RAttrBase.hxx.

◆ GetParent()

RAttrBase * ROOT::Experimental::RAttrBase::GetParent ( ) const
inlineprotectedinherited

Definition at line 53 of file RAttrBase.hxx.

◆ GetPrefix()

const char * ROOT::Experimental::RAttrBase::GetPrefix ( ) const
inlineprotectedinherited

Definition at line 153 of file RAttrBase.hxx.

◆ Has()

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

Definition at line 87 of file RAttrValue.hxx.

◆ IsAggregation()

virtual bool ROOT::Experimental::RAttrBase::IsAggregation ( ) const
inlineprotectedvirtualinherited

Reimplemented in ROOT::Experimental::RAttrAggregation.

Definition at line 58 of file RAttrBase.hxx.

◆ MoveTo()

void RAttrBase::MoveTo ( RAttrBase & tgt)
protectedinherited

Move all fields into target object.

Definition at line 73 of file RAttrBase.cxx.

◆ operator T()

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

Definition at line 101 of file RAttrValue.hxx.

◆ operator=() [1/2]

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

Definition at line 99 of file RAttrValue.hxx.

◆ operator=() [2/2]

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

Definition at line 97 of file RAttrValue.hxx.

◆ Set()

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

Definition at line 70 of file RAttrValue.hxx.

◆ SetNoValue()

void RAttrBase::SetNoValue ( const std::string & name)
protectedinherited

Set <NoValue> for attribute.

Ensure that value can not be configured via style - defaults will be used Equivalent to css syntax { attrname:; }

Definition at line 64 of file RAttrBase.cxx.

◆ operator!= [1/2]

template<typename T>
bool operator!= ( const RAttrValue< T > & lhs,
const RAttrValue< T > & rhs )
friend

Definition at line 104 of file RAttrValue.hxx.

◆ operator!= [2/2]

template<typename T>
bool operator!= ( const RAttrValue< T > & lhs,
const T & rhs )
friend

Definition at line 107 of file RAttrValue.hxx.

◆ operator== [1/2]

template<typename T>
bool operator== ( const RAttrValue< T > & lhs,
const RAttrValue< T > & rhs )
friend

Definition at line 103 of file RAttrValue.hxx.

◆ operator== [2/2]

template<typename T>
bool operator== ( const RAttrValue< T > & lhs,
const T & rhs )
friend

Definition at line 106 of file RAttrValue.hxx.

Member Data Documentation

◆ drawable

RDrawable* ROOT::Experimental::RAttrBase::drawable
inherited

Definition at line 40 of file RAttrBase.hxx.

◆ fDefault

template<typename T>
T ROOT::Experimental::RAttrValue< T >::fDefault {}
protected

! default value

Definition at line 45 of file RAttrValue.hxx.

◆ fPrefix

const char* ROOT::Experimental::RAttrBase::fPrefix {nullptr}
privateinherited

! name prefix for all attributes values

Definition at line 45 of file RAttrBase.hxx.

◆ []

enum { ... } ROOT::Experimental::RAttrBase::kDrawable

! kind of data

◆ [union]

union { ... } ROOT::Experimental::RAttrBase::nullptr

! data

◆ ownattr

RAttrMap* ROOT::Experimental::RAttrBase::ownattr
inherited

Definition at line 42 of file RAttrBase.hxx.

◆ parent

RAttrBase* ROOT::Experimental::RAttrBase::parent
inherited

Definition at line 41 of file RAttrBase.hxx.


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