|
Bifrost SDK
Bifrost SDK documentation
|
An interface for dictionary-like objects. More...
#include <Object.h>
Classes | |
| struct | Property |
| A property in a Bifrost::Object. More... | |
Public Member Functions | |
| Object () | |
| Constructor. More... | |
| virtual | ~Object () |
| Destructor. More... | |
Interface description | |
This ifndef guard should not be used to lie to the CppParser! | |
| virtual size_t | size () const noexcept=0 |
| Returns the number of properties in the object. More... | |
| virtual bool | empty () const noexcept=0 |
| Check if this object is empty. More... | |
| virtual bool | hasProperty (Amino::StringView key) const noexcept=0 |
| Check if the property exists. More... | |
| virtual Amino::Any | getProperty (Amino::StringView key) const noexcept=0 |
| Get a property. More... | |
| virtual Amino::Any | extractProperty (Amino::StringView key) noexcept=0 |
| Extract a property. The property is removed and returned. More... | |
| virtual bool | eraseProperty (Amino::StringView key) noexcept=0 |
| Erase a property. More... | |
| virtual void | eraseAllProperties () noexcept=0 |
| Clear the object. After size() == 0 and empty() is true. More... | |
| virtual Amino::Ptr< Amino::Array< Amino::String > > | keys () const noexcept=0 |
| Get all of the keys stored in this object. More... | |
| template<typename T > | |
| bool | setProperty (Amino::StringView key, T &&value) noexcept |
| Set a property. Replace or add depending on if the property already exists or not in the object. More... | |
| template<typename S , typename T > | |
| std::enable_if< std::is_same< std::decay_t< S >, Amino::String >::value, bool >::type | setProperty (S &&key, T &&value) noexcept |
| Set a property. Replace or add depending on if the property already exists or not in the object. More... | |
Static Public Member Functions | |
| static bool | isA (Object const &object, Object const &prototype) |
| Check if a given object contains all of the properties of the specified prototype. More... | |
Protected Member Functions | |
| Object (Object &&) noexcept=default | |
| Only subclasses allowed to use copy/move constructor/assignments. More... | |
| Object (Object const &)=default | |
| Only subclasses allowed to use copy/move constructor/assignments. More... | |
| Object & | operator= (Object &&) noexcept=default |
| Only subclasses allowed to use copy/move constructor/assignments. More... | |
| Object & | operator= (Object const &)=default |
| Only subclasses allowed to use copy/move constructor/assignments. More... | |
| virtual bool | setPropertyAny (Amino::StringView key, Amino::Any value) noexcept=0 |
| Set a property with an Amino::Any. More... | |
| virtual bool | setPropertyAny (Amino::String const &key, Amino::Any value) noexcept=0 |
| Set a property with an Amino::Any. More... | |
An interface for dictionary-like objects.
The Object interface class specifies the methods to be implemented by a class that needs to be handled as a Object.
Classes that implement of this interface are assumed to:
| Bifrost::Object::Object | ( | ) |
Constructor.
|
virtual |
Destructor.
|
protecteddefaultnoexcept |
Only subclasses allowed to use copy/move constructor/assignments.
The Object not is publicly copiable/movable because it's a pure virtual class. The copy/move constructor and assignments are still defaulted but protected, to allows subclasses to = default their copy/move constructor and assignments if they want to.
|
protecteddefault |
Only subclasses allowed to use copy/move constructor/assignments.
The Object not is publicly copiable/movable because it's a pure virtual class. The copy/move constructor and assignments are still defaulted but protected, to allows subclasses to = default their copy/move constructor and assignments if they want to.
|
pure virtualnoexcept |
Check if this object is empty.
|
pure virtualnoexcept |
|
pure virtualnoexcept |
Erase a property.
| [in] | key | The property's name |
|
pure virtualnoexcept |
Extract a property. The property is removed and returned.
| [in] | key | The property's name to extract. |
|
pure virtualnoexcept |
Get a property.
| [in] | key | The property name to fetch |
|
pure virtualnoexcept |
Check if the property exists.
| [in] | key | The property's name. |
Check if a given object contains all of the properties of the specified prototype.
This check is recursive. If the prototype's value is an object, then isA is also called to check that the object's property contains all the property of the prototypes's property.
| [in] | object | The reference to the object to check if it matches the prototype. |
| [in] | prototype | The reference to the prototype object to compare with. |
Referenced by Bifrost::Geometry::findPrototype().
|
pure virtualnoexcept |
Get all of the keys stored in this object.
Only subclasses allowed to use copy/move constructor/assignments.
The Object not is publicly copiable/movable because it's a pure virtual class. The copy/move constructor and assignments are still defaulted but protected, to allows subclasses to = default their copy/move constructor and assignments if they want to.
Only subclasses allowed to use copy/move constructor/assignments.
The Object not is publicly copiable/movable because it's a pure virtual class. The copy/move constructor and assignments are still defaulted but protected, to allows subclasses to = default their copy/move constructor and assignments if they want to.
|
noexcept |
Set a property. Replace or add depending on if the property already exists or not in the object.
| [in] | key | The property's name. |
| [in] | value | The value of this property. |
Referenced by Bifrost::Geometry::populateDataGeoProperty(), Bifrost::PropertyGuard< T >::~PropertyGuard(), and Bifrost::PropertyGuard< Amino::Ptr< T > >::~PropertyGuard().
|
noexcept |
Set a property. Replace or add depending on if the property already exists or not in the object.
| [in] | key | The property's name. |
| [in] | value | The value of this property. |
|
protectedpure virtualnoexcept |
Set a property with an Amino::Any.
Prefer using setProperty instead of this method. Use this method only when the Amino::Any being passed in comes from getProperty(). For example when copying properties from one object to another.
Replace or add depending on if the property already exists or not in the object.
| [in] | key | The property's name. |
| [in] | value | A Amino::Any. |
|
protectedpure virtualnoexcept |
Set a property with an Amino::Any.
Prefer using setProperty instead of this method. Use this method only when the Amino::Any being passed in comes from getProperty(). For example when copying properties from one object to another.
Replace or add depending on if the property already exists or not in the object.
| [in] | key | The property's name. |
| [in] | value | A Amino::Any. |
|
pure virtualnoexcept |
Returns the number of properties in the object.