ActiveLib
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
active::serialise::Entry Struct Reference

#include <Entry.h>

Classes

class  ID
 

Public Types

enum class  Type { attribute , element }
 

Public Member Functions

 Entry (const Identity &ident, int16_t ind, Type type, bool mustHave=true, const std::type_info *owner=nullptr)
 
 Entry (Identity &&ident, int16_t ind, Type type, bool mustHave=true, const std::type_info *owner=nullptr)
 
 Entry (const Identity &ident, int16_t ind, size_t howMany, std::optional< size_t > max=1, bool mustHave=true, const std::type_info *owner=nullptr)
 
 Entry (Identity &&ident, int16_t ind, size_t howMany, std::optional< size_t > max=1, bool mustHave=true, const std::type_info *owner=nullptr)
 
 Entry (const Entry &source)=default
 
Entryoperator= (const Entry &source)=default
 
const Identityidentity () const
 Get the wrapped identity.
 
bool isAttribute () const
 
bool isRepeating () const
 
std::optional< size_t > maximum () const
 
void setIdentity (const Identity &ident)
 
void setIdentity (Identity &&ident)
 
EntrywithOwner (const std::type_info *owner)
 
bool bumpAvailable ()
 

Public Attributes

const std::type_info * ownerType = nullptr
 The type info of the owner package.
 
size_t available = 0
 How many are currently available (also acts as the requested item on import/export in 'getCargo')
 
int16_t index = 0
 The entry index.
 
bool required = true
 True if required for export.
 

Detailed Description

An entry in the inventory of a serialisable package

Constructor & Destructor Documentation

◆ Entry() [1/2]

active::serialise::Entry::Entry ( const Identity & ident,
int16_t ind,
Type type,
bool mustHave = true,
const std::type_info * owner = nullptr )
inline

Constructor (Single-instance items)

Parameters
identThe entry identity
indAn index for the entry
typeValue type, i.e. attribute/element
mustHaveTrue if required for export
ownerThe owner type

◆ Entry() [2/2]

active::serialise::Entry::Entry ( const Identity & ident,
int16_t ind,
size_t howMany,
std::optional< size_t > max = 1,
bool mustHave = true,
const std::type_info * owner = nullptr )
inline

Constructor (Single-instance items)

Parameters
identThe entry identity
indAn index for the entry
howManyHow many items are currently available
mustHaveTrue if required for export
ownerThe owner type

Member Function Documentation

◆ bumpAvailable()

bool active::serialise::Entry::bumpAvailable ( )
inline

Bump the entry availability (where allowed) return: True if the availability was bumped (false indicates no additional items are allowed)

Here is the call graph for this function:

◆ isRepeating()

bool active::serialise::Entry::isRepeating ( ) const
inline

Determine if the entry items can repeat, e.g. are stored in an array

Returns
True if the entry is repeating

◆ maximum()

std::optional< size_t > active::serialise::Entry::maximum ( ) const
inline

The maximum number of instances against this entry (nullopt = unlimited)

Returns
The maximum number of instances
Here is the caller graph for this function:

◆ setIdentity() [1/2]

void active::serialise::Entry::setIdentity ( const Identity & ident)
inline

Set the entry identity return: True if the availability was bumped (false indicates no additional items are allowed)

◆ setIdentity() [2/2]

void active::serialise::Entry::setIdentity ( Identity && ident)
inline

Set the entry identity return: True if the availability was bumped (false indicates no additional items are allowed)

◆ withOwner()

Entry & active::serialise::Entry::withOwner ( const std::type_info * owner)
inline

Set the entry owner type

Parameters
ownerThe owner type ID
Returns
A reference to this

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