-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAppend.cpp
43 lines (32 loc) · 1.18 KB
/
Append.cpp
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
#include "Append.h"
using namespace Operator;
std::string _Append::getCode() {
std::stringstream stream;
stream << _newDatatype->getDeclaration() << std::endl
<< _newDatatype->getVariableIdentifier() << " = " << _initializationValue << ";" << std::endl
<< "{yield}";
return stream.str();
}
std::shared_ptr<_Schema> _Append::getOutputSchema() {
auto outputVariables = _inputSchema->getVariables();
outputVariables.push_back(_newDatatype);
return Schema(outputVariables);
}
std::set<std::string> _Append::getHeaders() {
return {};
}
std::string _AppendTimestamp::getCode() {
std::stringstream stream;
stream << _timestamp->getDeclaration() << std::endl
<< _timestamp->getVariableIdentifier() << " = getCurrentUnixTimestampInMilliseconds();" << std::endl
<< "{yield}";
return stream.str();
}
std::shared_ptr<_Schema> _AppendTimestamp::getOutputSchema() {
auto outputVariables = _inputSchema->getVariables();
outputVariables.push_back(_timestamp);
return Schema(outputVariables);
}
std::set<std::string> _AppendTimestamp::getHeaders() {
return {"\"../../generated_code_libraries/Timestamp.h\""};
}