Loading...
Searching...
No Matches
traits.h
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_BASE_GF_TRAITS_H
8#define PXR_BASE_GF_TRAITS_H
9
10#include "pxr/pxr.h"
11#include "pxr/base/gf/api.h"
12
13#include <type_traits>
14#include <typeinfo>
15
16PXR_NAMESPACE_OPEN_SCOPE
17
18class TfType;
19
22template <class T>
23struct GfIsGfVec { static const bool value = false; };
24
28template <class T>
29struct GfIsGfMatrix { static const bool value = false; };
30
33template <class T>
34struct GfIsGfQuat { static const bool value = false; };
35
38template <class T>
39struct GfIsGfDualQuat { static const bool value = false; };
40
43template <class T>
44struct GfIsGfRange { static const bool value = false; };
45
48template <class T>
49struct GfIsFloatingPoint : public std::is_floating_point<T>{};
50
53template <class T>
54struct GfIsArithmetic : public std::integral_constant<
55 bool, GfIsFloatingPoint<T>::value || std::is_arithmetic<T>::value>{};
56
59GF_API
60bool GfIsFloatingPointType(const TfType& type);
61
63GF_API
64bool GfIsFloatingPointType(const std::type_info& typeInfo);
65
66PXR_NAMESPACE_CLOSE_SCOPE
67
68#endif // PXR_BASE_GF_TRAITS_H
TfType represents a dynamic runtime type.
Definition type.h:48
A metafunction which is equivalent to std::arithmetic but also includes any specializations from GfIs...
Definition traits.h:55
A metafunction which is equivalent to std::is_floating_point but allows for additional specialization...
Definition traits.h:49
A metafunction with a static const bool member 'value' that is true for GfDualQuat types and false fo...
Definition traits.h:39
A metafunction with a static const bool member 'value' that is true for GfMatrix types,...
Definition traits.h:29
A metafunction with a static const bool member 'value' that is true for GfQuat types and false for al...
Definition traits.h:34
A metafunction with a static const bool member 'value' that is true for GfRange types and false for a...
Definition traits.h:44
A metafunction with a static const bool member 'value' that is true for GfVec types,...
Definition traits.h:23