Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update apidocs #79

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions barkeep/barkeep.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class AsyncDisplay {

protected:
/// Render a display: animation, progress bar, etc.
/// @return Number of \n characters in the display.
/// @return Number of `\n` characters in the display.
virtual long render_(const std::string& end = " ") = 0;

virtual Duration default_interval_() const = 0;
Expand All @@ -169,7 +169,7 @@ class AsyncDisplay {

protected:
/// Display the message to output stream.
/// @return Number of \n characters in the message.
/// @return Number of `\n` characters in the message.
long render_message_() const {
if (not message_.empty()) { *out_ << message_ << " "; }
return std::count(message_.begin(), message_.end(), '\n');
Expand Down
11 changes: 8 additions & 3 deletions docs/api/Classes/classbarkeep_1_1_animation.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Inherits from [`barkeep::AsyncDisplay`](api/Classes/classbarkeep_1_1_async_displ

| | Name |
| -------------- | -------------- |
| <span class="codey"> virtual void </span>| <span class="codey"> **[render_](api/Classes/classbarkeep_1_1_animation.md#function-render_)**() override</span><br>Render a display: animation, progress bar, etc. |
| <span class="codey"> virtual long </span>| <span class="codey"> **[render_](api/Classes/classbarkeep_1_1_animation.md#function-render_)**(const std::string & end = " ") override</span><br>Render a display: animation, progress bar, etc. |
| <span class="codey"> virtual [Duration](api/Namespaces/namespacebarkeep.md#using-duration) </span>| <span class="codey"> **[default_interval_](api/Classes/classbarkeep_1_1_animation.md#function-default_interval_)**() const override</span> |


Expand Down Expand Up @@ -74,7 +74,7 @@ Inherits from [`barkeep::AsyncDisplay`](api/Classes/classbarkeep_1_1_async_displ
| | Name |
| -------------- | -------------- |
| <span class="codey">void </span>| <span class="codey">**[display_](api/Classes/classbarkeep_1_1_async_display.md#function-display_)**()</span><br>Display everything (message, maybe with animation, progress bar, etc). |
| <span class="codey">void </span>| <span class="codey">**[render_message_](api/Classes/classbarkeep_1_1_async_display.md#function-render_message_)**() const</span><br>Display the message to output stream. |
| <span class="codey">long </span>| <span class="codey">**[render_message_](api/Classes/classbarkeep_1_1_async_display.md#function-render_message_)**() const</span><br>Display the message to output stream. |
| <span class="codey">virtual void </span>| <span class="codey">**[start](api/Classes/classbarkeep_1_1_async_display.md#function-start)**()</span><br>Start the display but do not show. This typically means start measuring speed if applicable, without displaying anything. |
| <span class="codey">virtual void </span>| <span class="codey">**[join](api/Classes/classbarkeep_1_1_async_display.md#function-join)**()</span><br>Join the display thread. Protected because python bindings need to override to handle GIL. |
| <span class="codey">void </span>| <span class="codey">**[ensure_not_running](api/Classes/classbarkeep_1_1_async_display.md#function-ensure_not_running)**() const</span> |
Expand All @@ -93,6 +93,7 @@ Inherits from [`barkeep::AsyncDisplay`](api/Classes/classbarkeep_1_1_async_displ
| <span class="codey">std::condition_variable </span>| <span class="codey">**[completion_](api/Classes/classbarkeep_1_1_async_display.md#variable-completion_)** </span> |
| <span class="codey">std::mutex </span>| <span class="codey">**[completion_m_](api/Classes/classbarkeep_1_1_async_display.md#variable-completion_m_)** </span> |
| <span class="codey">std::atomic< bool > </span>| <span class="codey">**[complete_](api/Classes/classbarkeep_1_1_async_display.md#variable-complete_)** </span> |
| <span class="codey">long </span>| <span class="codey">**[last_num_newlines_](api/Classes/classbarkeep_1_1_async_display.md#variable-last_num_newlines_)** </span> |
| <span class="codey">[Duration](api/Namespaces/namespacebarkeep.md#using-duration) </span>| <span class="codey">**[interval_](api/Classes/classbarkeep_1_1_async_display.md#variable-interval_)** </span> |
| <span class="codey">std::string </span>| <span class="codey">**[message_](api/Classes/classbarkeep_1_1_async_display.md#variable-message_)** </span> |
| <span class="codey">std::string </span>| <span class="codey">**[format_](api/Classes/classbarkeep_1_1_async_display.md#variable-format_)** </span> |
Expand Down Expand Up @@ -179,11 +180,15 @@ inline virtual std::unique_ptr< AsyncDisplay > clone() const override
### function `render_`

```cpp
inline virtual void render_() override
inline virtual long render_(
const std::string & end = " "
) override
```

Render a display: animation, progress bar, etc.

**Return**: Number of `\n` characters in the display.

**Reimplements**: [`barkeep::AsyncDisplay::render_`](api/Classes/classbarkeep_1_1_async_display.md#function-render_)


Expand Down
22 changes: 18 additions & 4 deletions docs/api/Classes/classbarkeep_1_1_async_display.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ Inherited by [`barkeep::Animation`](api/Classes/classbarkeep_1_1_animation.md),

| | Name |
| -------------- | -------------- |
| <span class="codey"> virtual void </span>| <span class="codey"> **[render_](api/Classes/classbarkeep_1_1_async_display.md#function-render_)**() = 0</span><br>Render a display: animation, progress bar, etc. |
| <span class="codey"> virtual long </span>| <span class="codey"> **[render_](api/Classes/classbarkeep_1_1_async_display.md#function-render_)**(const std::string & end = " ") = 0</span><br>Render a display: animation, progress bar, etc. |
| <span class="codey"> virtual [Duration](api/Namespaces/namespacebarkeep.md#using-duration) </span>| <span class="codey"> **[default_interval_](api/Classes/classbarkeep_1_1_async_display.md#function-default_interval_)**() const = 0</span> |
| <span class="codey"> void </span>| <span class="codey"> **[display_](api/Classes/classbarkeep_1_1_async_display.md#function-display_)**()</span><br>Display everything (message, maybe with animation, progress bar, etc). |
| <span class="codey"> void </span>| <span class="codey"> **[render_message_](api/Classes/classbarkeep_1_1_async_display.md#function-render_message_)**() const</span><br>Display the message to output stream. |
| <span class="codey"> long </span>| <span class="codey"> **[render_message_](api/Classes/classbarkeep_1_1_async_display.md#function-render_message_)**() const</span><br>Display the message to output stream. |
| <span class="codey"> virtual void </span>| <span class="codey"> **[start](api/Classes/classbarkeep_1_1_async_display.md#function-start)**()</span><br>Start the display but do not show. This typically means start measuring speed if applicable, without displaying anything. |
| <span class="codey"> virtual void </span>| <span class="codey"> **[join](api/Classes/classbarkeep_1_1_async_display.md#function-join)**()</span><br>Join the display thread. Protected because python bindings need to override to handle GIL. |
| <span class="codey"> void </span>| <span class="codey"> **[ensure_not_running](api/Classes/classbarkeep_1_1_async_display.md#function-ensure_not_running)**() const</span> |
Expand All @@ -54,6 +54,7 @@ Inherited by [`barkeep::Animation`](api/Classes/classbarkeep_1_1_animation.md),
| <span class="codey"> std::condition_variable </span> | <span class="codey"> **[completion_](api/Classes/classbarkeep_1_1_async_display.md#variable-completion_)**</span> |
| <span class="codey"> std::mutex </span> | <span class="codey"> **[completion_m_](api/Classes/classbarkeep_1_1_async_display.md#variable-completion_m_)**</span> |
| <span class="codey"> std::atomic< bool > </span> | <span class="codey"> **[complete_](api/Classes/classbarkeep_1_1_async_display.md#variable-complete_)**</span> |
| <span class="codey"> long </span> | <span class="codey"> **[last_num_newlines_](api/Classes/classbarkeep_1_1_async_display.md#variable-last_num_newlines_)**</span> |
| <span class="codey"> [Duration](api/Namespaces/namespacebarkeep.md#using-duration) </span> | <span class="codey"> **[interval_](api/Classes/classbarkeep_1_1_async_display.md#variable-interval_)**</span> |
| <span class="codey"> std::string </span> | <span class="codey"> **[message_](api/Classes/classbarkeep_1_1_async_display.md#variable-message_)**</span> |
| <span class="codey"> std::string </span> | <span class="codey"> **[format_](api/Classes/classbarkeep_1_1_async_display.md#variable-format_)**</span> |
Expand Down Expand Up @@ -151,11 +152,15 @@ virtual std::unique_ptr< AsyncDisplay > clone() const = 0
### function `render_`

```cpp
virtual void render_() = 0
virtual long render_(
const std::string & end = " "
) = 0
```

Render a display: animation, progress bar, etc.

**Return**: Number of `\n` characters in the display.

**Reimplemented by**: [`barkeep::Animation::render_`](api/Classes/classbarkeep_1_1_animation.md#function-render_), [`barkeep::Composite::render_`](api/Classes/classbarkeep_1_1_composite.md#function-render_), [`barkeep::Counter::render_`](api/Classes/classbarkeep_1_1_counter.md#function-render_), [`barkeep::ProgressBar::render_`](api/Classes/classbarkeep_1_1_progress_bar.md#function-render_)


Expand All @@ -180,11 +185,13 @@ Display everything (message, maybe with animation, progress bar, etc).
### function `render_message_`

```cpp
inline void render_message_() const
inline long render_message_() const
```

Display the message to output stream.

**Return**: Number of `\n` characters in the message.

### function `start`

```cpp
Expand Down Expand Up @@ -248,6 +255,13 @@ std::atomic< bool > complete_ = false;
```


### variable `last_num_newlines_`

```cpp
long last_num_newlines_ = 0;
```


### variable `interval_`

```cpp
Expand Down
44 changes: 32 additions & 12 deletions docs/api/Classes/classbarkeep_1_1_composite.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Inherits from [`barkeep::AsyncDisplay`](api/Classes/classbarkeep_1_1_async_displ

| | Name |
| -------------- | -------------- |
| <span class="codey"> </span>| <span class="codey"> **[Composite](api/Classes/classbarkeep_1_1_composite.md#function-composite)**(std::unique_ptr< [AsyncDisplay](api/Classes/classbarkeep_1_1_async_display.md) > left, std::unique_ptr< [AsyncDisplay](api/Classes/classbarkeep_1_1_async_display.md) > right)</span> |
| <span class="codey"> template <typename... Displays\> <br></span>| <span class="codey"> **[Composite](api/Classes/classbarkeep_1_1_composite.md#function-composite)**(const [AsyncDisplay](api/Classes/classbarkeep_1_1_async_display.md) & head, const Displays &... tail)</span><br>Variadic constructor to combine multiple displays into a [Composite](api/Classes/classbarkeep_1_1_composite.md). |
| <span class="codey"> template <typename... Displays\> <br></span>| <span class="codey"> **[Composite](api/Classes/classbarkeep_1_1_composite.md#function-composite)**(std::string delim, const Displays &... displays)</span><br>Constructor to combine multiple displays into a [Composite](api/Classes/classbarkeep_1_1_composite.md) with a delimiter. |
| <span class="codey"> </span>| <span class="codey"> **[Composite](api/Classes/classbarkeep_1_1_composite.md#function-composite)**(const [Composite](api/Classes/classbarkeep_1_1_composite.md) & other)</span><br>Copy constructor clones child displays. |
| <span class="codey"> </span>| <span class="codey"> **[~Composite](api/Classes/classbarkeep_1_1_composite.md#function-~composite)**()</span> |
| <span class="codey"> virtual std::unique_ptr< [AsyncDisplay](api/Classes/classbarkeep_1_1_async_display.md) > </span>| <span class="codey"> **[clone](api/Classes/classbarkeep_1_1_composite.md#function-clone)**() const override</span> |
Expand All @@ -28,7 +29,7 @@ Inherits from [`barkeep::AsyncDisplay`](api/Classes/classbarkeep_1_1_async_displ

| | Name |
| -------------- | -------------- |
| <span class="codey"> virtual void </span>| <span class="codey"> **[render_](api/Classes/classbarkeep_1_1_composite.md#function-render_)**() override</span><br>Render a display: animation, progress bar, etc. |
| <span class="codey"> virtual long </span>| <span class="codey"> **[render_](api/Classes/classbarkeep_1_1_composite.md#function-render_)**(const std::string & end = " ") override</span><br>Render a display: animation, progress bar, etc. |
| <span class="codey"> virtual [Duration](api/Namespaces/namespacebarkeep.md#using-duration) </span>| <span class="codey"> **[default_interval_](api/Classes/classbarkeep_1_1_composite.md#function-default_interval_)**() const override</span> |
| <span class="codey"> virtual void </span>| <span class="codey"> **[start](api/Classes/classbarkeep_1_1_composite.md#function-start)**() override</span><br>Start the display but do not show. This typically means start measuring speed if applicable, without displaying anything. |

Expand All @@ -41,8 +42,8 @@ Inherits from [`barkeep::AsyncDisplay`](api/Classes/classbarkeep_1_1_async_displ

| | Name |
| -------------- | -------------- |
| <span class="codey"> std::unique_ptr< [AsyncDisplay](api/Classes/classbarkeep_1_1_async_display.md) > </span> | <span class="codey"> **[left_](api/Classes/classbarkeep_1_1_composite.md#variable-left_)**</span> |
| <span class="codey"> std::unique_ptr< [AsyncDisplay](api/Classes/classbarkeep_1_1_async_display.md) > </span> | <span class="codey"> **[right_](api/Classes/classbarkeep_1_1_composite.md#variable-right_)**</span> |
| <span class="codey"> std::string </span> | <span class="codey"> **[delim_](api/Classes/classbarkeep_1_1_composite.md#variable-delim_)**</span> |
| <span class="codey"> std::vector< std::unique_ptr< [AsyncDisplay](api/Classes/classbarkeep_1_1_async_display.md) > > </span> | <span class="codey"> **[displays_](api/Classes/classbarkeep_1_1_composite.md#variable-displays_)**</span> |


</span>
Expand Down Expand Up @@ -75,7 +76,7 @@ Inherits from [`barkeep::AsyncDisplay`](api/Classes/classbarkeep_1_1_async_displ
| | Name |
| -------------- | -------------- |
| <span class="codey">void </span>| <span class="codey">**[display_](api/Classes/classbarkeep_1_1_async_display.md#function-display_)**()</span><br>Display everything (message, maybe with animation, progress bar, etc). |
| <span class="codey">void </span>| <span class="codey">**[render_message_](api/Classes/classbarkeep_1_1_async_display.md#function-render_message_)**() const</span><br>Display the message to output stream. |
| <span class="codey">long </span>| <span class="codey">**[render_message_](api/Classes/classbarkeep_1_1_async_display.md#function-render_message_)**() const</span><br>Display the message to output stream. |
| <span class="codey">virtual void </span>| <span class="codey">**[join](api/Classes/classbarkeep_1_1_async_display.md#function-join)**()</span><br>Join the display thread. Protected because python bindings need to override to handle GIL. |
| <span class="codey">void </span>| <span class="codey">**[ensure_not_running](api/Classes/classbarkeep_1_1_async_display.md#function-ensure_not_running)**() const</span> |

Expand All @@ -93,6 +94,7 @@ Inherits from [`barkeep::AsyncDisplay`](api/Classes/classbarkeep_1_1_async_displ
| <span class="codey">std::condition_variable </span>| <span class="codey">**[completion_](api/Classes/classbarkeep_1_1_async_display.md#variable-completion_)** </span> |
| <span class="codey">std::mutex </span>| <span class="codey">**[completion_m_](api/Classes/classbarkeep_1_1_async_display.md#variable-completion_m_)** </span> |
| <span class="codey">std::atomic< bool > </span>| <span class="codey">**[complete_](api/Classes/classbarkeep_1_1_async_display.md#variable-complete_)** </span> |
| <span class="codey">long </span>| <span class="codey">**[last_num_newlines_](api/Classes/classbarkeep_1_1_async_display.md#variable-last_num_newlines_)** </span> |
| <span class="codey">[Duration](api/Namespaces/namespacebarkeep.md#using-duration) </span>| <span class="codey">**[interval_](api/Classes/classbarkeep_1_1_async_display.md#variable-interval_)** </span> |
| <span class="codey">std::string </span>| <span class="codey">**[message_](api/Classes/classbarkeep_1_1_async_display.md#variable-message_)** </span> |
| <span class="codey">std::string </span>| <span class="codey">**[format_](api/Classes/classbarkeep_1_1_async_display.md#variable-format_)** </span> |
Expand All @@ -107,12 +109,26 @@ Inherits from [`barkeep::AsyncDisplay`](api/Classes/classbarkeep_1_1_async_displ
### function `Composite`

```cpp
template <typename... Displays>
inline Composite(
std::unique_ptr< AsyncDisplay > left,
std::unique_ptr< AsyncDisplay > right
const AsyncDisplay & head,
const Displays &... tail
)
```

Variadic constructor to combine multiple displays into a [Composite](api/Classes/classbarkeep_1_1_composite.md).

### function `Composite`

```cpp
template <typename... Displays>
inline Composite(
std::string delim,
const Displays &... displays
)
```

Constructor to combine multiple displays into a [Composite](api/Classes/classbarkeep_1_1_composite.md) with a delimiter.

### function `Composite`

Expand Down Expand Up @@ -146,11 +162,15 @@ inline virtual std::unique_ptr< AsyncDisplay > clone() const override
### function `render_`

```cpp
inline virtual void render_() override
inline virtual long render_(
const std::string & end = " "
) override
```

Render a display: animation, progress bar, etc.

**Return**: Number of `\n` characters in the display.

**Reimplements**: [`barkeep::AsyncDisplay::render_`](api/Classes/classbarkeep_1_1_async_display.md#function-render_)


Expand All @@ -177,17 +197,17 @@ Start the display but do not show. This typically means start measuring speed if

## Protected Attributes Documentation

### variable `left_`
### variable `delim_`

```cpp
std::unique_ptr< AsyncDisplay > left_;
std::string delim_ = " ";
```


### variable `right_`
### variable `displays_`

```cpp
std::unique_ptr< AsyncDisplay > right_;
std::vector< std::unique_ptr< AsyncDisplay > > displays_;
```


Expand Down
Loading
Loading