Deki 1.3.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches
IDekiPackage Class Referenceabstract

Abstract interface for hardware peripheral packages. More...

#include <IDekiPackage.h>

Public Member Functions

virtual ~IDekiPackage ()=default
virtual const char * GetPackageId () const =0
 Get the unique package identifier.
virtual const char * GetPackageName () const =0
 Get the human-readable package name.
virtual const char * GetPackageCategory () const =0
 Get the package category for UI grouping.
virtual void Configure (const PackageConfig &config)=0
 Configure the package with pin mappings and settings.
virtual bool Initialize ()=0
 Initialize the package hardware.
virtual void Shutdown ()=0
 Shutdown the package and release resources.
virtual void Update (float deltaTime)=0
 Update the package (called each frame).
virtual PackageState GetState () const =0
 Get the current package state.
virtual const char * GetLastError () const =0
 Get the last error message.

Detailed Description

Abstract interface for hardware peripheral packages.

This interface defines the contract that hardware packages (SD card, GPS, WiFi, etc.) must implement to work with the Deki engine. Packages are discovered via plugin exports and configured through the editor's platform configuration.

Lifecycle:

  1. Package created via factory
  2. Configure() called with pin/setting configuration
  3. Initialize() called to set up hardware
  4. Update() called each frame (for polling packages)
  5. Shutdown() called on engine shutdown

Constructor & Destructor Documentation

◆ ~IDekiPackage()

virtual IDekiPackage::~IDekiPackage ( )
virtualdefault

Member Function Documentation

◆ GetPackageId()

virtual const char * IDekiPackage::GetPackageId ( ) const
pure virtual

Get the unique package identifier.

Returns
Package ID string (e.g., "sd_card", "gps", "wifi")

◆ GetPackageName()

virtual const char * IDekiPackage::GetPackageName ( ) const
pure virtual

Get the human-readable package name.

Returns
Display name (e.g., "SD Card", "GPS Package")

◆ GetPackageCategory()

virtual const char * IDekiPackage::GetPackageCategory ( ) const
pure virtual

Get the package category for UI grouping.

Returns
Category string (e.g., "storage", "sensors", "communication")

◆ Configure()

virtual void IDekiPackage::Configure ( const PackageConfig & config)
pure virtual

Configure the package with pin mappings and settings.

Called before Initialize() to provide configuration from the platform. The package should store these settings for use during initialization.

Parameters
configConfiguration containing pins and settings

◆ Initialize()

virtual bool IDekiPackage::Initialize ( )
pure virtual

Initialize the package hardware.

Called after Configure(). Should set up hardware, allocate resources, and prepare the package for operation.

Returns
true if initialization successful, false otherwise

◆ Shutdown()

virtual void IDekiPackage::Shutdown ( )
pure virtual

Shutdown the package and release resources.

Called during engine shutdown or when package is disabled. Should safely release all hardware resources.

◆ Update()

virtual void IDekiPackage::Update ( float deltaTime)
pure virtual

Update the package (called each frame).

For polling-based packages (e.g., GPS), this is called each frame to read data and update state. For event-based packages, this may be a no-op.

Parameters
deltaTimeTime elapsed since last frame in seconds

◆ GetState()

virtual PackageState IDekiPackage::GetState ( ) const
pure virtual

Get the current package state.

Returns
Current lifecycle state

◆ GetLastError()

virtual const char * IDekiPackage::GetLastError ( ) const
pure virtual

Get the last error message.

Returns
Error string, or empty string if no error

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