-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathc-util-generator.h
51 lines (39 loc) · 1.33 KB
/
c-util-generator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once
#include <memory>
#include "types/message.h"
#include "fs-creator.h"
#include "filewriter.h"
#include "conditional-tree.h"
class CiUtilGenerator {
public:
CiUtilGenerator();
void Clear();
// msgs - the whole list of messages in CAN matrix
// fsd - file and names descriptor
// groups - collection of msg IDs assigned to available groups (rx, tx, both)
// the output of this function source files which contain:
// - global TX and RX typedefs message struct
// - function to Unpack incoming frame to dedicated RX message struct field
// - optional (through define in global "dbccodeconf.hpp") variable allocation in source files
//
void Generate(DbcMessageList_t& dlist, const AppSettings_t& fsd,
const MsgsClassification& groups, const std::string& drvname);
private:
void PrintHeader();
void PrintSource();
ConditionalTree_t* FillTreeLevel(std::vector<MessageDescriptor_t*>& msgs,
int32_t l, int32_t h, bool started = false);
private:
std::vector<MessageDescriptor_t*> tx;
std::vector<MessageDescriptor_t*> rx;
std::vector<MessageDescriptor_t*> both;
// to file writer
FileWriter tof;
ConditionalTree condtree;
std::string code_drvname;
std::string file_drvname;
const FsDescriptor_t* fdesc;
const GenDescriptor_t* gdesc;
const DbcMessageList_t* p_dlist;
bool treestarted;
};