1 | // |
2 | // TestChannel.h |
3 | // |
4 | // Definition of the TestChannel class. |
5 | // |
6 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. |
7 | // and Contributors. |
8 | // |
9 | // SPDX-License-Identifier: BSL-1.0 |
10 | // |
11 | |
12 | |
13 | #ifndef TestChannel_INCLUDED |
14 | #define TestChannel_INCLUDED |
15 | |
16 | |
17 | #include "Poco/Channel.h" |
18 | #include "Poco/Message.h" |
19 | #include <list> |
20 | |
21 | |
22 | class TestChannel: public Poco::Channel |
23 | { |
24 | public: |
25 | typedef std::list<Poco::Message> MsgList; |
26 | |
27 | TestChannel(); |
28 | |
29 | void log(const Poco::Message& msg); |
30 | MsgList& list(); |
31 | void clear(); |
32 | const Poco::Message& getLastMessage() const { return _lastMessage; } |
33 | |
34 | protected: |
35 | ~TestChannel(); |
36 | |
37 | private: |
38 | MsgList _msgList; |
39 | Poco::Message _lastMessage; |
40 | }; |
41 | |
42 | |
43 | #endif // TestChannel_INCLUDED |
44 | |