ImagingTools Core SDK
TJsonRepresentationControllerCompWrap.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#include <iqt/ITranslationManager.h>
8
9// ImtCore includes
10#include <imtserverapp/TJsonRepresentationControllerWrap.h>
11
12
13namespace imtserverapp
14{
15
16
17template<class SdlClass>
18class TJsonRepresentationControllerCompWrap:
19 public ilog::CLoggerComponentBase,
20 public TJsonRepresentationControllerWrap<SdlClass>
21{
22public:
23 typedef ilog::CLoggerComponentBase BaseClass;
24 typedef TJsonRepresentationControllerWrap<SdlClass> BaseClass2;
25
26 I_BEGIN_BASE_COMPONENT(TJsonRepresentationControllerCompWrap);
27 I_REGISTER_INTERFACE(IJsonRepresentationController);
28 I_ASSIGN(m_modelIdAttrPtr, "ModelId", "Model-ID", false, "");
29 I_ASSIGN(m_nameAttrPtr, "Name", "Name", false, "");
30 I_ASSIGN(m_descriptionAttrPtr, "Description", "Description", false, "");
31 I_ASSIGN(m_translationManagerCompPtr, "TranslationManager", "Translation manager", false, "TranslationManager");
32 I_END_COMPONENT;
33
34protected:
35 // reimplemented (icomp::CComponentBase)
36 virtual void OnComponentCreated() override;
37
38protected:
39 I_ATTR(QByteArray, m_modelIdAttrPtr);
40 I_TEXTATTR(m_nameAttrPtr);
41 I_TEXTATTR(m_descriptionAttrPtr);
42 I_REF(iqt::ITranslationManager, m_translationManagerCompPtr);
43};
44
45
46// reimplemented (icomp::CComponentBase)
47template<class SdlClass>
48void TJsonRepresentationControllerCompWrap<SdlClass>::OnComponentCreated()
49{
50 BaseClass::OnComponentCreated();
51
52 if (m_modelIdAttrPtr.IsValid()){
53 this->m_modelId = *m_modelIdAttrPtr;
54 }
55
56 if (m_nameAttrPtr.IsValid()){
57 this->m_name = *m_nameAttrPtr;
58 }
59
60 if (m_descriptionAttrPtr.IsValid()){
61 this->m_description = *m_descriptionAttrPtr;
62 }
63
64 if (m_translationManagerCompPtr.IsValid()){
65 this->m_translationManagerPtr = m_translationManagerCompPtr.GetPtr();
66 }
67}
68
69
70} // namespace imtserverapp
71
72