ImSQL
C++ 기반 SQL 자동화 및 라이선스 관리 엔진
Loading...
Searching...
No Matches
license_features.hpp
Go to the documentation of this file.
1
11#pragma once
12
13#include <string>
14#include <unordered_set>
15#include <utils/log.hpp>
16
17namespace license {
18
26 public:
33 if (hasFeature("API_SUPPORT")) {
34 SQLOG_I("Sending metadata to client (feature: API_SUPPORT)");
35 } else {
36 SQLOG_I("API_SUPPORT feature not available. Skipping metadata transmission.");
37 }
38 }
39
44 void setFeatures(const std::vector<std::string>& features) {
45 m_features.clear();
46 for (const auto& f : features) {
47 m_features.insert(f);
48 SQLOG_I("Enabled feature : %s", f.c_str());
49 }
50 }
51
57 bool hasFeature(const std::string& key) const {
58 return m_features.find(key) != m_features.end();
59 }
60
61 private:
62 std::unordered_set<std::string> m_features;
63 };
64
71 static FeatureControl instance;
72 return instance;
73 }
74
80#define HAS_FEATURE(fkey) ::license::getFeatureControl().hasFeature(fkey)
81
82} // namespace license // end of LicenseFeatures
라이선스 기능(feature)을 제어하는 클래스.
Definition license_features.hpp:25
void setFeatures(const std::vector< std::string > &features)
활성화된 기능 목록을 설정합니다.
Definition license_features.hpp:44
bool hasFeature(const std::string &key) const
특정 기능이 활성화되어 있는지 확인합니다.
Definition license_features.hpp:57
void sendMetadataToClient()
클라이언트로 메타데이터를 전송합니다.
Definition license_features.hpp:32
FeatureControl & getFeatureControl()
전역 FeatureControl 인스턴스를 반환합니다.
Definition license_features.hpp:70
통합 로깅 유틸리티를 제공하는 헤더 파일입니다.