Vuo  2.3.2
VuoNodeAndPortIdentifierCache.hh
Go to the documentation of this file.
1 
10 #pragma once
11 
12 #include <mutex>
13 class VuoComposition;
14 class VuoNode;
15 class VuoPort;
16 class VuoPublishedPort;
17 
22 {
23 public:
25  void addNodeToCache(VuoNode *node);
26  void addPublishedPortToCache(VuoPublishedPort *publishedPort);
27  void clearCache(void);
28  bool doForNodeWithIdentifier(const string &identifier, std::function<void(VuoNode *)> callback);
29  bool doForPortWithIdentifier(const string &identifier, std::function<void(VuoPort *)> callback);
30  string getIdentifierForPort(VuoPort *port);
31 
32 private:
33  void addNodeToCache_internal(VuoNode *node);
34  void addPortToCache_internal(VuoPort *port, VuoNode *node = nullptr);
35 
36  map<string, VuoNode *> nodeWithGraphvizIdentifier;
37  map<string, VuoPort *> portWithStaticIdentifier;
38  map<VuoPort *, string> staticIdentifierForPort;
39 
40  std::mutex mapMutex;
41 };