ImagingTools Core SDK
CMigrationControllerCompBase.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 <ifile/IFileNameParam.h>
8
9// ImtCore includes
10#include <imtdb/IMigrationController.h>
11#include <imtdb/IDatabaseEngine.h>
12
13
14namespace imtdb
15{
16
17
18class CMigrationControllerCompBase: public ilog::CLoggerComponentBase, virtual public imtdb::IMigrationController
19{
20public:
21 typedef ilog::CLoggerComponentBase BaseClass;
22
23 I_BEGIN_BASE_COMPONENT(CMigrationControllerCompBase);
24 I_REGISTER_INTERFACE(imtdb::IMigrationController)
25 I_ASSIGN(m_rangeFromAttrPtr, "From", "Range of from value", false, -1);
26 I_ASSIGN(m_rangeToAttrPtr, "To", "if value -1, then maximum value in the migration folder", false, -1);
27 I_ASSIGN(m_databaseEngineCompPtr, "DatabaseEngine", "Database engine", true, "DatabaseEngine");
28 I_END_COMPONENT;
29
30protected:
31 // reimplemented (imtdb::IMigrationController)
32 virtual istd::CIntRange GetMigrationRange() const override;
33
34 // reimplemented (icomp::CComponentBase)
35 virtual void OnComponentCreated() override;
36
37protected:
38 I_REF(imtdb::IDatabaseEngine, m_databaseEngineCompPtr);
39 I_ATTR(int, m_rangeFromAttrPtr);
40 I_ATTR(int, m_rangeToAttrPtr);
41
42 istd::CIntRange m_range;
43};
44
45
46} // namespace imtdb
47
48
Core database engine interface for low-level SQL execution and transaction management.
Controls database schema versioning and migration execution.
Database Abstraction Layer (ORM Framework) for ImtCore applications.