1 module des.flow.base;
2 
3 import std.datetime;
4 public import des.util.logsys;
5 
6 ///
7 class FlowException : Exception
8 {
9     @safe pure nothrow this( string msg, string file=__FILE__, size_t line=__LINE__ )
10     { super( msg, file, line ); }
11 }
12 
13 /// Control work element commands
14 enum Command
15 {
16     START, /// 
17     PAUSE, ///
18     STOP,  ///
19     REINIT,/// destroy work element and create it
20     CLOSE  /// destroy work element
21 };
22 
23 ///
24 @property ulong currentTick()
25 { return Clock.currAppTick().length; }
26 
27 package
28 {
29     import des.util.testsuite;
30 
31     version(unittest)
32     {
33         import std.math;
34         import std.traits;
35         import std.range;
36 
37         bool creationTest(T)( T a )
38             if( is( Unqual!T == T ) )
39         {
40             auto cn_a = const T( a );
41             auto im_a = immutable T( a );
42             auto sh_a = shared T( a );
43             auto sc_a = shared const T( a );
44             auto si_a = shared immutable T( a );
45             auto a_cn = T( cn_a );
46             auto a_im = T( im_a );
47             auto a_sh = T( sh_a );
48             auto a_sc = T( sc_a );
49             auto a_si = T( si_a );
50             return a_cn == a &&
51                    a_im == a &&
52                    a_sh == a &&
53                    a_sc == a &&
54                    a_si == a;
55         }
56     }
57 }