CppELib 1.7.0
Loading...
Searching...
No Matches
TestDoubleMutexFactory.h
Go to the documentation of this file.
1#ifndef TEST_DOUBLE_OS_WRAPPER_TEST_DOUBLE_MUTEX_FACTORY_H_INCLUDED
2#define TEST_DOUBLE_OS_WRAPPER_TEST_DOUBLE_MUTEX_FACTORY_H_INCLUDED
3
4#include "OSWrapper/Mutex.h"
6
7namespace TestDoubleOSWrapper {
8
10protected:
12
13public:
18
19 void setCreateArgs(int priorityCeiling)
20 {
21 m_priorityCeiling = priorityCeiling;
22 }
23
25 {
26 }
27
29 {
30 return OSWrapper::OK;
31 }
32
34 {
35 return OSWrapper::OK;
36 }
37
39 {
40 (void) tmout;
41 return OSWrapper::OK;
42 }
43
45 {
46 return OSWrapper::OK;
47 }
48};
49
50template <typename T = TestDoubleMutex>
52public:
55
57 {
58 return create(0);
59 }
60
61 virtual OSWrapper::Mutex* create(int priorityCeiling)
62 {
63 T* obj = new T();
64 obj->setCreateArgs(priorityCeiling);
65 return obj;
66 }
67
68 virtual void destroy(OSWrapper::Mutex* m)
69 {
70 delete static_cast<T*>(m);
71 }
72
73private:
76};
77
78}
79
80#endif // TEST_DOUBLE_OS_WRAPPER_TEST_DOUBLE_MUTEX_FACTORY_H_INCLUDED
Definition MutexFactory.h:8
Abstract class that has functions of common RTOS's mutex.
Definition Mutex.h:22
Value object for the timeout.
Definition Timeout.h:11
Definition TestDoubleMutexFactory.h:51
TestDoubleMutexFactory()
Definition TestDoubleMutexFactory.h:53
virtual OSWrapper::Mutex * create(int priorityCeiling)
Definition TestDoubleMutexFactory.h:61
virtual OSWrapper::Mutex * create()
Definition TestDoubleMutexFactory.h:56
virtual void destroy(OSWrapper::Mutex *m)
Definition TestDoubleMutexFactory.h:68
virtual ~TestDoubleMutexFactory()
Definition TestDoubleMutexFactory.h:54
Definition TestDoubleMutexFactory.h:9
virtual OSWrapper::Error tryLock()
Try to lock this mutex without blocking.
Definition TestDoubleMutexFactory.h:33
int m_priorityCeiling
Definition TestDoubleMutexFactory.h:11
virtual OSWrapper::Error unlock()
Unlock this mutex that the current thread locks.
Definition TestDoubleMutexFactory.h:44
virtual ~TestDoubleMutex()
Definition TestDoubleMutexFactory.h:24
virtual OSWrapper::Error timedLock(OSWrapper::Timeout tmout)
Block the current thread until locks this mutex but only within the limited time.
Definition TestDoubleMutexFactory.h:38
TestDoubleMutex()
Definition TestDoubleMutexFactory.h:14
void setCreateArgs(int priorityCeiling)
Definition TestDoubleMutexFactory.h:19
virtual OSWrapper::Error lock()
Block the current thread until locks this mutex.
Definition TestDoubleMutexFactory.h:28
Error
Kinds of errors of the OS objects.
Definition OSWrapperError.h:9
@ OK
Definition OSWrapperError.h:10
Implementation of OSWrapper for Test Double.
Definition TestDoubleEventFlagFactory.h:7