1digraph g 2{ 3 graph 4 [ 5 nodesep="0.2" 6 ]; 7 8 edge 9 [ 10 fontname="Helvetica", 11 fontsize=10, 12 labelfontname="Helvetica", 13 labelfontsize=10 14 ]; 15 16 node 17 [ 18 fontname="Helvetica", 19 fontsize=10, 20 shape=box 21 ]; 22 23 edge 24 [ 25 arrowhead="open" 26 ] 27 28 // Program elements. 29 { 30 operating_system [ label="Operating System", shape=ellipse ]; 31 io_context [ label="I/O Execution Context\ne.g. io_context" ]; 32 io_object [ label="I/O Object\ne.g. socket" ]; 33 your_program [ label="Your Program" ]; 34 your_completion_handler [ label="Your Completion Handler" ]; 35 } 36 37 // Owning relationships. 38 { 39 edge [ arrowtail="diamond" ]; 40 your_program:e -> your_completion_handler:n; 41 your_program:w -> io_object:nw; 42 your_program:se -> io_context:ne; 43 } 44 45 // Non-owning relationships; 46 { 47 io_object:sw -> io_context:w; 48 } 49 50 // Visible actions. 51 { 52 edge [ style="dashed", color="#808080" ]; 53 54 // Forward actions. 55 { 56 your_program:sw -> io_object:n [ label="1" ]; 57 io_object:s -> io_context:nw [ label="2" ]; 58 io_context:s -> operating_system:n [ label="3" ]; 59 } 60 } 61 62 // Invisible actions. 63 { 64 edge [ style="invis" ]; 65 66 // Forward actions. 67 { 68 your_program:s -> io_context:n [ label="5" ]; 69 } 70 71 // Reverse actions. 72 { 73 edge [ arrowhead="none", arrowtail="open" ]; 74 //io_context:s -> operating_system:n [ label="4" ]; 75 your_completion_handler:s -> io_context:e [ label="6" ]; 76 } 77 } 78} 79