-registering same system multiple times only replace pointer for callback

-added export attributes (required by windows to make DLL library, not work at now due to DMD bugs)
-interface D files to import
This commit is contained in:
Mergul 2018-09-18 13:28:04 +02:00
parent cb0f56b0fb
commit d0fcdba6cd
20 changed files with 1322 additions and 105 deletions

View file

@ -0,0 +1,31 @@
// D import file generated from 'source\ecs\string_intern.d'
module ecs.string_intern;
import ecs.hash_map;
import ecs.traits : isForeachDelegateWithI;
import std.experimental.allocator;
import std.experimental.allocator.mallocator;
import std.traits : Parameters;
private static __gshared HashMap!(const(char)[], StringIntern) gStringInterns;
struct StringIntern
{
private const(char)* strPtr;
this(const(char)[] fromStr)
{
opAssign(fromStr);
}
void reset();
size_t length();
const(char)[] str();
const(char)[] cstr();
bool opEquals()(auto ref const StringIntern s)
{
return strPtr == s.strPtr;
}
bool opEquals()(auto ref const(char[]) s)
{
return str() == s;
}
void opAssign(const(char)[] fromStr);
const(char)[] opSlice();
private const(char)[] allocStr(const(char)[] fromStr);
}