undoStudio
The IDE of the undoRT ecosystem
Loading...
Searching...
No Matches
undoStudio::core::Application Class Reference

Main application class for undoStudio. More...

#include <Application.hpp>

Collaboration diagram for undoStudio::core::Application:
Collaboration graph

Public Member Functions

bool initialize (int argc, char **argv)
 Initialize the application with command line arguments.
 
void shutdown ()
 Shutdown the application and release all resources.
 
bool isRunning () const
 Check if the application is currently running.
 
int run ()
 Run the main application loop.
 
void requestQuit ()
 Request the application to quit gracefully.
 
template<typename T >
void registerService (T *service)
 Register a service with the application.
 
template<typename T >
T * getService ()
 Get a registered service by type.
 

Static Public Member Functions

static Application & getInstance ()
 Get the singleton instance of the Application.
 

Private Member Functions

 Application ()=default
 
 ~Application ()=default
 
 Application (const Application &)=delete
 
Application & operator= (const Application &)=delete
 

Private Attributes

bool m_isRunning = false
 
bool m_quitRequested = false
 
std::unordered_map< std::type_index, void * > m_services
 

Detailed Description

Main application class for undoStudio.

The Application class is the central entry point for the undoStudio IDE. It manages initialization, the main event loop, and shutdown procedures. It also provides a service locator pattern for accessing various services.

Constructor & Destructor Documentation

◆ Application() [1/2]

undoStudio::core::Application::Application ( )
privatedefault

◆ ~Application()

undoStudio::core::Application::~Application ( )
privatedefault

◆ Application() [2/2]

undoStudio::core::Application::Application ( const Application &  )
privatedelete

Member Function Documentation

◆ getInstance()

Application & undoStudio::core::Application::getInstance ( )
static

Get the singleton instance of the Application.

Returns
Reference to the single Application instance

◆ getService()

template<typename T >
T * undoStudio::core::Application::getService ( )
inline

Get a registered service by type.

Template Parameters
TService type
Returns
Pointer to the service instance, or nullptr if not found

◆ initialize()

bool undoStudio::core::Application::initialize ( int  argc,
char **  argv 
)

Initialize the application with command line arguments.

Parameters
argcNumber of command line arguments
argvArray of command line argument strings
Returns
true if initialization succeeded, false otherwise

◆ isRunning()

bool undoStudio::core::Application::isRunning ( ) const

Check if the application is currently running.

Returns
true if the application is running, false otherwise

◆ operator=()

Application & undoStudio::core::Application::operator= ( const Application &  )
privatedelete

◆ registerService()

template<typename T >
void undoStudio::core::Application::registerService ( T *  service)
inline

Register a service with the application.

Template Parameters
TService type
Parameters
serviceInstance of the service

◆ requestQuit()

void undoStudio::core::Application::requestQuit ( )

Request the application to quit gracefully.

This method signals the main loop to exit after completing the current iteration.

◆ run()

int undoStudio::core::Application::run ( )

Run the main application loop.

Returns
Exit code (0 for success, non-zero for errors)

◆ shutdown()

void undoStudio::core::Application::shutdown ( )

Shutdown the application and release all resources.

This method properly cleans up all services and releases any allocated resources before application termination.

Member Data Documentation

◆ m_isRunning

bool undoStudio::core::Application::m_isRunning = false
private

◆ m_quitRequested

bool undoStudio::core::Application::m_quitRequested = false
private

◆ m_services

std::unordered_map<std::type_index, void*> undoStudio::core::Application::m_services
private

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