Dev Essential  1.8.1
Loading...
Searching...
No Matches
ddl::dd::datamodel::InfoSlot< INFO_T > Class Template Reference

Holds a single info of type INFO_T for its owner. Like the entries of an InfoMap, the info belongs to the owning object only: it is neither copied nor moved along with it. More...

#include <infomodel_base.h>

Public Member Functions

 InfoSlot ()=default
 Creates an empty slot.
 
 InfoSlot (const InfoSlot &) noexcept
 Creates an empty slot, the info of other is not copied.
 
 InfoSlot (InfoSlot &&) noexcept
 Creates an empty slot, the info of other is not moved.
 
InfoSlot & operator= (const InfoSlot &) noexcept
 Keeps the own info, the info of other is not copied.
 
InfoSlot & operator= (InfoSlot &&) noexcept
 Keeps the own info, the info of other is not moved.
 
 ~InfoSlot ()=default
 Destroys the slot and releases its info.
 
const INFO_T * get () const noexcept
 Get the info.
 
INFO_T * get () noexcept
 Get the info.
 
void set (std::shared_ptr< INFO_T > info) noexcept
 Set the info.
 

Detailed Description

template<typename INFO_T>
class ddl::dd::datamodel::InfoSlot< INFO_T >

Holds a single info of type INFO_T for its owner. Like the entries of an InfoMap, the info belongs to the owning object only: it is neither copied nor moved along with it.

Template Parameters
INFO_Tthe info type, which may be incomplete where the slot is declared

Member Function Documentation

◆ get() [1/2]

template<typename INFO_T>
const INFO_T * ddl::dd::datamodel::InfoSlot< INFO_T >::get ( ) const
inlinenoexcept

Get the info.

Returns
the info, or nullptr if none is set

◆ get() [2/2]

template<typename INFO_T>
INFO_T * ddl::dd::datamodel::InfoSlot< INFO_T >::get ( )
inlinenoexcept

Get the info.

Returns
the info, or nullptr if none is set

◆ set()

template<typename INFO_T>
void ddl::dd::datamodel::InfoSlot< INFO_T >::set ( std::shared_ptr< INFO_T > info)
inlinenoexcept

Set the info.

Parameters
infothe info to hold

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