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

A class that contains a name and can be named and unnamed. More...

#include "common-structures.hpp"

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

Public Member Functions

 namable ()=default
 
constexpr namable (std::string const &name)
 
constexpr namable (std::string &&name)
 
 ~namable ()=default
 
constexpr void set_name (std::string const &name)
 
constexpr void set_name (std::string &&name)
 
constexpr void clear_name ()
 
constexpr bool has_name () const
 
constexpr std::string_view name () const
 

Private Attributes

std::string name_
 

Detailed Description

A class that contains a name and can be named and unnamed.

Note
This class is constexpr compatible

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

Constructor & Destructor Documentation

◆ namable() [1/3]

mal_toolkit::namable::namable ( )
default

◆ namable() [2/3]

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

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

◆ namable() [3/3]

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

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

◆ ~namable()

mal_toolkit::namable::~namable ( )
default

Member Function Documentation

◆ clear_name()

void mal_toolkit::namable::clear_name ( )
inlineconstexpr

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

◆ has_name()

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

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

◆ name()

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

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)
inlineconstexpr

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

Here is the call graph for this function:

◆ set_name() [2/2]

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

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

Here is the call graph for this function:

Member Data Documentation

◆ name_

std::string mal_toolkit::namable::name_
private

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


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