Skip to content

Commit 6331bcc

Browse files
authored
Merge pull request #3 from Serial-IO/2-add-support-for-sequential-execution
Add sequential execution support for serial interface functions
2 parents f01cbfb + 5122982 commit 6331bcc

28 files changed

+782
-40
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/doxygen.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: 'Generate & Deploy Doxygen Docs'
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'include/**'
8+
- 'Doxyfile'
9+
- '.github/workflows/doxygen.yml'
10+
workflow_dispatch:
11+
12+
# Required for GitHub Pages deployment
13+
permissions:
14+
contents: write
15+
pages: write
16+
id-token: write
17+
18+
jobs:
19+
build-docs:
20+
runs-on: ubuntu-latest
21+
name: 'Build Doxygen HTML'
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v3
25+
26+
- name: Install Doxygen + Graphviz
27+
run: |
28+
sudo apt-get update -qq
29+
sudo apt-get install -y doxygen graphviz
30+
31+
- name: Generate documentation
32+
run: |
33+
doxygen -v
34+
doxygen Doxyfile
35+
36+
- name: Upload Pages artifact
37+
uses: actions/upload-pages-artifact@v3
38+
with:
39+
path: docs/html
40+
41+
deploy:
42+
needs: build-docs
43+
runs-on: ubuntu-latest
44+
name: 'Deploy to GitHub Pages'
45+
steps:
46+
- name: Deploy
47+
id: deployment
48+
uses: actions/deploy-pages@v4

Doxyfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#--------------------------------------------------------------------------
2+
# Doxyfile – generated for cpp-core
3+
#--------------------------------------------------------------------------
4+
5+
# Project related --------------------------------------------------------
6+
PROJECT_NAME = "cpp-core"
7+
PROJECT_BRIEF = "Header-only C++ helper library"
8+
PROJECT_NUMBER = "1.0"
9+
OUTPUT_DIRECTORY = docs/html
10+
CREATE_SUBDIRS = NO
11+
12+
# Build options ----------------------------------------------------------
13+
EXTRACT_ALL = YES
14+
EXTRACT_PRIVATE = YES
15+
EXTRACT_STATIC = YES
16+
EXTRACT_ANON_NSPACES = YES
17+
18+
# Source files -----------------------------------------------------------
19+
INPUT = include README.md LICENSE
20+
FILE_PATTERNS = *.h *.hpp *.md
21+
RECURSIVE = YES
22+
23+
# HTML output ------------------------------------------------------------
24+
GENERATE_HTML = YES
25+
HTML_OUTPUT = .
26+
HTML_COLORSTYLE_HUE = 220
27+
HTML_COLORSTYLE_SAT = 100
28+
HTML_COLORSTYLE_GAMMA = 80
29+
30+
# Disable unwanted output -----------------------------------------------
31+
GENERATE_LATEX = NO
32+
GENERATE_MAN = NO
33+
GENERATE_RTF = NO
34+
GENERATE_XML = NO
35+
36+
# Diagrams --------------------------------------------------------------
37+
HAVE_DOT = YES
38+
DOT_IMAGE_FORMAT = svg
39+
CALL_GRAPH = YES
40+
CALLER_GRAPH = YES
41+
42+
# Misc ------------------------------------------------------------------
43+
FULL_PATH_NAMES = NO
44+
STRIP_FROM_PATH = include
45+
GENERATE_TREEVIEW = YES

include/cpp_core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*/
1414

