ImagingTools Core SDK
CCollectionBasedMessageConsumerComp.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// ACF includes
6#include <ilog/CLogCompBase.h>
7#include <ilog/TLoggerCompWrap.h>
8#include <ibase/TRuntimeStatusHanderCompWrap.h>
9
10// ImtCore includes
11#include <imtbase/IObjectCollection.h>
12
13
14namespace imtlog
15{
16
17
18class CCollectionBasedMessageConsumerComp:
19 public ibase::TRuntimeStatusHanderCompWrap<ilog::CLogCompBase>
20{
21public:
22 typedef ibase::TRuntimeStatusHanderCompWrap<ilog::CLogCompBase> BaseClass;
23
24 I_BEGIN_COMPONENT(CCollectionBasedMessageConsumerComp);
25 I_ASSIGN(m_messageCollectionCompPtr, "MessageCollection", "Message collection", true, "MessageCollection");
26 I_END_COMPONENT;
27
28 CCollectionBasedMessageConsumerComp();
29
30protected:
31 // reimplemented (ibase::TRuntimeStatusHanderCompWrap)
32 virtual void OnSystemStarted() override;
33
34 // reimplemented (ilog::CLogCompBase)
35 virtual void WriteMessageToLog(const MessagePtr& messagePtr) override;
36
37private:
38 I_REF(imtbase::IObjectCollection, m_messageCollectionCompPtr);
39
40 bool m_isSystemStarted;
41 QList<MessagePtr> m_startMessages;
42};
43
44
45} // namespace imtlog
46
47