19 #ifndef CORE_TRUST_TAGGED_INTEGER_H_ 20 #define CORE_TRUST_TAGGED_INTEGER_H_ 25 #include <type_traits> 27 #include <sys/types.h> 34 template<
typename Tag,
typename Integer>
38 static_assert(std::is_integral<Integer>::value,
"Integer has to be an integral type");
60 template<
typename Tag,
typename Integer>
67 template<
typename Tag,
typename Integer>
74 template<
typename Tag,
typename Integer>
77 return lhs.
value < rhs.value;
81 template<
typename Tag,
typename Integer>
82 inline std::ostream& operator<<(std::ostream& out, const TaggedInteger<Tag, Integer>& ti)
84 return out << ti.value;
110 #endif // CORE_TRUST_TAGGED_INTEGER_H_ Tag TagType
We bail out if the Integral type is not an integral one.
TaggedInteger()
Construct an instance with a default value.
TaggedInteger< tag::Uid, uid_t > Uid
Our internal user id type.
Integer value
The contained integer value.
Helper structure for tagging integer types with certain semantics.
TaggedInteger(Integer value)
Construct an instance from an existing integer type.
bool operator!=(const TaggedInteger< Tag, Integer > &lhs, const TaggedInteger< Tag, Integer > &rhs)
Returns true iff both tagged integer instances are not equal.
CORE_TRUST_DLL_PUBLIC bool operator==(const Agent::RequestParameters &lhs, const Agent::RequestParameters &rhs)
Returns true iff lhs and rhs are equal.
Integer IntegerType
Stores the Integer type.
TaggedInteger< tag::Gid, gid_t > Gid
Our internal group id type.
TaggedInteger< tag::Pid, pid_t > Pid
Our internal process id type.
TaggedInteger< tag::Feature, std::uint64_t > Feature
Our internal service-feature type.