Base module

Application

Main icey application class.

Application

#include <icy/application.h>

Main icey application class.

This class exposes basic features required by most applications:

  • Running the event loop

  • Command line option parsing See also: OptionParser

  • Shutdown signal (Ctrl-C) handling

  • Garbage collection

Public Attributes

ReturnNameDescription
uv::Loop *loopActive event loop.

loop

uv::Loop * loop

Active event loop.

The event loop may be assigned on construction, otherwise the default event loop will be used.

Public Methods

ReturnNameDescription
ApplicationConstructor.
~ApplicationDestructor.
voidrunRun the application event loop.
voidstopStop the application event loop.
voidfinalizeFinalize and free any remaining pointers still held by the application event loop.
voidwaitForShutdownBind the shutdown signal and run the main event loop.
voidbindShutdownSignalBind the shutdown signal.

Application

Application(uv::Loop * loop)

Constructor.


~Application

~Application()

Destructor.


run

void run()

Run the application event loop.


stop

void stop()

Stop the application event loop.


finalize

void finalize()

Finalize and free any remaining pointers still held by the application event loop.


waitForShutdown

void waitForShutdown(std::function< void(void *)> callback, void * opaque)

Bind the shutdown signal and run the main event loop.


bindShutdownSignal

void bindShutdownSignal(std::function< void(void *)> callback, void * opaque)

Bind the shutdown signal.

Public Static Methods

ReturnNameDescription
Application &getDefault staticReturns the default Application singleton, although Application instances may be initialized individually.

getDefault

static

static Application & getDefault()

Returns the default Application singleton, although Application instances may be initialized individually.

Protected Methods

ReturnNameDescription
ApplicationDeleted constructor.
ApplicationDeleted constructor.

Application

Application(const Application &) = delete

Deleted constructor.


Application

Application(Application &&) = delete

Deleted constructor.