|
ActiveLib
|
#include <ItemWrap.h>


Public Types | |
| using | base = std::reference_wrapper<Item> |
| Item reference base. | |
Public Types inherited from active::serialise::Item | |
| 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 | |
| ItemWrap (Item &source) | |
| ItemWrap (const Item &source) | |
| ItemWrap (const ItemWrap &source) | |
| virtual | ~ItemWrap ()=default |
| virtual bool | fillInventory (Inventory &inventory) const override |
| virtual Cargo::Unique | getCargo (const Inventory::Item &item) const override |
| virtual bool | write (utility::String &dest) const override |
| virtual void | clear () override |
| virtual void | setDefault () override |
| virtual bool | validate () override |
| virtual bool | read (const utility::String &source) override |
Public Member Functions inherited from active::serialise::Item | |
| virtual std::optional< Type > | type () const |
| virtual bool | read (const setting::Value &source) |
Public Member Functions inherited from active::serialise::Cargo | |
| Cargo () | |
| Cargo (const Cargo &source) | |
| virtual | ~Cargo ()=default |
Lightweight interface wrapper for passing a reference to a serialisable item into (de)serialisation functions
|
inline |
Constructor
| source | The source package to wrap |
|
inline |
Constructor
| source | The source package to wrap |
|
inline |
Copy constructor
| source | The object to copy |
|
virtualdefault |
Destructor
|
inlineoverridevirtual |
Clear the data content (typically a reset to defaults)
Reimplemented from active::serialise::Cargo.
|
inlineoverridevirtual |
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 |
Reimplemented from active::serialise::Item.
|
inlineoverridevirtual |
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 |
Reimplemented from active::serialise::Item.
|
inlineoverridevirtual |
Read the cargo data from the specified string
| source | The string to read |
Implements active::serialise::Item.
|
inlineoverridevirtual |
Set to the default package content
Implements active::serialise::Cargo.
|
inlineoverridevirtual |
Validate the cargo data
Reimplemented from active::serialise::Cargo.
|
inlineoverridevirtual |
Write the item data to a string
| dest | The string to write the data to |
Implements active::serialise::Item.