Vuo  2.3.2
VuoCompilerNode.hh
Go to the documentation of this file.
1 
10 #pragma once
11 
12 #include "VuoBaseDetail.hh"
13 
19 class VuoCompilerType;
20 class VuoNode;
21 class VuoPort;
22 
26 class VuoCompilerNode : public VuoBaseDetail<VuoNode>
27 {
28 private:
29  VuoCompilerInstanceData *instanceData;
30  string graphvizIdentifier;
31  VuoCompilerConstantsCache *constantsCache;
32  size_t indexInOrderedNodes;
33 
34  CallInst * generateFunctionCall(Function *functionSrc, Module *module, BasicBlock *block, Value *compositionStateValue, Value *nodeContextValue,
35  const map<VuoCompilerEventPort *, Value *> &portContextForEventPort = (map<VuoCompilerEventPort *, Value *>()));
36  bool isArgumentInFunction(VuoCompilerNodeArgument *argument, Function *function);
37  size_t getArgumentIndexInFunction(VuoCompilerNodeArgument *argument, Function *function);
38  bool isUnloweredStructPointerParameter(VuoCompilerInputData *inputData, Function *function);
39 
40 public:
41  VuoCompilerNode(VuoNode *baseNode);
42  void setIndexInOrderedNodes(size_t indexInOrderedNodes);
43  size_t getIndexInOrderedNodes(void);
44  void setConstantsCache(VuoCompilerConstantsCache *constantsCache);
45  Value * generateIdentifierValue(Module *module);
46  Value * generateSubcompositionIdentifierValue(Module *module, BasicBlock *block, Value *compositionIdentifierValue);
47  Value * generateGetContext(Module *module, BasicBlock *block, Value *compositionStateValue);
48  void generateAddMetadata(Module *module, BasicBlock *block, Value *compositionStateValue, const vector<VuoCompilerType *> &orderedTypes, Function *compositionCreateContextForNode, Function *compositionSetPortValueFunction, Function *compositionGetPortValueFunction, Function *compositionFireTriggerPortEventFunction, Function *compositionReleasePortDataFunction);
49  Value * generateCreateContext(Module *module, BasicBlock *block);
50  void generateEventFunctionCall(Module *module, Function *function, BasicBlock *&currentBlock, Value *compositionStateValue);
51  void generateInitFunctionCall(Module *module, BasicBlock *block, Value *compositionStateValue);
52  void generateFiniFunctionCall(Module *module, BasicBlock *block, Value *compositionStateValue);
53  void generateCallbackStartFunctionCall(Module *module, BasicBlock *block, Value *compositionStateValue);
54  void generateCallbackUpdateFunctionCall(Module *module, BasicBlock *block, Value *compositionStateValue);
55  void generateCallbackStopFunctionCall(Module *module, BasicBlock *block, Value *compositionStateValue);
56  Value * generateReceivedEventCondition(Module *module, BasicBlock *block, Value *nodeContextValue);
57  Value * generateReceivedEventCondition(Module *module, BasicBlock *block, Value *nodeContextValue, vector<VuoPort *> selectedInputPorts,
58  const map<VuoCompilerEventPort *, Value *> &portContextForEventPort = (map<VuoCompilerEventPort *, Value *>()));
60  string getIdentifier(void);
61  string getGraphvizIdentifierPrefix(void);
62  void setGraphvizIdentifier(string graphvizIdentifier);
63  string getGraphvizIdentifier(void);
64  string getGraphvizDeclaration(bool shouldPrintPosition = false, double xPositionOffset = 0, double yPositionOffset = 0, VuoPort *manuallyFirableInputPort = nullptr);
65 };