Synesis Software STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ...

Front-end Callbacks

The Pantheios stock front-ends are intentionally simple, and their incorporation into a process/dynamic-library is resolved at link-time.

Consequently, the modification of front-end characteristics at runtime is not directly supported, and it is the intention that use of sophisticated front-ends whose behaviour is runtime modifiable is left to front-end extensions. The stock front-ends provide simple severity level arbitration only.

Notwithstanding, certain stock front-ends have a potential spectrum of behaviour that means some limited runtime decision-making would be of use in a significant number of scenarios. It has proven possible to facilitate this without breaking the fundamental architecture of Pantheios, whose significant benefits (in particular the one-time, main-thread initialisation of front and front-ends), it would be unwise to disturb. Hence, these stock front-ends provide "callback" functionality.

In every case of a callback front-end, rather than defining the global character array PANTHEIOS_FE_PROCESS_IDENTITY, the callback function pantheios_fe_getAppProcessIdentity() must be defined, as shown in the following example:

  PANTHEIOS_CALL(PAN_CHAR_T const*) pantheios_fe_getAppProcessIdentity(void) /* throw() */
  {
    return "my-program-identity";
  }

Naturally, it is expected that users will have specific reasons for defining the process identity dynamically: specifically, they require to generate it dynamically, which must be done in pantheios_fe_init().

pantheios Library documentation © Matthew Wilson & Synesis Software, 2006-2011 SourceForge.net Logo