Simbody
3.6
|
Concrete templatized class derived from AbstractValue, adding generic value type-specific functionality, with implicit conversion to the underlying type T
.
More...
Public Member Functions | |
Value () | |
Creates a Value<T> whose contained object of type T has been default constructed. More... | |
Value (const T &value) | |
Creates a Value<T> whose contained object is copy constructed from the given value . More... | |
Value (const T &&value) | |
Creates a Value<T> whose contained object is move constructed from the given value . More... | |
~Value ()=default | |
Value (const Value &value) | |
Copy constructor invokes the type T copy constructor to copy the contained value. More... | |
Value (const Value &&value) | |
Move constructor invokes the type T move constructor, if available, to move the given value into this Value<T> object. More... | |
Value & | operator= (const Value &value) |
The copy assignment here invokes type T copy assignment on the contained object, it does not invoke AbstractValue's copy assignment. More... | |
Value & | operator= (const Value &&value) |
The move assignment here invokes type T move assignment on the contained object, it does not invoke AbstractValue's move assignment. More... | |
Value & | operator= (const T &value) |
Assign a new value to the contained object, using the type T copy assignment operator. More... | |
Value & | operator= (const T &&value) |
Assign a new value to the contained object, using the type T move assignment operator, if available. More... | |
const T & | get () const |
Return a const reference to the object of type T that is contained in this Value<T> object. More... | |
T & | upd () |
Return a writable reference to the object of type T that is contained in this Value object. More... | |
void | set (const T &value) |
Assign the contained object to the given value by invoking the type T copy assignment operator. More... | |
void | set (const T &&value) |
Assign the contained object to the given value by invoking the type T move assignment operator, if available. More... | |
operator const T & () const | |
Implicit conversion from a const reference to a Value<T> object to a const reference to the type T object it contains. More... | |
operator T & () | |
Implicit conversion from a writable reference to a Value object to a writable reference to the type T object it contains. More... | |
Value * | clone () const override |
Covariant implementation of the AbstractValue::clone() method. More... | |
bool | isCompatible (const AbstractValue &value) const override |
Test whether a given AbstractValue is assignment-compatible with this Value object. More... | |
void | compatibleAssign (const AbstractValue &value) override |
If the given AbstractValue is assignment-compatible, perform the assignment. More... | |
String | getTypeName () const override |
Use NiceTypeName to produce a human-friendly representation of the type T . More... | |
String | getValueAsString () const override |
(Not implemented yet) Produce a human-friendly representation of the contained value of type T . More... | |
Public Member Functions inherited from SimTK::AbstractValue | |
AbstractValue & | operator= (const AbstractValue &v) |
Invokes the compatibleAssign() method which will perform the assignment if the source object is compatible, or throw an exception otherwise. More... | |
template<typename T > | |
const T & | getValue () const |
Retrieve the original (type-erased)thing as read-only. More... | |
template<typename T > | |
T & | updValue () |
Retrieve the original (type-erased)thing as read-write. More... | |
virtual | ~AbstractValue () |
Static Public Member Functions | |
static bool | isA (const AbstractValue &value) |
Return true if the given AbstractValue is an object of this type Value<T> . More... | |
static const Value & | downcast (const AbstractValue &value) |
Downcast a const reference to an AbstractValue to a const reference to this type Value<T> . More... | |
static Value & | updDowncast (AbstractValue &value) |
Downcast a writable reference to an AbstractValue to a writable reference to this type Value<T> . More... | |
static Value & | downcast (AbstractValue &value) |
Deprecated – use updDowncast() instead. More... | |
Additional Inherited Members | |
Related Functions inherited from SimTK::AbstractValue | |
std::ostream & | operator<< (std::ostream &o, const AbstractValue &v) |
Write a human-readable representation of an AbstractValue to an output stream, using the getValueAsString() member function. More... | |
Concrete templatized class derived from AbstractValue, adding generic value type-specific functionality, with implicit conversion to the underlying type T
.
|
inline |
Creates a Value<T>
whose contained object of type T
has been default constructed.
|
inlineexplicit |
Creates a Value<T>
whose contained object is copy constructed from the given value
.
|
inlineexplicit |
Creates a Value<T>
whose contained object is move constructed from the given value
.
If type T
doesn't provide a move constructor then this is copy constructed.
|
default |
|
inline |
Copy constructor invokes the type T
copy constructor to copy the contained value.
|
inline |
Move constructor invokes the type T
move constructor, if available, to move the given value
into this Value<T>
object.
|
inline |
The copy assignment here invokes type T
copy assignment on the contained object, it does not invoke AbstractValue's copy assignment.
|
inline |
The move assignment here invokes type T
move assignment on the contained object, it does not invoke AbstractValue's move assignment.
If type T
doesn't provide move assignment then copy assignment is used instead.
|
inline |
Assign a new value to the contained object, using the type T
copy assignment operator.
|
inline |
Assign a new value to the contained object, using the type T
move assignment operator, if available.
|
inline |
Return a const reference to the object of type T
that is contained in this Value<T>
object.
There is also an implicit conversion that performs the same function.
|
inline |
Return a writable reference to the object of type T
that is contained in this Value object.
There is also an implicit conversion that performs the same function.
|
inline |
Assign the contained object to the given value
by invoking the type T
copy assignment operator.
|
inline |
Assign the contained object to the given value
by invoking the type T
move assignment operator, if available.
|
inline |
|
inline |
Implicit conversion from a writable reference to a Value object to a writable reference to the type T
object it contains.
This is identical to the upd() method.
|
inlineoverridevirtual |
Covariant implementation of the AbstractValue::clone() method.
(Covariant means that the return type has been changed to the derived type.)
Implements SimTK::AbstractValue.
|
inlineoverridevirtual |
Test whether a given AbstractValue is assignment-compatible with this Value object.
Currently this only returns true if the source is exactly the same type as this.
Implements SimTK::AbstractValue.
|
inlineoverridevirtual |
If the given AbstractValue is assignment-compatible, perform the assignment.
Otherwise, throw an exception (at least in a Debug build).
Implements SimTK::AbstractValue.
|
inlineoverridevirtual |
Use NiceTypeName to produce a human-friendly representation of the type T
.
Implements SimTK::AbstractValue.
|
inlineoverridevirtual |
(Not implemented yet) Produce a human-friendly representation of the contained value of type T
.
Currently just returns the type name.
Implements SimTK::AbstractValue.
|
inlinestatic |
Return true if the given AbstractValue is an object of this type Value<T>
.
|
inlinestatic |
Downcast a const reference to an AbstractValue to a const reference to this type Value<T>
.
A std::bad_cast exception is thrown if the type is wrong, at least in Debug builds.
|
inlinestatic |
Downcast a writable reference to an AbstractValue to a writable reference to this type Value<T>
.
A std::bad_cast exception is thrown if the type is wrong, at least in Debug builds.
|
inlinestatic |
Deprecated – use updDowncast() instead.