CppELib 1.7.0
|
OSWrapper provides abstract C++ interface of common RTOS: thread, mutex, event flag, message queue, memory pool, etc. More...
Classes | |
class | EventFlag |
Abstract class that has functions of common RTOS's event flag. More... | |
class | EventFlagFactory |
class | FixedMemoryPool |
Abstract class that has functions of common RTOS's fixed-size memory pool. More... | |
class | FixedMemoryPoolFactory |
class | LockGuard |
RAII wrapper of Mutex. More... | |
class | MessageQueue |
Class template of message queue. More... | |
class | Mutex |
Abstract class that has functions of common RTOS's mutex. More... | |
class | MutexFactory |
class | OneShotTimer |
Abstract class that has functions of common RTOS's one-shot timer. More... | |
class | OneShotTimerFactory |
class | PeriodicTimer |
Abstract class that has functions of common RTOS's periodic timer. More... | |
class | PeriodicTimerFactory |
class | Runnable |
Interface for implementing an active class. More... | |
class | Thread |
Abstract class that has functions of common RTOS's thread. More... | |
class | ThreadFactory |
class | ThreadPool |
Class of thread pool pattern. More... | |
class | Timeout |
Value object for the timeout. More... | |
class | VariableMemoryPool |
Abstract class that has functions of common RTOS's variable-size memory pool. More... | |
class | VariableMemoryPoolFactory |
Enumerations | |
enum | Error { OK , TimedOut , CalledByNonThread , InvalidParameter , NotLocked , OtherError } |
Kinds of errors of the OS objects. More... | |
Functions | |
void | registerEventFlagFactory (EventFlagFactory *factory) |
Register the EventFlagFactory. | |
void | registerFixedMemoryPoolFactory (FixedMemoryPoolFactory *factory) |
Register the FixedMemoryPoolFactory. | |
void | registerMutexFactory (MutexFactory *factory) |
Register the MutexFactory. | |
void | registerOneShotTimerFactory (OneShotTimerFactory *factory) |
Register the OneShotTimerFactory. | |
void | registerPeriodicTimerFactory (PeriodicTimerFactory *factory) |
Register the PeriodicTimerFactory. | |
void | registerThreadFactory (ThreadFactory *factory) |
Register the ThreadFactory. | |
void | registerVariableMemoryPoolFactory (VariableMemoryPoolFactory *factory) |
Register the VariableMemoryPoolFactory. | |
OSWrapper provides abstract C++ interface of common RTOS: thread, mutex, event flag, message queue, memory pool, etc.
This class diagram shows the mechanism that isolates the client code from the code depended on the real RTOS.
Factories of OSWrapper are the mechanism to call static methods (create(), destroy(), etc) as virtual methods. Concrete factories are created as static objects and registered when the application is initialized.
All the OS objects (Thread, Mutex, EventFlag, etc) are generated by create() static method and released by destroy() static method. The OS objects can be accessed with the pointer returned by create(). They can not be generated as stack objects by constructor.
You can implement concrete classes for your OS platform like classes of ItronOSWrapper.
enum OSWrapper::Error |
void OSWrapper::registerEventFlagFactory | ( | EventFlagFactory * | factory | ) |
Register the EventFlagFactory.
factory | Pointer of the object of the concrete class derived from EventFlagFactory |
void OSWrapper::registerFixedMemoryPoolFactory | ( | FixedMemoryPoolFactory * | factory | ) |
Register the FixedMemoryPoolFactory.
factory | Pointer of the object of the concrete class derived from FixedMemoryPoolFactory |
void OSWrapper::registerMutexFactory | ( | MutexFactory * | factory | ) |
Register the MutexFactory.
factory | Pointer of the object of the concrete class derived from MutexFactory |
void OSWrapper::registerOneShotTimerFactory | ( | OneShotTimerFactory * | factory | ) |
Register the OneShotTimerFactory.
factory | Pointer of the object of the concrete class derived from OneShotTimerFactory |
void OSWrapper::registerPeriodicTimerFactory | ( | PeriodicTimerFactory * | factory | ) |
Register the PeriodicTimerFactory.
factory | Pointer of the object of the concrete class derived from PeriodicTimerFactory |
void OSWrapper::registerThreadFactory | ( | ThreadFactory * | factory | ) |
Register the ThreadFactory.
factory | Pointer of the object of the concrete class derived from ThreadFactory |
void OSWrapper::registerVariableMemoryPoolFactory | ( | VariableMemoryPoolFactory * | factory | ) |
Register the VariableMemoryPoolFactory.
factory | Pointer of the object of the concrete class derived from VariableMemoryPoolFactory |