![]() |
asyncapi_gencpp package from asyncapi_gencpp repoasyncapi_gencpp |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.1.0 |
License | BSD-3-Clause |
Build type | CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/hatchbed/asyncapi_gencpp.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2022-07-29 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Marc Alban
Authors
- Marc Alban
asyncapi_gencpp
C++ code generator for serializing and deserializing Async API components and messages based on a specification file.
The generator is implemented as as python3 script with the following usage:
usage: asyncapi_gencpp.py [-h] spec prefix outdir
positional arguments:
spec AsyncAPI specification file
prefix Include file prefix
outdir Output directory
The script will generate C++ data structures and code for parsing and writing
the JSON objects described in the components
and messages
sections of the
asyncapi spec file. Low level JSON parsing code is handled using the header
only nlohmann json library.
The generated objects are returned as std::optional<> to deal with parsing failures, and so will be dependent on C++17.
The generator can also be used directly in cmake using a provided macro.
Example Usage:
asyncapi.yaml
components:
schemas:
pose:
type: object
properties:
position:
$ref: '#/components/schemas/vector3'
orientation:
type: object
properties:
- w:
type: number
- x:
type: number
- y:
type: number
- z:
type: number
required:
- w
- x
- y
- z
required:
- position
- orientation
vector3:
type: object
properties:
x:
type: number
y:
type: number
z:
type: number
required:
- x
- y
- z
CMakeLists.txt
project(example)
find_package(asyncapi_gencpp REQUIRED)
# asyncapi_gencpp macro provided via find_package(asyncapi_gencpp)
asyncapi_gencpp(${PROJECT_SOURCE_DIR}/api/asyncapi.yaml ${PROJECT_NAME}/msg ${CMAKE_CURRENT_BINARY_DIR}/include)
add_executable(main src/main.cpp)
add_dependencies(main ${PROJECT_NAME}_gencpp)
main.cpp
```
#include
int main(int argc, char **argv) {
// serialize to JSON example::msg::Pose pose; pose.position.x = 0.0; pose.position.y = 0.0; pose.position.z = 0.0; pose.orientation.w = 1.0; pose.orientation.x = 0.0; pose.orientation.y = 0.0; pose.orientation.z = 0.0;
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
opensw |
Launch files
Messages
Services
Plugins
Recent questions tagged asyncapi_gencpp at Robotics Stack Exchange
![]() |
asyncapi_gencpp package from asyncapi_gencpp repoasyncapi_gencpp |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.1.0 |
License | BSD-3-Clause |
Build type | CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/hatchbed/asyncapi_gencpp.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2022-07-29 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Marc Alban
Authors
- Marc Alban
asyncapi_gencpp
C++ code generator for serializing and deserializing Async API components and messages based on a specification file.
The generator is implemented as as python3 script with the following usage:
usage: asyncapi_gencpp.py [-h] spec prefix outdir
positional arguments:
spec AsyncAPI specification file
prefix Include file prefix
outdir Output directory
The script will generate C++ data structures and code for parsing and writing
the JSON objects described in the components
and messages
sections of the
asyncapi spec file. Low level JSON parsing code is handled using the header
only nlohmann json library.
The generated objects are returned as std::optional<> to deal with parsing failures, and so will be dependent on C++17.
The generator can also be used directly in cmake using a provided macro.
Example Usage:
asyncapi.yaml
components:
schemas:
pose:
type: object
properties:
position:
$ref: '#/components/schemas/vector3'
orientation:
type: object
properties:
- w:
type: number
- x:
type: number
- y:
type: number
- z:
type: number
required:
- w
- x
- y
- z
required:
- position
- orientation
vector3:
type: object
properties:
x:
type: number
y:
type: number
z:
type: number
required:
- x
- y
- z
CMakeLists.txt
project(example)
find_package(asyncapi_gencpp REQUIRED)
# asyncapi_gencpp macro provided via find_package(asyncapi_gencpp)
asyncapi_gencpp(${PROJECT_SOURCE_DIR}/api/asyncapi.yaml ${PROJECT_NAME}/msg ${CMAKE_CURRENT_BINARY_DIR}/include)
add_executable(main src/main.cpp)
add_dependencies(main ${PROJECT_NAME}_gencpp)
main.cpp
```
#include
int main(int argc, char **argv) {
// serialize to JSON example::msg::Pose pose; pose.position.x = 0.0; pose.position.y = 0.0; pose.position.z = 0.0; pose.orientation.w = 1.0; pose.orientation.x = 0.0; pose.orientation.y = 0.0; pose.orientation.z = 0.0;
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
opensw |
Launch files
Messages
Services
Plugins
Recent questions tagged asyncapi_gencpp at Robotics Stack Exchange
![]() |
asyncapi_gencpp package from asyncapi_gencpp repoasyncapi_gencpp |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.1.0 |
License | BSD-3-Clause |
Build type | CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/hatchbed/asyncapi_gencpp.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2022-07-29 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Marc Alban
Authors
- Marc Alban
asyncapi_gencpp
C++ code generator for serializing and deserializing Async API components and messages based on a specification file.
The generator is implemented as as python3 script with the following usage:
usage: asyncapi_gencpp.py [-h] spec prefix outdir
positional arguments:
spec AsyncAPI specification file
prefix Include file prefix
outdir Output directory
The script will generate C++ data structures and code for parsing and writing
the JSON objects described in the components
and messages
sections of the
asyncapi spec file. Low level JSON parsing code is handled using the header
only nlohmann json library.
The generated objects are returned as std::optional<> to deal with parsing failures, and so will be dependent on C++17.
The generator can also be used directly in cmake using a provided macro.
Example Usage:
asyncapi.yaml
components:
schemas:
pose:
type: object
properties:
position:
$ref: '#/components/schemas/vector3'
orientation:
type: object
properties:
- w:
type: number
- x:
type: number
- y:
type: number
- z:
type: number
required:
- w
- x
- y
- z
required:
- position
- orientation
vector3:
type: object
properties:
x:
type: number
y:
type: number
z:
type: number
required:
- x
- y
- z
CMakeLists.txt
project(example)
find_package(asyncapi_gencpp REQUIRED)
# asyncapi_gencpp macro provided via find_package(asyncapi_gencpp)
asyncapi_gencpp(${PROJECT_SOURCE_DIR}/api/asyncapi.yaml ${PROJECT_NAME}/msg ${CMAKE_CURRENT_BINARY_DIR}/include)
add_executable(main src/main.cpp)
add_dependencies(main ${PROJECT_NAME}_gencpp)
main.cpp
```
#include
int main(int argc, char **argv) {
// serialize to JSON example::msg::Pose pose; pose.position.x = 0.0; pose.position.y = 0.0; pose.position.z = 0.0; pose.orientation.w = 1.0; pose.orientation.x = 0.0; pose.orientation.y = 0.0; pose.orientation.z = 0.0;
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
opensw |
Launch files
Messages
Services
Plugins
Recent questions tagged asyncapi_gencpp at Robotics Stack Exchange
![]() |
asyncapi_gencpp package from asyncapi_gencpp repoasyncapi_gencpp |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.1.0 |
License | BSD-3-Clause |
Build type | CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/hatchbed/asyncapi_gencpp.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2022-07-29 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Marc Alban
Authors
- Marc Alban
asyncapi_gencpp
C++ code generator for serializing and deserializing Async API components and messages based on a specification file.
The generator is implemented as as python3 script with the following usage:
usage: asyncapi_gencpp.py [-h] spec prefix outdir
positional arguments:
spec AsyncAPI specification file
prefix Include file prefix
outdir Output directory
The script will generate C++ data structures and code for parsing and writing
the JSON objects described in the components
and messages
sections of the
asyncapi spec file. Low level JSON parsing code is handled using the header
only nlohmann json library.
The generated objects are returned as std::optional<> to deal with parsing failures, and so will be dependent on C++17.
The generator can also be used directly in cmake using a provided macro.
Example Usage:
asyncapi.yaml
components:
schemas:
pose:
type: object
properties:
position:
$ref: '#/components/schemas/vector3'
orientation:
type: object
properties:
- w:
type: number
- x:
type: number
- y:
type: number
- z:
type: number
required:
- w
- x
- y
- z
required:
- position
- orientation
vector3:
type: object
properties:
x:
type: number
y:
type: number
z:
type: number
required:
- x
- y
- z
CMakeLists.txt
project(example)
find_package(asyncapi_gencpp REQUIRED)
# asyncapi_gencpp macro provided via find_package(asyncapi_gencpp)
asyncapi_gencpp(${PROJECT_SOURCE_DIR}/api/asyncapi.yaml ${PROJECT_NAME}/msg ${CMAKE_CURRENT_BINARY_DIR}/include)
add_executable(main src/main.cpp)
add_dependencies(main ${PROJECT_NAME}_gencpp)
main.cpp
```
#include
int main(int argc, char **argv) {
// serialize to JSON example::msg::Pose pose; pose.position.x = 0.0; pose.position.y = 0.0; pose.position.z = 0.0; pose.orientation.w = 1.0; pose.orientation.x = 0.0; pose.orientation.y = 0.0; pose.orientation.z = 0.0;
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
opensw |
Launch files
Messages
Services
Plugins
Recent questions tagged asyncapi_gencpp at Robotics Stack Exchange
![]() |
asyncapi_gencpp package from asyncapi_gencpp repoasyncapi_gencpp |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.1.0 |
License | BSD-3-Clause |
Build type | CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/hatchbed/asyncapi_gencpp.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2022-07-29 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Marc Alban
Authors
- Marc Alban
asyncapi_gencpp
C++ code generator for serializing and deserializing Async API components and messages based on a specification file.
The generator is implemented as as python3 script with the following usage:
usage: asyncapi_gencpp.py [-h] spec prefix outdir
positional arguments:
spec AsyncAPI specification file
prefix Include file prefix
outdir Output directory
The script will generate C++ data structures and code for parsing and writing
the JSON objects described in the components
and messages
sections of the
asyncapi spec file. Low level JSON parsing code is handled using the header
only nlohmann json library.
The generated objects are returned as std::optional<> to deal with parsing failures, and so will be dependent on C++17.
The generator can also be used directly in cmake using a provided macro.
Example Usage:
asyncapi.yaml
components:
schemas:
pose:
type: object
properties:
position:
$ref: '#/components/schemas/vector3'
orientation:
type: object
properties:
- w:
type: number
- x:
type: number
- y:
type: number
- z:
type: number
required:
- w
- x
- y
- z
required:
- position
- orientation
vector3:
type: object
properties:
x:
type: number
y:
type: number
z:
type: number
required:
- x
- y
- z
CMakeLists.txt
project(example)
find_package(asyncapi_gencpp REQUIRED)
# asyncapi_gencpp macro provided via find_package(asyncapi_gencpp)
asyncapi_gencpp(${PROJECT_SOURCE_DIR}/api/asyncapi.yaml ${PROJECT_NAME}/msg ${CMAKE_CURRENT_BINARY_DIR}/include)
add_executable(main src/main.cpp)
add_dependencies(main ${PROJECT_NAME}_gencpp)
main.cpp
```
#include
int main(int argc, char **argv) {
// serialize to JSON example::msg::Pose pose; pose.position.x = 0.0; pose.position.y = 0.0; pose.position.z = 0.0; pose.orientation.w = 1.0; pose.orientation.x = 0.0; pose.orientation.y = 0.0; pose.orientation.z = 0.0;
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
opensw |
Launch files
Messages
Services
Plugins
Recent questions tagged asyncapi_gencpp at Robotics Stack Exchange
![]() |
asyncapi_gencpp package from asyncapi_gencpp repoasyncapi_gencpp |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.1.0 |
License | BSD-3-Clause |
Build type | CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/hatchbed/asyncapi_gencpp.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2022-07-29 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Marc Alban
Authors
- Marc Alban
asyncapi_gencpp
C++ code generator for serializing and deserializing Async API components and messages based on a specification file.
The generator is implemented as as python3 script with the following usage:
usage: asyncapi_gencpp.py [-h] spec prefix outdir
positional arguments:
spec AsyncAPI specification file
prefix Include file prefix
outdir Output directory
The script will generate C++ data structures and code for parsing and writing
the JSON objects described in the components
and messages
sections of the
asyncapi spec file. Low level JSON parsing code is handled using the header
only nlohmann json library.
The generated objects are returned as std::optional<> to deal with parsing failures, and so will be dependent on C++17.
The generator can also be used directly in cmake using a provided macro.
Example Usage:
asyncapi.yaml
components:
schemas:
pose:
type: object
properties:
position:
$ref: '#/components/schemas/vector3'
orientation:
type: object
properties:
- w:
type: number
- x:
type: number
- y:
type: number
- z:
type: number
required:
- w
- x
- y
- z
required:
- position
- orientation
vector3:
type: object
properties:
x:
type: number
y:
type: number
z:
type: number
required:
- x
- y
- z
CMakeLists.txt
project(example)
find_package(asyncapi_gencpp REQUIRED)
# asyncapi_gencpp macro provided via find_package(asyncapi_gencpp)
asyncapi_gencpp(${PROJECT_SOURCE_DIR}/api/asyncapi.yaml ${PROJECT_NAME}/msg ${CMAKE_CURRENT_BINARY_DIR}/include)
add_executable(main src/main.cpp)
add_dependencies(main ${PROJECT_NAME}_gencpp)
main.cpp
```
#include
int main(int argc, char **argv) {
// serialize to JSON example::msg::Pose pose; pose.position.x = 0.0; pose.position.y = 0.0; pose.position.z = 0.0; pose.orientation.w = 1.0; pose.orientation.x = 0.0; pose.orientation.y = 0.0; pose.orientation.z = 0.0;
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
opensw |
Launch files
Messages
Services
Plugins
Recent questions tagged asyncapi_gencpp at Robotics Stack Exchange
![]() |
asyncapi_gencpp package from asyncapi_gencpp repoasyncapi_gencpp |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.1.0 |
License | BSD-3-Clause |
Build type | CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/hatchbed/asyncapi_gencpp.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2022-07-29 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Marc Alban
Authors
- Marc Alban
asyncapi_gencpp
C++ code generator for serializing and deserializing Async API components and messages based on a specification file.
The generator is implemented as as python3 script with the following usage:
usage: asyncapi_gencpp.py [-h] spec prefix outdir
positional arguments:
spec AsyncAPI specification file
prefix Include file prefix
outdir Output directory
The script will generate C++ data structures and code for parsing and writing
the JSON objects described in the components
and messages
sections of the
asyncapi spec file. Low level JSON parsing code is handled using the header
only nlohmann json library.
The generated objects are returned as std::optional<> to deal with parsing failures, and so will be dependent on C++17.
The generator can also be used directly in cmake using a provided macro.
Example Usage:
asyncapi.yaml
components:
schemas:
pose:
type: object
properties:
position:
$ref: '#/components/schemas/vector3'
orientation:
type: object
properties:
- w:
type: number
- x:
type: number
- y:
type: number
- z:
type: number
required:
- w
- x
- y
- z
required:
- position
- orientation
vector3:
type: object
properties:
x:
type: number
y:
type: number
z:
type: number
required:
- x
- y
- z
CMakeLists.txt
project(example)
find_package(asyncapi_gencpp REQUIRED)
# asyncapi_gencpp macro provided via find_package(asyncapi_gencpp)
asyncapi_gencpp(${PROJECT_SOURCE_DIR}/api/asyncapi.yaml ${PROJECT_NAME}/msg ${CMAKE_CURRENT_BINARY_DIR}/include)
add_executable(main src/main.cpp)
add_dependencies(main ${PROJECT_NAME}_gencpp)
main.cpp
```
#include
int main(int argc, char **argv) {
// serialize to JSON example::msg::Pose pose; pose.position.x = 0.0; pose.position.y = 0.0; pose.position.z = 0.0; pose.orientation.w = 1.0; pose.orientation.x = 0.0; pose.orientation.y = 0.0; pose.orientation.z = 0.0;
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
opensw |
Launch files
Messages
Services
Plugins
Recent questions tagged asyncapi_gencpp at Robotics Stack Exchange
![]() |
asyncapi_gencpp package from asyncapi_gencpp repoasyncapi_gencpp |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.1.0 |
License | BSD-3-Clause |
Build type | CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/hatchbed/asyncapi_gencpp.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2022-07-29 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Marc Alban
Authors
- Marc Alban
asyncapi_gencpp
C++ code generator for serializing and deserializing Async API components and messages based on a specification file.
The generator is implemented as as python3 script with the following usage:
usage: asyncapi_gencpp.py [-h] spec prefix outdir
positional arguments:
spec AsyncAPI specification file
prefix Include file prefix
outdir Output directory
The script will generate C++ data structures and code for parsing and writing
the JSON objects described in the components
and messages
sections of the
asyncapi spec file. Low level JSON parsing code is handled using the header
only nlohmann json library.
The generated objects are returned as std::optional<> to deal with parsing failures, and so will be dependent on C++17.
The generator can also be used directly in cmake using a provided macro.
Example Usage:
asyncapi.yaml
components:
schemas:
pose:
type: object
properties:
position:
$ref: '#/components/schemas/vector3'
orientation:
type: object
properties:
- w:
type: number
- x:
type: number
- y:
type: number
- z:
type: number
required:
- w
- x
- y
- z
required:
- position
- orientation
vector3:
type: object
properties:
x:
type: number
y:
type: number
z:
type: number
required:
- x
- y
- z
CMakeLists.txt
project(example)
find_package(asyncapi_gencpp REQUIRED)
# asyncapi_gencpp macro provided via find_package(asyncapi_gencpp)
asyncapi_gencpp(${PROJECT_SOURCE_DIR}/api/asyncapi.yaml ${PROJECT_NAME}/msg ${CMAKE_CURRENT_BINARY_DIR}/include)
add_executable(main src/main.cpp)
add_dependencies(main ${PROJECT_NAME}_gencpp)
main.cpp
```
#include
int main(int argc, char **argv) {
// serialize to JSON example::msg::Pose pose; pose.position.x = 0.0; pose.position.y = 0.0; pose.position.z = 0.0; pose.orientation.w = 1.0; pose.orientation.x = 0.0; pose.orientation.y = 0.0; pose.orientation.z = 0.0;
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
opensw |
Launch files
Messages
Services
Plugins
Recent questions tagged asyncapi_gencpp at Robotics Stack Exchange
![]() |
asyncapi_gencpp package from asyncapi_gencpp repoasyncapi_gencpp |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.1.0 |
License | BSD-3-Clause |
Build type | CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/hatchbed/asyncapi_gencpp.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2022-07-29 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Marc Alban
Authors
- Marc Alban
asyncapi_gencpp
C++ code generator for serializing and deserializing Async API components and messages based on a specification file.
The generator is implemented as as python3 script with the following usage:
usage: asyncapi_gencpp.py [-h] spec prefix outdir
positional arguments:
spec AsyncAPI specification file
prefix Include file prefix
outdir Output directory
The script will generate C++ data structures and code for parsing and writing
the JSON objects described in the components
and messages
sections of the
asyncapi spec file. Low level JSON parsing code is handled using the header
only nlohmann json library.
The generated objects are returned as std::optional<> to deal with parsing failures, and so will be dependent on C++17.
The generator can also be used directly in cmake using a provided macro.
Example Usage:
asyncapi.yaml
components:
schemas:
pose:
type: object
properties:
position:
$ref: '#/components/schemas/vector3'
orientation:
type: object
properties:
- w:
type: number
- x:
type: number
- y:
type: number
- z:
type: number
required:
- w
- x
- y
- z
required:
- position
- orientation
vector3:
type: object
properties:
x:
type: number
y:
type: number
z:
type: number
required:
- x
- y
- z
CMakeLists.txt
project(example)
find_package(asyncapi_gencpp REQUIRED)
# asyncapi_gencpp macro provided via find_package(asyncapi_gencpp)
asyncapi_gencpp(${PROJECT_SOURCE_DIR}/api/asyncapi.yaml ${PROJECT_NAME}/msg ${CMAKE_CURRENT_BINARY_DIR}/include)
add_executable(main src/main.cpp)
add_dependencies(main ${PROJECT_NAME}_gencpp)
main.cpp
```
#include
int main(int argc, char **argv) {
// serialize to JSON example::msg::Pose pose; pose.position.x = 0.0; pose.position.y = 0.0; pose.position.z = 0.0; pose.orientation.w = 1.0; pose.orientation.x = 0.0; pose.orientation.y = 0.0; pose.orientation.z = 0.0;
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
opensw |
Launch files
Messages
Services
Plugins
Recent questions tagged asyncapi_gencpp at Robotics Stack Exchange
![]() |
asyncapi_gencpp package from asyncapi_gencpp repoasyncapi_gencpp |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.1.0 |
License | BSD-3-Clause |
Build type | CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/hatchbed/asyncapi_gencpp.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2022-07-29 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Marc Alban
Authors
- Marc Alban
asyncapi_gencpp
C++ code generator for serializing and deserializing Async API components and messages based on a specification file.
The generator is implemented as as python3 script with the following usage:
usage: asyncapi_gencpp.py [-h] spec prefix outdir
positional arguments:
spec AsyncAPI specification file
prefix Include file prefix
outdir Output directory
The script will generate C++ data structures and code for parsing and writing
the JSON objects described in the components
and messages
sections of the
asyncapi spec file. Low level JSON parsing code is handled using the header
only nlohmann json library.
The generated objects are returned as std::optional<> to deal with parsing failures, and so will be dependent on C++17.
The generator can also be used directly in cmake using a provided macro.
Example Usage:
asyncapi.yaml
components:
schemas:
pose:
type: object
properties:
position:
$ref: '#/components/schemas/vector3'
orientation:
type: object
properties:
- w:
type: number
- x:
type: number
- y:
type: number
- z:
type: number
required:
- w
- x
- y
- z
required:
- position
- orientation
vector3:
type: object
properties:
x:
type: number
y:
type: number
z:
type: number
required:
- x
- y
- z
CMakeLists.txt
project(example)
find_package(asyncapi_gencpp REQUIRED)
# asyncapi_gencpp macro provided via find_package(asyncapi_gencpp)
asyncapi_gencpp(${PROJECT_SOURCE_DIR}/api/asyncapi.yaml ${PROJECT_NAME}/msg ${CMAKE_CURRENT_BINARY_DIR}/include)
add_executable(main src/main.cpp)
add_dependencies(main ${PROJECT_NAME}_gencpp)
main.cpp
```
#include
int main(int argc, char **argv) {
// serialize to JSON example::msg::Pose pose; pose.position.x = 0.0; pose.position.y = 0.0; pose.position.z = 0.0; pose.orientation.w = 1.0; pose.orientation.x = 0.0; pose.orientation.y = 0.0; pose.orientation.z = 0.0;
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
opensw |
Launch files
Messages
Services
Plugins
Recent questions tagged asyncapi_gencpp at Robotics Stack Exchange
![]() |
asyncapi_gencpp package from asyncapi_gencpp repoasyncapi_gencpp |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.1.0 |
License | BSD-3-Clause |
Build type | CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/hatchbed/asyncapi_gencpp.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2022-07-29 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Marc Alban
Authors
- Marc Alban
asyncapi_gencpp
C++ code generator for serializing and deserializing Async API components and messages based on a specification file.
The generator is implemented as as python3 script with the following usage:
usage: asyncapi_gencpp.py [-h] spec prefix outdir
positional arguments:
spec AsyncAPI specification file
prefix Include file prefix
outdir Output directory
The script will generate C++ data structures and code for parsing and writing
the JSON objects described in the components
and messages
sections of the
asyncapi spec file. Low level JSON parsing code is handled using the header
only nlohmann json library.
The generated objects are returned as std::optional<> to deal with parsing failures, and so will be dependent on C++17.
The generator can also be used directly in cmake using a provided macro.
Example Usage:
asyncapi.yaml
components:
schemas:
pose:
type: object
properties:
position:
$ref: '#/components/schemas/vector3'
orientation:
type: object
properties:
- w:
type: number
- x:
type: number
- y:
type: number
- z:
type: number
required:
- w
- x
- y
- z
required:
- position
- orientation
vector3:
type: object
properties:
x:
type: number
y:
type: number
z:
type: number
required:
- x
- y
- z
CMakeLists.txt
project(example)
find_package(asyncapi_gencpp REQUIRED)
# asyncapi_gencpp macro provided via find_package(asyncapi_gencpp)
asyncapi_gencpp(${PROJECT_SOURCE_DIR}/api/asyncapi.yaml ${PROJECT_NAME}/msg ${CMAKE_CURRENT_BINARY_DIR}/include)
add_executable(main src/main.cpp)
add_dependencies(main ${PROJECT_NAME}_gencpp)
main.cpp
```
#include
int main(int argc, char **argv) {
// serialize to JSON example::msg::Pose pose; pose.position.x = 0.0; pose.position.y = 0.0; pose.position.z = 0.0; pose.orientation.w = 1.0; pose.orientation.x = 0.0; pose.orientation.y = 0.0; pose.orientation.z = 0.0;
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
opensw |
Launch files
Messages
Services
Plugins
Recent questions tagged asyncapi_gencpp at Robotics Stack Exchange
![]() |
asyncapi_gencpp package from asyncapi_gencpp repoasyncapi_gencpp |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.1.0 |
License | BSD-3-Clause |
Build type | CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/hatchbed/asyncapi_gencpp.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2022-07-29 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Marc Alban
Authors
- Marc Alban
asyncapi_gencpp
C++ code generator for serializing and deserializing Async API components and messages based on a specification file.
The generator is implemented as as python3 script with the following usage:
usage: asyncapi_gencpp.py [-h] spec prefix outdir
positional arguments:
spec AsyncAPI specification file
prefix Include file prefix
outdir Output directory
The script will generate C++ data structures and code for parsing and writing
the JSON objects described in the components
and messages
sections of the
asyncapi spec file. Low level JSON parsing code is handled using the header
only nlohmann json library.
The generated objects are returned as std::optional<> to deal with parsing failures, and so will be dependent on C++17.
The generator can also be used directly in cmake using a provided macro.
Example Usage:
asyncapi.yaml
components:
schemas:
pose:
type: object
properties:
position:
$ref: '#/components/schemas/vector3'
orientation:
type: object
properties:
- w:
type: number
- x:
type: number
- y:
type: number
- z:
type: number
required:
- w
- x
- y
- z
required:
- position
- orientation
vector3:
type: object
properties:
x:
type: number
y:
type: number
z:
type: number
required:
- x
- y
- z
CMakeLists.txt
project(example)
find_package(asyncapi_gencpp REQUIRED)
# asyncapi_gencpp macro provided via find_package(asyncapi_gencpp)
asyncapi_gencpp(${PROJECT_SOURCE_DIR}/api/asyncapi.yaml ${PROJECT_NAME}/msg ${CMAKE_CURRENT_BINARY_DIR}/include)
add_executable(main src/main.cpp)
add_dependencies(main ${PROJECT_NAME}_gencpp)
main.cpp
```
#include
int main(int argc, char **argv) {
// serialize to JSON example::msg::Pose pose; pose.position.x = 0.0; pose.position.y = 0.0; pose.position.z = 0.0; pose.orientation.w = 1.0; pose.orientation.x = 0.0; pose.orientation.y = 0.0; pose.orientation.z = 0.0;
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
opensw |
Launch files
Messages
Services
Plugins
Recent questions tagged asyncapi_gencpp at Robotics Stack Exchange
![]() |
asyncapi_gencpp package from asyncapi_gencpp repoasyncapi_gencpp |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.1.0 |
License | BSD-3-Clause |
Build type | CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/hatchbed/asyncapi_gencpp.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2022-07-29 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Marc Alban
Authors
- Marc Alban
asyncapi_gencpp
C++ code generator for serializing and deserializing Async API components and messages based on a specification file.
The generator is implemented as as python3 script with the following usage:
usage: asyncapi_gencpp.py [-h] spec prefix outdir
positional arguments:
spec AsyncAPI specification file
prefix Include file prefix
outdir Output directory
The script will generate C++ data structures and code for parsing and writing
the JSON objects described in the components
and messages
sections of the
asyncapi spec file. Low level JSON parsing code is handled using the header
only nlohmann json library.
The generated objects are returned as std::optional<> to deal with parsing failures, and so will be dependent on C++17.
The generator can also be used directly in cmake using a provided macro.
Example Usage:
asyncapi.yaml
components:
schemas:
pose:
type: object
properties:
position:
$ref: '#/components/schemas/vector3'
orientation:
type: object
properties:
- w:
type: number
- x:
type: number
- y:
type: number
- z:
type: number
required:
- w
- x
- y
- z
required:
- position
- orientation
vector3:
type: object
properties:
x:
type: number
y:
type: number
z:
type: number
required:
- x
- y
- z
CMakeLists.txt
project(example)
find_package(asyncapi_gencpp REQUIRED)
# asyncapi_gencpp macro provided via find_package(asyncapi_gencpp)
asyncapi_gencpp(${PROJECT_SOURCE_DIR}/api/asyncapi.yaml ${PROJECT_NAME}/msg ${CMAKE_CURRENT_BINARY_DIR}/include)
add_executable(main src/main.cpp)
add_dependencies(main ${PROJECT_NAME}_gencpp)
main.cpp
```
#include
int main(int argc, char **argv) {
// serialize to JSON example::msg::Pose pose; pose.position.x = 0.0; pose.position.y = 0.0; pose.position.z = 0.0; pose.orientation.w = 1.0; pose.orientation.x = 0.0; pose.orientation.y = 0.0; pose.orientation.z = 0.0;
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
opensw |
Launch files
Messages
Services
Plugins
Recent questions tagged asyncapi_gencpp at Robotics Stack Exchange
![]() |
asyncapi_gencpp package from asyncapi_gencpp repoasyncapi_gencpp |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.1.0 |
License | BSD-3-Clause |
Build type | CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/hatchbed/asyncapi_gencpp.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2022-07-29 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Marc Alban
Authors
- Marc Alban
asyncapi_gencpp
C++ code generator for serializing and deserializing Async API components and messages based on a specification file.
The generator is implemented as as python3 script with the following usage:
usage: asyncapi_gencpp.py [-h] spec prefix outdir
positional arguments:
spec AsyncAPI specification file
prefix Include file prefix
outdir Output directory
The script will generate C++ data structures and code for parsing and writing
the JSON objects described in the components
and messages
sections of the
asyncapi spec file. Low level JSON parsing code is handled using the header
only nlohmann json library.
The generated objects are returned as std::optional<> to deal with parsing failures, and so will be dependent on C++17.
The generator can also be used directly in cmake using a provided macro.
Example Usage:
asyncapi.yaml
components:
schemas:
pose:
type: object
properties:
position:
$ref: '#/components/schemas/vector3'
orientation:
type: object
properties:
- w:
type: number
- x:
type: number
- y:
type: number
- z:
type: number
required:
- w
- x
- y
- z
required:
- position
- orientation
vector3:
type: object
properties:
x:
type: number
y:
type: number
z:
type: number
required:
- x
- y
- z
CMakeLists.txt
project(example)
find_package(asyncapi_gencpp REQUIRED)
# asyncapi_gencpp macro provided via find_package(asyncapi_gencpp)
asyncapi_gencpp(${PROJECT_SOURCE_DIR}/api/asyncapi.yaml ${PROJECT_NAME}/msg ${CMAKE_CURRENT_BINARY_DIR}/include)
add_executable(main src/main.cpp)
add_dependencies(main ${PROJECT_NAME}_gencpp)
main.cpp
```
#include
int main(int argc, char **argv) {
// serialize to JSON example::msg::Pose pose; pose.position.x = 0.0; pose.position.y = 0.0; pose.position.z = 0.0; pose.orientation.w = 1.0; pose.orientation.x = 0.0; pose.orientation.y = 0.0; pose.orientation.z = 0.0;
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
opensw |
Launch files
Messages
Services
Plugins
Recent questions tagged asyncapi_gencpp at Robotics Stack Exchange
![]() |
asyncapi_gencpp package from asyncapi_gencpp repoasyncapi_gencpp |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.1.0 |
License | BSD-3-Clause |
Build type | CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/hatchbed/asyncapi_gencpp.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2022-07-29 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Marc Alban
Authors
- Marc Alban
asyncapi_gencpp
C++ code generator for serializing and deserializing Async API components and messages based on a specification file.
The generator is implemented as as python3 script with the following usage:
usage: asyncapi_gencpp.py [-h] spec prefix outdir
positional arguments:
spec AsyncAPI specification file
prefix Include file prefix
outdir Output directory
The script will generate C++ data structures and code for parsing and writing
the JSON objects described in the components
and messages
sections of the
asyncapi spec file. Low level JSON parsing code is handled using the header
only nlohmann json library.
The generated objects are returned as std::optional<> to deal with parsing failures, and so will be dependent on C++17.
The generator can also be used directly in cmake using a provided macro.
Example Usage:
asyncapi.yaml
components:
schemas:
pose:
type: object
properties:
position:
$ref: '#/components/schemas/vector3'
orientation:
type: object
properties:
- w:
type: number
- x:
type: number
- y:
type: number
- z:
type: number
required:
- w
- x
- y
- z
required:
- position
- orientation
vector3:
type: object
properties:
x:
type: number
y:
type: number
z:
type: number
required:
- x
- y
- z
CMakeLists.txt
project(example)
find_package(asyncapi_gencpp REQUIRED)
# asyncapi_gencpp macro provided via find_package(asyncapi_gencpp)
asyncapi_gencpp(${PROJECT_SOURCE_DIR}/api/asyncapi.yaml ${PROJECT_NAME}/msg ${CMAKE_CURRENT_BINARY_DIR}/include)
add_executable(main src/main.cpp)
add_dependencies(main ${PROJECT_NAME}_gencpp)
main.cpp
```
#include
int main(int argc, char **argv) {
// serialize to JSON example::msg::Pose pose; pose.position.x = 0.0; pose.position.y = 0.0; pose.position.z = 0.0; pose.orientation.w = 1.0; pose.orientation.x = 0.0; pose.orientation.y = 0.0; pose.orientation.z = 0.0;
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
opensw |
Launch files
Messages
Services
Plugins
Recent questions tagged asyncapi_gencpp at Robotics Stack Exchange
![]() |
asyncapi_gencpp package from asyncapi_gencpp repoasyncapi_gencpp |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.1.0 |
License | BSD-3-Clause |
Build type | CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/hatchbed/asyncapi_gencpp.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2022-07-29 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Marc Alban
Authors
- Marc Alban
asyncapi_gencpp
C++ code generator for serializing and deserializing Async API components and messages based on a specification file.
The generator is implemented as as python3 script with the following usage:
usage: asyncapi_gencpp.py [-h] spec prefix outdir
positional arguments:
spec AsyncAPI specification file
prefix Include file prefix
outdir Output directory
The script will generate C++ data structures and code for parsing and writing
the JSON objects described in the components
and messages
sections of the
asyncapi spec file. Low level JSON parsing code is handled using the header
only nlohmann json library.
The generated objects are returned as std::optional<> to deal with parsing failures, and so will be dependent on C++17.
The generator can also be used directly in cmake using a provided macro.
Example Usage:
asyncapi.yaml
components:
schemas:
pose:
type: object
properties:
position:
$ref: '#/components/schemas/vector3'
orientation:
type: object
properties:
- w:
type: number
- x:
type: number
- y:
type: number
- z:
type: number
required:
- w
- x
- y
- z
required:
- position
- orientation
vector3:
type: object
properties:
x:
type: number
y:
type: number
z:
type: number
required:
- x
- y
- z
CMakeLists.txt
project(example)
find_package(asyncapi_gencpp REQUIRED)
# asyncapi_gencpp macro provided via find_package(asyncapi_gencpp)
asyncapi_gencpp(${PROJECT_SOURCE_DIR}/api/asyncapi.yaml ${PROJECT_NAME}/msg ${CMAKE_CURRENT_BINARY_DIR}/include)
add_executable(main src/main.cpp)
add_dependencies(main ${PROJECT_NAME}_gencpp)
main.cpp
```
#include
int main(int argc, char **argv) {
// serialize to JSON example::msg::Pose pose; pose.position.x = 0.0; pose.position.y = 0.0; pose.position.z = 0.0; pose.orientation.w = 1.0; pose.orientation.x = 0.0; pose.orientation.y = 0.0; pose.orientation.z = 0.0;
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
opensw |
Launch files
Messages
Services
Plugins
Recent questions tagged asyncapi_gencpp at Robotics Stack Exchange
![]() |
asyncapi_gencpp package from asyncapi_gencpp repoasyncapi_gencpp |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.1.0 |
License | BSD-3-Clause |
Build type | CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/hatchbed/asyncapi_gencpp.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2022-07-29 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Marc Alban
Authors
- Marc Alban
asyncapi_gencpp
C++ code generator for serializing and deserializing Async API components and messages based on a specification file.
The generator is implemented as as python3 script with the following usage:
usage: asyncapi_gencpp.py [-h] spec prefix outdir
positional arguments:
spec AsyncAPI specification file
prefix Include file prefix
outdir Output directory
The script will generate C++ data structures and code for parsing and writing
the JSON objects described in the components
and messages
sections of the
asyncapi spec file. Low level JSON parsing code is handled using the header
only nlohmann json library.
The generated objects are returned as std::optional<> to deal with parsing failures, and so will be dependent on C++17.
The generator can also be used directly in cmake using a provided macro.
Example Usage:
asyncapi.yaml
components:
schemas:
pose:
type: object
properties:
position:
$ref: '#/components/schemas/vector3'
orientation:
type: object
properties:
- w:
type: number
- x:
type: number
- y:
type: number
- z:
type: number
required:
- w
- x
- y
- z
required:
- position
- orientation
vector3:
type: object
properties:
x:
type: number
y:
type: number
z:
type: number
required:
- x
- y
- z
CMakeLists.txt
project(example)
find_package(asyncapi_gencpp REQUIRED)
# asyncapi_gencpp macro provided via find_package(asyncapi_gencpp)
asyncapi_gencpp(${PROJECT_SOURCE_DIR}/api/asyncapi.yaml ${PROJECT_NAME}/msg ${CMAKE_CURRENT_BINARY_DIR}/include)
add_executable(main src/main.cpp)
add_dependencies(main ${PROJECT_NAME}_gencpp)
main.cpp
```
#include
int main(int argc, char **argv) {
// serialize to JSON example::msg::Pose pose; pose.position.x = 0.0; pose.position.y = 0.0; pose.position.z = 0.0; pose.orientation.w = 1.0; pose.orientation.x = 0.0; pose.orientation.y = 0.0; pose.orientation.z = 0.0;
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
opensw |
Launch files
Messages
Services
Plugins
Recent questions tagged asyncapi_gencpp at Robotics Stack Exchange
![]() |
asyncapi_gencpp package from asyncapi_gencpp repoasyncapi_gencpp |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.1.0 |
License | BSD-3-Clause |
Build type | CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/hatchbed/asyncapi_gencpp.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2022-07-29 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Marc Alban
Authors
- Marc Alban
asyncapi_gencpp
C++ code generator for serializing and deserializing Async API components and messages based on a specification file.
The generator is implemented as as python3 script with the following usage:
usage: asyncapi_gencpp.py [-h] spec prefix outdir
positional arguments:
spec AsyncAPI specification file
prefix Include file prefix
outdir Output directory
The script will generate C++ data structures and code for parsing and writing
the JSON objects described in the components
and messages
sections of the
asyncapi spec file. Low level JSON parsing code is handled using the header
only nlohmann json library.
The generated objects are returned as std::optional<> to deal with parsing failures, and so will be dependent on C++17.
The generator can also be used directly in cmake using a provided macro.
Example Usage:
asyncapi.yaml
components:
schemas:
pose:
type: object
properties:
position:
$ref: '#/components/schemas/vector3'
orientation:
type: object
properties:
- w:
type: number
- x:
type: number
- y:
type: number
- z:
type: number
required:
- w
- x
- y
- z
required:
- position
- orientation
vector3:
type: object
properties:
x:
type: number
y:
type: number
z:
type: number
required:
- x
- y
- z
CMakeLists.txt
project(example)
find_package(asyncapi_gencpp REQUIRED)
# asyncapi_gencpp macro provided via find_package(asyncapi_gencpp)
asyncapi_gencpp(${PROJECT_SOURCE_DIR}/api/asyncapi.yaml ${PROJECT_NAME}/msg ${CMAKE_CURRENT_BINARY_DIR}/include)
add_executable(main src/main.cpp)
add_dependencies(main ${PROJECT_NAME}_gencpp)
main.cpp
```
#include
int main(int argc, char **argv) {
// serialize to JSON example::msg::Pose pose; pose.position.x = 0.0; pose.position.y = 0.0; pose.position.z = 0.0; pose.orientation.w = 1.0; pose.orientation.x = 0.0; pose.orientation.y = 0.0; pose.orientation.z = 0.0;
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
opensw |
Launch files
Messages
Services
Plugins
Recent questions tagged asyncapi_gencpp at Robotics Stack Exchange
![]() |
asyncapi_gencpp package from asyncapi_gencpp repoasyncapi_gencpp |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.1.0 |
License | BSD-3-Clause |
Build type | CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/hatchbed/asyncapi_gencpp.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2022-07-29 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Marc Alban
Authors
- Marc Alban
asyncapi_gencpp
C++ code generator for serializing and deserializing Async API components and messages based on a specification file.
The generator is implemented as as python3 script with the following usage:
usage: asyncapi_gencpp.py [-h] spec prefix outdir
positional arguments:
spec AsyncAPI specification file
prefix Include file prefix
outdir Output directory
The script will generate C++ data structures and code for parsing and writing
the JSON objects described in the components
and messages
sections of the
asyncapi spec file. Low level JSON parsing code is handled using the header
only nlohmann json library.
The generated objects are returned as std::optional<> to deal with parsing failures, and so will be dependent on C++17.
The generator can also be used directly in cmake using a provided macro.
Example Usage:
asyncapi.yaml
components:
schemas:
pose:
type: object
properties:
position:
$ref: '#/components/schemas/vector3'
orientation:
type: object
properties:
- w:
type: number
- x:
type: number
- y:
type: number
- z:
type: number
required:
- w
- x
- y
- z
required:
- position
- orientation
vector3:
type: object
properties:
x:
type: number
y:
type: number
z:
type: number
required:
- x
- y
- z
CMakeLists.txt
project(example)
find_package(asyncapi_gencpp REQUIRED)
# asyncapi_gencpp macro provided via find_package(asyncapi_gencpp)
asyncapi_gencpp(${PROJECT_SOURCE_DIR}/api/asyncapi.yaml ${PROJECT_NAME}/msg ${CMAKE_CURRENT_BINARY_DIR}/include)
add_executable(main src/main.cpp)
add_dependencies(main ${PROJECT_NAME}_gencpp)
main.cpp
```
#include
int main(int argc, char **argv) {
// serialize to JSON example::msg::Pose pose; pose.position.x = 0.0; pose.position.y = 0.0; pose.position.z = 0.0; pose.orientation.w = 1.0; pose.orientation.x = 0.0; pose.orientation.y = 0.0; pose.orientation.z = 0.0;
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
opensw |