Cogs.Foundation
Loading...
Searching...
No Matches
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.

Constructor & Destructor Documentation

◆ Name() [1/6]

Cogs::Reflection::Name::Name ( )
default

Default constructor.

◆ Name() [2/6]

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.

References Cogs::hash().

◆ Name() [3/6]

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

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

◆ Name() [4/6]

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

Construct a new unique name from the given standard string.

◆ Name() [5/6]

Cogs::Reflection::Name::Name ( const Name other)
default

Defaulted copy constructor.

◆ Name() [6/6]

Cogs::Reflection::Name::Name ( Name &&  other)
defaultnoexcept

Default move constructor.

Member Function Documentation

◆ c_str()

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

Gets the name as a null-terminated string.

◆ getId()

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

Get the unique identifier of this name.

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

◆ getName()

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

Get the string name. This can be empty, even in valid instances of Name.

◆ operator=() [1/2]

Name & Cogs::Reflection::Name::operator= ( const Name other)
default

Default copy assignment operator.

◆ operator=() [2/2]

Name & Cogs::Reflection::Name::operator= ( Name &&  other)
defaultnoexcept

Default move assignment operator.

◆ operator==()

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

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


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