adjusted folder of examples.

This commit is contained in:
HuYingzhuo(hugo/hyzboy) 2023-07-21 11:11:24 +08:00
parent d76f259125
commit 34cc1c1b46
16 changed files with 79 additions and 46 deletions

View File

@ -1,5 +1,4 @@
macro(cm_example_project project_name)
macro(cm_example_project sub_folder project_name)
target_link_libraries(${project_name} PRIVATE CMCore CMPlatform CMUtil)
if(UNIX)
@ -14,63 +13,72 @@ macro(cm_example_project project_name)
target_sources(${project_name} PRIVATE ${CM_MANIFEST})
ENDIF()
set_property(TARGET ${project_name} PROPERTY FOLDER "CM/Examples")
set_property(TARGET ${project_name} PROPERTY FOLDER "CM/Examples/${sub_folder}")
endmacro()
add_executable(HalfFloatTest HalfFloatTest.cpp)
cm_example_project(HalfFloatTest)
add_executable(GetCpuInfo GetCpuInfo.cpp)
cm_example_project(GetCpuInfo)
add_executable(CollectionTest CollectionTest.cpp)
cm_example_project(CollectionTest)
add_executable(HalfFloatTest datatype/HalfFloatTest.cpp)
cm_example_project("DataType" HalfFloatTest)
add_executable(FixFilenameTest FixFilenameTest.cpp)
cm_example_project(FixFilenameTest)
add_executable(CollectionTest datatype/CollectionTest.cpp)
cm_example_project("DataType" CollectionTest)
add_executable(SplitStringTest datatype/SplitStringTest.cpp)
cm_example_project("DataType" SplitStringTest)
add_executable(MultiMapTest datatype/MultiMapTest.cpp)
cm_example_project("DataType" MultiMapTest)
add_executable(RuntimeAssetManagerTest datatype/ram/RuntimeAssetManagerTest.cpp
datatype/ram/RuntimeAssetManager.h
datatype/ram/RAM_TestClass.h
datatype/ram/RAM_TestClass.cpp)
cm_example_project("DataType/RAM" RuntimeAssetManagerTest)
add_executable(Size2Test datatype/Size2Test.cpp)
cm_example_project("DataType" Size2Test)
add_executable(DataArrayTest datatype/DataArrayTest.cpp)
cm_example_project("DataType" DataArrayTest)
add_executable(FixFilenameTest filesystem/FixFilenameTest.cpp)
cm_example_project("File System" FixFilenameTest)
IF(WIN32)
add_executable(EnumVolumeTest EnumVolumeTest.cpp)
cm_example_project(EnumVolumeTest)
add_executable(EnumVolumeTest filesystem/EnumVolumeTest.cpp)
cm_example_project("File System" EnumVolumeTest)
ENDIF(WIN32)
add_executable(SplitStringTest SplitStringTest.cpp)
cm_example_project(SplitStringTest)
add_executable(GetCpuInfo GetCpuInfo.cpp)
cm_example_project("Hareware" GetCpuInfo)
add_executable(CreateBinaryH CreateBinaryH.cpp)
cm_example_project(CreateBinaryH)
cm_example_project("" CreateBinaryH)
add_executable(NormalCompressTest NormalCompressTest.cpp)
CM_EXAMPLE_PROJECT(NormalCompressTest)
add_executable(MultiMapTest MultiMapTest.cpp)
cm_example_project(MultiMapTest)
CM_EXAMPLE_PROJECT("" NormalCompressTest)
add_executable(OSFontList OSFontList.cpp)
cm_example_project(OSFontList)
cm_example_project("os" OSFontList)
target_link_libraries(OSFontList PRIVATE CMUtil)
add_executable(RuntimeAssetManagerTest RuntimeAssetManagerTest.cpp RuntimeAssetManager.h RAM_TestClass.h RAM_TestClass.cpp)
cm_example_project(RuntimeAssetManagerTest)
add_executable(DistributionChart2D DistributionChart2D.cpp BitmapFont.cpp BitmapFont.h)
cm_example_project(DistributionChart2D)
cm_example_project("chart" DistributionChart2D)
add_executable(Size2Test Size2Test.cpp)
cm_example_project(Size2Test)
add_executable(AndroidDeviceAnalysis android/AndroidDeviceAnalysis/main.cpp
android/AndroidDeviceAnalysis/GameRecord.h
android/AndroidDeviceAnalysis/GameRecord.cpp
android/AndroidDeviceAnalysis/ParseDeviceID.cpp
android/AndroidDeviceAnalysis/ParseScreenSize.cpp
android/AndroidDeviceAnalysis/ParseDateTime.cpp
android/AndroidDeviceAnalysis/ParseAndroidVersion.cpp
android/AndroidDeviceAnalysis/ParseNumber.cpp
android/AndroidDeviceAnalysis/LoadRecordFile.cpp)
cm_example_project("android" AndroidDeviceAnalysis)
add_executable(AndroidDeviceAnalysis AndroidDeviceAnalysis/main.cpp
AndroidDeviceAnalysis/GameRecord.h
AndroidDeviceAnalysis/GameRecord.cpp
AndroidDeviceAnalysis/ParseDeviceID.cpp
AndroidDeviceAnalysis/ParseScreenSize.cpp
AndroidDeviceAnalysis/ParseDateTime.cpp
AndroidDeviceAnalysis/ParseAndroidVersion.cpp
AndroidDeviceAnalysis/ParseNumber.cpp
AndroidDeviceAnalysis/LoadRecordFile.cpp)
cm_example_project(AndroidDeviceAnalysis)
add_executable(DataArrayTest DataArrayTest.cpp)
cm_example_project(DataArrayTest)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 768 KiB

@ -0,0 +1 @@
Subproject commit 8fdb442ef22b0c2d6944aa7d9750a93be6d5d2da

View File

@ -58,7 +58,9 @@ void main(int,char **)
out(cu);
}
cu.Insert(0,0);out(cu);
std::cout<<"insert 'A' data at first."<<std::endl;
cu.Insert(0,"A");
out(cu);
std::cout<<"indexOf(E) is "<<cu.indexOfValue('E')<<std::endl;

View File

@ -0,0 +1,12 @@
template<typename KEY,typename VALUE>
struct DataPair
{
KEY key;
VALUE value;
};
template<typename KEY,typename VALUE>
class UnorderedMap
{
ObjectList<DataPair<KEY,VALUE>> data_list;
};

View File

@ -0,0 +1,8 @@
struct Person
{
char name[128];
bool sex;
int age;
};
template<typename T> Table

View File

@ -1,11 +1,13 @@
#pragma once
#include"RuntimeAssetManager.h"
#include<hgl/type/String.h>
#include<hgl/type/SortedSets.h>
#include<iostream>
using namespace hgl;
using InstanceID =uint64_t;
using PhysicalDeviceID =uint64_t;
using InstanceID =uint64;
using PhysicalDeviceID =uint64;
struct Instance:public RuntimeAsset<InstanceID,Instance>
{

View File

@ -1,10 +1,10 @@
#pragma once
#include<hgl/type/ResManage.h>
#include<hgl/type/ObjectManage.h>
using namespace hgl;
template<typename K,typename V> struct RuntimeAssetManager:public ResManage<K,V>
template<typename K,typename V> struct RuntimeAssetManager:public ObjectManage<K,V>
{
public:
@ -12,7 +12,7 @@ public:
{
if(!v)return(false);
return ResManage<K,V>::Add(v->GetID(),v);
return ObjectManage<K,V>::Add(v->GetID(),v);
}
};