Bifrost resources
The basic elements that allow to define the Bifrost graphs are types and nodes (either compounds or operators).
Bifrost definition JSON files
The Bifrost definition JSON files are used to declare types (in a "types"
section), operators (in an "operators"
section), compounds (in a "compounds"
section) and/or terminal nodes (in a "terminalNodes"
section).
The objects flowing in a Bifrost graph may have different types. Many built-in types are already defined in Amino, like bool
, int
, float
, String
, Array
etc. These built-in types don't need to be explicitly defined in any resource file. Using these built-in types, more complex types are defined in Bifrost, like Geometry::Mesh::FaceEdge
, Object
, Simulation::Time
etc. These other types are declared in definition JSON files that are shipped with Bifrost, and they must be loaded by Bifrost so they can be recognized by Amino and used in graphs.
C++ custom types can be defined using the Bifrost Operator SDK, and more precisely using the Type annotation.
Custom structures and enums can be defined directly in the "types"
section of a definition JSON file using the "structName"
and "structMembers"
fields, respectively the "enumName"
and "enumMembers"
fields. These custom structures and enums can flow in graphs, but are not accessible in C++.
As with types, many built-in nodes are already defined in Amino, like the equal
and for_each
operators. New custom operators can also be defined using the Bifrost Operator SDK (see Building a Bifrost operator and its Bifrost pack).
Once new custom types or operators have been declared in Bifrost definition JSON file(s), they must be loaded into Bifrost through Bifrost config JSON file(s). The Library class in the Bifrost Executor SDK provides the loadDefinitionFile()
method to load a Bifrost definition JSON file.
Bifrost packs / libraries
All Bifrost resources, whether they are shipped with Bifrost or are created using the Bifrost Operator SDK, must be loaded into Bifrost so they can be used in graphs. Multiple types of Bifrost resources can be grouped together in what is called a Bifrost pack or library.
Bifrost config JSON files
A Bifrost config JSON file is used to list all the resources that make up a pack or library.
The Bifrost host application must load these Bifrost config JSON files to use the resources they list. The Workspace class in the Bifrost Executor SDK provides the loadConfigFiles()
method to load these Bifrost config JSON files.
Here are some important elements of a Bifrost config JSON file that are known and parsed by Bifrost to load the resources that it lists:
Root element name | Sub-element name | Value type | Description |
---|---|---|---|
"AminoConfigurations" | array<object> | ||
"libraryName" | string | The name of the Bifrost library/pack. This name can be used to disable this pack when loading config files using the Workspace::loadConfigFiles() method. See the Workspace class in the Bifrost Executor SDK. |
|
"libraryVersion" | string | The version of this library/pack. | |
"vendorName" | string | The vendor of this library/pack. | |
"jsonLibs" | array<object> | The locations and/or filenames of Bifrost definition JSON files. | |
"sharedLibs" | array<object> | The locations and filenames of shared libraries containing custom types or operators. | |
"callbackLibs" | array<object> | The locations and filenames of shared libraries containing callback definitions. See the BifrostGraph::Executor::Callbacks class in the API reference section. |
|
"typesTranslationlibs" | array<object> | The locations and filenames of shared libraries containing TypeTranslation definitions. See the TypeTranslation class in the Bifrost Executor SDK. Note: The "typesTranslationlibs" sub-element name may be renamed in a future version. |
|
"watchPointsTranslationLibs" | array<object> | The locations and filenames of shared libraries containing Watchpoint definitions. See the Watchpoint class in the Bifrost Executor SDK. Note: The "watchPointsTranslationLibs" sub-element name may be renamed in a future version. |
|
"include" | string | The pathname of another Bifrost config JSON file to be included. |