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
1 auto a = Event( 1, [ 0.1, 0.2, 0.3 ] ); 2 assertEq( a.as!(double[]), [ 0.1, 0.2, 0.3 ] ); 3 auto b = Event( 1, "some string"w ); 4 assertEq( b.as!wstring, "some string"w ); 5 auto c = Event( 1, "some str" ); 6 auto d = shared Event( c ); 7 assertEq( c.as!string, "some str" ); 8 assertEq( d.as!string, "some str" ); 9 assertEq( c.code, d.code ); 10 11 struct TestStruct { double x, y; string info; immutable(int)[] data; } 12 13 auto ts = TestStruct( 10.1, 12.3, "hello", [1,2,3,4] ); 14 auto e = Event( 1, ts ); 15 16 auto f = shared Event( e ); 17 auto g = immutable Event( e ); 18 auto h = shared const Event( e ); 19 20 assertEq( e.as!TestStruct, ts ); 21 assertEq( f.as!TestStruct, ts ); 22 assertEq( g.as!TestStruct, ts ); 23 assertEq( h.as!TestStruct, ts ); 24 25 assertEq( Event(f).as!TestStruct, ts ); 26 assertEq( Event(g).as!TestStruct, ts ); 27 assertEq( Event(h).as!TestStruct, ts );
1 static struct TestStruct { double x, y; string info; immutable(int)[] data; } 2 auto ts = TestStruct( 3.14, 2.7, "hello", [ 2, 3, 4 ] ); 3 4 auto a = Event( 8, ts ); 5 auto ac = const Event( a ); 6 auto ai = immutable Event( a ); 7 auto as = shared Event( a ); 8 auto acs = const shared Event( a ); 9 10 assertEq( a.as!TestStruct, ts ); 11 assertEq( ac.as!TestStruct, ts ); 12 assertEq( ai.as!TestStruct, ts ); 13 assertEq( as.as!TestStruct, ts ); 14 assertEq( acs.as!TestStruct, ts );
Pass data between threads