Covalent Bond  0.0.1-alpha
'covalent bond' is a data middle office. As a 2022-2023 Fall SWE final project.
api.hpp
Go to the documentation of this file.
1 
11 #ifndef __SERVER_API_HPP_
12 #define __SERVER_API_HPP_
13 
14 #include "wfrest/HttpMsg.h"
15 #ifdef _WIN32
16 #if _MSC_VER > 1000
17 #pragma once
18 #endif
19 #endif
20 
21 #if defined(__unix__) && defined(__clang__)
22 #pragma once
23 #endif
24 
25 #include "../pch.hpp"
26 
27 #include <wfrest/json.hpp>
28 
29 #include "task/cbComputeGraph.hpp"
31 using namespace wfrest;
32 namespace cb {
33 namespace apiCPP {
34 
35 cb::graph::cbComputeGraph* addGraph(int32_t idx, const std::string& cmd,
37 
38 } // namespace apiCPP
39 } // namespace cb
40 
41 namespace cb {
42 namespace trans {
43 struct opMapStruct {
44  int nodeCode = 0;
45  std::vector<int> inputNodeCode;
46  int inputNum = 0;
47  int inputNumNow = 0;
48  int posy = 0;
49 };
50 struct leafMapStruct {
51  int nodeCode = 0;
52  int posy = 0;
53 };
54 
55 void outbase(HttpResp* resp);
57  trivial::cbMySqlDevice* leafNode);
58 void createOpNode(HttpResp* resp, cb::trans::opMapStruct& opMapStruct);
59 void createFinNode(int posy, int opCodeNow, HttpResp* resp);
60 void Node_leaf_connect(int nodeleftnum, int noderightnum, int nowinputsnum, HttpResp* resp);
61 void Node_op_connect(int nodeleftnum, int nowinputsnum, HttpResp* resp);
62 void outbaseo(HttpResp* resp);
63 } // namespace trans
64 } // namespace cb
65 #endif //! __SERVER_API_HPP_
cb::graph::cbComputeGraph
Definition: cbComputeGraph.hpp:342
cb::trans::createOpNode
void createOpNode(HttpResp *resp, cb::trans::opMapStruct &opMapStruct)
Definition: api.cpp:76
cb::trans::outbaseo
void outbaseo(HttpResp *resp)
Definition: api.cpp:139
cb::trans::createLeafNode
void createLeafNode(HttpResp *resp, cb::trans::leafMapStruct &leafMapStruct, trivial::cbMySqlDevice *leafNode)
Definition: api.cpp:38
cb::trans::createFinNode
void createFinNode(int posy, int opCodeNow, HttpResp *resp)
Definition: api.cpp:104
cb::trans::Node_op_connect
void Node_op_connect(int nodeleftnum, int nowinputsnum, HttpResp *resp)
Definition: api.cpp:132
cb::trans::opMapStruct::inputNodeCode
std::vector< int > inputNodeCode
Definition: api.hpp:45
cb
_WIN32
Definition: api.cpp:4
cb::trans::Node_leaf_connect
void Node_leaf_connect(int nodeleftnum, int noderightnum, int nowinputsnum, HttpResp *resp)
Definition: api.cpp:126
cb::trans::opMapStruct
Definition: api.hpp:43
cbComputeGraph.hpp
The compute graph(DAG), a prepared graph for task flow to execute. It works as a state machine.
trivial::cbVirtualDeviceManager
Definition: cbVirtualDevice.hpp:260
cbVirtualDevice.hpp
abstract virtual device. Provide MySql/Redis/Kafka warper. All virtual device will handle the connect...
trivial::cbMySqlDevice
Definition: cbVirtualDevice.hpp:95
cb::trans::outbase
void outbase(HttpResp *resp)
Definition: api.cpp:20
cb::trans::leafMapStruct
Definition: api.hpp:50
cb::apiCPP::addGraph
cb::graph::cbComputeGraph * addGraph(int32_t idx, const std::string &cmd, trivial::cbVirtualDeviceManager *vdm)
Definition: api.cpp:7