#pragma once #include "CDAbstractProvider.h" /** * Shared memory provider with CDAbstractSharedMemoryProvider * * Depends on the boost::interprocess library — header only * * Requires that CD_PROVIDER_MEMORY is defined and CD_PROVIDER_SQLITE is not defined */ #if defined(CD_PROVIDER_MEMORY) && !defined(CD_PROVIDER_SQLITE) #include "CDAbstractSharedMemoryProvider.h" #define CD_PROVIDER(provider, key, value) CDAbstractSharedMemoryProvider* provider; typedef key CD_KEY; typedef value CD_VALUE #define NEW_CD_PROVIDER(provider, name, parser, size_calculator, cache) provider = new CDAbstractSharedMemoryProvider(name, parser, size_calculator, cache) template using CDProvider = CDAbstractSharedMemoryProvider; #endif /** * SQLite provider with CDAbstractSqliteProvider * * No extra dependencies * * Requires that CD_PROVIDER_SQLITE or CD_PROVIDER_MEMORY is not defined — the default option */ #if defined(CD_PROVIDER_SQLITE) || !defined(CD_PROVIDER_MEMORY) #include "CDAbstractSqliteProvider.h" #define CD_PROVIDER(provider, key, value) CDAbstractSqliteProvider* provider; typedef key CD_KEY; typedef value CD_VALUE #define NEW_CD_PROVIDER(provider, name, parser, size_calculator, cache) provider = new CDAbstractSqliteProvider(name, parser, cache) template using CDProvider = CDAbstractSqliteProvider; #endif