]> Creatis software - bbtk.git/blob - packages/std/src/bbstdWait.xml
8d6c09351057640433a8cad0a23e07a95574cd28
[bbtk.git] / packages / std / src / bbstdWait.xml
1 <!--==========================================================================
2    STARTS THE DESCRIPTION OF THE BLACK BOX -->
3 <blackbox name="Wait">
4 <!--=======================================================================-->
5
6   <!--========================================================================
7     THE BOX DOCUMENTATION -->
8
9   <author>laurent.guigues@creatis.insa-lyon.fr</author>
10   <description>Waits a certain number of milliseconds</description>
11   <category></category>
12   <!--=====================================================================-->
13
14   <!--========================================================================
15     #include directives to be put in the .h generated
16     There must be one tag per file to include
17     Here we include the standard header iostream.h -->
18   <include><PRE>ctime</PRE></include>
19   <!--=====================================================================-->
20
21   <!--========================================================================
22     INPUTS/OUTPUTS DECLARATION -->
23   <input name="In" type="int" description="Number of milliseconds to wait"/>
24   <!--=====================================================================-->
25
26   <!--========================================================================
27     THE PROCESSING METHOD BODY : -->
28   <process>
29   <PRE>
30     clock_t endwait;
31     endwait = clock () + (bbGetInputIn() * CLOCKS_PER_SEC )/ 1000;
32     while (clock() < endwait) {}
33   </PRE>
34   </process>
35   <!--=====================================================================-->
36
37   <!--========================================================================
38     CONSTRUCTORS / DESTRUCTORS (OPTIONAL) 
39     THE CONSTRUCTION METHOD BODY : -->
40   <constructor>
41   <PRE>
42     bbSetInputIn(1000);
43   </PRE>
44   </constructor>
45
46   <!-- THE COPY-CONSTRUCTION METHOD BODY :
47     Here does nothing 
48     But this is where you should allocate the output pointers if any
49     and copy the pointed values (to avoid bug caused by multiple references)-->
50   <copyconstructor>
51   <PRE>
52   </PRE>
53   </copyconstructor>
54
55   <!-- THE DESTRUCTION METHOD BODY :
56     Here does nothing 
57     but this is where you should desallocate the output pointers if any -->
58   <destructor>
59   <PRE>
60   </PRE>
61   </destructor>
62   <!--=====================================================================-->
63
64 <!--=======================================================================-->
65 <!-- END OF BLACK BOX DESCRIPTION -->
66 </blackbox>
67 <!--=======================================================================-->