Async 1.5.0
Classes | Public Member Functions | Public Attributes | List of all members
Async::CppApplication Class Reference

An application class for writing non GUI applications. More...

#include <AsyncCppApplication.h>

Inheritance diagram for Async::CppApplication:
Async::Application

Public Member Functions

 CppApplication (void)
 Constructor.
 
 ~CppApplication (void)
 Destructor.
 
void catchUnixSignal (int signum)
 Catch the specified UNIX signal.
 
void uncatchUnixSignal (int signum)
 Uncatch the specified UNIX signal.
 
void exec (void)
 Execute the application main loop.
 
void quit (void)
 Exit the application main loop.
 
- Public Member Functions inherited from Async::Application
 Application (void)
 Default constructor.
 
virtual ~Application (void)
 Destructor.
 
virtual void exec (void)=0
 Execute the application main loop.
 
virtual void quit (void)=0
 Exit the application main loop.
 
void runTask (sigc::slot< void > task)
 Run a task from the Async main loop.
 

Public Attributes

sigc::signal< void, int > unixSignalCaught
 A signal that is emitted when a monitored UNIX signal is caught.
 

Additional Inherited Members

- Static Public Member Functions inherited from Async::Application
static Applicationapp (void)
 Get the one and only application instance.
 
- Protected Member Functions inherited from Async::Application
void clearTasks (void)
 

Detailed Description

An application class for writing non GUI applications.

Examples
AsyncAtTimer_demo.cpp, AsyncAudioIO_demo.cpp, AsyncDnsLookup_demo.cpp, AsyncExec_demo.cpp, AsyncFdWatch_demo.cpp, AsyncFramedTcpClient_demo.cpp, AsyncFramedTcpServer_demo.cpp, AsyncPtyStreamBuf_demo.cpp, AsyncSerial_demo.cpp, AsyncTcpClient_demo.cpp, AsyncTcpServer_demo.cpp, AsyncTimer_demo.cpp, and AsyncUdpSocket_demo.cpp.

Definition at line 136 of file AsyncCppApplication.h.

Constructor & Destructor Documentation

◆ CppApplication()

Async::CppApplication::CppApplication ( void  )

Constructor.

◆ ~CppApplication()

Async::CppApplication::~CppApplication ( void  )

Destructor.

Member Function Documentation

◆ catchUnixSignal()

void Async::CppApplication::catchUnixSignal ( int  signum)

Catch the specified UNIX signal.

Parameters
signumThe signal number to catch

◆ exec()

void Async::CppApplication::exec ( void  )
virtual

Execute the application main loop.

When this member function is called the application core will enter the main loop. It will not exit from this loop until the Async::Application::quit method is called.

Implements Async::Application.

Examples
AsyncAtTimer_demo.cpp, AsyncAudioIO_demo.cpp, AsyncDnsLookup_demo.cpp, AsyncExec_demo.cpp, AsyncFdWatch_demo.cpp, AsyncFramedTcpClient_demo.cpp, AsyncFramedTcpServer_demo.cpp, AsyncPtyStreamBuf_demo.cpp, AsyncSerial_demo.cpp, AsyncTcpClient_demo.cpp, AsyncTcpServer_demo.cpp, AsyncTimer_demo.cpp, and AsyncUdpSocket_demo.cpp.

◆ quit()

void Async::CppApplication::quit ( void  )
virtual

Exit the application main loop.

This function should be called to exit the application core main loop.

Implements Async::Application.

◆ uncatchUnixSignal()

void Async::CppApplication::uncatchUnixSignal ( int  signum)

Uncatch the specified UNIX signal.

Parameters
signumThe UNIX signal to uncatch

Member Data Documentation

◆ unixSignalCaught

sigc::signal<void, int> Async::CppApplication::unixSignalCaught

A signal that is emitted when a monitored UNIX signal is caught.

Parameters
signumThe signal number that was caught

Use the catchUnixSignal and uncatchUnixSignal functions to add signals to be monitored for activity. When the signal is triggered, this sigc signal will be emitted.

Definition at line 185 of file AsyncCppApplication.h.


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