ONE - On-device Neural Engine
Loading...
Searching...
No Matches
nnkit::BackendPlugin Class Reference

#include <BackendPlugin.h>

Public Types

typedef std::unique_ptr< Backend >(* Entry) (const CmdlineArguments &)
 

Public Member Functions

 BackendPlugin (void *handle, Entry entry)
 
 BackendPlugin (const BackendPlugin &)=delete
 
 BackendPlugin (BackendPlugin &&)
 
 ~BackendPlugin ()
 
std::unique_ptr< Backendcreate (const CmdlineArguments &args) const
 

Detailed Description

Definition at line 29 of file BackendPlugin.h.

Member Typedef Documentation

◆ Entry

typedef std::unique_ptr< Backend >(* nnkit::BackendPlugin::Entry) (const CmdlineArguments &)

Definition at line 32 of file BackendPlugin.h.

Constructor & Destructor Documentation

◆ BackendPlugin() [1/3]

nnkit::BackendPlugin::BackendPlugin ( void *  handle,
Entry  entry 
)
inline

Definition at line 35 of file BackendPlugin.h.

35 : _handle{handle}, _entry{entry}
36 {
37 // DO NOTHING
38 }
int entry(const int argc, char **argv)
Definition Driver.cpp:53

◆ BackendPlugin() [2/3]

nnkit::BackendPlugin::BackendPlugin ( const BackendPlugin )
delete

◆ BackendPlugin() [3/3]

nnkit::BackendPlugin::BackendPlugin ( BackendPlugin &&  plugin)

Definition at line 29 of file BackendPlugin.cpp.

30{
31 // Handle is transferd from 'binder' instance into this instance.
32 _handle = plugin._handle;
33 _entry = plugin._entry;
34
35 plugin._handle = nullptr;
36 plugin._entry = nullptr;
37}

◆ ~BackendPlugin()

nnkit::BackendPlugin::~BackendPlugin ( )

Definition at line 39 of file BackendPlugin.cpp.

40{
41 if (_handle != nullptr)
42 {
43 dlclose(_handle);
44 }
45}

Member Function Documentation

◆ create()

std::unique_ptr< Backend > nnkit::BackendPlugin::create ( const CmdlineArguments args) const

Definition at line 47 of file BackendPlugin.cpp.

48{
49 return _entry(args);
50}

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