Skip to content

Commit 881bc04

Browse files
committed
added:memory cache module
1 parent 0288b97 commit 881bc04

15 files changed

+857
-1
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
LIBRARY
2+
3+
EXPORTS
4+
MemoryCache_GetLastError
5+
6+
MemoryCache_DBData_Init
7+
MemoryCache_DBData_Destory
8+
MemoryCache_DBData_DataInsert
9+
MemoryCache_DBData_DataQuery
10+
MemoryCache_DBData_DataDelete
Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|Win32">
9+
<Configuration>Release</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Debug|x64">
13+
<Configuration>Debug</Configuration>
14+
<Platform>x64</Platform>
15+
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|x64">
17+
<Configuration>Release</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
20+
</ItemGroup>
21+
<PropertyGroup Label="Globals">
22+
<VCProjectVersion>17.0</VCProjectVersion>
23+
<Keyword>Win32Proj</Keyword>
24+
<ProjectGuid>{8c55d3e0-fec2-4a6c-a374-651516ed8f99}</ProjectGuid>
25+
<RootNamespace>MQCoreMemoryCache</RootNamespace>
26+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
27+
</PropertyGroup>
28+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
29+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
30+
<ConfigurationType>DynamicLibrary</ConfigurationType>
31+
<UseDebugLibraries>true</UseDebugLibraries>
32+
<PlatformToolset>v143</PlatformToolset>
33+
<CharacterSet>Unicode</CharacterSet>
34+
</PropertyGroup>
35+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
36+
<ConfigurationType>DynamicLibrary</ConfigurationType>
37+
<UseDebugLibraries>false</UseDebugLibraries>
38+
<PlatformToolset>v143</PlatformToolset>
39+
<WholeProgramOptimization>true</WholeProgramOptimization>
40+
<CharacterSet>Unicode</CharacterSet>
41+
</PropertyGroup>
42+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
43+
<ConfigurationType>DynamicLibrary</ConfigurationType>
44+
<UseDebugLibraries>true</UseDebugLibraries>
45+
<PlatformToolset>v143</PlatformToolset>
46+
<CharacterSet>Unicode</CharacterSet>
47+
</PropertyGroup>
48+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
49+
<ConfigurationType>DynamicLibrary</ConfigurationType>
50+
<UseDebugLibraries>false</UseDebugLibraries>
51+
<PlatformToolset>v143</PlatformToolset>
52+
<WholeProgramOptimization>true</WholeProgramOptimization>
53+
<CharacterSet>Unicode</CharacterSet>
54+
</PropertyGroup>
55+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
56+
<ImportGroup Label="ExtensionSettings">
57+
</ImportGroup>
58+
<ImportGroup Label="Shared">
59+
</ImportGroup>
60+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
61+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
62+
</ImportGroup>
63+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
64+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
65+
</ImportGroup>
66+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
67+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
68+
</ImportGroup>
69+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
70+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
71+
</ImportGroup>
72+
<PropertyGroup Label="UserMacros" />
73+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
74+
<IncludePath>$(XEngine_Include);..\MQCore_MemoryCache;$(IncludePath)</IncludePath>
75+
<LibraryPath>$(XEngine_Lib32);$(LibraryPath)</LibraryPath>
76+
</PropertyGroup>
77+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
78+
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
79+
</PropertyGroup>
80+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
81+
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
82+
</PropertyGroup>
83+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
84+
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
85+
</PropertyGroup>
86+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
87+
<ClCompile>
88+
<WarningLevel>Level3</WarningLevel>
89+
<SDLCheck>true</SDLCheck>
90+
<PreprocessorDefinitions>WIN32;_DEBUG;MQCOREMEMORYCACHE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
91+
<ConformanceMode>true</ConformanceMode>
92+
<PrecompiledHeader>Use</PrecompiledHeader>
93+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
94+
<LanguageStandard>stdcpp20</LanguageStandard>
95+
<LanguageStandard_C>stdc17</LanguageStandard_C>
96+
</ClCompile>
97+
<Link>
98+
<SubSystem>Windows</SubSystem>
99+
<GenerateDebugInformation>true</GenerateDebugInformation>
100+
<EnableUAC>false</EnableUAC>
101+
<ModuleDefinitionFile>MQCore_MemoryCache.def</ModuleDefinitionFile>
102+
</Link>
103+
</ItemDefinitionGroup>
104+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
105+
<ClCompile>
106+
<WarningLevel>Level3</WarningLevel>
107+
<FunctionLevelLinking>true</FunctionLevelLinking>
108+
<IntrinsicFunctions>true</IntrinsicFunctions>
109+
<SDLCheck>true</SDLCheck>
110+
<PreprocessorDefinitions>WIN32;NDEBUG;MQCOREMEMORYCACHE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
111+
<ConformanceMode>true</ConformanceMode>
112+
<PrecompiledHeader>Use</PrecompiledHeader>
113+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
114+
<LanguageStandard>stdcpp20</LanguageStandard>
115+
<LanguageStandard_C>stdc17</LanguageStandard_C>
116+
</ClCompile>
117+
<Link>
118+
<SubSystem>Windows</SubSystem>
119+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
120+
<OptimizeReferences>true</OptimizeReferences>
121+
<GenerateDebugInformation>true</GenerateDebugInformation>
122+
<EnableUAC>false</EnableUAC>
123+
<ModuleDefinitionFile>MQCore_MemoryCache.def</ModuleDefinitionFile>
124+
</Link>
125+
</ItemDefinitionGroup>
126+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
127+
<ClCompile>
128+
<WarningLevel>Level3</WarningLevel>
129+
<SDLCheck>true</SDLCheck>
130+
<PreprocessorDefinitions>_DEBUG;MQCOREMEMORYCACHE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
131+
<ConformanceMode>true</ConformanceMode>
132+
<PrecompiledHeader>Use</PrecompiledHeader>
133+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
134+
<LanguageStandard>stdcpp20</LanguageStandard>
135+
<LanguageStandard_C>stdc17</LanguageStandard_C>
136+
</ClCompile>
137+
<Link>
138+
<SubSystem>Windows</SubSystem>
139+
<GenerateDebugInformation>true</GenerateDebugInformation>
140+
<EnableUAC>false</EnableUAC>
141+
<ModuleDefinitionFile>MQCore_MemoryCache.def</ModuleDefinitionFile>
142+
</Link>
143+
</ItemDefinitionGroup>
144+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
145+
<ClCompile>
146+
<WarningLevel>Level3</WarningLevel>
147+
<FunctionLevelLinking>true</FunctionLevelLinking>
148+
<IntrinsicFunctions>true</IntrinsicFunctions>
149+
<SDLCheck>true</SDLCheck>
150+
<PreprocessorDefinitions>NDEBUG;MQCOREMEMORYCACHE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
151+
<ConformanceMode>true</ConformanceMode>
152+
<PrecompiledHeader>Use</PrecompiledHeader>
153+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
154+
<LanguageStandard>stdcpp20</LanguageStandard>
155+
<LanguageStandard_C>stdc17</LanguageStandard_C>
156+
</ClCompile>
157+
<Link>
158+
<SubSystem>Windows</SubSystem>
159+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
160+
<OptimizeReferences>true</OptimizeReferences>
161+
<GenerateDebugInformation>true</GenerateDebugInformation>
162+
<EnableUAC>false</EnableUAC>
163+
<ModuleDefinitionFile>MQCore_MemoryCache.def</ModuleDefinitionFile>
164+
</Link>
165+
</ItemDefinitionGroup>
166+
<ItemGroup>
167+
<ClInclude Include="framework.h" />
168+
<ClInclude Include="MemoryCache_DBData\MemoryCache_DBData.h" />
169+
<ClInclude Include="MemoryCache_Define.h" />
170+
<ClInclude Include="MemoryCache_Error.h" />
171+
<ClInclude Include="pch.h" />
172+
</ItemGroup>
173+
<ItemGroup>
174+
<ClCompile Include="dllmain.cpp" />
175+
<ClCompile Include="MemoryCache_DBData\MemoryCache_DBData.cpp" />
176+
<ClCompile Include="pch.cpp">
177+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
178+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
179+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
180+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
181+
</ClCompile>
182+
</ItemGroup>
183+
<ItemGroup>
184+
<None Include="MQCore_MemoryCache.def" />
185+
</ItemGroup>
186+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
187+
<ImportGroup Label="ExtensionTargets">
188+
</ImportGroup>
189+
</Project>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="源文件">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="头文件">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
11+
</Filter>
12+
<Filter Include="资源文件">
13+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15+
</Filter>
16+
<Filter Include="头文件\MemoryCache_DBData">
17+
<UniqueIdentifier>{4c036899-9b97-4388-94f1-12e980800877}</UniqueIdentifier>
18+
</Filter>
19+
<Filter Include="源文件\MemoryCache_DBData">
20+
<UniqueIdentifier>{d3182e9a-8f45-4138-b4e2-a793c976d18d}</UniqueIdentifier>
21+
</Filter>
22+
</ItemGroup>
23+
<ItemGroup>
24+
<ClInclude Include="framework.h">
25+
<Filter>头文件</Filter>
26+
</ClInclude>
27+
<ClInclude Include="pch.h">
28+
<Filter>头文件</Filter>
29+
</ClInclude>
30+
<ClInclude Include="MemoryCache_Define.h">
31+
<Filter>头文件</Filter>
32+
</ClInclude>
33+
<ClInclude Include="MemoryCache_Error.h">
34+
<Filter>头文件</Filter>
35+
</ClInclude>
36+
<ClInclude Include="MemoryCache_DBData\MemoryCache_DBData.h">
37+
<Filter>头文件\MemoryCache_DBData</Filter>
38+
</ClInclude>
39+
</ItemGroup>
40+
<ItemGroup>
41+
<ClCompile Include="dllmain.cpp">
42+
<Filter>源文件</Filter>
43+
</ClCompile>
44+
<ClCompile Include="pch.cpp">
45+
<Filter>源文件</Filter>
46+
</ClCompile>
47+
<ClCompile Include="MemoryCache_DBData\MemoryCache_DBData.cpp">
48+
<Filter>源文件\MemoryCache_DBData</Filter>
49+
</ClCompile>
50+
</ItemGroup>
51+
<ItemGroup>
52+
<None Include="MQCore_MemoryCache.def">
53+
<Filter>源文件</Filter>
54+
</None>
55+
</ItemGroup>
56+
</Project>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup />
4+
</Project>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
CC = g++ -Wall -std=c++17 -fPIC
2+
PLATFORM = linux
3+
PLATVER =
4+
PLATDIR =
5+
FILEEXT =
6+
LIBFLAG =
7+
RELEASE = 0
8+
LOADHDR = -I ./
9+
LOADSO =
10+
LIB =
11+
LIBEX =
12+
OBJECTS = MemoryCache_DBData.o pch.o
13+
14+
ifeq ($(RELEASE),1)
15+
FLAGS = -c
16+
DEBUG =
17+
else
18+
ifeq ($(PLATFORM),mac)
19+
FLAGS = -c
20+
DEBUG = -g
21+
else
22+
FLAGS = -c -lc_p
23+
DEBUG = -g -pg
24+
endif
25+
endif
26+
27+
ifeq ($(PLATFORM),linux)
28+
ifeq (/etc/redhat-release,$(wildcard /etc/redhat-release))
29+
PLATVER = -D __CENTOS__
30+
PLATDIR = XEngine_Linux/Centos
31+
else
32+
PLATVER = -D __UBUNTU__
33+
PLATDIR = XEngine_Linux/Ubuntu
34+
endif
35+
FILEEXT = so
36+
LIBFLAG = -shared
37+
LIBEX = -lpthread -lrt -ldl
38+
LOADBIN = -Wl,-rpath=./,--disable-new-dtags
39+
else ifeq ($(PLATFORM),mac)
40+
CC += -Wno-deprecated-declarations
41+
PLATVER = -D __MACOS__
42+
PLATDIR = XEngine_Mac
43+
FILEEXT = dylib
44+
LIBFLAG = -dynamiclib
45+
LIBEX = -lpthread -ldl
46+
LOADBIN = -Wl,-rpath,@loader_path/./
47+
endif
48+
49+
50+
all:$(OBJECTS)
51+
$(CC) $(DEBUG) $(OBJECTS) -o libMQCore_MemoryCache.$(FILEEXT) $(LIBFLAG) $(LIB) $(LIBEX) $(LOADSO) $(LOADBIN)
52+
53+
MemoryCache_DBData.o:./MemoryCache_DBData/MemoryCache_DBData.cpp
54+
$(CC) $(DEBUG) $(FLAGS) $(PLATVER) $(LOADHDR) ./MemoryCache_DBData/MemoryCache_DBData.cpp
55+
56+
pch.o:./pch.cpp
57+
$(CC) $(DEBUG) $(FLAGS) $(PLATVER) $(LOADHDR) ./pch.cpp
58+
59+
60+
InstallAll:InstallSo
61+
InstallSo:./libMQCore_MemoryCache.$(FILEEXT)
62+
cp ./libMQCore_MemoryCache.$(FILEEXT) ../../XEngine_Release/libMQCore_MemoryCache.$(FILEEXT)
63+
64+
65+
CleanAll:CleanObj CleanMk
66+
CleanObj:
67+
rm *.o
68+
CleanMk:
69+
rm *.$(FILEEXT)

0 commit comments

Comments
 (0)