|
ActiveLib
|
#include <Item.h>


Public Types | |
| enum class | Type { text , number , boolean } |
Public Types inherited from active::serialise::Cargo | |
| using | Unique = std::unique_ptr<Cargo> |
| Unique pointer. | |
| using | Shared = std::shared_ptr<Cargo> |
| Shared pointer. | |
| using | size_type = std::string::size_type |
| Class size type. | |
| using | sizeOption = std::optional<size_type> |
| Optional size type (used to indicate an unspecified or non-existant position) | |
Public Member Functions | |
| virtual bool | fillInventory (Inventory &inventory) const |
| virtual Cargo::Unique | getCargo (const Inventory::Item &item) const |
| virtual bool | write (utility::String &dest) const =0 |
| virtual std::optional< Type > | type () const |
| virtual bool | read (const utility::String &source)=0 |
| virtual bool | read (const setting::Value &source) |
Public Member Functions inherited from active::serialise::Cargo | |
| Cargo () | |
| Cargo (const Cargo &source) | |
| virtual | ~Cargo ()=default |
| virtual void | clear () |
| virtual void | setDefault ()=0 |
| virtual bool | validate () |
Interface for unary data items (representing a single value like String, double etc) enabling serialise for transport
|
inlinevirtual |
Fill an inventory with the cargo items. NB: Most items rely on the enclosing package to do this, so returns false by default
| inventory | The inventory to receive the cargo items |
Implements active::serialise::Cargo.
Reimplemented in active::serialise::ItemWrap.
|
inlinevirtual |
Get the specified cargo. NB: Most items rely on the enclosing package to do this, so returns nullptr by default
| item | The inventory item to retrieve |
Implements active::serialise::Cargo.
Reimplemented in active::serialise::ItemWrap.
|
virtual |
Read the cargo data from the specified setting
| source | The setting to read |
Reimplemented in active::serialise::AnyValueWrap, active::serialise::ValueWrap< T >, and active::serialise::ValueWrap< double >.

|
pure virtual |
Read the cargo data from the specified string
| source | The string to read |
Implemented in active::serialise::ValueWrap< T >, active::serialise::ValueWrap< double >, active::serialise::ValueWrap< T >, active::serialise::ValueWrap< double >, active::serialise::UnknownItem, active::serialise::AnyValueWrap, active::serialise::ItemWrap, active::serialise::ValueWrap< T >, active::serialise::ValueWrap< double >, and active::serialise::xml::XMLDateTime.

|
inlinevirtual |
Get the serialisation type for the item value
Reimplemented in active::serialise::ValueWrap< T >, active::serialise::ValueWrap< double >, active::serialise::ValueWrap< T >, active::serialise::ValueWrap< double >, active::serialise::ValueWrap< T >, active::serialise::ValueWrap< double >, active::serialise::AnyValueWrap, active::serialise::ValueWrap< T >, and active::serialise::ValueWrap< double >.
|
pure virtual |
Write the item data to a string
| dest | The string to write the data to |
Implemented in active::serialise::ValueWrap< T >, active::serialise::ValueWrap< double >, active::serialise::ValueWrap< T >, active::serialise::ValueWrap< double >, active::serialise::ValueWrap< T >, active::serialise::ValueWrap< double >, active::serialise::xml::XMLNumber, active::serialise::UnknownItem, active::serialise::AnyValueWrap, active::serialise::ItemWrap, active::serialise::ValueWrap< T >, active::serialise::ValueWrap< double >, and active::serialise::xml::XMLDateTime.