ocean.io.serialize.TypeId

Templates to generate a a hash or a string that describes the binary layout of a value type, fully recursing into aggregates.

The data layout identifier hash is the 64-bit Fnv1a hash value of a string that is generated from a struct or union by concatenating the offsets and types of each field in order of appearance, recursing into structs, unions and function/delegate parameter lists and using the base type of enums and typedefs.

The type identifier of a non-aggregate type is the .stringof of that type (or its base if it is a typedef or enum).

Members

Templates

AggregateHash
template AggregateHash(ulong hash, T, size_t n = 0)

Evaluates to the hash value of the type identifiers of the fields of T, starting with the n-th field, using hash as initial hash value. T must be a struct or union.

AggregateId
template AggregateId(T, size_t n = 0)

Evaluates to the concatenated type identifiers of the fields of T, starting with the n-th field. T must be a struct or union.

BaseType
template BaseType(T)

Aliases the base type of T, if T is a typedef or enum, or T otherwise. Recurses into further typedefs/enums if required.

CheckedBaseType
template CheckedBaseType(T)

Aliases the base type of T, if T is a typedef or enum, or T otherwise. Recurses into further typedefs/enums if required. Veryfies that the aliased type is not a class, pointer, function, delegate or associative array (a reference type other than a dynamic array).

TupleHash
template TupleHash(ulong hash, T...)

Evaluates to the hash value of the concatenated type identifiers of the elements of T, using hash as initial hash value.

TupleId
template TupleId(T...)

Evaluates to the concatenated type identifiers of the elements of T.

TypeErrorMsg
template TypeErrorMsg(T, Base)

Evaluates to an error messsage used by CheckedBaseType.

TypeHash
template TypeHash(T)

Evaluates to the type hash of T, which is the 64-bit Fnv1a hash of the string that would be generated by TypeId!(T).

TypeHash
template TypeHash(ulong hash, T)

Evaluates to the type hash of T, which is the 64-bit Fnv1a hash of the string that would be generated by TypeId!(T), using hash as initial hash value so that TypeHash!(TypeHash!(A), B) evaluates to the 64-bit Fvn1a hash value of TypeId!(A) ~ TypeId!(B).

TypeId
template TypeId(T)

Evaluates to the type identifier of T, fully recursing into structs, unions and function/delegate parameter lists. T may be or contain any type except a class or interface.

Meta

License

Boost Software License Version 1.0. See LICENSE_BOOST.txt for details. Alternatively, this file may be distributed under the terms of the Tango 3-Clause BSD License (see LICENSE_BSD.txt for details).