Nui
Public Member Functions | Public Attributes | List of all members
Nui::SelectablesRegistry< T >::ItemWithId Struct Reference

Wrapper around items that associates them with an id. More...

#include <selectables_registry.hpp>

Public Member Functions

template<typename... Args>
 ItemWithId (IdType id, Detail::InplaceTag, Args &&... args)
 
 ItemWithId (IdType id, T item)
 
 ItemWithId (IdType id, std::optional< T > item)
 
 ItemWithId (ItemWithId const &)=default
 
 ItemWithId (ItemWithId &&)=default
 
ItemWithIdoperator= (ItemWithId const &)=default
 
ItemWithIdoperator= (ItemWithId &&)=default
 
bool operator< (ItemWithId const &other) const
 Compares the id of the item. More...
 

Public Attributes

IdType id
 Id of the item. More...
 
std::optional< T > item
 The item. More...
 

Detailed Description

template<typename T>
struct Nui::SelectablesRegistry< T >::ItemWithId

Wrapper around items that associates them with an id.

Constructor & Destructor Documentation

◆ ItemWithId() [1/5]

template<typename T >
template<typename... Args>
Nui::SelectablesRegistry< T >::ItemWithId::ItemWithId ( IdType  id,
Detail::InplaceTag  ,
Args &&...  args 
)
inline

◆ ItemWithId() [2/5]

template<typename T >
Nui::SelectablesRegistry< T >::ItemWithId::ItemWithId ( IdType  id,
item 
)
inline

◆ ItemWithId() [3/5]

template<typename T >
Nui::SelectablesRegistry< T >::ItemWithId::ItemWithId ( IdType  id,
std::optional< T >  item 
)
inline

◆ ItemWithId() [4/5]

template<typename T >
Nui::SelectablesRegistry< T >::ItemWithId::ItemWithId ( ItemWithId const &  )
default

◆ ItemWithId() [5/5]

template<typename T >
Nui::SelectablesRegistry< T >::ItemWithId::ItemWithId ( ItemWithId &&  )
default

Member Function Documentation

◆ operator<()

template<typename T >
bool Nui::SelectablesRegistry< T >::ItemWithId::operator< ( ItemWithId const &  other) const
inline

Compares the id of the item.

◆ operator=() [1/2]

template<typename T >
ItemWithId& Nui::SelectablesRegistry< T >::ItemWithId::operator= ( ItemWithId &&  )
default

◆ operator=() [2/2]

template<typename T >
ItemWithId& Nui::SelectablesRegistry< T >::ItemWithId::operator= ( ItemWithId const &  )
default

Member Data Documentation

◆ id

template<typename T >
IdType Nui::SelectablesRegistry< T >::ItemWithId::id

Id of the item.

◆ item

template<typename T >
std::optional<T> Nui::SelectablesRegistry< T >::ItemWithId::item

The item.

The item is stored in an optional to allow for efficient "removal" of items from the core container.


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