-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathNodeGraphSignature.h
More file actions
77 lines (65 loc) · 2.53 KB
/
NodeGraphSignature.h
File metadata and controls
77 lines (65 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// Distributed under the MIT License (See
// accompanying file "LICENSE" or the website
// http://www.opensource.org/licenses/mit-license.php)
#pragma once
#include "../Utility/StringUtils.h"
#include "../Utility/IteratorUtils.h"
#include <vector>
namespace GraphLanguage
{
enum class ParameterDirection { In, Out };
class NodeGraphSignature
{
public:
class Parameter
{
public:
std::string _type, _name;
ParameterDirection _direction = ParameterDirection::In;
std::string _semantic, _default;
};
// Returns the list of parameters taken as input through the function call mechanism
auto GetParameters() const -> IteratorRange<const Parameter*> { return MakeIteratorRange(_functionParameters); }
auto GetParameters() -> IteratorRange<Parameter*> { return MakeIteratorRange(_functionParameters); }
void AddParameter(const Parameter& param);
// Returns the list of parameters that are accesses as global scope variables (or captured from a containing scope)
// In other words, these aren't explicitly passed to the function, but the function needs to interact with them, anyway
auto GetCapturedParameters() const -> IteratorRange<const Parameter*> { return MakeIteratorRange(_capturedParameters); }
void AddCapturedParameter(const Parameter& param);
class TemplateParameter
{
public:
std::string _name;
std::string _restriction;
};
auto GetTemplateParameters() const -> IteratorRange<const TemplateParameter*> { return MakeIteratorRange(_templateParameters); }
void AddTemplateParameter(const TemplateParameter& param);
const std::string& GetImplements() const { return _implements; }
void SetImplements(const std::string& value) { _implements = value; }
NodeGraphSignature();
~NodeGraphSignature();
private:
std::vector<Parameter> _functionParameters;
std::vector<Parameter> _capturedParameters;
std::vector<TemplateParameter> _templateParameters;
std::string _implements;
};
class UniformBufferSignature
{
public:
class Parameter
{
public:
std::string _name;
std::string _type;
std::string _semantic;
};
std::vector<Parameter> _parameters;
};
class ShaderFragmentSignature
{
public:
std::vector<std::pair<std::string, NodeGraphSignature>> _functions;
std::vector<std::pair<std::string, UniformBufferSignature>> _uniformBuffers;
};
}