ssproessig / ipc-adapter

Study for an inter-process adapter in C++/Qt 5
MIT License
0 stars 0 forks source link

Converter: Provide "declarative" ByteStreamReaderConverter and ByteStreamWriterConverter #21

Open ssproessig opened 5 years ago

ssproessig commented 5 years ago

Todo

ssproessig commented 5 years ago

Idea

Provide a declarative complex configuration

<?xml version="1.0" encoding="UTF-8"?>
<configuration version="1" xmlns="urn:ipca-configuration-v1"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="urn:ipca-configuration-v1 ipca-configuration-v1.xsd">

    <configurations>
        <bsd:configuration id="cfgBsd" xmlns:bsd="urn:ipca-configuration-for-byte-stream-definitions-v1">
            <bsd:struct name="Sample">
                <bsd:uint8 name="index"/>
                <bsd:uint16-be name="shortField"/>
                <bsd:uint64-be name="longLongField"/>
                <bsd:string name="message" type="fixed" encoding="utf-8"/>
                <bsd:debug/>
            </bsd:struct>
        </bsd:configuration>
    </configurations>

    <components>
        <component id="bsrTest" type="ByteStreamReader">
            <configuration ref="cfgBsd"/>
        </component>
...

Design

ssproessig commented 5 years ago

string usage

ssproessig commented 5 years ago

debug usage

ssproessig commented 5 years ago

structuring

finally, think about to add <struct/> as sub-element into a <struct/> so that the parser structures the data better