|
functional-dag
|
(Library related) A library defines what is needed to construct a dag tree. More...
#include <lib_utils.h>
Public Member Functions | |
| expected< bool, fn_dag::error_codes > | load_lib (const fs::path _lib_path) |
| This function loads the library and keeps the constructor around for subsequent asks to create the node. | |
| void | load_all_available_libs (const fs::directory_entry &_library_path) |
| This function is for convenience. | |
| expected< fn_dag::dag_manager< string > *, fn_dag::error_codes > | fsys_deserialize (const string &_json_in) |
| Takes highly structured JSON in and turns it into a lambda dag. | |
Static Public Member Functions | |
| static bool | preflight_lib (const fs::path _lib_path) |
| A quick and easy function to test whether a dynamic library conforms to the library specifications. | |
Protected Member Functions | |
| expected< bool, fn_dag::error_codes > | _create_node (dag_manager< string > &_manager, const fn_dag::node_spec *const _spec) |
| Private function to verify parameters, create the node, and attach it. | |
Protected Attributes | |
| map< GUID< node_spec >, function< construction_signature > > | m_constructors |
| A mapping between IDs to the constructors that create the nodes; The user will need to define these libraries.constructors in their dynamic libraries. | |
| map< GUID< node_spec >, vector< option_spec > > | m_options |
| This is a parallel data structure that ensures that whatever options/parameters are passed to it at runtime conform to the expectations of the constructors signature. | |
(Library related) A library defines what is needed to construct a dag tree.
The library is a utility that defines an interface for dynamic libraries to be loaded into the library. Once a set number of nodes are available to be constructed from the dynamic libraries, users can define a "pipe" which represents the dag to be added to a manager to be managed.
|
protected |
Private function to verify parameters, create the node, and attach it.
| _manager | A dag manager to attach the new node to. |
| _spec | Specifications about which node and what parameters should be used to create it. |
|
nodiscard |
Takes highly structured JSON in and turns it into a lambda dag.
In some ways this can be considered the casual user's interface to this entire library. This function will connect the functional dag's functionality to a simple JSON specification. It will check if the node specified in the JSON file is available.
| _json_in | The JSON specification to create the DAG structure. |
| void fn_dag::library::load_all_available_libs | ( | const fs::directory_entry & | _library_path | ) |
This function is for convenience.
This function takes a directory and iterates through the .so or .dylibs. It will preflight them and load them if they are indeed compatible.
| _library_path | A path where many .so and .dylibs are expected to be. |
|
nodiscard |
This function loads the library and keeps the constructor around for subsequent asks to create the node.
It is recommended to preflight the library before loading it but not necessary. This is only due to the heavyweight nature of this funciton compared to preflight. Once The library is known to be compatible with the signatures, then this function will load the dynamic library and store it's constructors and specifications to be used later during construction.
| _lib_path | The path to the dynamic library. |
|
staticnodiscard |
A quick and easy function to test whether a dynamic library conforms to the library specifications.
If the user of the library would like to check if a dynamic library could be tracked and used to create nodes, then this function will help you check. It's meant to be a stateless way to just double check before asking the library to load it.
| _lib_path | The path to the dynamic library |