ulong.max reserved system event code
get data as type T
get data as type T
get data as type T
elapsed time before create event
generate system event
auto a = Event( 1, [ 0.1, 0.2, 0.3 ] ); assertEq( a.as!(double[]), [ 0.1, 0.2, 0.3 ] ); auto b = Event( 1, "some string"w ); assertEq( b.as!wstring, "some string"w ); auto c = Event( 1, "some str" ); auto d = shared Event( c ); assertEq( c.as!string, "some str" ); assertEq( d.as!string, "some str" ); assertEq( c.code, d.code ); struct TestStruct { double x, y; string info; immutable(int)[] data; } auto ts = TestStruct( 10.1, 12.3, "hello", [1,2,3,4] ); auto e = Event( 1, ts ); auto f = shared Event( e ); auto g = immutable Event( e ); auto h = shared const Event( e ); assertEq( e.as!TestStruct, ts ); assertEq( f.as!TestStruct, ts ); assertEq( g.as!TestStruct, ts ); assertEq( h.as!TestStruct, ts ); assertEq( Event(f).as!TestStruct, ts ); assertEq( Event(g).as!TestStruct, ts ); assertEq( Event(h).as!TestStruct, ts );
static struct TestStruct { double x, y; string info; immutable(int)[] data; } auto ts = TestStruct( 3.14, 2.7, "hello", [ 2, 3, 4 ] ); auto a = Event( 8, ts ); auto ac = const Event( a ); auto ai = immutable Event( a ); auto as = shared Event( a ); auto acs = const shared Event( a ); assertEq( a.as!TestStruct, ts ); assertEq( ac.as!TestStruct, ts ); assertEq( ai.as!TestStruct, ts ); assertEq( as.as!TestStruct, ts ); assertEq( acs.as!TestStruct, ts );
Pass data between threads