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