Skip to content

add mermaid diagram to README #61

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

Merged
merged 3 commits into from
Aug 2, 2023
Merged
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
30 changes: 29 additions & 1 deletion doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,32 @@ binding according to the `free_interface` abstract interface defined in
`sp_resource_m`. The user-defined `free` subroutine must free the associated
resource, which usually means deallocating the associated memory.

![smart-pointers-class-diagram](https://user-images.githubusercontent.com/13108868/192410592-19c6e194-ac3e-4f5c-a308-33b2e10d69a7.png)
```mermaid
---
title: Smart Pointers Class Diagram
---
classDiagram

class sp_resource_t {
free()
}
<<Abstract>> sp_resource_t
sp_resource_t--*sp_reference_counter_t

class sp_reference_counter_t {
-count_: integer, pointer
-object_: sp_resource_t
grab()
release()
}
sp_reference_counter_t--*sp_smart_pointer_t

class sp_smart_pointer_t {
-counter_:counter_t
release_handle()
start_counter()
}
<<Abstract>> sp_smart_pointer_t
sp_smart_pointer_t--|>sp_resource_t

```