lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
Pds::Trg::Factory< T > Class Template Reference

Loads a shared library and creates one object of type T with a C function exported by it; the object is deleted when the factory is destroyed or reused. More...

#include <utilities.hh>

Public Member Functions

 Factory ()
 Construct with no object.
 
 ~Factory ()
 Delete the object if one was created.
 
T * create (const std::string &soname, const std::string &symbol)
 Delete any previous object, close any open library, open soname and call its function symbol to create a new object.
 

Detailed Description

template<typename T>
class Pds::Trg::Factory< T >

Loads a shared library and creates one object of type T with a C function exported by it; the object is deleted when the factory is destroyed or reused.

Constructor & Destructor Documentation

◆ Factory()

template<typename T >
Pds::Trg::Factory< T >::Factory ( )
inline

Construct with no object.

◆ ~Factory()

template<typename T >
Pds::Trg::Factory< T >::~Factory ( )
inline

Delete the object if one was created.

Member Function Documentation

◆ create()

template<typename T >
T * Pds::Trg::Factory< T >::create ( const std::string &  soname,
const std::string &  symbol 
)

Delete any previous object, close any open library, open soname and call its function symbol to create a new object.

Returns the object, or nullptr if the library, the symbol or the creation fails.


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