22 #ifndef OTAWA_PROP_REF_H_
23 #define OTAWA_PROP_REF_H_
30 template <
class T,
class I>
41 inline const T&
get(void)
const {
return id.value(
prop); }
43 inline operator const T&(void)
const {
return id.get(
prop,
id.defaultValue()); }
53 template <
class T,
class I>
65 inline const Ref&
add(
const T& value)
const {
id().add(
props(), value);
return *
this; }
89 template <
class T,
class I>
90 io::Output& operator<<(io::Output& out, const Ref<T, I>& ref) { ref.print(
out);
return out; }
91 template <
class T,
class I>
92 io::Output& operator<<(io::Output& out, const ImmutableRef<T, I>& ref) { ref.print(
out);
return out; }
Ref(const Ref< T, I > &ref)
Definition: Ref.h:58
const Ref & add(const T &value) const
Definition: Ref.h:65
ImmutableRef(const ImmutableRef< T, I > &ref)
Definition: Ref.h:35
Ref(PropList &_prop, const I &_id)
Definition: Ref.h:56
const I & identifier(void) const
Definition: Ref.h:37
Ref< T, I > & operator*=(const T &v)
Definition: Ref.h:74
Ref< T, I > & operator-=(const T &v)
Definition: Ref.h:73
Ref< T, I > & operator+=(const T &v)
Definition: Ref.h:72
void print(io::Output &out) const
Definition: Ref.h:42
Ref< T, I > & operator^=(const T &v) const
Definition: Ref.h:79
Ref< T, I > & operator/=(const T &v)
Definition: Ref.h:75
bool hasProp(const AbstractIdentifier &id) const
Test if the property list contains a property matching the given identifier.
Definition: PropList.h:81
PropList & props(void) const
Definition: Ref.h:61
bool exists(void) const
Definition: Ref.h:40
T & ref(void) const
Definition: Ref.h:67
ImmutableRef(const PropList &_prop, const I &_id)
Definition: Ref.h:33
T operator->(void) const
Definition: Ref.h:44
Ref< T, I > & operator=(const Ref< T, I > &value)
Definition: Ref.h:71
Ref< T, I > & operator<<=(const T &v) const
Definition: Ref.h:80
const I & id
Definition: Ref.h:48
Ref(PropList *_prop, const I &_id)
Definition: Ref.h:57
const Ref< T, I > & operator=(const T &value) const
Definition: Ref.h:70
T & operator*(void) const
Definition: Ref.h:69
Ref< T, I > & operator%=(const T &v) const
Definition: Ref.h:76
ImmutableRef(const PropList *_prop, const I &_id)
Definition: Ref.h:34
const PropList & prop
Definition: Ref.h:47
Ref< T, I > & operator--(int) const
Definition: Ref.h:85
Ref< T, I > & operator++(void) const
Definition: Ref.h:82
Ref< T, I > & operator--(void) const
Definition: Ref.h:83
sys::SystemOutStream & out
const I & id(void) const
Definition: Ref.h:62
Ref< T, I > & operator|=(const T &v) const
Definition: Ref.h:78
void removeProp(const AbstractIdentifier *id)
Remove a property matching the given identifier.
Definition: prop_PropList.cpp:409
This a list of properties.
Definition: PropList.h:63
const PropList & proplist(void) const
Definition: Ref.h:36
Ref< T, I > & operator++(int) const
Definition: Ref.h:84
Property * getProp(const AbstractIdentifier *id) const
Find a property by its identifier.
Definition: prop_PropList.cpp:357
Ref< T, I > & operator>>=(const T &v) const
Definition: Ref.h:81
Ref< T, I > & operator&=(const T &v) const
Definition: Ref.h:77