ufe 5.5
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
|
Constant string representation with fixed space and O(1) comparison. More...
#include <pathComponent.h>
Public Member Functions | |
PathComponent (const std::string &aString) | |
PathComponent () | |
Constructor to create a null PathComponent. More... | |
~PathComponent () | |
Destructor. More... | |
operator bool () const | |
PathComponent (const PathComponent &)=default | |
Member-wise copy is fine. More... | |
PathComponent & | operator= (const PathComponent &) |
bool | operator== (const PathComponent &rhs) const |
Equal operator overload. More... | |
bool | operator!= (const PathComponent &rhs) const |
Not equal operator overload. More... | |
const std::string & | string () const |
Access the underlying shared string, and its ID. A null PathComponent has an empty string and an ID of -1. More... | |
std::int64_t | id () const |
Access the underlying shared string, and its ID. A null PathComponent has an empty string and an ID of -1. More... | |
Static Public Member Functions | |
static bool | exists (const std::string &aString) |
static std::vector< PathComponent > | toComponents (const std::vector< std::string > &strings) |
static std::size_t | tableSize () |
Private Member Functions | |
void | releaseSharedData () |
Private Attributes | |
std::shared_ptr< Data > | fData |
Constant string representation with fixed space and O(1) comparison.
This class provides a representation for strings used as path components. Identical strings share a representation, and thus can be stored with low storage cost, and O(1) comparison cost. The shared strings are reference counted, so that when no copies remain, the shared representation is deleted.
Default member-wise copy construction is used.
Definition at line 33 of file pathComponent.h.
Ufe::PathComponent::PathComponent | ( | const std::string & | aString | ) |
Create a PathComponent from a string, adding it to the table if it does not exist.
aString | String to create a PathComponent from. |
Ufe::PathComponent::PathComponent | ( | ) |
Constructor to create a null PathComponent.
Ufe::PathComponent::~PathComponent | ( | ) |
Destructor.
|
default |
Member-wise copy is fine.
|
static |
Static method to verify if the given string exists in the table of strings.
aString | String to check if is already in the table of strings. |
std::int64_t Ufe::PathComponent::id | ( | ) | const |
Access the underlying shared string, and its ID. A null PathComponent has an empty string and an ID of -1.
Referenced by std::hash< Ufe::PathComponent >::operator()().
Ufe::PathComponent::operator bool | ( | ) | const |
bool Ufe::PathComponent::operator!= | ( | const PathComponent & | rhs | ) | const |
Not equal operator overload.
PathComponent & Ufe::PathComponent::operator= | ( | const PathComponent & | ) |
bool Ufe::PathComponent::operator== | ( | const PathComponent & | rhs | ) | const |
Equal operator overload.
|
private |
const std::string & Ufe::PathComponent::string | ( | ) | const |
Access the underlying shared string, and its ID. A null PathComponent has an empty string and an ID of -1.
|
static |
|
static |
Convenience static method to turn a vector of strings into a vector of Path Components.
strings | A vector of strings. |
|
private |
Definition at line 86 of file pathComponent.h.