Scopira 20080306

The main loop

Introduction

Scopira uses the concept of stackable singleton objects "loops" to manage the core global variables needed various subsystem layers. Loop objects are either implicitly created, created by being a base class of another loop and directly instantied by you in your main() function.

You don't always need a loop object, however.

The scopira::core::basic_loop is the core loop in almost all loops. It can also be used directly but may also be a base class by variou other groups.

Features

scopira::core::basic_loop provides the following key features:

  • Command line and configuration file parsing and processing (get_config(), etc)
  • Dynamic library loading (plug-ins) via lib= parameters.

basic_loop is a singleton. It's instance can always be accessed via scopira::core::basic_loop::instance().

Example

A basic, non-gui Scopira program would be as follows:

  #include <scopira/core/loop.h>

  int main(int argc, char **argv)
  {
    scopira::core::basic_loop l(argc, argv);

    return 0;
  }