]> Creatis software - bbtk.git/blob - kernel/appli/bbCreateBlackBox/xml-templates/std-template.xml
bb8050b23c1487a5e6e1db11d3ef03f1399fbbf9
[bbtk.git] / kernel / appli / bbCreateBlackBox / xml-templates / std-template.xml
1 <!--==========================================================================
2    STARTS THE DESCRIPTION OF THE BLACK BOX -->
3 <blackbox name="__BLACKBOXNAME__">
4 <!--=======================================================================-->
5
6   <!--========================================================================
7     THE BOX DOCUMENTATION -->
8
9   <author>__AUTHOR__</author>
10   <description>__DESCRIPTION__</description>
11   <category>__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>iostream</PRE></include>
19   <!--=====================================================================-->
20
21   <!--========================================================================
22     INPUTS/OUTPUTS DECLARATION -->
23   <!-- Declares an input with name 'In', type 'double' 
24       and description 'First input' -->
25
26   <input name="In" type="double" description="First input"/>
27   
28   <!-- Declares an output with name 'Out', type 'double' 
29       and description 'First output' -->
30   <output name="Out" type="double" description="First output"/>
31   <!--=====================================================================-->
32
33   <!--========================================================================
34     THE PROCESSING METHOD BODY :
35     Here simpy copies the value of the input 'In' to the output 'Out'
36     And prints out the value
37     INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
38       void bbSet{Input|Output}NAME(const TYPE&)
39       const TYPE& bbGet{Input|Output}NAME() const 
40     Where :
41     * NAME is the name of the input/output
42       (the one provided in the attribute 'name' of the tag 'input')
43     * TYPE is the C++ type of the input/output
44       (the one provided in the attribute 'type' of the tag 'input') -->
45
46   <process>
47   <PRE>
48     bbSetOutputOut( bbGetInputIn() );
49     std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
50   </PRE>
51   </process>
52   <!--=====================================================================-->
53
54   <!--========================================================================
55     CONSTRUCTORS / DESTRUCTORS (OPTIONAL) 
56     THE CONSTRUCTION METHOD BODY :
57     Here initializes the input 'In' to 0
58     This is also where you should allocate the output pointers -->
59   <constructor>
60   <PRE>
61     bbSetInputIn(0);
62   </PRE>
63   </constructor>
64
65   <!-- THE COPY-CONSTRUCTION METHOD BODY :
66     Here does nothing 
67     But this is where you should allocate the output pointers if any
68     and copy the pointed values (to avoid bug caused by multiple references)-->
69   <copyconstructor>
70   <PRE>
71   </PRE>
72   </copyconstructor>
73
74   <!-- THE DESTRUCTION METHOD BODY :
75     Here does nothing 
76     but this is where you should desallocate the output pointers if any -->
77   <destructor>
78   <PRE>
79   </PRE>
80   </destructor>
81   <!--=====================================================================-->
82
83 <!--=======================================================================-->
84 <!-- END OF BLACK BOX DESCRIPTION -->
85 </blackbox>
86 <!--=======================================================================-->