-
Notifications
You must be signed in to change notification settings - Fork 13
Add strongly typed messages in protocol #114
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
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
061a36c
Validate in messgen-generate to avoid duplication
fa1feb7
Make cpp-generator conformant with clang format
b6e5750
Add type validation to avoid clashing hashes
cf985d8
Introduce type hashing in the model
c3b4845
Fix serialization / deserialization in dynamic
a22c670
Improve exception info in dynamic protocol
8e98541
Expose converter and type_hash
860c985
Introduce convenience overloads for serialization
a957f9b
Return type_hash on serialization / deserialization
e2b99a3
Improve converters to allow external usage
4e315ab
Improve naming in dynamic port
bc32333
Do not return type_hash from proto serialization
5648b0d
Add message descriptions to test protos
e3feb29
Introduce protocol message model type
42980c9
Seems members_of can be consteval
c9bce28
Remove unused code
45aa8c9
Rename member to member_variable
773c919
Cpp: generate msg structs instead of TYPE_ID var
00d0e9a
Remove spare print
94cdc9d
Make protocol message inherit from types
9ded34c
Better template parameter names
59cd0de
Test base aggregate initialization
91a98a9
Hash in dec is more useful
58a6b9f
Make concept stick with clang
c35d3a3
Make concept stick with clang
fcfaef1
Make message aliases more distinct
c39d2b2
Dispatch message since it inherits from type
ea9453b
Further improve message concept
c447316
Add protocol serialization fix and test
db8e934
Initialized base subobject explicitely
5321568
Remove double braces around scalar init
ce7b29c
Add MessageSerializer for more ergonomic API
2be9f08
TYPE_ID -> MESSAGE_ID in proto
ee2511a
Better names for dynamic.Codec member functions
3fcbf7f
Hash in dec is more debuggable
5cd89c6
More type annotations
a898471
Rename TypeSerializer to TypeConverter
6aebd71
Add Makefile
597280c
Update README
d441877
Consisent yaml formatting in README
lachem 5426bc4
Fix merge issue
e630c80
Type ID -> Message ID in readme
b818537
Fix ts_generator
4922c95
Restore json generator
a03446a
Js will be updated in a separate PR
2a7ae74
Restore .gitignore
lachem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| ROOT_DIR ?= $(realpath $(PWD)) | ||
| BUILD_DIR ?= $(ROOT_DIR)/build | ||
| BUILD_TYPE ?= Debug | ||
|
|
||
| all: check | ||
|
|
||
| configure: | ||
| cmake -B${BUILD_DIR} -S. -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_BUILD_TYPE=${BUILD_TYPE} | ||
|
|
||
| build: configure | ||
| cmake --build ${BUILD_DIR} | ||
|
|
||
| test: build | ||
| ctest --test-dir ${BUILD_DIR}/tests/ --output-on-failure | ||
| python3 -m pytest . | ||
|
|
||
| check: test | ||
| python3 -m mypy . | ||
|
|
||
| clean: | ||
| rm -rf ${BUILD_DIR} | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generating types and protocols maybe?