BifrostGraph Executor TypeTranslation.
More...
#include <TypeTranslation.h>
|
| | TypeTranslation (String name) noexcept |
| | Constructor. More...
|
| |
| virtual | ~TypeTranslation () noexcept |
| | Destructor. More...
|
| |
| String | getName () const noexcept |
| | Get the name of this TypeTranslation for logging purposes. More...
|
| |
| virtual void | deleteThis () noexcept=0 |
| | Instruct the TypeTranslation to delete itself. More...
|
| |
| virtual void | getSupportedTypes (const Amino::Library &amLibrary, Amino::TypeConstIndexedList &types) const noexcept |
| | Get the list of the types handled by this TypeTranslation. More...
|
| |
| virtual void | getSupportedTypeNames (StringArray &names) const noexcept |
| | Get the fully qualified names of the types handled by the TypeTranslation. More...
|
| |
| virtual bool | convertValueFromHost (const Amino::Type &type, Amino::Any &any, const ValueData *valueData) const noexcept |
| | Convert a host value to an Amino::Any. More...
|
| |
| virtual bool | convertValueToHost (const Amino::Any &any, ValueData *valueData) const noexcept |
| | Convert an Amino::Any to a host value. More...
|
| |
| virtual bool | portAdded (const String &name, PortDirection direction, const Amino::Type &type, const Amino::Metadata &metadata, PortClass portClass, PortData *portData) const noexcept |
| | Notification method called when a port is created/added. More...
|
| |
| virtual bool | portRemoved (const String &name, const String &graphName) const noexcept |
| | Notification method called when a port is removed. More...
|
| |
| virtual bool | portRenamed (const String &prevName, const String &name, const String &graphName) const noexcept |
| | Notification method called when a port is renamed. More...
|
| |
| virtual bool | registerHostPlugins (const PluginHostData *pluginData) const noexcept |
| | Register any plugins or data types needed. More...
|
| |
| virtual bool | unregisterHostPlugins (const PluginHostData *pluginData) const noexcept |
| | Unregister any previously registered plugins or data types. More...
|
| |
BifrostGraph Executor TypeTranslation.
TypeTranslation can be used to perform conversions from specific host data types to Amino types, and vice-versa.
A TypeTranslation should be allocated on the heap, not on the stack. The Workspace will manage its lifetime and delete it by calling TypeTranslation::deleteThis when the Workspace gets unloaded.
Definition at line 53 of file TypeTranslation.h.
◆ CreateFunc
◆ String
◆ StringArray
◆ TypeTranslation()
| BifrostGraph::Executor::TypeTranslation::TypeTranslation |
( |
String |
name | ) |
|
|
explicitnoexcept |
◆ ~TypeTranslation()
| virtual BifrostGraph::Executor::TypeTranslation::~TypeTranslation |
( |
| ) |
|
|
virtualnoexcept |
◆ convertValueFromHost()
| virtual bool BifrostGraph::Executor::TypeTranslation::convertValueFromHost |
( |
const Amino::Type & |
type, |
|
|
Amino::Any & |
any, |
|
|
const ValueData * |
valueData |
|
) |
| const |
|
virtualnoexcept |
Convert a host value to an Amino::Any.
- Note
- Default implementation does nothing and returns false.
- Parameters
-
| [in] | type | The Amino value type. |
| [out] | any | The destination Amino::Any. |
| [in] | valueData | A pointer to a ValueData instance, used to access the host value. |
- Returns
- true if the value was successfully converted.
◆ convertValueToHost()
| virtual bool BifrostGraph::Executor::TypeTranslation::convertValueToHost |
( |
const Amino::Any & |
any, |
|
|
ValueData * |
valueData |
|
) |
| const |
|
virtualnoexcept |
Convert an Amino::Any to a host value.
- Note
- Default implementation does nothing and returns false.
- Parameters
-
| [in] | any | The source Amino::Any. |
| [in,out] | valueData | A pointer to a ValueData instance, used to access the host value. |
- Returns
- true if the value was successfully converted.
◆ createFuncName()
| static const char * BifrostGraph::Executor::TypeTranslation::createFuncName |
( |
| ) |
|
|
staticnoexcept |
Get the name of the function used to create a new TypeTranslation from a shared library.
This function is the C entry point used to register a TypeTranslation with Bifrost. The client code must declare and define the entry point. This function must have the CreateFunc signature.
Note that BIFROSTGRAPH_EXECUTOR_SHARED_DECL is for symbol visiblity, see ExecutorExport.h file.
extern "C" {
createBifrostTypeTranslation(void);
createBifrostTypeTranslation(void) {
return new MyTypeTranslation();
}
BifrostGraph Executor TypeTranslation.
The TypeTranslation shared library is exposed to Bifrost via a config file. The JSON config file will need a typesTranslationlibs section. Note that, to be portable and depending on the platform, Bifrost config file parsing will automatically add the prefix "lib" and suffix "dll", "so", or "dylib".
{
"AminoConfigurations": [
{
"vendorName": "MyCompany",
"libraryVersion": "0.0.1",
"libraryName": "MyPackName",
"typesTranslationlibs": [
{
"path": "Directory containing the shared lib",
"files": [
"MyTypeTranslation"
]
}
]
}
]
}
- Returns
- "createBifrostTypeTranslation"
◆ deleteThis()
| virtual void BifrostGraph::Executor::TypeTranslation::deleteThis |
( |
| ) |
|
|
pure virtualnoexcept |
◆ getName()
| String BifrostGraph::Executor::TypeTranslation::getName |
( |
| ) |
const |
|
noexcept |
◆ getSupportedTypeNames()
| virtual void BifrostGraph::Executor::TypeTranslation::getSupportedTypeNames |
( |
StringArray & |
names | ) |
const |
|
virtualnoexcept |
Get the fully qualified names of the types handled by the TypeTranslation.
The Workspace will call getSupportedTypes and this method, in this order, to build the complete list of types handled by this TypeTranslation. The default implementation of this method adds no type name to names. The deriving class may override this default implementation to list the fully qualified names of the types it handles, in addition to the types it may have listed in its implementation of getSupportedTypes. If the same type name is listed more than once by this method, or if a type name listed by this method was already listed by getSupportedTypes, these duplicates are ignored.
- Parameters
-
| [out] | names | The fully qualified names of the types handled by this TypeTranslation. |
◆ getSupportedTypes()
| virtual void BifrostGraph::Executor::TypeTranslation::getSupportedTypes |
( |
const Amino::Library & |
amLibrary, |
|
|
Amino::TypeConstIndexedList & |
types |
|
) |
| const |
|
virtualnoexcept |
◆ portAdded()
| virtual bool BifrostGraph::Executor::TypeTranslation::portAdded |
( |
const String & |
name, |
|
|
PortDirection |
direction, |
|
|
const Amino::Type & |
type, |
|
|
const Amino::Metadata & |
metadata, |
|
|
PortClass |
portClass, |
|
|
PortData * |
portData |
|
) |
| const |
|
virtualnoexcept |
Notification method called when a port is created/added.
- Note
- Default implementation does nothing and returns true.
- Parameters
-
| [in] | name | The name of the port. |
| [in] | direction | The direction of the port (undefined, input or output). |
| [in] | type | The type of the port. |
| [in] | portClass | The class of the port (regular, terminal or job port). |
| [in] | metadata | Metadata for the port. |
| [in] | portData | A pointer to a PortData instance, used to create the host port. |
- Returns
- true if the host port was successfully created.
◆ portRemoved()
| virtual bool BifrostGraph::Executor::TypeTranslation::portRemoved |
( |
const String & |
name, |
|
|
const String & |
graphName |
|
) |
| const |
|
virtualnoexcept |
Notification method called when a port is removed.
- Note
- Default implementation does nothing and returns true.
- Parameters
-
| [in] | name | The name of the port to be removed. |
| [in] | graphName | The name of the graph that has this port. |
- Returns
- true if the host port was successfully removed.
◆ portRenamed()
| virtual bool BifrostGraph::Executor::TypeTranslation::portRenamed |
( |
const String & |
prevName, |
|
|
const String & |
name, |
|
|
const String & |
graphName |
|
) |
| const |
|
virtualnoexcept |
Notification method called when a port is renamed.
- Note
- Default implementation does nothing and returns true.
- Parameters
-
| [in] | prevName | The previous name of the port. |
| [in] | name | The new name of the port. |
| [in] | graphName | The name of the graph that has this port. |
- Returns
- true if the host port was successfully renamed.
◆ registerHostPlugins()
| virtual bool BifrostGraph::Executor::TypeTranslation::registerHostPlugins |
( |
const PluginHostData * |
pluginData | ) |
const |
|
virtualnoexcept |
Register any plugins or data types needed.
- Note
- Default implementation does nothing and returns true.
- Parameters
-
| [in] | pluginData | The host data. |
- Returns
- true on success, false otherwise.
◆ unregisterHostPlugins()
| virtual bool BifrostGraph::Executor::TypeTranslation::unregisterHostPlugins |
( |
const PluginHostData * |
pluginData | ) |
const |
|
virtualnoexcept |
Unregister any previously registered plugins or data types.
- Note
- Default implementation does nothing and returns true.
- Parameters
-
| [in] | pluginData | The host data. |
- Returns
- true on success, false otherwise.