ufe 5.5
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
Ufe::Value Class Reference

#include <value.h>

Public Member Functions

 Value ()
 Default constructor. Creates an empty Value. More...
 
template<typename T >
 Value (const T &v)
 
 Value (const Value &)
 Default copy constructor. More...
 
 Value (Value &&) noexcept
 Move constructor. More...
 
Valueoperator= (const Value &v)
 Default assignment operator. More...
 
Valueoperator= (Value &&) noexcept
 Move assignment. Right hand side becomes empty. More...
 
 ~Value ()
 Destructor. More...
 
template<typename T >
get () const
 
template<typename T >
safeGet (T arg) const
 
bool empty () const
 
std::string typeName () const
 
template<typename T >
bool isType () const
 
bool operator== (const Value &rhs) const
 Equality operators. More...
 
bool operator!= (const Value &rhs) const
 

Private Attributes

std::unique_ptr< Imp > _imp
 

Detailed Description

Definition at line 47 of file value.h.

Constructor & Destructor Documentation

◆ Value() [1/4]

Ufe::Value::Value ( )

Default constructor. Creates an empty Value.

◆ Value() [2/4]

template<typename T >
Ufe::Value::Value ( const T &  v)

Create a Value from the argument.

Parameters
vValue.

◆ Value() [3/4]

Ufe::Value::Value ( const Value )

Default copy constructor.

◆ Value() [4/4]

Ufe::Value::Value ( Value &&  )
noexcept

Move constructor.

◆ ~Value()

Ufe::Value::~Value ( )

Destructor.

Member Function Documentation

◆ empty()

bool Ufe::Value::empty ( ) const
Returns
True iff this value is empty.

◆ get()

template<typename T >
T Ufe::Value::get ( ) const
Returns
The current value if template type matches actual type.
Exceptions
InvalidValueGetIf the template type doesn't match the type of the actual value.

◆ isType()

template<typename T >
bool Ufe::Value::isType ( ) const
Returns
True if the contained value is an object of type T.

◆ operator!=()

bool Ufe::Value::operator!= ( const Value rhs) const

◆ operator=() [1/2]

Value & Ufe::Value::operator= ( const Value v)

Default assignment operator.

◆ operator=() [2/2]

Value & Ufe::Value::operator= ( Value &&  )
noexcept

Move assignment. Right hand side becomes empty.

◆ operator==()

bool Ufe::Value::operator== ( const Value rhs) const

Equality operators.

◆ safeGet()

template<typename T >
T Ufe::Value::safeGet ( arg) const

Returns a copy of the value if the template type matches actual type. Returns the input argument value otherwise. Especially useful to return a default when dealing with an empty Ufe::Value.

Returns
The current value if template type matches actual type, otherwise arg.

◆ typeName()

std::string Ufe::Value::typeName ( ) const

Returns the C++ type name of the contained value if non-empty. For basic types uses the typeid(T) function. For complex types will return more human readable string for easier comparison.

Returns
Empty string if Value is empty.
"bool", "int", "float", "double" for basic types.
"std::string" for std::string type.
"Ufe::Vector2i" for Ufe::Vector2i type.
"Ufe::Vector2f" for Ufe::Vector2f type.
"Ufe::Vector2d" for Ufe::Vector2d type.
"Ufe::Vector3i" for Ufe::Vector3i type.
"Ufe::Vector3f" for Ufe::Vector3f type.
"Ufe::Vector3d" for Ufe::Vector3d type.
"Ufe::Vector4i" for Ufe::Vector4i type.
"Ufe::Vector4f" for Ufe::Vector4f type.
"Ufe::Vector4d" for Ufe::Vector4d type.
"Ufe::Color3f" for Ufe::Color3f type.
"Ufe::Color4f" for Ufe::Color4f type.

Member Data Documentation

◆ _imp

std::unique_ptr<Imp> Ufe::Value::_imp
private

Definition at line 119 of file value.h.


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