sttcl  v0.9c
STTCL C++ template state machine framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Configuring the STTCL library for a specific OS/build environment

4 Configuring the STTCL library for a specific OS/build environment

4.1 Configuring STTCL builtin concurrency implementations
4.2 Providing custom implementations for concurrency

STTCL uses wrapper classes (adapters) for the environment specific implementations of the above mentioned capabilities:

4.1 Configuring STTCL builtin concurrency implementations

To use the builtin implementations you need to build the STTCL source files using one of the following defines (add -D<config> to your compiler flags):

  • STTCL_BOOST_IMPL to select the boost implementation as default
  • STTCL_POSIX_IMPL to select the POSIX implementation as default
  • STTCL_CX11_IMPL to select the C++ 11 standard implementation as default

4.2 Providing custom implementations for concurrency

You may implement your own abstractions for threads, mutexes, semaphores and time duration representation. Provide the following defines to set your custom implementation as defaults (these must be seen by the STTCL header files):

#define STTCL_DEFAULT_THREADIMPL MyThreadImpl
#define STTCL_DEFAULT_MUTEXDIMPL MyMutexImpl
#define STTCL_DEFAULT_SEMAPHOREIMPL MySemaphoreImpl
#define STTCL_DEFAULT_TIMEDURATIONIMPL MyTimeDurationImpl

Alternatively you can provide your implementations directly as template parameters of the STTCL template base classes.