REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
Loading...
Searching...
No Matches
loader::SinglePluginLoader Struct Reference

The SinglePluginLoader can only load a single plugin at a given time. More...

#include <plugin.h>

Inheritance diagram for loader::SinglePluginLoader:
Collaboration diagram for loader::SinglePluginLoader:

Public Member Functions

bool can_load () const
 
int load (const Plugin &new_plugin)
 returns 0 on success
 
void unload ()
 frees memory, does not call unloader.
 
virtual int load_and_execute (JsonObjectConst msg_in, JsonObject &msg_out)
 load from protocol message, gives out reply msg, returns 0 on success
 
virtual int unload (JsonObjectConst msg_in, JsonObject &msg_out)
 unload from protocol message, gives out reply msg, returns 0 on success
 

Public Attributes

optional< Pluginplugin
 The slot for a single managed plugin (if loaded). It's load_addr defines the memory address.
 
uint8_t * load_addr =0
 Absolute address of the memory segment. It is always (plugin->load_addr = load_addr).
 
uint32_t memsize =0
 The maximum memory size managed/accessible/available by this loader. It is always (plugin->size <= memsize).
 

Detailed Description

The SinglePluginLoader can only load a single plugin at a given time.

He is typically limited by his memory size and layout, i.e. he does not use some memory mangament data structure (a heap, stack, tree, etc). Currently there is only one implementation, anyway.

Definition at line 63 of file plugin.h.

Member Function Documentation

◆ can_load()

bool loader::SinglePluginLoader::can_load ( ) const
inline

Definition at line 68 of file plugin.h.

References load_addr, and plugin.

◆ load()

FLASHMEM int loader::SinglePluginLoader::load ( const Plugin & new_plugin)

returns 0 on success

Definition at line 224 of file plugin.cpp.

References loader::Plugin::size.

◆ unload()

void loader::SinglePluginLoader::unload ( )
inline

frees memory, does not call unloader.

Definition at line 72 of file plugin.h.

References plugin.

Member Data Documentation

◆ load_addr

uint8_t* loader::SinglePluginLoader::load_addr =0

Absolute address of the memory segment. It is always (plugin->load_addr = load_addr).

Definition at line 65 of file plugin.h.

Referenced by can_load(), and loader::GlobalPluginLoader::GlobalPluginLoader().

◆ memsize

uint32_t loader::SinglePluginLoader::memsize =0

The maximum memory size managed/accessible/available by this loader. It is always (plugin->size <= memsize).

Definition at line 66 of file plugin.h.

Referenced by loader::GlobalPluginLoader::GlobalPluginLoader().

◆ plugin

optional<Plugin> loader::SinglePluginLoader::plugin

The slot for a single managed plugin (if loaded). It's load_addr defines the memory address.

Definition at line 64 of file plugin.h.

Referenced by can_load(), and unload().


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