2 <xsl:stylesheet version=
"1.0" xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform">
4 <xsl:output method=
"text" indent=
"no"/>
6 <!-- Output : can be 'header', 'cpp' or 'php' -->
7 <xsl:param name=
"output"/> <!-- select="'header' -->
8 <xsl:param name=
"side"/> <!-- The generation side (my be 'server' or 'client' -->
9 <xsl:param name=
"filename"/>
10 <xsl:param name=
"bank"/> <!-- The database bank to generate (must meet an entry in <bank_superclass> banks) -->
12 <!-- A special template applyer that is mode aware -->
13 <xsl:template name=
"myApplyTemplate">
15 <xsl:when test=
"$output = 'header'">
16 <xsl:if test=
"$side = 'server'">
17 <xsl:apply-templates mode=
"header-server"/>
19 <xsl:if test=
"$side = 'client'">
20 <xsl:apply-templates mode=
"header-client"/>
23 <xsl:when test=
"$output = 'cpp'">
24 <xsl:if test=
"$side = 'server'">
25 <xsl:apply-templates mode=
"cpp-server"/>
27 <xsl:if test=
"$side = 'client'">
28 <xsl:apply-templates mode=
"cpp-client"/>
34 <!-- some stupide template to remove unwanted text from output -->
35 <xsl:template match=
"text()" mode=
"cpp-server"/>
36 <xsl:template match=
"text()" mode=
"header-server"/>
37 <xsl:template match=
"text()" mode=
"cpp-client"/>
38 <xsl:template match=
"text()" mode=
"header-client"/>
40 <xsl:template match=
"/"><xsl:call-template name=
"myApplyTemplate"/></xsl:template>
42 <!-- ######################################################### -->
43 <!-- ##### Recursive build of full class name ####### -->
44 <!-- ######################################################### -->
45 <xsl:template name=
"makeFullClassName">
46 <xsl:if test=
"name() = 'branch'">
47 <xsl:for-each select=
"..">
48 <xsl:call-template name=
"makeFullClassName"/>
50 <xsl:text>::
</xsl:text><xsl:call-template name=
"makeBranchType"/>
52 <xsl:if test=
"name() = 'database_description'">
53 <xsl:text>CBankAccessor_
</xsl:text><xsl:value-of select=
"$bank"/>
57 <!-- ######################################################### -->
58 <!-- ##### Root template matcher (cpp-server) ####### -->
59 <!-- ######################################################### -->
60 <xsl:template match=
"database_description" mode=
"cpp-server">
61 // Ryzom - MMORPG Framework
<http://dev.ryzom.com/projects/ryzom/
>
62 // Copyright (C)
2010 Winch Gate Property Limited
64 // This program is free software: you can redistribute it and/or modify
65 // it under the terms of the GNU Affero General Public License as
66 // published by the Free Software Foundation, either version
3 of the
67 // License, or (at your option) any later version.
69 // This program is distributed in the hope that it will be useful,
70 // but WITHOUT ANY WARRANTY; without even the implied warranty of
71 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
72 // GNU Affero General Public License for more details.
74 // You should have received a copy of the GNU Affero General Public License
75 // along with this program. If not, see
<http://www.gnu.org/licenses/
>.
77 /////////////////////////////////////////////////////////////////
83 // WARNING : this is a generated file, don't change it !
90 /////////////////////////////////////////////////////////////////
93 #include
"database_<xsl:value-of select="translate($bank, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')
"/>.h"
95 <xsl:for-each select=
"bank_superclass/bank[@name = $bank]">
96 <xsl:variable name=
"bankName" select=
"@name"/>
98 TCDBBank CBankAccessor_
<xsl:value-of select=
"@name"/>::BankTag;
100 <!-- generate root class members-->
101 <xsl:for-each select=
"/*/branch[@bank = $bankName and not(@clientonly)]">
102 <xsl:call-template name=
"makeFullClassName"/><xsl:text> </xsl:text><xsl:for-each select=
".."><xsl:call-template name=
"makeFullClassName"/></xsl:for-each>::_
<xsl:call-template name=
"makeBranchName"/><xsl:if test=
"@count">[
<xsl:value-of select=
"@count"/>]
</xsl:if><xsl:text>;
106 <!-- generate init method -->
107 void CBankAccessor_
<xsl:value-of select=
"@name"/>::init()
109 static bool inited = false;
112 // retreive the bank structure
113 CCDBStructBanks *bank = CCDBStructBanks::instance();
114 BankTag = CCDBStructBanks::readBankName(
"<xsl:value-of select="$bankName
"/>");
116 ICDBStructNode *node;
119 <xsl:for-each select=
"/*/branch[@bank = $bankName and not(@clientonly)]">
120 <xsl:if test=
"not(@count)">
121 node = bank-
>getICDBStructNodeFromName( BankTag,
"<xsl:value-of select="@name
"/>" );
122 nlassert(node != NULL);
123 // call sub branch init
124 _
<xsl:call-template name=
"makeBranchName"/>.init(node);
126 <xsl:if test=
"@count">
127 for (uint i=
0; i
<<xsl:value-of select=
"@count"/>; ++i)
129 node = bank-
>getICDBStructNodeFromName( BankTag, NLMISC::toString(
"<xsl:value-of select="@name
"/>%u", i) );
130 nlassert(node != NULL);
131 // call sub branch init
132 _
<xsl:call-template name=
"makeBranchName"/>[i].init(node, i);
140 <!-- generate inner classes methods -->
141 <xsl:for-each select=
"/*/branch[@bank = $bankName and not(@clientonly)]">
142 <xsl:call-template name=
"branch_cpp"/>
149 <!-- ######################################################### -->
150 <!-- ##### Root template matcher ####### -->
151 <!-- ######################################################### -->
152 <xsl:template match=
"database_description" mode=
"header-server">
154 #ifndef INCLUDED_
<xsl:value-of select=
"concat($filename, '_', $bank)"/>_H
155 #define INCLUDED_
<xsl:value-of select=
"concat($filename, '_', $bank)"/>_H
156 // Ryzom - MMORPG Framework
<http://dev.ryzom.com/projects/ryzom/
>
157 // Copyright (C)
2010 Winch Gate Property Limited
159 // This program is free software: you can redistribute it and/or modify
160 // it under the terms of the GNU Affero General Public License as
161 // published by the Free Software Foundation, either version
3 of the
162 // License, or (at your option) any later version.
164 // This program is distributed in the hope that it will be useful,
165 // but WITHOUT ANY WARRANTY; without even the implied warranty of
166 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
167 // GNU Affero General Public License for more details.
169 // You should have received a copy of the GNU Affero General Public License
170 // along with this program. If not, see
<http://www.gnu.org/licenses/
>.
172 /////////////////////////////////////////////////////////////////
178 // WARNING : this is a generated file, don't change it !
185 /////////////////////////////////////////////////////////////////
187 #include
"nel/misc/string_common.h"
188 #include
"cdb_group.h"
189 #include
"player_manager/cdb.h"
190 #include
"player_manager/cdb_synchronised.h"
192 <xsl:for-each select=
"bank_superclass/bank[@name = $bank]">
193 <xsl:for-each select=
"include">
194 #include
"<xsl:value-of select="@file
"/>"
196 <!-- copy any verbatime code -->
197 <xsl:value-of select=
"verbatime"/>
201 #ifndef _SET_PROP_ACCESSOR_
202 #define _SET_PROP_ACCESSOR_
203 inline void _setProp(CCDBSynchronised &db, ICDBStructNode *node, bool value, bool forceSending = false)
205 db.x_setProp(node, uint64(value), forceSending);
207 inline void _setProp(CCDBSynchronised &db, ICDBStructNode *node, uint8 value, bool forceSending = false)
209 db.x_setProp(node, uint64(value), forceSending);
211 inline void _setProp(CCDBSynchronised &db, ICDBStructNode *node, uint16 value, bool forceSending = false)
213 db.x_setProp(node, uint64(value), forceSending);
215 inline void _setProp(CCDBSynchronised &db, ICDBStructNode *node, uint32 value, bool forceSending = false)
217 db.x_setProp(node, uint64(value), forceSending);
219 inline void _setProp(CCDBSynchronised &db, ICDBStructNode *node, uint64 value, bool forceSending = false)
221 db.x_setProp(node, uint64(value), forceSending);
223 inline void _setProp(CCDBSynchronised &db, ICDBStructNode *node, sint8 value, bool forceSending = false)
225 db.x_setProp(node, uint64(value), forceSending);
227 inline void _setProp(CCDBSynchronised &db, ICDBStructNode *node, sint16 value, bool forceSending = false)
229 db.x_setProp(node, uint64(value), forceSending);
231 inline void _setProp(CCDBSynchronised &db, ICDBStructNode *node, sint32 value, bool forceSending = false)
233 db.x_setProp(node, uint64(value), forceSending);
235 inline void _setProp(CCDBSynchronised &db, ICDBStructNode *node, sint64 value, bool forceSending = false)
237 db.x_setProp(node, uint64(value), forceSending);
239 inline void _setProp(CCDBSynchronised &db, ICDBStructNode *node, const std::string &value, bool forceSending = false)
241 db.x_setPropString(node, value, forceSending);
243 inline void _setProp(CCDBSynchronised &db, ICDBStructNode *node, const ucstring &value, bool forceSending = false)
245 db.x_setPropString(node, value, forceSending);
247 inline void _setProp(CCDBSynchronised &db, ICDBStructNode *node, const NLMISC::CSheetId &value, bool forceSending = false)
249 db.x_setProp(node, uint64(value.asInt()), forceSending);
253 inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, bool &value)
255 value = db.x_getProp(node) !=
0;
257 inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, uint8 &value)
259 value = uint8(db.x_getProp(node));
261 inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, uint16 &value)
263 value = uint16(db.x_getProp(node));
265 inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, uint32 &value)
267 value = uint32(db.x_getProp(node));
269 inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, uint64 &value)
271 value = db.x_getProp(node);
273 inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, sint8 &value)
275 value = uint8(db.x_getProp(node));
277 inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, sint16 &value)
279 value = uint16(db.x_getProp(node));
281 inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, sint32 &value)
283 value = uint32(db.x_getProp(node));
285 inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, sint64 &value)
287 value = db.x_getProp(node);
289 inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, std::string &value)
291 value = db.x_getPropString(node);
293 inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, ucstring &value)
295 value = db.x_getPropUcstring(node);
297 inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::CSheetId &value)
299 value = uint32(db.x_getProp(node));
301 #endif // _SET_PROP_ACCESSOR_
304 <xsl:for-each select=
"bank_superclass/bank[@name = $bank]">
305 <xsl:variable name=
"bankName" select=
"@name"/>
306 class CBankAccessor_
<xsl:value-of select=
"@name"/> : public
<xsl:value-of select=
"@class"/>
309 static TCDBBank BankTag;
311 <!-- generate inner classes -->
312 <xsl:for-each select=
"/*/branch[@bank = $bankName and not(@clientonly)]">
313 <xsl:call-template name=
"branch_header"/>
316 <!-- generate branch class instance -->
317 <xsl:for-each select=
"/*/branch[@bank = $bankName and not(@clientonly)]">
318 static
<xsl:call-template name=
"makeBranchType"/> _
<xsl:call-template name=
"makeBranchName"/><xsl:if test=
"@count">[
<xsl:value-of select=
"@count"/>]
</xsl:if><xsl:text>;
325 CBankAccessor_
<xsl:value-of select=
"@name"/>()
327 // make sure the static tree is initialised (some kind of lazy initialisation)
330 // init the base class
331 <xsl:value-of select=
"@class"/>::init(BankTag);
334 <!-- generate init method -->
337 <!-- generate branch accessors -->
338 <xsl:for-each select=
"/*/branch[@bank = $bankName and not(@clientonly)]">
339 <xsl:call-template name=
"branchAccess"/>
344 <xsl:call-template name=
"myApplyTemplate"/>
346 #endif // INCLUDED_
<xsl:value-of select=
"concat($filename, '_', $bank)"/><xsl:text>_H
352 <!-- ######################################################### -->
353 <!-- ##### branch template (header) ####### -->
354 <!-- ######################################################### -->
355 <xsl:template name=
"branch_header" match=
"IDONTKNOWWHATSHOULDGOHERE" mode=
"header-server">
356 <xsl:if test=
"not(@clientonly='1')">
357 class
<xsl:call-template name=
"makeBranchType"/>
360 <!-- generate sub class member -->
361 <xsl:for-each select=
"branch[not(@clientonly)]"><xsl:call-template name=
"branch_header" /></xsl:for-each>
364 ICDBStructNode *_BranchNode;
366 <!-- generate leaf -->
367 <xsl:for-each select=
"leaf[not(@clientonly)]">
368 <xsl:call-template name=
"leaf"/>
371 <!-- generate branch -->
372 <xsl:for-each select=
"branch[not(@clientonly)]">
373 <xsl:call-template name=
"branchInstance"/>
377 void init(ICDBStructNode *parent
<xsl:if test=
"@count">, uint index
</xsl:if>);
379 // accessor to branch node
380 ICDBStructNode *getCDBNode()
385 <!-- generate accessors -->
386 <xsl:for-each select=
"leaf[not(@clientonly)]">
387 <xsl:call-template name=
"leafAccess"/>
389 <xsl:for-each select=
"branch[not(@clientonly)]">
390 <xsl:call-template name=
"branchAccess"/>
396 <!-- ######################################################### -->
397 <!-- ##### branch template (cpp) ####### -->
398 <!-- ######################################################### -->
399 <xsl:template name=
"branch_cpp">
400 <xsl:if test=
"not(@clientonly='1')">
403 <!--ICDBStructNode *<xsl:call-template name="makeFullClassName"/>::_BranchNode;-->
405 <!-- generate class members-->
407 <xsl:for-each select="branch[not(@clientonly)]">
408 <xsl:call-template name="makeFullClassName"/><xsl:text> </xsl:text><xsl:for-each select=".."><xsl:call-template name="makeFullClassName"/></xsl:for-each>::_<xsl:call-template name="makeBranchName"/><xsl:if test="@count">[<xsl:value-of select="@count"/>]</xsl:if><xsl:text>;
411 <xsl:for-each select="leaf[not(@clientonly)]">
412 ICDBStructNode *<xsl:for-each select=".."><xsl:call-template name="makeFullClassName"/>::</xsl:for-each>_<xsl:value-of select="@name"/><xsl:if test="@count">[<xsl:value-of select="@count"/>]</xsl:if><xsl:text>;
417 <!-- generate init method -->
418 void
<xsl:call-template name=
"makeFullClassName"/>::init(ICDBStructNode *parent
<xsl:if test=
"@count">, uint index
</xsl:if>)
420 ICDBStructNode *node = parent;
425 <xsl:for-each select=
"leaf[not(@clientonly)]">
426 <xsl:if test=
"not(@count)">
427 node = parent-
>getNode( ICDBStructNode::CTextId(
"<xsl:value-of select="@name
"/>"), false );
428 nlassert(node != NULL);
429 _
<xsl:value-of select=
"@name"/> = node;
431 <xsl:if test=
"@count">
432 for (uint i=
0; i
<<xsl:value-of select=
"@count"/>; ++i)
434 node = parent-
>getNode( ICDBStructNode::CTextId(NLMISC::toString(
"<xsl:value-of select="@name
"/>%u", i)), false );
435 nlassert(node != NULL);
436 _
<xsl:value-of select=
"@name"/>[i] = node;
442 <xsl:for-each select=
"branch[not(@clientonly)]">
443 <xsl:if test=
"not(@count)">
444 node = parent-
>getNode( ICDBStructNode::CTextId(
"<xsl:value-of select="@name
"/>"), false );
445 nlassert(node != NULL);
446 _
<xsl:call-template name=
"makeBranchName"/>.init(node);
448 <xsl:if test=
"@count">
449 for (uint i=
0; i
<<xsl:value-of select=
"@count"/>; ++i)
451 node = parent-
>getNode( ICDBStructNode::CTextId(NLMISC::toString(
"<xsl:value-of select="@name
"/>%u", i)), false );
452 nlassert(node != NULL);
453 _
<xsl:call-template name=
"makeBranchName"/>[i].init(node, i);
459 <!-- generate inner classes methods -->
460 <xsl:for-each select=
"branch[not(@clientonly)]">
461 <xsl:call-template name=
"branch_cpp"/>
468 <!-- ######################################################### -->
469 <!-- ##### generate branch accessor ###### -->
470 <!-- ######################################################### -->
471 <xsl:template name=
"branchAccess">
472 <xsl:if test=
"not(@count)">
473 <xsl:if test=
"name(..) = 'database_description'">static
</xsl:if><xsl:call-template name=
"makeBranchType"/> &get
<xsl:call-template name=
"makeBranchName"/>()
475 return _
<xsl:call-template name=
"makeBranchName"/>;
478 <xsl:if test=
"@count">
479 <xsl:if test=
"name(..) = 'database_description'">static
</xsl:if><xsl:call-template name=
"makeBranchType"/> &get
<xsl:call-template name=
"makeBranchName"/>(uint32 index)
481 nlassert(index
< <xsl:value-of select=
"@count"/>);
482 return _
<xsl:call-template name=
"makeBranchName"/>[index];
487 <!-- ######################################################### -->
488 <!-- ##### generate leaf accessor ###### -->
489 <!-- ######################################################### -->
490 <xsl:template name=
"leafAccess">
491 <xsl:variable name=
"bankName" select=
"ancestor::*/@bank"/>
492 void set
<xsl:value-of select=
"@name"/>(
<xsl:value-of select=
"/*/bank_superclass/bank[@name = $bankName]/@class"/> &dbGroup,
<xsl:call-template name=
"makeLeafParamType"><xsl:with-param name=
"leafType" select=
"@type"/><xsl:with-param name=
"cppType" select=
"@cppType"/></xsl:call-template> value, bool forceSending = false)
494 <xsl:if test=
"not(@cppType) and not(substring(@type, 2) = '1' or substring(@type, 2) = '8' or substring(@type, 2) = '16' or substring(@type, 2) = '32' or substring(@type, 2) = '64')">
495 <!-- we can only test validity on simple types that are not of standard bit size-->
496 <xsl:if test=
"(substring(@type, 1, 1) = 'I' or substring(@type, 1, 1) = 'U')">
497 <!-- unsigned value -->
498 // Check that the value is not out of database precision
499 STOP_IF(value
> (
1<<<xsl:value-of select=
"substring(@type, 2)"/>)-
1,
"set<xsl:value-of select="@name
"/> : Value out of bound : trying to store "<<value
<<" in a unsigned field limited to <xsl:value-of select="substring(@type,
2)
"/> bits");
501 <xsl:if test=
"substring(@type, 1, 1) = 'S'">
502 <!-- signed value -->
503 // Check that the value is not out of database precision
505 STOP_IF(value
> (
1<<(
<xsl:value-of select=
"substring(@type, 2)"/>-
1))-
1,
"set<xsl:value-of select="@name
"/> : Value out of bound : trying to store "<<value
<<" in a signed field limited to <xsl:value-of select="substring(@type,
2)
"/> bits");
507 STOP_IF(value
< -(
1<<(
<xsl:value-of select=
"substring(@type, 2)"/>-
1)),
"set<xsl:value-of select="@name
"/> : Value out of bound : trying to store "<<value
<<" in a signed field limited to <xsl:value-of select="substring(@type,
2)
"/> bits");
511 _setProp(dbGroup
<xsl:value-of select=
"/*/bank_superclass/bank[@name = $bankName]/@dbAccessor"/>, _
<xsl:value-of select=
"@name"/>, value, forceSending);
514 <xsl:call-template name=
"makeLeafParamType"><xsl:with-param name=
"leafType" select=
"@type"/><xsl:with-param name=
"cppType" select=
"@cppType"/></xsl:call-template> get
<xsl:value-of select=
"@name"/>(const
<xsl:value-of select=
"/*/bank_superclass/bank[@name = $bankName]/@class"/> &dbGroup)
516 <xsl:call-template name=
"makeLeafType"><xsl:with-param name=
"leafType" select=
"@type"/><xsl:with-param name=
"cppType" select=
"@cppType"/></xsl:call-template> value;
517 _getProp(dbGroup
<xsl:value-of select=
"/*/bank_superclass/bank[@name = $bankName]/@dbAccessor"/>, _
<xsl:value-of select=
"@name"/>, value);
521 <xsl:if test=
"@type = 'TEXT'">
522 <!-- generate int accessor for text type -->
523 void set
<xsl:value-of select=
"@name"/>(
<xsl:value-of select=
"/*/bank_superclass/bank[@name = $bankName]/@class"/> &dbGroup, uint32 stringId, bool forceSending = false)
525 _setProp(dbGroup
<xsl:value-of select=
"/*/bank_superclass/bank[@name = $bankName]/@dbAccessor"/>, _
<xsl:value-of select=
"@name"/>, stringId, forceSending);
527 uint32 get
<xsl:value-of select=
"@name"/>_id(const
<xsl:value-of select=
"/*/bank_superclass/bank[@name = $bankName]/@class"/> &dbGroup)
530 _getProp(dbGroup
<xsl:value-of select=
"/*/bank_superclass/bank[@name = $bankName]/@dbAccessor"/>, _
<xsl:value-of select=
"@name"/>, value);
535 ICDBStructNode *get
<xsl:value-of select=
"@name"/>CDBNode()
537 return _
<xsl:value-of select=
"@name"/>;
541 <!-- ######################################################### -->
542 <!-- ##### generate leaf declaration ###### -->
543 <!-- ######################################################### -->
544 <xsl:template name=
"leaf">
545 <xsl:if test=
"@count">
546 <xsl:text>ICDBStructNode *_
</xsl:text><xsl:value-of select=
"@name"/>[
<xsl:value-of select=
"@count"/>];
548 <xsl:if test=
"not(@count)">
549 <xsl:text>ICDBStructNode *_
</xsl:text><xsl:value-of select=
"@name"/>;
553 <!-- ######################################################### -->
554 <!-- ##### generate branch declaration ###### -->
555 <!-- ######################################################### -->
556 <xsl:template name=
"branchInstance">
557 <xsl:if test=
"@count">
558 <xsl:text></xsl:text><xsl:call-template name=
"makeBranchType"/> _
<xsl:call-template name=
"makeBranchName"/>[
<xsl:value-of select=
"@count"/>];
560 <xsl:if test=
"not(@count)">
561 <xsl:text></xsl:text><xsl:call-template name=
"makeBranchType"/> _
<xsl:call-template name=
"makeBranchName"/>;
565 <!-- ################################################################## -->
566 <!-- ##### generate leaf C++ group name (mainly for anonimous group ## -->
567 <!-- ################################################################## -->
568 <xsl:template name=
"makeBranchName">
569 <xsl:if test=
"@name = ''"><xsl:text>Array
</xsl:text></xsl:if>
570 <xsl:if test=
"@name != ''"><xsl:value-of select=
"@name"/></xsl:if>
573 <xsl:template name=
"makeBranchType">
574 <xsl:if test=
"@name = ''"><xsl:text>TArray
</xsl:text></xsl:if>
575 <xsl:if test=
"@name != ''">T
<xsl:value-of select=
"@name"/></xsl:if>
579 <!-- ######################################################### -->
580 <!-- ##### generate leaf C++ convertion ###### -->
581 <!-- ######################################################### -->
583 <xsl:template name=
"convToUint64">
585 <xsl:when test=
"@type = 'TEXT'"> <xsl:text>std::string
</xsl:text></xsl:when>
592 <!-- ######################################################### -->
593 <!-- ##### generate C++ param type ###### -->
594 <!-- ######################################################### -->
595 <xsl:template name=
"makeLeafParamType">
596 <xsl:param name=
"leafType"/>
597 <xsl:param name=
"cppType"/>
599 <xsl:if test=
"$cppType = 'TEXT'"><xsl:text>const
</xsl:text></xsl:if>
600 <xsl:call-template name=
"makeLeafType"><xsl:with-param name=
"leafType" select=
"$leafType"/><xsl:with-param name=
"cppType" select=
"$cppType"/></xsl:call-template>
601 <xsl:if test=
"$cppType = 'TEXT'"><xsl:text> &</xsl:text></xsl:if>
605 <!-- ######################################################### -->
606 <!-- ##### generate leaf C++ type ###### -->
607 <!-- ######################################################### -->
608 <xsl:template name=
"makeLeafType">
609 <xsl:param name=
"leafType"/>
610 <xsl:param name=
"cppType"/>
612 <xsl:if test=
"$cppType"><xsl:value-of select=
"$cppType"/></xsl:if>
613 <xsl:if test=
"not($cppType)">
615 <xsl:when test=
"$leafType = 'I1'"> <xsl:text>bool
</xsl:text> </xsl:when>
616 <xsl:when test=
"$leafType = 'I2'"> <xsl:text>uint8
</xsl:text> </xsl:when>
617 <xsl:when test=
"$leafType = 'I3'"> <xsl:text>uint8
</xsl:text> </xsl:when>
618 <xsl:when test=
"$leafType = 'I4'"> <xsl:text>uint8
</xsl:text> </xsl:when>
619 <xsl:when test=
"$leafType = 'I5'"> <xsl:text>uint8
</xsl:text> </xsl:when>
620 <xsl:when test=
"$leafType = 'I6'"> <xsl:text>uint8
</xsl:text> </xsl:when>
621 <xsl:when test=
"$leafType = 'I7'"> <xsl:text>uint8
</xsl:text> </xsl:when>
622 <xsl:when test=
"$leafType = 'I8'"> <xsl:text>uint8
</xsl:text> </xsl:when>
623 <xsl:when test=
"$leafType = 'I9'"> <xsl:text>uint16
</xsl:text> </xsl:when>
624 <xsl:when test=
"$leafType = 'I10'"> <xsl:text>uint16
</xsl:text> </xsl:when>
625 <xsl:when test=
"$leafType = 'I11'"> <xsl:text>uint16
</xsl:text> </xsl:when>
626 <xsl:when test=
"$leafType = 'I12'"> <xsl:text>uint16
</xsl:text> </xsl:when>
627 <xsl:when test=
"$leafType = 'I13'"> <xsl:text>uint16
</xsl:text> </xsl:when>
628 <xsl:when test=
"$leafType = 'I14'"> <xsl:text>uint16
</xsl:text> </xsl:when>
629 <xsl:when test=
"$leafType = 'I15'"> <xsl:text>uint16
</xsl:text> </xsl:when>
630 <xsl:when test=
"$leafType = 'I16'"> <xsl:text>uint16
</xsl:text> </xsl:when>
631 <xsl:when test=
"$leafType = 'I17'"> <xsl:text>uint32
</xsl:text> </xsl:when>
632 <xsl:when test=
"$leafType = 'I18'"> <xsl:text>uint32
</xsl:text> </xsl:when>
633 <xsl:when test=
"$leafType = 'I19'"> <xsl:text>uint32
</xsl:text> </xsl:when>
634 <xsl:when test=
"$leafType = 'I20'"> <xsl:text>uint32
</xsl:text> </xsl:when>
635 <xsl:when test=
"$leafType = 'I21'"> <xsl:text>uint32
</xsl:text> </xsl:when>
636 <xsl:when test=
"$leafType = 'I22'"> <xsl:text>uint32
</xsl:text> </xsl:when>
637 <xsl:when test=
"$leafType = 'I23'"> <xsl:text>uint32
</xsl:text> </xsl:when>
638 <xsl:when test=
"$leafType = 'I24'"> <xsl:text>uint32
</xsl:text> </xsl:when>
639 <xsl:when test=
"$leafType = 'I25'"> <xsl:text>uint32
</xsl:text> </xsl:when>
640 <xsl:when test=
"$leafType = 'I26'"> <xsl:text>uint32
</xsl:text> </xsl:when>
641 <xsl:when test=
"$leafType = 'I27'"> <xsl:text>uint32
</xsl:text> </xsl:when>
642 <xsl:when test=
"$leafType = 'I28'"> <xsl:text>uint32
</xsl:text> </xsl:when>
643 <xsl:when test=
"$leafType = 'I29'"> <xsl:text>uint32
</xsl:text> </xsl:when>
644 <xsl:when test=
"$leafType = 'I30'"> <xsl:text>uint32
</xsl:text> </xsl:when>
645 <xsl:when test=
"$leafType = 'I31'"> <xsl:text>uint32
</xsl:text> </xsl:when>
646 <xsl:when test=
"$leafType = 'I32'"> <xsl:text>uint32
</xsl:text> </xsl:when>
647 <xsl:when test=
"$leafType = 'I33'"> <xsl:text>uint64
</xsl:text> </xsl:when>
648 <xsl:when test=
"$leafType = 'I34'"> <xsl:text>uint64
</xsl:text> </xsl:when>
649 <xsl:when test=
"$leafType = 'I35'"> <xsl:text>uint64
</xsl:text> </xsl:when>
650 <xsl:when test=
"$leafType = 'I36'"> <xsl:text>uint64
</xsl:text> </xsl:when>
651 <xsl:when test=
"$leafType = 'I37'"> <xsl:text>uint64
</xsl:text> </xsl:when>
652 <xsl:when test=
"$leafType = 'I38'"> <xsl:text>uint64
</xsl:text> </xsl:when>
653 <xsl:when test=
"$leafType = 'I39'"> <xsl:text>uint64
</xsl:text> </xsl:when>
654 <xsl:when test=
"$leafType = 'I40'"> <xsl:text>uint64
</xsl:text> </xsl:when>
655 <xsl:when test=
"$leafType = 'I41'"> <xsl:text>uint64
</xsl:text> </xsl:when>
656 <xsl:when test=
"$leafType = 'I42'"> <xsl:text>uint64
</xsl:text> </xsl:when>
657 <xsl:when test=
"$leafType = 'I43'"> <xsl:text>uint64
</xsl:text> </xsl:when>
658 <xsl:when test=
"$leafType = 'I44'"> <xsl:text>uint64
</xsl:text> </xsl:when>
659 <xsl:when test=
"$leafType = 'I45'"> <xsl:text>uint64
</xsl:text> </xsl:when>
660 <xsl:when test=
"$leafType = 'I46'"> <xsl:text>uint64
</xsl:text> </xsl:when>
661 <xsl:when test=
"$leafType = 'I47'"> <xsl:text>uint64
</xsl:text> </xsl:when>
662 <xsl:when test=
"$leafType = 'I48'"> <xsl:text>uint64
</xsl:text> </xsl:when>
663 <xsl:when test=
"$leafType = 'I49'"> <xsl:text>uint64
</xsl:text> </xsl:when>
664 <xsl:when test=
"$leafType = 'I50'"> <xsl:text>uint64
</xsl:text> </xsl:when>
665 <xsl:when test=
"$leafType = 'I51'"> <xsl:text>uint64
</xsl:text> </xsl:when>
666 <xsl:when test=
"$leafType = 'I52'"> <xsl:text>uint64
</xsl:text> </xsl:when>
667 <xsl:when test=
"$leafType = 'I53'"> <xsl:text>uint64
</xsl:text> </xsl:when>
668 <xsl:when test=
"$leafType = 'I54'"> <xsl:text>uint64
</xsl:text> </xsl:when>
669 <xsl:when test=
"$leafType = 'I55'"> <xsl:text>uint64
</xsl:text> </xsl:when>
670 <xsl:when test=
"$leafType = 'I56'"> <xsl:text>uint64
</xsl:text> </xsl:when>
671 <xsl:when test=
"$leafType = 'I57'"> <xsl:text>uint64
</xsl:text> </xsl:when>
672 <xsl:when test=
"$leafType = 'I58'"> <xsl:text>uint64
</xsl:text> </xsl:when>
673 <xsl:when test=
"$leafType = 'I59'"> <xsl:text>uint64
</xsl:text> </xsl:when>
674 <xsl:when test=
"$leafType = 'I59'"> <xsl:text>uint64
</xsl:text> </xsl:when>
675 <xsl:when test=
"$leafType = 'I60'"> <xsl:text>uint64
</xsl:text> </xsl:when>
676 <xsl:when test=
"$leafType = 'I61'"> <xsl:text>uint64
</xsl:text> </xsl:when>
677 <xsl:when test=
"$leafType = 'I62'"> <xsl:text>uint64
</xsl:text> </xsl:when>
678 <xsl:when test=
"$leafType = 'I63'"> <xsl:text>uint64
</xsl:text> </xsl:when>
679 <xsl:when test=
"$leafType = 'I64'"> <xsl:text>uint64
</xsl:text> </xsl:when>
680 <xsl:when test=
"$leafType = 'S1'"> <xsl:text>sint8
</xsl:text> </xsl:when>
681 <xsl:when test=
"$leafType = 'S2'"> <xsl:text>sint8
</xsl:text> </xsl:when>
682 <xsl:when test=
"$leafType = 'S3'"> <xsl:text>sint8
</xsl:text> </xsl:when>
683 <xsl:when test=
"$leafType = 'S4'"> <xsl:text>sint8
</xsl:text> </xsl:when>
684 <xsl:when test=
"$leafType = 'S5'"> <xsl:text>sint8
</xsl:text> </xsl:when>
685 <xsl:when test=
"$leafType = 'S6'"> <xsl:text>sint8
</xsl:text> </xsl:when>
686 <xsl:when test=
"$leafType = 'S7'"> <xsl:text>sint8
</xsl:text> </xsl:when>
687 <xsl:when test=
"$leafType = 'S8'"> <xsl:text>sint8
</xsl:text> </xsl:when>
688 <xsl:when test=
"$leafType = 'S9'"> <xsl:text>sint16
</xsl:text> </xsl:when>
689 <xsl:when test=
"$leafType = 'S10'"> <xsl:text>sint16
</xsl:text> </xsl:when>
690 <xsl:when test=
"$leafType = 'S11'"> <xsl:text>sint16
</xsl:text> </xsl:when>
691 <xsl:when test=
"$leafType = 'S12'"> <xsl:text>sint16
</xsl:text> </xsl:when>
692 <xsl:when test=
"$leafType = 'S13'"> <xsl:text>sint16
</xsl:text> </xsl:when>
693 <xsl:when test=
"$leafType = 'S14'"> <xsl:text>sint16
</xsl:text> </xsl:when>
694 <xsl:when test=
"$leafType = 'S15'"> <xsl:text>sint16
</xsl:text> </xsl:when>
695 <xsl:when test=
"$leafType = 'S16'"> <xsl:text>sint16
</xsl:text> </xsl:when>
696 <xsl:when test=
"$leafType = 'S17'"> <xsl:text>sint32
</xsl:text> </xsl:when>
697 <xsl:when test=
"$leafType = 'S18'"> <xsl:text>sint32
</xsl:text> </xsl:when>
698 <xsl:when test=
"$leafType = 'S19'"> <xsl:text>sint32
</xsl:text> </xsl:when>
699 <xsl:when test=
"$leafType = 'S20'"> <xsl:text>sint32
</xsl:text> </xsl:when>
700 <xsl:when test=
"$leafType = 'S21'"> <xsl:text>sint32
</xsl:text> </xsl:when>
701 <xsl:when test=
"$leafType = 'S22'"> <xsl:text>sint32
</xsl:text> </xsl:when>
702 <xsl:when test=
"$leafType = 'S23'"> <xsl:text>sint32
</xsl:text> </xsl:when>
703 <xsl:when test=
"$leafType = 'S24'"> <xsl:text>sint32
</xsl:text> </xsl:when>
704 <xsl:when test=
"$leafType = 'S25'"> <xsl:text>sint32
</xsl:text> </xsl:when>
705 <xsl:when test=
"$leafType = 'S26'"> <xsl:text>sint32
</xsl:text> </xsl:when>
706 <xsl:when test=
"$leafType = 'S27'"> <xsl:text>sint32
</xsl:text> </xsl:when>
707 <xsl:when test=
"$leafType = 'S28'"> <xsl:text>sint32
</xsl:text> </xsl:when>
708 <xsl:when test=
"$leafType = 'S29'"> <xsl:text>sint32
</xsl:text> </xsl:when>
709 <xsl:when test=
"$leafType = 'S30'"> <xsl:text>sint32
</xsl:text> </xsl:when>
710 <xsl:when test=
"$leafType = 'S31'"> <xsl:text>sint32
</xsl:text> </xsl:when>
711 <xsl:when test=
"$leafType = 'S32'"> <xsl:text>sint32
</xsl:text> </xsl:when>
712 <xsl:when test=
"$leafType = 'S33'"> <xsl:text>sint64
</xsl:text> </xsl:when>
713 <xsl:when test=
"$leafType = 'S34'"> <xsl:text>sint64
</xsl:text> </xsl:when>
714 <xsl:when test=
"$leafType = 'S35'"> <xsl:text>sint64
</xsl:text> </xsl:when>
715 <xsl:when test=
"$leafType = 'S36'"> <xsl:text>sint64
</xsl:text> </xsl:when>
716 <xsl:when test=
"$leafType = 'S37'"> <xsl:text>sint64
</xsl:text> </xsl:when>
717 <xsl:when test=
"$leafType = 'S38'"> <xsl:text>sint64
</xsl:text> </xsl:when>
718 <xsl:when test=
"$leafType = 'S39'"> <xsl:text>sint64
</xsl:text> </xsl:when>
719 <xsl:when test=
"$leafType = 'S40'"> <xsl:text>sint64
</xsl:text> </xsl:when>
720 <xsl:when test=
"$leafType = 'S41'"> <xsl:text>sint64
</xsl:text> </xsl:when>
721 <xsl:when test=
"$leafType = 'S42'"> <xsl:text>sint64
</xsl:text> </xsl:when>
722 <xsl:when test=
"$leafType = 'S43'"> <xsl:text>sint64
</xsl:text> </xsl:when>
723 <xsl:when test=
"$leafType = 'S44'"> <xsl:text>sint64
</xsl:text> </xsl:when>
724 <xsl:when test=
"$leafType = 'S45'"> <xsl:text>sint64
</xsl:text> </xsl:when>
725 <xsl:when test=
"$leafType = 'S46'"> <xsl:text>sint64
</xsl:text> </xsl:when>
726 <xsl:when test=
"$leafType = 'S47'"> <xsl:text>sint64
</xsl:text> </xsl:when>
727 <xsl:when test=
"$leafType = 'S48'"> <xsl:text>sint64
</xsl:text> </xsl:when>
728 <xsl:when test=
"$leafType = 'S49'"> <xsl:text>sint64
</xsl:text> </xsl:when>
729 <xsl:when test=
"$leafType = 'S50'"> <xsl:text>sint64
</xsl:text> </xsl:when>
730 <xsl:when test=
"$leafType = 'S51'"> <xsl:text>sint64
</xsl:text> </xsl:when>
731 <xsl:when test=
"$leafType = 'S52'"> <xsl:text>sint64
</xsl:text> </xsl:when>
732 <xsl:when test=
"$leafType = 'S53'"> <xsl:text>sint64
</xsl:text> </xsl:when>
733 <xsl:when test=
"$leafType = 'S54'"> <xsl:text>sint64
</xsl:text> </xsl:when>
734 <xsl:when test=
"$leafType = 'S55'"> <xsl:text>sint64
</xsl:text> </xsl:when>
735 <xsl:when test=
"$leafType = 'S56'"> <xsl:text>sint64
</xsl:text> </xsl:when>
736 <xsl:when test=
"$leafType = 'S57'"> <xsl:text>sint64
</xsl:text> </xsl:when>
737 <xsl:when test=
"$leafType = 'S58'"> <xsl:text>sint64
</xsl:text> </xsl:when>
738 <xsl:when test=
"$leafType = 'S59'"> <xsl:text>sint64
</xsl:text> </xsl:when>
739 <xsl:when test=
"$leafType = 'S59'"> <xsl:text>sint64
</xsl:text> </xsl:when>
740 <xsl:when test=
"$leafType = 'S60'"> <xsl:text>sint64
</xsl:text> </xsl:when>
741 <xsl:when test=
"$leafType = 'S61'"> <xsl:text>sint64
</xsl:text> </xsl:when>
742 <xsl:when test=
"$leafType = 'S62'"> <xsl:text>sint64
</xsl:text> </xsl:when>
743 <xsl:when test=
"$leafType = 'S63'"> <xsl:text>sint64
</xsl:text> </xsl:when>
744 <xsl:when test=
"$leafType = 'S64'"> <xsl:text>sint64
</xsl:text> </xsl:when>
746 <xsl:when test=
"$leafType = 'TEXT'"> <xsl:text>ucstring
</xsl:text> </xsl:when>
747 <xsl:otherwise> <xsl:message terminate=
"yes">Unsupported leaf type
<xsl:value-of select=
"$leafType"/></xsl:message></xsl:otherwise>