Cogs.Core
Public Member Functions | List of all members
Cogs::Reflection::Name Struct Reference

Represents an unique name. More...

#include <Name.h>

Public Member Functions

 Name ()=default
 Default constructor.
 
 Name (const StringView &name)
 Construct a new unique name instance from the given name string.
 
 Name (const char *name)
 Construct a new unique name from the given null terminated C string.
 
 Name (const std::string &name)
 Construct a new unique name from the given standard string.
 
 Name (const Name &other)=default
 Defaulted copy constructor.
 
 Name (Name &&other) noexcept=default
 Default move constructor.
 
Nameoperator= (const Name &other)=default
 Default copy assignment operator.
 
Nameoperator= (Name &&other) noexcept=default
 Default move assignment operator.
 
bool operator== (const Name &other) const
 Compare to other. Considered equal if the identifier is the same.
 
const std::string & getName () const
 Get the string name. This can be empty, even in valid instances of Name.
 
const char * c_str () const
 Gets the name as a null-terminated string.
 
size_t getId () const
 Get the unique identifier of this name.
 

Detailed Description

Represents an unique name.

Stores the hash of the string given internally to use as basis for comparisons.

Definition at line 69 of file Name.h.

Constructor & Destructor Documentation

◆ Name() [1/3]

Cogs::Reflection::Name::Name ( const StringView name)
inline

Construct a new unique name instance from the given name string.

The hash of the given name will be calculated and stored in this instance.

Definition at line 79 of file Name.h.

◆ Name() [2/3]

Cogs::Reflection::Name::Name ( const char *  name)
inline

Construct a new unique name from the given null terminated C string.

Definition at line 84 of file Name.h.

◆ Name() [3/3]

Cogs::Reflection::Name::Name ( const std::string &  name)
inline

Construct a new unique name from the given standard string.

Definition at line 89 of file Name.h.

Member Function Documentation

◆ c_str()

const char * Cogs::Reflection::Name::c_str ( ) const
inline

Gets the name as a null-terminated string.

Definition at line 116 of file Name.h.

Referenced by Cogs::Core::applyFieldValues(), and Cogs::Core::findHierarchyWithMatch().

◆ getId()

size_t Cogs::Reflection::Name::getId ( ) const
inline

Get the unique identifier of this name.

Definition at line 120 of file Name.h.

Referenced by Cogs::Reflection::TypeDatabase::getType().

◆ getName()

const std::string & Cogs::Reflection::Name::getName ( ) const
inline

◆ operator==()

bool Cogs::Reflection::Name::operator== ( const Name other) const
inline

Compare to other. Considered equal if the identifier is the same.

Definition at line 105 of file Name.h.


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