1515
#include "cpp_core/error_callback.h"
16+
#include "cpp_core/interface/sequential.h"
1617
#include "cpp_core/serial.h"
1718
#include "cpp_core/status_codes.h"
1819
#include "cpp_core/version.h"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#pragma once
2+
3+
// Sequential wrappers
4+
#include "sequential/serial_abort_read_sequential.h"
5+
#include "sequential/serial_abort_write_sequential.h"
6+
#include "sequential/serial_clear_buffer_in_sequential.h"
7+
#include "sequential/serial_clear_buffer_out_sequential.h"
8+
#include "sequential/serial_close_sequential.h"
9+
#include "sequential/serial_drain_sequential.h"
10+
#include "sequential/serial_in_bytes_total_sequential.h"
11+
#include "sequential/serial_in_bytes_waiting_sequential.h"
12+
#include "sequential/serial_out_bytes_total_sequential.h"
13+
#include "sequential/serial_out_bytes_waiting_sequential.h"
14+
#include "sequential/serial_read_line_sequential.h"
15+
#include "sequential/serial_read_sequential.h"
16+
#include "sequential/serial_read_until_sequence_sequential.h"
17+
#include "sequential/serial_read_until_sequential.h"
18+
#include "sequential/serial_write_sequential.h"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#pragma once
2+
3+
#include "../../error_callback.h"
4+
#include "../../internal/sequential/call.h"
5+
#include "../serial_abort_read.h"
6+
7+
#ifdef __cplusplus
8+
extern "C"
9+
{
10+
#endif
11+
12+
/**
13+
* @copydoc serialAbortRead
14+
* @note Sequential variant: guarantees execution in the exact order the calls were made across threads.
15+
*/
16+
inline MODULE_API auto serialAbortReadSequential(
17+
int64_t handle,
18+
ErrorCallbackT error_callback = nullptr
19+
) -> int
20+
{
21+
return cpp_core::internal::sequential::call(handle, [=] { return serialAbortRead(handle, error_callback); });
22+
}
23+
24+
#ifdef __cplusplus
25+
}
26+
#endif
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#pragma once
2+
3+
#include "../../error_callback.h"
4+
#include "../../internal/sequential/call.h"
5+
#include "../serial_abort_write.h"
6+
7+
#ifdef __cplusplus
8+
extern "C"
9+
{
10+
#endif
11+
12+
/**
13+
* @copydoc serialAbortWrite
14+
* @note Sequential variant: guarantees execution in the exact order the calls were made across threads.
15+
*/
16+
inline MODULE_API auto serialAbortWriteSequential(
17+
int64_t handle,
18+
ErrorCallbackT error_callback = nullptr
19+
) -> int
20+
{
21+
return cpp_core::internal::sequential::call(handle, [=] { return serialAbortWrite(handle, error_callback); });
22+
}
23+
24+
#ifdef __cplusplus
25+
}
26+
#endif
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#pragma once
2+
3+
#include "../../error_callback.h"
4+
#include "../../internal/sequential/call.h"
5+
#include "../serial_clear_buffer_in.h"
6+
7+
#ifdef __cplusplus
8+
extern "C"
9+
{
10+
#endif
11+
12+
/**
13+
* @copydoc serialClearBufferIn
14+
* @note Sequential variant: guarantees execution in the exact order the calls were made across threads.
15+
*/
16+
inline MODULE_API auto serialClearBufferInSequential(
17+
int64_t handle,
18+
ErrorCallbackT error_callback = nullptr
19+
) -> int
20+
{
21+
return cpp_core::internal::sequential::call(handle, [=] {
22+
return serialClearBufferIn(handle, error_callback);
23+
});
24+
}
25+
26+
#ifdef __cplusplus
27+
}
28+
#endif
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#pragma once
2+
3+
#include "../../error_callback.h"
4+
#include "../../internal/sequential/call.h"
5+
#include "../serial_clear_buffer_out.h"
6+
7+
#ifdef __cplusplus
8+
extern "C"
9+
{
10+
#endif
11+
12+
/**
13+
* @copydoc serialClearBufferOut
14+
* @note Sequential variant: guarantees execution in the exact order the calls were made across threads.
15+
*/
16+
inline MODULE_API auto serialClearBufferOutSequential(
17+
int64_t handle,
18+
ErrorCallbackT error_callback = nullptr
19+
) -> int
20+
{
21+
return cpp_core::internal::sequential::call(handle, [=] {
22+
return serialClearBufferOut(handle, error_callback);
23+
});
24+
}
25+
26+
#ifdef __cplusplus
27+
}
28+
#endif
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#pragma once
2+
3+
#include "../../error_callback.h"
4+
#include "../../internal/sequential/call.h"
5+
#include "../serial_close.h"
6+
7+
#ifdef __cplusplus
8+
extern "C"
9+
{
10+
#endif
11+
12+
/**
13+
* @copydoc serialClose
14+
* @note Sequential variant: guarantees execution in the exact order the calls were made across threads.
15+
*/
16+
inline MODULE_API auto serialCloseSequential(
17+
int64_t handle,
18+
ErrorCallbackT error_callback = nullptr
19+
) -> int
20+
{
21+
return cpp_core::internal::sequential::call(handle, [=] { return serialClose(handle, error_callback); });
22+
}
23+
24+
#ifdef __cplusplus
25+
}
26+
#endif

0 commit comments

Comments
 (0)