The iopccommon library contains support classes and utilities that are used by other parts of the library. The classes can be divided into three groups:
The thread synchronization classes were taken from the POLiTe 2 library. Synchronization primitives encapsulated by these classes are:
Mutex (non-recursive) - the
Mutex
class.Mutex (recursive) - the
Lock
class.Conditional variable - the
CondVar
class.Read-write lock - the
RWLock
class.Read-write-exclusive lock - the
RWXLock
class.
Although the class metadata container is implemented as a generic structure in the iopccommon library, it is primarily designed to be used with the reflection features. Therefore we will provide its description later, in the the section called “Class metadata”.
Utilities offered by the iopccommon library include reference counted pointer, various string manipulation methods, tracing and logging. Logging is encapsulated by the LogWriter
singleton class.
Log messages have a severity level attached which helps to determine how critical the message is. Message filtering based on the level is also possible. Tracing macros defined in the same file as the LogWriter
class are used through the IOPC 2 library allowing developers to dump detailed debugging information in case of application crash or malfunction. These macros can be enabled or disabled by setting appropriate filter in the LogWriter
class or by (un)commenting macro options IOPC_DEBUG, IOPC_TRACE in the same file and by recompiling the whole IOPC 2 library. This way a diagnostic version of the library can be created.