SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
smtk
graph
NodeProperties.h
1
//=========================================================================
2
// Copyright (c) Kitware, Inc.
3
// All rights reserved.
4
// See LICENSE.txt for details.
5
//
6
// This software is distributed WITHOUT ANY WARRANTY; without even
7
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8
// PURPOSE. See the above copyright notice for more information.
9
//=========================================================================
10
11
#ifndef smtk_graph_NodeProperties_h
12
#define smtk_graph_NodeProperties_h
13
14
#include "smtk/Metaprogramming.h"
15
#include "
smtk/common/Visit.h
"
16
#include "smtk/string/Token.h"
17
18
#include <functional>
19
#include <iterator>
20
#include <set>
21
#include <type_traits>
22
23
namespace
smtk
24
{
25
namespace
graph
26
{
27
35
template
<
typename
NodeType>
36
class
NodeProperties
37
{
38
template
<
class
>
39
struct
type_sink
40
{
41
using
type = void;
42
};
// consume a type and make it `void`
43
template
<
class
T>
44
using
type_sink_t =
typename
type_sink<T>::type;
45
46
public
:
51
template
<
class
T,
class
=
void
>
52
struct
hasSerializeMark
: std::false_type
53
{
54
};
55
template
<
class
T>
56
struct
hasSerializeMark
<T, type_sink_t<typename T::Serialize>>
57
: std::conditional<T::Serialize::value, std::true_type, std::false_type>::type
58
{
59
};
60
62
class
isSerializable
63
{
64
public
:
65
using
type =
typename
hasSerializeMark<NodeType>::type
;
66
static
constexpr
bool
value = type::value;
67
};
68
};
69
70
}
// namespace graph
71
}
// namespace smtk
72
73
#endif
smtk
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition:
doc.h:33
smtk::graph::NodeProperties::isSerializable
True when a node type should be serialized.
Definition:
NodeProperties.h:62
smtk::graph::NodeProperties
Checks that can be performed on a node-type.
Definition:
NodeProperties.h:36
smtk::graph::NodeProperties::hasSerializeMark
Check whether the node type is marked to be serialized/deserialized.
Definition:
NodeProperties.h:52
Visit.h
Generated by
1.8.17