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");
43 typedef Integer IntegerType;
60 template<
typename Tag,
typename Integer>
63 return lhs.value == rhs.value;
67 template<
typename Tag,
typename Integer>
70 return lhs.value != rhs.value;
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_
TaggedInteger< tag::Uid, uid_t > Uid
Our internal user id type.
Helper structure for tagging integer types with certain semantics.
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.
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.