Bryan Fok
Bryan Fok

Reputation: 3487

visual studio comment generate tool

I wonder what tool could generate comment like this in visual studio? Especially the capability of create the diagram like the comment shown at below.

//
//  +---------------+
//  |               |
//  | start_connect |<---+
//  |               |    |
//  +---------------+    |
//           |           |
//  async_-  |    +----------------+
// connect() |    |                |
//           +--->| handle_connect |
//                |                |
//                +----------------+
//                          :
// Once a connection is     :
// made, the connect        :
// actor forks in two -     :
//                          :
// an actor for reading     :       and an actor for
// inbound messages:        :       sending heartbeats:
//                          :
//  +------------+          :          +-------------+
//  |            |<- - - - -+- - - - ->|             |
//  | start_read |                     | start_write |<---+
//  |            |<---+                |             |    |
//  +------------+    |                +-------------+    | async_wait()
//          |         |                        |          |
//  async_- |    +-------------+       async_- |    +--------------+
//   read_- |    |             |       write() |    |              |
//  until() +--->| handle_read |               +--->| handle_write |
//               |             |                    |              |
//               +-------------+                    +--------------+
//

Upvotes: 5

Views: 912

Answers (1)

David Titarenco
David Titarenco

Reputation: 33386

I doubt you'll find anything that integrates in Visual Studio, but you may be interested in AsciiFlow, an online ASCII flow-chart generator (that you can copy-paste in your comments).

With that said, what you have up there is essentially architectural documentation. This kind of broad-stroke documentation should (almost) never be a part of comments. Comments should be brief, concise and to the point (especially if working in a team). For more information read one of the many resources out there (one of the popular ones around here is the Google C++ Style Guide).

Flow-charts and the like are much better suited as a part of some sort of auxiliary documentation (like a design document or an API documentation) that is wholly human-readable - not buried deep in source files.

Upvotes: 5

Related Questions