mal-packet-weaver
C++20 packet serialization/deserialization library.
Loading...
Searching...
No Matches
mal_toolkit::namable_protected Class Reference

A class that contains a name and can be named and unnamed, but you cant set the name from outside. More...

#include "common-structures.hpp"

Inheritance diagram for mal_toolkit::namable_protected:
[legend]
Collaboration diagram for mal_toolkit::namable_protected:
[legend]

Public Member Functions

 namable_protected ()=default
 
constexpr namable_protected (std::string const &name)
 
constexpr namable_protected (std::string &&name)
 
 ~namable_protected ()=default
 
constexpr bool has_name () const
 
constexpr std::string_view name () const
 

Protected Member Functions

constexpr void clear_name ()
 
constexpr void set_name (std::string const &name)
 
constexpr void set_name (std::string &&name)
 

Private Attributes

std::string name_
 

Detailed Description

A class that contains a name and can be named and unnamed, but you cant set the name from outside.

Note
This class is constexpr compatible

Definition at line 57 of file common-structures.hpp.

Constructor & Destructor Documentation

◆ namable_protected() [1/3]

mal_toolkit::namable_protected::namable_protected ( )
default

◆ namable_protected() [2/3]

mal_toolkit::namable_protected::namable_protected ( std::string const & name)
inlineexplicitconstexpr

Definition at line 61 of file common-structures.hpp.

◆ namable_protected() [3/3]

mal_toolkit::namable_protected::namable_protected ( std::string && name)
inlineexplicitconstexpr

Definition at line 62 of file common-structures.hpp.

◆ ~namable_protected()

mal_toolkit::namable_protected::~namable_protected ( )
default

Member Function Documentation

◆ clear_name()

void mal_toolkit::namable::clear_name ( )
inlineconstexprprotected

Definition at line 45 of file common-structures.hpp.

◆ has_name()

bool mal_toolkit::namable::has_name ( ) const
inlineconstexprinherited

Definition at line 46 of file common-structures.hpp.

◆ name()

std::string_view mal_toolkit::namable::name ( ) const
inlinenodiscardconstexprinherited

Definition at line 47 of file common-structures.hpp.

Here is the caller graph for this function:

◆ set_name() [1/2]

void mal_toolkit::namable::set_name ( std::string && name)
inlineconstexprprotected

Definition at line 44 of file common-structures.hpp.

◆ set_name() [2/2]

void mal_toolkit::namable::set_name ( std::string const & name)
inlineconstexprprotected

Definition at line 43 of file common-structures.hpp.

Member Data Documentation

◆ name_

std::string mal_toolkit::namable::name_
privateinherited

Definition at line 50 of file common-structures.hpp.


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