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