Glue generator produces a binding headers for connecting the MATIEC Structured Text to C application code to the OpenPLC runtime. More...
Classes | |
struct | IecVar |
Defines the information we need about a particular variable in order to generate the glue structures. More... | |
Functions | |
void | findPositions (const char *varName, uint16_t *pos1, uint16_t *pos2) |
const char * | fromDirectionFlag (const char flag) |
const char * | fromSizeFlag (const char flag) |
void | generateBody (istream &locatedVars, ostream &glueVars, md5_byte_t digest[16]) |
void | generateBoolGroups (ostream &glueVars, char direction, map< uint16_t, array< string, 8 >> &items) |
void | generateBoolGroups (ostream &glueVars, list< IecVar > &all_vars) |
Generate the boolean groups structures. More... | |
void | generateBottom (ostream &glueVars) |
void | generateChecksum (ostream &glueVars, md5_byte_t digest[16]) |
void | generateHeader (ostream &glueVars) |
Write the header to the output stream. More... | |
void | generateIntegratedGlue (ostream &glueVars, const list< IecVar > &all_vars) |
void | glueVar (ostream &glueVars, const char *varName, uint16_t pos1, uint16_t pos2) |
int | main (int argc, char *argv[]) |
int | mainImpl (int argc, char const *const *argv) |
This is our main function. More... | |
int | parseIecVars (istream &locatedVars, char *varName, char *varType, md5_state_s &md5_state) |
Glue generator produces a binding headers for connecting the MATIEC Structured Text to C application code to the OpenPLC runtime.
void findPositions | ( | const char * | varName, |
uint16_t * | pos1, | ||
uint16_t * | pos2 | ||
) |
Definition at line 237 of file glue_generator.cpp.
const char* fromDirectionFlag | ( | const char | flag | ) |
Definition at line 325 of file glue_generator.cpp.
const char* fromSizeFlag | ( | const char | flag | ) |
Definition at line 336 of file glue_generator.cpp.
void generateBody | ( | istream & | locatedVars, |
ostream & | glueVars, | ||
md5_byte_t | digest[16] | ||
) |
Definition at line 476 of file glue_generator.cpp.
void generateBoolGroups | ( | ostream & | glueVars, |
char | direction, | ||
map< uint16_t, array< string, 8 >> & | items | ||
) |
Definition at line 354 of file glue_generator.cpp.
void generateBoolGroups | ( | ostream & | glueVars, |
list< IecVar > & | all_vars | ||
) |
Generate the boolean groups structures.
These structures contain boolean values that are grouped together. For example, IX0.0 and IX0.1 are generated as a group and then that group is referred to from the integrated glue. This function generates the definitions of the bool groups.
Definition at line 383 of file glue_generator.cpp.
void generateBottom | ( | ostream & | glueVars | ) |
Definition at line 464 of file glue_generator.cpp.
void generateChecksum | ( | ostream & | glueVars, |
md5_byte_t | digest[16] | ||
) |
Definition at line 525 of file glue_generator.cpp.
void generateHeader | ( | ostream & | glueVars | ) |
Write the header to the output stream.
The header is common among all glueVars files.
glueVars | The output stream to write to. |
Definition at line 54 of file glue_generator.cpp.
void generateIntegratedGlue | ( | ostream & | glueVars, |
const list< IecVar > & | all_vars | ||
) |
Definition at line 441 of file glue_generator.cpp.
void glueVar | ( | ostream & | glueVars, |
const char * | varName, | ||
uint16_t | pos1, | ||
uint16_t | pos2 | ||
) |
Definition at line 263 of file glue_generator.cpp.
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 598 of file glue_generator.cpp.
int mainImpl | ( | int | argc, |
char const *const * | argv | ||
) |
This is our main function.
We define it with a different name and then call it from the main function so that we can mock it for the purpose of testing.
Definition at line 544 of file glue_generator.cpp.
int parseIecVars | ( | istream & | locatedVars, |
char * | varName, | ||
char * | varType, | ||
md5_state_s & | md5_state | ||
) |
Definition at line 204 of file glue_generator.cpp.