|
ORE Studio 0.0.4
|
A strongly-typed wrapper around a UUID representing a tenant identifier. More...
#include <tenant_id.hpp>

Public Member Functions | |
| bool | is_system () const noexcept |
| Checks if this tenant_id represents the system tenant. | |
| bool | is_nil () const noexcept |
| Checks if the underlying UUID is nil. | |
| const boost::uuids::uuid & | to_uuid () const noexcept |
| Returns the underlying boost UUID. | |
| std::string | to_string () const |
| Converts the tenant_id to its string representation. | |
| bool | operator== (const tenant_id &other) const noexcept=default |
| Equality comparison operator. | |
Static Public Member Functions | |
| static tenant_id | system () |
| Creates a tenant_id representing the system tenant. | |
| static std::expected< tenant_id, std::string > | from_uuid (const boost::uuids::uuid &uuid) |
| Creates a tenant_id from a boost UUID. | |
| static std::expected< tenant_id, std::string > | from_string (std::string_view str) |
| Creates a tenant_id from a string representation. | |
A strongly-typed wrapper around a UUID representing a tenant identifier.
This class provides type safety for tenant identifiers by:
The class is designed to make it impossible to accidentally create an uninitialized tenant ID that would be confused with the system tenant.
|
static |
|
static |
Creates a tenant_id from a boost UUID.
This factory method validates the UUID and rejects nil UUIDs to prevent accidental use of uninitialized values.
| uuid | The UUID to create the tenant_id from. |

|
static |
Creates a tenant_id from a string representation.
This factory method parses the string as a UUID and validates it. Nil UUIDs are rejected.
| str | The string representation of the UUID. |

|
noexcept |
Checks if this tenant_id represents the system tenant.
|
noexcept |
Checks if the underlying UUID is nil.
This method is useful for detecting legacy or uninitialized tenant IDs during migration. Under normal circumstances, a tenant_id should never be nil since factory methods reject nil UUIDs.
|
noexcept |
Returns the underlying boost UUID.
| std::string to_string | ( | ) | const |
Converts the tenant_id to its string representation.
