Skip to content

Instantly share code, notes, and snippets.

Created Jul 23, 2020
What would you like to do?
meander nested capture
{:opnname (m/some ?opnname)
:name (m/some (m/app name ?prmname))
:ctype (m/some {:ctuid {:ctypeName ?prmtypename}})}
[[:litFld "prtId" (m/app str* ["GraphDataGetId(\"" ?opnname "." ?prmname "\")"])]
[:litFld "prtName" (m/app str* ["\"" ?prmname "\""])]
[:litFld "prtType" "EGraphPinType::CompParm"]]]
;; Node
{:nodename (m/some ?opnname)
:prmins (m/some [!prmin ...])
:prmouts (m/some [!prmout ...])}
[[:litFld "nodeId" (m/app str* ["GraphDataGetId(\"" ?opnname "\")"])]
[:litFld "nodeName" (m/app str* ["\"" ?opnname "\""])]
[:litFld "nodeVizTID" "EOpnodeVizTID::OpNode"]
[:litFld "inPorts"
[(m/cata (m/app (fn [prmblk] (assoc prmblk :opnname ?opnname)) !prmin)) ...]
[:litFld "outPorts"
[(m/cata (m/app (fn [prmblk] (assoc prmblk :opnname ?opnname)) !prmout)) ...]
;; Link
{:src (m/some ?lnkSrc)
:dst (m/some ?lnkDst)}
[[:litFld "linkId" (m/app str* ["GraphDataGetId(\"" ?lnkSrc "->" ?lnkDst "\")"])]
[:litFld "srcPrtId" (m/app str* ["GraphDataGetId(\"" ?lnkSrc "\")"])]
[:litFld "dstPrtId" (m/app str* ["GraphDataGetId(\"" ?lnkDst "\")"])]
[:litFld "linkType" "EGraphEdgeType::Data"]]]
;; NodeGraphDbc
{:nodeBindings (m/some [!nodeBind ...])
:linkBindings (m/some [!lnkBind ...])}
[:litStructBlk "NodeGraph_dbc"
[[:litFld "nodeBindings"
[(m/cata !nodeBind) ...]]]
[:litFld "linkBindings"
[:litBlk [(m/cata !lnkBind) ...]]]]]
{:opnodes (m/some [{:opnodename !opnodename
:opdef {:oprmblkdef {:inputs !prmins
:outputs !prmouts}}}
{:nodeBindings [{:nodename (m/app name !opnodename)
:prmins !prmins
:prmouts !prmouts} ...]
:linkBindings [{:src "mynodeA.argout0"
:dst "mynodeB.argin0"}]}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment