C++
C++ language is supported since version 3.3.0
To define C++ as the target language in a template file :
#set( $env.language = 'C++' )
The information below shows the behavior of the generator when C++ is the current target language. For a detailed description of type conversion, see the generated documentation :
https://www.telosys.org/doc/latest/languages/language-c++.html
The table below describes how model neutral types are automatically converted to C++ types with potential impact due to annotations (@UnsignedType, @NotNull, @PrimitiveType, @ObjectType)
Model type | C++ type | with annotation |
---|---|---|
string | string | |
byte | char unsigned char | @UnsignedType |
short | short unsigned short | @UnsignedType |
int | int unsigned int | @UnsignedType |
long | long unsigned long | @UnsignedType |
decimal | double | |
float | float | |
double | double | |
boolean | bool | |
date | std::tm | |
time | | |
timestamp | | |
binary | | |
- @UnsignedType has effect only for char, short, int, long
- @NotNull has no effect
- @PrimitiveType no effect
- @ObjectType no effect
- $attribute.fullType no effect
- $attribute.simpleType no effect
- $attribute.wrapperType no effect
So, for C++ you can always use the basic "$attribute.type"
C++ literal | |
---|---|
TRUE | true |
FALSE | false |
NULL | NULL |
Below some examples of literal values generated for each type :
Model type | C++ type | C++ literal value |
---|---|---|
string | string | "AAA" |
byte | char unsigned char | 1 |
short | short unsigned short | 1 |
int | int unsigned int | 100 |
long | long unsigned long | 1000 |
decimal | double | 10000.77 |
float | float | 1000.5 |
double | double | 1000.66 |
boolean | bool | true or false |
date | std::tm | NULL |
time | | NULL |
timestamp | | NULL |
binary | | NULL |
Last modified 1mo ago