Skip to content

Commit

Permalink
Merge pull request #51 from vkottler/dev/3.1.0
Browse files Browse the repository at this point in the history
3.1.0 - Re-structure for more bit-field methods
  • Loading branch information
vkottler authored Oct 16, 2023
2 parents 752ad86 + 7db4614 commit 4c41eea
Show file tree
Hide file tree
Showing 15 changed files with 477 additions and 248 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
- run: |
mk python-release owner=vkottler \
repo=ifgen version=3.0.1
repo=ifgen version=3.1.0
if: |
matrix.python-version == '3.11'
&& matrix.system == 'ubuntu-latest'
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
=====================================
generator=datazen
version=3.1.4
hash=e2d67bfd7efcf9a8fd101e9a24006e5a
hash=81700982f3f009c9782a7d73261925b4
=====================================
-->

# ifgen ([3.0.1](https://pypi.org/project/ifgen/))
# ifgen ([3.1.0](https://pypi.org/project/ifgen/))

[![python](https://img.shields.io/pypi/pyversions/ifgen.svg)](https://pypi.org/project/ifgen/)
![Build Status](https://github.com/vkottler/ifgen/workflows/Python%20Package/badge.svg)
Expand Down
4 changes: 2 additions & 2 deletions ifgen/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# =====================================
# generator=datazen
# version=3.1.4
# hash=75a8be659b7a0b9eac6bb40ac4061a5a
# hash=addf6d9c81cc0f844ae7e2c96f5f4bb4
# =====================================

"""
Expand All @@ -10,4 +10,4 @@

DESCRIPTION = "An interface generator for distributed computing."
PKG_NAME = "ifgen"
VERSION = "3.0.1"
VERSION = "3.1.0"
4 changes: 4 additions & 0 deletions ifgen/data/schemas/Enum.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ properties:
type: boolean
default: true

identifier:
type: boolean
default: true

underlying:
type: string
default: uint8_t
Expand Down
4 changes: 4 additions & 0 deletions ifgen/data/schemas/Struct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ properties:
type: boolean
default: true

identifier:
type: boolean
default: true

instances:
type: array
items:
Expand Down
5 changes: 4 additions & 1 deletion ifgen/enum/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,17 @@ def enum_header(task: GenerateTask, writer: IndentedFileWriter) -> None:

runtime = task.enum()

with writer.padding():
writer.empty()

if task.instance["identifier"]:
writer.write(
(
"static constexpr "
f"{task.env.config.data['enum_id_underlying']} "
f"{task.name}_id = {runtime.id};"
)
)
writer.empty()

enum_to_string_function(
task, writer, task.instance["use_map"], definition=True
Expand Down
15 changes: 8 additions & 7 deletions ifgen/struct/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,15 @@ def create_struct(task: GenerateTask) -> None:
with writer.trailing_comment_lines(
style=CommentStyle.C_DOXYGEN
) as lines:
lines.append(
(
"static constexpr "
f"{task.env.config.data['struct_id_underlying']} "
f"id = {task.protocol().id};",
f"{task.name}'s identifier.",
if task.instance["identifier"]:
lines.append(
(
"static constexpr "
f"{task.env.config.data['struct_id_underlying']} "
f"id = {task.protocol().id};",
f"{task.name}'s identifier.",
)
)
)

size = task.env.size(task.name)
enforce_expected_size(size, task.instance, task.name)
Expand Down
232 changes: 0 additions & 232 deletions ifgen/struct/methods/fields.py

This file was deleted.

Loading

0 comments on commit 4c41eea

Please sign in to comment.