0.2.0
Loading...
Searching...
No Matches
NodeRegistry.hpp
Go to the documentation of this file.
1// This file is part of INSTINCT, the INS Toolkit for Integrated
2// Navigation Concepts and Training by the Institute of Navigation of
3// the University of Stuttgart, Germany.
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
13
14#pragma once
15
16#include <string>
17#include <memory>
18#include <functional>
19#include <vector>
20#include <map>
21
22#include "internal/Node/Pin.hpp"
23
24namespace NAV
25{
26class Node;
27
28namespace NodeRegistry
29{
31struct PinInfo
32{
37 PinInfo(const Pin::Kind& kind, const Pin::Type& type, std::vector<std::string> dataIdentifier)
39
45 std::vector<std::string> dataIdentifier;
46};
47
50{
52 std::function<Node*()> constructor;
54 std::string type;
56 std::vector<PinInfo> pinInfoList;
57
60 [[nodiscard]] bool hasCompatiblePin(const Pin* pin) const;
61};
62
64const std::map<std::string, std::vector<NodeInfo>>& RegisteredNodes();
65
70bool NodeDataTypeAnyIsChildOf(const std::vector<std::string>& childTypes, const std::vector<std::string>& parentTypes);
71
74std::vector<std::string> GetParentNodeDataTypes(const std::string& type);
75
78
81
82} // namespace NodeRegistry
83
84} // namespace NAV
bool NodeDataTypeAnyIsChildOf(const std::vector< std::string > &childTypes, const std::vector< std::string > &parentTypes)
Checks if any of the provided child types is a child of any of the provided parent types.
std::vector< std::string > GetParentNodeDataTypes(const std::string &type)
Get the Parent Node Data Types of the specified Node Data Type.
void RegisterNodeDataTypes()
Register all available NodeData types for the program.
const std::map< std::string, std::vector< NodeInfo > > & RegisteredNodes()
Reference to List of all registered Nodes.
void RegisterNodeTypes()
Register all available Node types for the program.
Pin class.
void move(std::vector< T > &v, size_t sourceIdx, size_t targetIdx)
Moves an element within a vector to a new position.
Definition Vector.hpp:26
Abstract parent class for all nodes.
Definition Node.hpp:86
Pins in the GUI for information exchange.
Definition Pin.hpp:43
Holds information for registered nodes.
Definition NodeRegistry.hpp:50
std::function< Node *()> constructor
Constructor.
Definition NodeRegistry.hpp:52
std::string type
Class Type of the node.
Definition NodeRegistry.hpp:54
bool hasCompatiblePin(const Pin *pin) const
Checks if the node has a pin which can be linked.
std::vector< PinInfo > pinInfoList
List of port data types.
Definition NodeRegistry.hpp:56
Holds info of the pins of registered nodes.
Definition NodeRegistry.hpp:32
Pin::Type type
Type of the Pin.
Definition NodeRegistry.hpp:43
Pin::Kind kind
Kind of the Pin (Input/Output)
Definition NodeRegistry.hpp:41
PinInfo(const Pin::Kind &kind, const Pin::Type &type, std::vector< std::string > dataIdentifier)
Constructor.
Definition NodeRegistry.hpp:37
std::vector< std::string > dataIdentifier
One or multiple Data Identifiers (Unique name which is used for data flows)
Definition NodeRegistry.hpp:45
Kind of the Pin (Input/Output)
Definition Pin.hpp:165
@ None
None.
Definition Pin.hpp:169
Type of the data on the Pin.
Definition Pin.hpp:47
@ None
Not initialized.
Definition Pin.hpp:51