SensESP 3.0.1
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
sensesp::SensESPBaseApp Class Reference

The base class for SensESP applications. More...

#include <sensesp_base_app.h>

Inheritance diagram for sensesp::SensESPBaseApp:
[legend]

Public Member Functions

virtual bool destroy ()
 Destroy the SensESPBaseApp instance.
 
virtual void start ()
 Start the app (activate all the subcomponents)
 
virtual void reset ()
 Reset the device to factory defaults.
 
std::shared_ptr< ObservableValue< String > > get_hostname_observable ()
 Get the hostname observable object.
 

Static Public Member Functions

static const std::shared_ptr< SensESPBaseApp > & get ()
 Get the singleton instance of the SensESPBaseApp.
 
static String get_hostname ()
 Get the current hostname.
 
static std::shared_ptr< reactesp::EventLoop > get_event_loop ()
 Get the event loop object from the singleton SensESPBaseApp instance.
 

Protected Member Functions

 SensESPBaseApp ()
 Construct a new SensESP Base App object.
 
 ~SensESPBaseApp ()
 
void init_hostname ()
 
virtual void setup ()
 Perform initialization of SensESPBaseApp once builder configuration is done.
 
void set_instance (const std::shared_ptr< SensESPBaseApp > &instance)
 
const SensESPBaseAppset_hostname (String hostname)
 

Protected Attributes

std::shared_ptr< reactesp::EventLoop > event_loop_
 
std::shared_ptr< PersistingObservableValue< String > > hostname_
 
std::shared_ptr< Filesystemfilesystem_
 

Static Protected Attributes

static std::shared_ptr< SensESPBaseAppinstance_ = nullptr
 

Detailed Description

The base class for SensESP applications.

SensESPBaseApp is the base class for all apps. It can be either expanded in child classes to provide additional functionality, or used as is to provide a bare-bones application.

See also
SensESPApp

Definition at line 42 of file sensesp_base_app.h.

Constructor & Destructor Documentation

◆ SensESPBaseApp()

sensesp::SensESPBaseApp::SensESPBaseApp ( )
inlineprotected

Construct a new SensESP Base App object.

This constructor must only be used in SensESPBaseAppBuilder, and must be called only once. For compatibility reasons, the class hasn't been refactored into a singleton.

Definition at line 125 of file sensesp_base_app.h.

◆ ~SensESPBaseApp()

sensesp::SensESPBaseApp::~SensESPBaseApp ( )
inlineprotected

Definition at line 131 of file sensesp_base_app.h.

Member Function Documentation

◆ destroy()

virtual bool sensesp::SensESPBaseApp::destroy ( )
inlinevirtual

Destroy the SensESPBaseApp instance.

Reimplemented in sensesp::SensESPApp.

Definition at line 55 of file sensesp_base_app.h.

◆ get()

static const std::shared_ptr< SensESPBaseApp > & sensesp::SensESPBaseApp::get ( )
inlinestatic

Get the singleton instance of the SensESPBaseApp.

Definition at line 50 of file sensesp_base_app.h.

Here is the caller graph for this function:

◆ get_event_loop()

static std::shared_ptr< reactesp::EventLoop > sensesp::SensESPBaseApp::get_event_loop ( )
inlinestatic

Get the event loop object from the singleton SensESPBaseApp instance.

Definition at line 113 of file sensesp_base_app.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_hostname()

static String sensesp::SensESPBaseApp::get_hostname ( )
inlinestatic

Get the current hostname.

Returns
String

Definition at line 104 of file sensesp_base_app.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_hostname_observable()

std::shared_ptr< ObservableValue< String > > sensesp::SensESPBaseApp::get_hostname_observable ( )
inline

Get the hostname observable object.

Returns
ObservableValue<String>*

Definition at line 95 of file sensesp_base_app.h.

◆ init_hostname()

void sensesp::SensESPBaseApp::init_hostname ( )
inlineprotected

Definition at line 133 of file sensesp_base_app.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

virtual void sensesp::SensESPBaseApp::reset ( )
inlinevirtual

Reset the device to factory defaults.

Definition at line 79 of file sensesp_base_app.h.

Here is the call graph for this function:

◆ set_hostname()

const SensESPBaseApp * sensesp::SensESPBaseApp::set_hostname ( String hostname)
inlineprotected

Definition at line 162 of file sensesp_base_app.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_instance()

void sensesp::SensESPBaseApp::set_instance ( const std::shared_ptr< SensESPBaseApp > & instance)
inlineprotected

Definition at line 154 of file sensesp_base_app.h.

◆ setup()

virtual void sensesp::SensESPBaseApp::setup ( )
inlineprotectedvirtual

Perform initialization of SensESPBaseApp once builder configuration is done.

This should be only called from the builder!

Reimplemented in sensesp::SensESPApp.

Definition at line 146 of file sensesp_base_app.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ start()

virtual void sensesp::SensESPBaseApp::start ( )
inlinevirtual

Start the app (activate all the subcomponents)

Definition at line 71 of file sensesp_base_app.h.

Member Data Documentation

◆ event_loop_

std::shared_ptr<reactesp::EventLoop> sensesp::SensESPBaseApp::event_loop_
protected

Definition at line 44 of file sensesp_base_app.h.

◆ filesystem_

std::shared_ptr<Filesystem> sensesp::SensESPBaseApp::filesystem_
protected

Definition at line 160 of file sensesp_base_app.h.

◆ hostname_

std::shared_ptr<PersistingObservableValue<String> > sensesp::SensESPBaseApp::hostname_
protected

Definition at line 158 of file sensesp_base_app.h.

◆ instance_

std::shared_ptr< SensESPBaseApp > sensesp::SensESPBaseApp::instance_ = nullptr
staticprotected

Definition at line 152 of file sensesp_base_app.h.


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