CppELib 1.7.0
Loading...
Searching...
No Matches
TestDoubleEventFlagFactory.h
Go to the documentation of this file.
1#ifndef TEST_DOUBLE_OS_WRAPPER_TEST_DOUBLE_EVENT_FLAG_FACTORY_H_INCLUDED
2#define TEST_DOUBLE_OS_WRAPPER_TEST_DOUBLE_EVENT_FLAG_FACTORY_H_INCLUDED
3
6
8
10protected:
12
13public:
15 : m_autoReset()
16 {
17 }
18
19 void setCreateArgs(bool autoReset)
20 {
21 m_autoReset = autoReset;
22 }
23
25 {
26 }
27
29 {
30 return OSWrapper::OK;
31 }
32
33 virtual OSWrapper::Error waitOne(std::size_t pos)
34 {
35 (void) pos;
36 return OSWrapper::OK;
37 }
38
40 {
41 (void) bitPattern;
42 (void) waitMode;
43 (void) releasedPattern;
44 return OSWrapper::OK;
45 }
46
48 {
49 return OSWrapper::OK;
50 }
51
52 virtual OSWrapper::Error tryWaitOne(std::size_t pos)
53 {
54 (void) pos;
55 return OSWrapper::OK;
56 }
57
59 {
60 (void) bitPattern;
61 (void) waitMode;
62 (void) releasedPattern;
63 return OSWrapper::OK;
64 }
65
67 {
68 (void) tmout;
69 return OSWrapper::OK;
70 }
71
72 virtual OSWrapper::Error timedWaitOne(std::size_t pos, OSWrapper::Timeout tmout)
73 {
74 (void) pos;
75 (void) tmout;
76 return OSWrapper::OK;
77 }
78
80 {
81 (void) bitPattern;
82 (void) waitMode;
83 (void) releasedPattern;
84 (void) tmout;
85 return OSWrapper::OK;
86 }
87
89 {
90 return OSWrapper::OK;
91 }
92
93 virtual OSWrapper::Error setOne(std::size_t pos)
94 {
95 (void) pos;
96 return OSWrapper::OK;
97 }
98
100 {
101 (void) bitPattern;
102 return OSWrapper::OK;
103 }
104
106 {
107 return OSWrapper::OK;
108 }
109
110 virtual OSWrapper::Error resetOne(std::size_t pos)
111 {
112 (void) pos;
113 return OSWrapper::OK;
114 }
115
117 {
118 (void) bitPattern;
119 return OSWrapper::OK;
120 }
121
126};
127
128template <typename T = TestDoubleEventFlag>
130public:
133
134 virtual OSWrapper::EventFlag* create(bool autoReset)
135 {
136 T* obj = new T();
137 obj->setCreateArgs(autoReset);
138 return obj;
139 }
140
142 {
143 delete static_cast<T*>(e);
144 }
145
146private:
149};
150
151}
152
153#endif // TEST_DOUBLE_OS_WRAPPER_TEST_DOUBLE_EVENT_FLAG_FACTORY_H_INCLUDED
The container with bitwise operation like std::bitset.
Definition BitPattern.h:17
Definition EventFlagFactory.h:8
Abstract class that has functions of common RTOS's event flag.
Definition EventFlag.h:24
Container::BitPattern< unsigned int > Pattern
Type for bit pattern of EventFlag.
Definition EventFlag.h:40
Mode
Used as argument of the wait methods.
Definition EventFlag.h:32
Value object for the timeout.
Definition Timeout.h:11
Definition TestDoubleEventFlagFactory.h:129
TestDoubleEventFlagFactory()
Definition TestDoubleEventFlagFactory.h:131
virtual void destroy(OSWrapper::EventFlag *e)
Definition TestDoubleEventFlagFactory.h:141
virtual ~TestDoubleEventFlagFactory()
Definition TestDoubleEventFlagFactory.h:132
virtual OSWrapper::EventFlag * create(bool autoReset)
Definition TestDoubleEventFlagFactory.h:134
Definition TestDoubleEventFlagFactory.h:9
virtual OSWrapper::Error tryWaitAny()
Query without blocking whether any bit of this EventFlag is set ON.
Definition TestDoubleEventFlagFactory.h:47
virtual OSWrapper::Error set(OSWrapper::EventFlag::Pattern bitPattern)
Set the bits of bitPattern of this EventFlag object ON.
Definition TestDoubleEventFlagFactory.h:99
virtual OSWrapper::EventFlag::Pattern getCurrentPattern() const
Get current bit pattern of this EventFlag object.
Definition TestDoubleEventFlagFactory.h:122
virtual OSWrapper::Error wait(OSWrapper::EventFlag::Pattern bitPattern, OSWrapper::EventFlag::Mode waitMode, OSWrapper::EventFlag::Pattern *releasedPattern)
Block the current thread until the condition is satisfied.
Definition TestDoubleEventFlagFactory.h:39
virtual OSWrapper::Error resetOne(std::size_t pos)
Reset the bit at position pos of this EventFlag object OFF.
Definition TestDoubleEventFlagFactory.h:110
virtual OSWrapper::Error tryWait(OSWrapper::EventFlag::Pattern bitPattern, OSWrapper::EventFlag::Mode waitMode, OSWrapper::EventFlag::Pattern *releasedPattern)
Query without blocking whether the condition is satisfied.
Definition TestDoubleEventFlagFactory.h:58
virtual OSWrapper::Error setAll()
Set all the bits of this EventFlag object ON.
Definition TestDoubleEventFlagFactory.h:88
virtual OSWrapper::Error timedWait(OSWrapper::EventFlag::Pattern bitPattern, OSWrapper::EventFlag::Mode waitMode, OSWrapper::EventFlag::Pattern *releasedPattern, OSWrapper::Timeout tmout)
Block the current thread until the condition is satisfied but only within the limited time.
Definition TestDoubleEventFlagFactory.h:79
virtual OSWrapper::Error timedWaitAny(OSWrapper::Timeout tmout)
Block the current thread until any bit of this EventFlag is set ON but only within the limited time.
Definition TestDoubleEventFlagFactory.h:66
virtual OSWrapper::Error reset(OSWrapper::EventFlag::Pattern bitPattern)
Reset the bits of bitPattern of this EventFlag object OFF.
Definition TestDoubleEventFlagFactory.h:116
virtual OSWrapper::Error timedWaitOne(std::size_t pos, OSWrapper::Timeout tmout)
Block the current thread until the bit at position pos of this EventFlag is set ON but only within th...
Definition TestDoubleEventFlagFactory.h:72
virtual ~TestDoubleEventFlag()
Definition TestDoubleEventFlagFactory.h:24
void setCreateArgs(bool autoReset)
Definition TestDoubleEventFlagFactory.h:19
virtual OSWrapper::Error resetAll()
Reset all the bits of this EventFlag object OFF.
Definition TestDoubleEventFlagFactory.h:105
virtual OSWrapper::Error waitOne(std::size_t pos)
Block the current thread until the bit at position pos of this EventFlag is set ON.
Definition TestDoubleEventFlagFactory.h:33
virtual OSWrapper::Error waitAny()
Block the current thread until any bit of this EventFlag is set ON.
Definition TestDoubleEventFlagFactory.h:28
bool m_autoReset
Definition TestDoubleEventFlagFactory.h:11
virtual OSWrapper::Error tryWaitOne(std::size_t pos)
Query without blocking whether the bit at position pos of this EventFlag is set ON.
Definition TestDoubleEventFlagFactory.h:52
TestDoubleEventFlag()
Definition TestDoubleEventFlagFactory.h:14
virtual OSWrapper::Error setOne(std::size_t pos)
Set the bit at position pos of this EventFlag object ON.
Definition TestDoubleEventFlagFactory.h:93
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