#include "reflect.hpp"
#include "std.hpp"
#include "types.hpp"
#include <algorithm>
#include <type_traits>
Go to the source code of this file.
◆ align()
template<typename Ptr >
constexpr Ptr plywoot::detail::align |
( |
Ptr |
ptr, |
|
|
PlyDataType |
type |
|
) |
| |
|
constexpr |
Aligns the given input pointer according to the size of the given PLY data type.
- Parameters
-
ptr | input point to align |
type | PLY data type of the object pointed to by ptr |
- Returns
- the input pointer
ptr
aligned according to the alignment requirements for the given PLY data type type
Definition at line 249 of file type_traits.hpp.
◆ isList()
template<typename T >
constexpr bool plywoot::detail::isList |
( |
| ) |
|
|
constexpr |
Returns whether the given reflection type T
represents a list.
- Template Parameters
-
T | type for which to calculate whether it represents a list |
- Returns
true
in case the given type T
represents a list
Definition at line 66 of file type_traits.hpp.
◆ isMemcpyable() [1/2]
Returns whether the range of properties in [first
, last
) represents PLY properties that have the same type as the given type range. Note that a single reflect::Pack
type is compared with same number of properties as are in the pack.
- Parameters
-
first | iterator pointing to the first property in the range of input PLY properties |
last | iterator pointing after the last property in the range of input PLY properties |
- Returns
true
in case all PLY properties in the given range are memcpy
'able, false
otherwise
Definition at line 355 of file type_traits.hpp.
◆ isMemcpyable() [2/2]
template<typename T , typename U , typename... Ts>
Returns whether the range of properties in [first
, last
) represents PLY properties that have the same type as the given type range. Note that a single reflect::Pack
type is compared with same number of properties as are in the pack.
- Parameters
-
first | iterator pointing to the first property in the range of input PLY properties |
last | iterator pointing after the last property in the range of input PLY properties |
- Returns
true
in case all PLY properties in the given range are memcpy
'able, false
otherwise
Definition at line 372 of file type_traits.hpp.
◆ isPacked() [1/2]
template<typename T >
constexpr bool plywoot::detail::isPacked |
( |
uintptr_t |
offset = 0 | ) |
|
|
constexpr |
Type function that returns whether a type is aligned in memory at the given memory offset
.
- Template Parameters
-
T | type to check whether it is aligned in memory at the given offset |
- Parameters
-
offset | relative memory offset at which an object of type T is to be stored |
- Returns
true
in case the given type is packed, false
otherwise
Definition at line 283 of file type_traits.hpp.
◆ isPacked() [2/2]
template<typename T , typename U , typename... Ts>
constexpr bool plywoot::detail::isPacked |
( |
uintptr_t |
offset = 0 | ) |
|
|
constexpr |
Type function that returns whether a list of types are consecutively aligned in memory, without any padding, at the given memory offset
.
- Parameters
-
offset | relative memory offset at which an object of type T is to be stored |
- Returns
true
in case the given type is packed, false
otherwise
Definition at line 295 of file type_traits.hpp.
◆ isSame()
template<typename T >
constexpr bool plywoot::detail::isSame |
( |
PlyDataType |
type | ) |
|
|
constexpr |
Returns whether an object of type T
represents that same object as an object of the given PLY data type type
.
- Template Parameters
-
T | type to check for equality with the PLY data type type |
- Parameters
-
type | PLY data type to check for equality with T |
- Returns
true
in case an type T
equals the given PLY data type type
Definition at line 130 of file type_traits.hpp.
◆ isTriviallyCopyable()
template<typename... Ts>
constexpr bool plywoot::detail::isTriviallyCopyable |
( |
| ) |
|
|
constexpr |
Type function that returns whether all types in the given list of types are trivially copyable, that is, they do not have a custom copy constructor non-standard implementation.
- Template Parameters
-
T,U,Ts... | type for which to check whether it is trivially copyable |
- Returns
true
in case all types passed in as template parameters are trivially copyable, false
otherwise
Definition at line 308 of file type_traits.hpp.
◆ numProperties()
template<typename... Ts>
constexpr std::size_t plywoot::detail::numProperties |
( |
| ) |
|
|
constexpr |
Returns the number of properties spanned by the given list of reflection types. By default, every reflection type spans one property, except for plywoot::reflect::Pack
, which spans multiple properties by definition.
- Returns
- the number of properties spanned by the given list of reflection types
Definition at line 118 of file type_traits.hpp.
◆ sizeOf() [1/2]
template<typename... Ts>
constexpr std::size_t plywoot::detail::sizeOf |
( |
| ) |
|
|
constexpr |
Returns the size of some type T, effectively implementing sizeof(T), where it overrides sizeof() for types of instance Pack<> and Array<>. For pack types, the computed size is the sum of SizeOf
for all types in the pack, whereas for arrays it is the SizeOf
of the element type in the array times the number of elements in the array.
- Returns
- the sum of the size in bytes of the given list of reflection types
Ts...
Definition at line 211 of file type_traits.hpp.
◆ sizeOf() [2/2]
constexpr std::size_t plywoot::detail::sizeOf |
( |
PlyDataType |
type | ) |
|
|
constexpr |
Returns the size in bytes of the given PLY data type.
- Parameters
-
type | PLY data type to calculate the size for |
- Returns
- the size in bytes of the given PLY data type
Definition at line 220 of file type_traits.hpp.