Pothos  0.7.0-gf7fbae99
The Pothos dataflow programming software suite
Public Member Functions | Static Public Member Functions | List of all members
Pothos::BlockRegistry Class Reference

#include <BlockRegistry.hpp>

Public Member Functions

 BlockRegistry (const std::string &path, const Callable &factory)
 
template<typename... ArgsType>
Pothos::Proxy make (const std::string &path, ArgsType &&... args)
 

Static Public Member Functions

template<typename... ArgsType>
static Proxy make (const std::string &path, ArgsType &&... args)
 

Detailed Description

The BlockRegistry class registers factories for topological elements. These elements include Blocks and sub-Topologies (hierarchies of elements). A BlockRegistry can be created at static initialization time so that modules providing blocks will automatically register. Usage example (put this at the bottom of your c++ source file) static Pothos::BlockRegistry registerMyBlock("/my/factory/path", &MyBlock::make);

Constructor & Destructor Documentation

◆ BlockRegistry()

Pothos::BlockRegistry::BlockRegistry ( const std::string &  path,
const Callable factory 
)

Register a factory function into the plugin registry. The resulting factory path will be /blocks/path. Example: a path of /foo/bar will register to /blocks/foo/bar.

Because this call is used at static initialization time, it does not throw. However, registration errors are logged, and the block will not be available at runtime.

The return type of the call must be Block* or Topology*.

Parameters
paththe factory path begining with a slash ("/")
factorythe Callable factory function

Member Function Documentation

◆ make() [1/2]

template<typename... ArgsType>
Pothos::Proxy Pothos::BlockRegistry::make ( const std::string &  path,
ArgsType &&...  args 
)

◆ make() [2/2]

template<typename... ArgsType>
static Proxy Pothos::BlockRegistry::make ( const std::string &  path,
ArgsType &&...  args 
)
static

Instantiate a block given the factory path and arguments.

Parameters
paththe factory path begining with a slash ("/")
argsa variable number of factory arguments
Returns
the newly created block instance as a Proxy

The documentation for this class was generated from the following files: