ImagingTools Core SDK
CApiClientComp.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/TLoggerCompWrap.h>
7
8// ImtCore includes
9#include <imtclientgql/IGqlClient.h>
10#include <imtclientgql/IClientProtocolEngine.h>
11
12
13namespace imtclientgql
14{
15
16
17class CApiClientComp:
18 public ilog::CLoggerComponentBase,
19 virtual public IGqlClient
20{
21public:
22 typedef ilog::CLoggerComponentBase BaseClass;
23
24 I_BEGIN_COMPONENT(CApiClientComp);
25 I_REGISTER_INTERFACE(IGqlClient);
26 I_ASSIGN(m_protocolEngineCompPtr, "ProtocolEngine", "Protocol engine used for the communication with the server", true, "ProtocolEngine");
27 I_ASSIGN(m_timeoutAttrPtr, "Timeout", "Request timeout in seconds", true, 30.0);
28 I_END_COMPONENT
29
30 CApiClientComp();
31
32 // reimplemented (IGqlClient)
33 virtual GqlResponsePtr SendRequest(GqlRequestPtr requestPtr, imtbase::IUrlParam* urlParamPtr = nullptr) const override;
34
35protected:
36 // reimplemented (icomp::CComponentBase)
37 virtual void OnComponentCreated() override;
38
39private:
40 I_REF(imtclientgql::IClientProtocolEngine, m_protocolEngineCompPtr);
41 I_ATTR(double, m_timeoutAttrPtr);
42
43 int m_timeout;
44};
45
46
47} // namespace imtclientgql
48
49