Loading [MathJax]/extensions/TeX/AMSmath.js
Radium Engine  1.5.28
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Ra::Dataflow::Core::NodeFactorySet Class Reference

#include <Dataflow/Core/NodeFactory.hpp>

+ Collaboration diagram for Ra::Dataflow::Core::NodeFactorySet:

Public Types

using container_type = std::map<std::string, std::shared_ptr<NodeFactory>>
 
using key_type = container_type::key_type
 
using mapped_type = container_type::mapped_type
 
using value_type = container_type::value_type
 
using const_iterator = container_type::const_iterator
 
using iterator = container_type::iterator
 

Public Member Functions

auto add_factory (mapped_type factory) -> bool
 
auto has_factory (const key_type &name) -> Ra::Core::Utils::optional< mapped_type >
 Test if a factory exists in the set with the given name.
 
auto remove_factory (const key_type &name) -> bool
 Remove the identified factory from the set.
 
auto create_node (const std::string &nodeType, const nlohmann::json &data, DataflowGraph *owningGraph=nullptr) -> std::shared_ptr< Node >
 Create a node using one of the functor (if it exists) registered in one factory for the given type name.
 
auto begin () const -> const_iterator
 
auto end () const -> const_iterator
 
auto cbegin () const -> const_iterator
 
auto cend () const -> const_iterator
 
auto find (const key_type &key) const -> const_iterator
 
auto insert (value_type value) -> std::pair< iterator, bool >
 
auto erase (const key_type &key) -> size_t
 
const std::stringdefault_factory_name ()
 

Detailed Description

NodeFactorySet store a set of NodeFactory, singleton managed with NodeFactoriesManager.

Definition at line 122 of file NodeFactory.hpp.

Member Typedef Documentation

◆ const_iterator

using Ra::Dataflow::Core::NodeFactorySet::const_iterator = container_type::const_iterator

Definition at line 131 of file NodeFactory.hpp.

◆ container_type

◆ iterator

using Ra::Dataflow::Core::NodeFactorySet::iterator = container_type::iterator

Definition at line 132 of file NodeFactory.hpp.

◆ key_type

using Ra::Dataflow::Core::NodeFactorySet::key_type = container_type::key_type

Definition at line 127 of file NodeFactory.hpp.

◆ mapped_type

using Ra::Dataflow::Core::NodeFactorySet::mapped_type = container_type::mapped_type

Definition at line 128 of file NodeFactory.hpp.

◆ value_type

using Ra::Dataflow::Core::NodeFactorySet::value_type = container_type::value_type

Definition at line 129 of file NodeFactory.hpp.

Member Function Documentation

◆ add_factory()

auto Ra::Dataflow::Core::NodeFactorySet::add_factory ( NodeFactorySet::mapped_type factory) -> bool
inline

Add a factory to the set of factories available

Parameters
factorythe factory
Returns
true if the factory was inserted, false if the insertion was prevented by an already existing factory with the same name.

Definition at line 282 of file NodeFactory.hpp.

+ Here is the call graph for this function:

◆ begin()

auto Ra::Dataflow::Core::NodeFactorySet::begin ( ) const -> const_iterator
inline

Definition at line 296 of file NodeFactory.hpp.

◆ cbegin()

auto Ra::Dataflow::Core::NodeFactorySet::cbegin ( ) const -> const_iterator
inline

Definition at line 302 of file NodeFactory.hpp.

◆ cend()

auto Ra::Dataflow::Core::NodeFactorySet::cend ( ) const -> const_iterator
inline

Definition at line 305 of file NodeFactory.hpp.

◆ create_node()

auto Ra::Dataflow::Core::NodeFactorySet::create_node ( const std::string & nodeType,
const nlohmann::json & data,
DataflowGraph * owningGraph = nullptr ) -> std::shared_ptr<Node>
nodiscard

Create a node using one of the functor (if it exists) registered in one factory for the given type name.

Returns
the created node, nullptr if there is no construction functor registered for the type.
Parameters
nodeTypename of the node type (as simplified by Radium demangler) to create
datajson data to fill the created node
owningGraphGraph in which the node should be added, if not nullptr.
Returns
The created node, nullptr in case of failure

Definition at line 48 of file NodeFactory.cpp.

◆ default_factory_name()

const std::string & Ra::Dataflow::Core::NodeFactorySet::default_factory_name ( )
inline

Definition at line 188 of file NodeFactory.hpp.

◆ end()

auto Ra::Dataflow::Core::NodeFactorySet::end ( ) const -> const_iterator
inline

Definition at line 299 of file NodeFactory.hpp.

◆ erase()

auto Ra::Dataflow::Core::NodeFactorySet::erase ( const key_type & key) -> size_t
inline

Definition at line 316 of file NodeFactory.hpp.

◆ find()

auto Ra::Dataflow::Core::NodeFactorySet::find ( const key_type & key) const -> const_iterator
inline

Definition at line 308 of file NodeFactory.hpp.

◆ has_factory()

auto Ra::Dataflow::Core::NodeFactorySet::has_factory ( const key_type & name) -> Ra::Core::Utils::optional<mapped_type>
inline

Test if a factory exists in the set with the given name.

Parameters
nameThe name of the factory to search for
Returns
an optional that is empty (evaluates to false) if no factory exists with the given name or that contains the existing factory.

Definition at line 287 of file NodeFactory.hpp.

◆ insert()

auto Ra::Dataflow::Core::NodeFactorySet::insert ( NodeFactorySet::value_type value) -> std::pair<iterator, bool>
inline

Definition at line 312 of file NodeFactory.hpp.

◆ remove_factory()

auto Ra::Dataflow::Core::NodeFactorySet::remove_factory ( const key_type & name) -> bool
inline

Remove the identified factory from the set.

Parameters
namethe name of the factory to remove
Returns
true if the factory was removed, false if the factory does not exist in the set.

Definition at line 293 of file NodeFactory.hpp.


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