To make the server program easier to build and program, the program will be split into almost independent modules. All of these modules will be built at the same time and statically linked into the resulting executable program file.
Some of these modules will be in separated directories (e.g. the network module), and will be built as static libraries. Other modules will already be in the main source directory, and will only be using a separate namespace. Also, some modules, specially those in sub-directories (again, e.g. the network module), will have their own sub-modules.
All modules have only three common API functions: An
init function, a
boot function, and a
init()is called on initialization of the server program.
boot()is called after all initialization is done.
clean()is called at shutdown for cleanup.
All other functions and classes in the modules is specific to that module.
Some modules, most notably the configuration module, will have a custom standard function (the configuration modules
init() needs the command line argument parameters.)
Here is a list of all modules, in the order they are initialized:
- Configuration (namespace raven::config)
- Logging (namespace raven::log)
- Host (namespace raven::host)
- Network (namespace raven::net, directory net)
- Database (namespace raven::db, directory db)
Design of the configuration module here.
Design of the network module here.
Design of the database module is not done yet. This module will also include sub-modules to parse and execute the library code.
The calling of the
boot function will be the same as the initialization order. The calling of the
clean function will be in reversed order.