For this reason, a restricted set of classes are written mainly using inline method to provide access to the low level api. The "wefts_os.h" file tests the environment to select a proper header file including OSThread, OSCondition, OSMutex and OSSpecificData, and sets proper defines to link the correct .cpp module that is sometimes required with os specific implementation. In example, the OS wrapper classes for pthreads are in wefts_os_pthread.cpp and wefts_os_pthread.h.
Wrappers are required to include the wefts_os_base.h, that contains the named classes with the suffix "Base" (i.e. OSThreadBase), that are abstract base classes that defines both a template and a standard for OS Layer implementation.
OS Implementations should follow a certain naming convention: they should define the classes using a meaningful suffix (i.e. for pthread OS Layer, OSThreadPthread). At the end of the header file, the classes should then be aliased using typedefs. In example, these are the last lines of wefts_os_pthread.h:
typedef OSSPecificDataPthread OSSpecificData; typedef OSThreadPthread OSThread; typedef OSConditionPthread OSCondition; typedef OSMutexPthread OSMutex;
This will allow to have specific documentation for each implementation, and also to address directly a specific implementation routine, if necessary.