17#ifndef ADTF_FILE_FACTORY_INCLUDED
18#define ADTF_FILE_FACTORY_INCLUDED
26#include <unordered_map>
47class Objects:
public std::vector<std::shared_ptr<Object>>
64 template <
typename OBJECT_TYPE>
67 std::vector<std::shared_ptr<OBJECT_TYPE>> all_of_given_type;
68 for (
auto&
object: *
this)
70 auto object_of_given_type = std::dynamic_pointer_cast<OBJECT_TYPE>(
object);
71 if (object_of_given_type)
73 all_of_given_type.push_back(object_of_given_type);
77 return all_of_given_type;
103 std::unordered_map<std::string, void*> _plugin_handles;
121template <
typename FACTORIES,
typename FACTORY_TYPE>
126 for (
auto& factory:
getObjects().getAllOfType<FACTORY_TYPE>())
128 factories.add(factory);
168bool adtfFileIsDebugPlugin();
Abstract sink for log messages produced by the adtf_file library.
Definition log.h:67
base interface class for all available objects of the ADTF File Library that can be added to the obje...
Definition object.h:38
container for objects. this object container can be retrieved as objects singleton of the library via...
Definition object.h:48
std::vector< std::shared_ptr< OBJECT_TYPE > > getAllOfType() const
Get the All Of Type of type OBJECT_TYPE.
Definition object.h:65
void unloadPlugin(const std::string &file_name)
Unload a plugin.
void loadPlugin(const std::string &file_name)
Load a plugin.
void loadPlugin(const std::string &file_name, Logger *plugin_logger)
Load a plugin.
PluginInitializer(std::function< void()> initialization_callback)
CTOR.
namespace for ADTF File library
Definition adtf2_adtf_core_media_sample_deserializer.h:25
FACTORIES getFactories()
Get the Factories from the objects singleton of the library.
Definition object.h:122
void loadPlugin(const std::string &file_name)
Loads a ADTF File Library plugin.
Objects & getObjects()
Get the objects singleton of the library.
const char * adtfFileGetVersion()
retrieves the ADTF File Library plugin version
void adtfFileSetObjects2(adtf_file::Objects &objects)
sets the objects singleton of the calling application to the plugin