6 #ifndef UTILS_STRONG_ID_H 7 #define UTILS_STRONG_ID_H 10 #include <Utils/StrongType.h> 11 #include <Utils/ExtSTD.h> 27 template <
typename PhantomType>
31 using ValueType = uint32_t;
38 :
StrongType<ValueType, PhantomType>(static_cast<ValueType>(value))
43 :
StrongType<ValueType, PhantomType>(static_cast<ValueType>(value))
50 return StrongId(this->
template As<ValueType>() + 1);
56 return std::to_string(this->
template As<ValueType>());
61 static inline std::vector<StrongId<PhantomType>>
CreateIds(
const std::vector<unsigned> &ids)
Template class implementation of a Named Strong Type.
Definition: StrongType.h:28
std::string ToString() const
Convert the id to string.
Definition: StrongID.h:54
StrongId(size_t value)
Construct from size_t.
Definition: StrongID.h:37
StrongId Next() const
An id following this one. Incremented by 1.
Definition: StrongID.h:48
StrongId(int value)
Construct from int.
Definition: StrongID.h:42
Template class implementation of a Named Strong Id (a Strong Type with an underlying unsigned integer...
Definition: StrongID.h:28
auto Transformed(const C &container, F Function)
Simplified wrapper for std::transform.
Definition: ExtSTD.h:831
General namespace for utilities.
Definition: BulletConversions.h:9
static std::vector< StrongId< PhantomType > > CreateIds(const std::vector< unsigned > &ids)
Creates vector of specific strong ids values from the vector of unsigned values.
Definition: StrongID.h:61