Bifrost SDK
Bifrost SDK documentation
TypeTranslation.h
Go to the documentation of this file.
1//-
2// ================================================================================================
3// Copyright 2024 Autodesk, Inc. All rights reserved.
4//
5// Use of this software is subject to the terms of the Autodesk license agreement provided
6// at the time of installation or download, or which otherwise accompanies this software in
7// either electronic or hard copy form.
8// ================================================================================================
9//+
10
15
16#ifndef BIFROSTGRAPH_EXECUTOR_TYPE_TRANSLATION_H
17#define BIFROSTGRAPH_EXECUTOR_TYPE_TRANSLATION_H
18
19#include <BifrostGraph/Executor/internal/ExecutorExport.h>
20
22
23#include <Amino/Core/Array.h>
24#include <Amino/Core/String.h>
25
26namespace Amino {
27class Any;
28class Library;
29class Metadata;
30class Type;
31class Value;
32
33template <typename E>
35
37} // namespace Amino
38
39namespace BifrostGraph {
40namespace Executor {
41
43
53class BIFROSTGRAPH_EXECUTOR_SHARED_DECL TypeTranslation {
54public:
57
61 class BIFROSTGRAPH_EXECUTOR_SHARED_DECL ValueData {
62 public:
63 ValueData() noexcept;
64 virtual ~ValueData() noexcept;
65 };
66
70 class BIFROSTGRAPH_EXECUTOR_SHARED_DECL PortData {
71 public:
72 PortData() noexcept;
73 virtual ~PortData() noexcept;
74 };
75
79 class BIFROSTGRAPH_EXECUTOR_SHARED_DECL PluginHostData {
80 public:
81 PluginHostData() noexcept;
82 virtual ~PluginHostData() noexcept;
83 };
84
85public:
88 explicit TypeTranslation(String name) noexcept;
89
91 virtual ~TypeTranslation() noexcept;
92
95 String getName() const noexcept;
96
99
150 static const char* createFuncName() noexcept;
151
153 virtual void deleteThis() noexcept = 0;
154
168 virtual void getSupportedTypes(const Amino::Library& amLibrary,
169 Amino::TypeConstIndexedList& types) const noexcept;
170
184 virtual void getSupportedTypeNames(StringArray& names) const noexcept;
185
193 virtual bool convertValueFromHost(const Amino::Type& type,
194 Amino::Any& any,
195 const ValueData* valueData) const noexcept;
196
203 virtual bool convertValueToHost(const Amino::Any& any, ValueData* valueData) const noexcept;
204
215 virtual bool portAdded(const String& name,
216 PortDirection direction,
217 const Amino::Type& type,
218 const Amino::Metadata& metadata,
219 PortClass portClass,
220 PortData* portData) const noexcept;
221
228 virtual bool portRemoved(const String& name, const String& graphName) const noexcept;
229
237 virtual bool portRenamed(const String& prevName,
238 const String& name,
239 const String& graphName) const noexcept;
240
246 virtual bool registerHostPlugins(const PluginHostData* pluginData) const noexcept;
247
253 virtual bool unregisterHostPlugins(const PluginHostData* pluginData) const noexcept;
254
255private:
258 TypeTranslation(const TypeTranslation&) = delete;
260 TypeTranslation& operator=(const TypeTranslation&) = delete;
261 TypeTranslation& operator=(TypeTranslation&&) = delete;
263
265 String m_name;
266};
267
268} // namespace Executor
269} // namespace BifrostGraph
270#endif
A resizable container of contiguous elements.
String class.
PortClass
The port class. This is to indicate if a port is a regular input or output port, a terminal output or...
Definition: Types.h:65
PortDirection
The direction of a port.
Definition: Types.h:75
Definition: HostData.h:33
EntityIndexedList< const Type > TypeConstIndexedList
Define a Amino array of elements of type T.
Definition: Array.h:105
The string class used by Amino.
Definition: String.h:46
A Library of types and node definitions that can be used by Bifrost.
Definition: Library.h:53
BifrostGraph Executor TypeTranslation.
TypeTranslation *(*)() CreateFunc
The signature of the function used to create the TypeTranslation.
The host data for translating values from/to host/Amino.
The host data for creating host ports.
The host data for registering TypeTranslation to host plugin.
BifrostGraph Executor common types.