Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
davmac314 committed Sep 12, 2024
1 parent 0a0dff7 commit af98edc
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 10 deletions.
2 changes: 1 addition & 1 deletion doc/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ should generally unmask them after forking a child process.
class my_child_proc_watcher : public loop_t::child_proc_watcher<my_child_proc_watcher>
{
public:
rearm status_change(loop_t &, pid_t child, int status)
rearm status_change(loop_t &, pid_t child, proc_status_t status)
{
return rearm::DISARM; // or REMOVE, REMOVED, NOOP
}
Expand Down
44 changes: 44 additions & 0 deletions doc/html/child_proc_watcher.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ <h2>Members</h2>
<h3>Types</h3>
<ul>
<li><i class="code-name">event_loop_t</i> &mdash; the event loop type that this watcher registers with.</li>
<li><a href="#proc_status_t"><i class="code-name">proc_status_t</i></a> &mdash; status information about a watched proces.</i>
</ul>

<h3>Constructors</h3>
Expand Down Expand Up @@ -168,4 +169,47 @@ <h2>Details and Usage</h2>
<p>A <i class="code-name">child_proc_watcher_impl</i> instantiation has no public or protected members, other than
those inherited from <i class="code-name">child_proc_watcher</i>, which it publicly derives from.</p>

<hr>


<h2 id="proc_status_t">proc_status_t</h2>

<p><b>Brief</b>: The <i class="code-name">proc_status_t</i> class wraps information about the
(termination) status of a watched process.</p>

<p><span class="note"><i>Note:</i> this may be a typedef'd alias of another type internal to Dasynq.</span></p>

<h2>Members</h2>

<div class="small-indent">
<h3>Constructors</h3>
<ul>
<li><i class="code-name">proc_status_t() noexcept</i> &mdash; default constructor; contents unspecified</li>
<li><i class="code-name">proc_status_t(const proc_status_t &) noexcept</i> &mdash; copy constructor</li>
</ul>

<h3>Functions</h3>
<ul>
<li><i class="code-name">proc_status_t &operator=(const proc_status_t &) noexcept</i>
<br>&mdash; assignment</li>
<li><i class="code-name">bool did_exit() noexcept</i>
<br>&mdash; whether the process terminated normally</li>
<li><i class="code-name">bool did_exit_clean() noexcept</i>
<br>&mdash; whether the process terminated normally, with an exit status of 0</li>
<li><i class="code-name">bool was_signalled() noexcept</i>
<br>&mdash; whether the process was terminated via a signal</li>
<li><i class="code-name">int get_exit_status() noexcept</i>
<br>&mdash; if the process exited normally, the exit status it returned; otherwise unspecified</li>
<li><i class="code-name">int get_signal() noexcept</i>
<br>&mdash; if the process was terminated via a signal, the relevant signal number; otherwise unspecified</li>
</ul>

</div>

<h2>Details and Usage</h2>

<p>The <i class="code-name">proc_status_t</i> class is a straight-forward wrapper around process
status information. For convenience, a default constructor, copy constructor and assignment operator
are provided.</p>

</div></body></html>
2 changes: 1 addition & 1 deletion doc/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="content">
<h1>Dasynq manual</h1>

This is the manual for the <b>Dasynq</b> event loop library (version 1.2.5).
This is the manual for the <b>Dasynq</b> event loop library (version 2.0).

<ul>
<li><a href="#intro">Introduction</a></l1>
Expand Down
18 changes: 10 additions & 8 deletions include/dasynq/childproc.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,17 @@ class proc_status {
int wait_si_status; // exit status as per exit(...), or signal number

public:
proc_status() {}
proc_status(int wait_si_code, int wait_si_status)
proc_status() noexcept {}
proc_status(int wait_si_code, int wait_si_status) noexcept
: wait_si_code(wait_si_code), wait_si_status(wait_si_status) {}

bool did_exit() { return wait_si_code == CLD_EXITED; }
bool did_exit_clean() { return wait_si_status == 0; }
bool was_signalled() { return !did_exit(); }
int get_exit_status() { return wait_si_status; }
int get_signal() { return wait_si_status; }
proc_status(const proc_status &) noexcept = default;
proc_status &operator=(const proc_status &) noexcept = default;

bool did_exit() noexcept { return wait_si_code == CLD_EXITED; }
bool did_exit_clean() noexcept { return wait_si_status == 0; }
bool was_signalled() noexcept { return !did_exit(); }
int get_exit_status() noexcept { return wait_si_status; }
int get_signal() noexcept { return wait_si_status; }
};

} // namespace dprivate
Expand Down

0 comments on commit af98edc

Please sign in to comment.