ssproessig / ipc-adapter Goto Github PK
View Code? Open in Web Editor NEWStudy for an inter-process adapter in C++/Qt 5
License: MIT License
Study for an inter-process adapter in C++/Qt 5
License: MIT License
Use Qt's QJsEngine (https://doc.qt.io/qt-5/qjsengine.html) to allow users to define custom conversion functions.
<?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>
<js:configuration id="cfgHelloWorld" xmlns:js="urn:ipca-configuration-for-custom-converter-v1"><![CDATA[
function(data, metaData) { return "Hello, World: " + data; }
]]>
</js:configuration>
</configurations>
<components>
<component id="helloWorld" type="CustomConverter">
<configuration ref="cfgHelloWorld"/>
</component>
data
callback as wellUdpSink
and UdpSource
go to NetworkComponents
AmqpExchangeSink
goes to AmqpComponents
This is a prerequisite to add further AMQP components.
IComponent
have to implement getConfigurable()
Core
interface IProvides<T>
with method T* get() const
and use it as IProvides<IConfigurable>
in those components that really are configurableConfigurationHandler
Status Code File Line Column Project
Confirmed reference Core::IConfigurable* getConfigurable() override; W:\20_Sources\IpcAdapter\Components\Sources\src\UdpSource.h 39 23 IpcAdapterSources
class IpcAdapter::Core::IConfigurable W:\20_Sources\IpcAdapter\Core\api\IConfigurable.h 21 9
Confirmed reference IpcAdapter::Core::IConfigurable* ReverseBytesConverter::getConfigurable() W:\20_Sources\IpcAdapter\Components\Converters\src\ReverseBytesConverter.cpp 18 19 IpcAdapterConverters
Confirmed reference : Core::IConfigurable W:\20_Sources\IpcAdapter\Components\Converters\src\XmlToMetaDataConverter.cpp 68 13 IpcAdapterConverters
Confirmed reference IpcAdapter::Core::IConfigurable* XmlToMetaDataConverter::getConfigurable() W:\20_Sources\IpcAdapter\Components\Converters\src\XmlToMetaDataConverter.cpp 109 19 IpcAdapterConverters
class IpcAdapter::Core::IConfigurable W:\20_Sources\IpcAdapter\Core\api\IConfigurable.h 21 9
Confirmed reference Core::IConfigurable* getConfigurable() override; W:\20_Sources\IpcAdapter\Components\Converters\src\ReverseBytesConverter.h 35 23 IpcAdapterConvertersTest
Confirmed reference Core::IConfigurable* getConfigurable() override; W:\20_Sources\IpcAdapter\Components\Converters\src\XmlToMetaDataConverter.h 39 23 IpcAdapterConvertersTest
Confirmed reference std::function<void(IpcAdapter::Core::IConfigurable&)> configurationCallback, W:\20_Sources\IpcAdapter\Components\Converters\tst\XmlToMetaDataConverterTest.cpp 19 46 IpcAdapterConvertersTest
class IpcAdapter::Core::IConfigurable W:\20_Sources\IpcAdapter\Core\api\IConfigurable.h 21 9
Confirmed reference using IpcAdapter::Core::IConfigurable; W:\20_Sources\IpcAdapter\Core\src\ConfigurationHandler.cpp 22 25 IpcAdapterCore
Confirmed reference IConfigurable* currentConfigurable = nullptr; W:\20_Sources\IpcAdapter\Core\src\ConfigurationHandler.cpp 53 9 IpcAdapterCore
Confirmed reference IpcAdapter::Core::IConfigurable* getConfigurable() override W:\20_Sources\IpcAdapter\Core\src\RuntimeConfiguration.cpp 29 27 IpcAdapterCore
class IpcAdapter::Core::IConfigurable W:\20_Sources\IpcAdapter\Core\api\IConfigurable.h 21 9
Confirmed reference IpcAdapter::Core::IConfigurable* getConfigurable() override W:\20_Sources\IpcAdapter\Core\tst\ComponentRegistryTest.cpp 29 27 IpcAdapterCoreTest
Confirmed reference using IpcAdapter::Core::IConfigurable; W:\20_Sources\IpcAdapter\Core\tst\PipelineTest.cpp 16 25 IpcAdapterCoreTest
Confirmed reference IConfigurable* getConfigurable() override W:\20_Sources\IpcAdapter\Core\tst\PipelineTest.cpp 32 9 IpcAdapterCoreTest
Confirmed reference IConfigurable* getConfigurable() override W:\20_Sources\IpcAdapter\Core\tst\PipelineTest.cpp 58 9 IpcAdapterCoreTest
Confirmed reference using IpcAdapter::Core::IConfigurable; W:\20_Sources\IpcAdapter\Core\tst\RuntimeTest.cpp 18 25 IpcAdapterCoreTest
Confirmed reference , IpcAdapter::Core::IConfigurable W:\20_Sources\IpcAdapter\Core\tst\RuntimeTest.cpp 28 29 IpcAdapterCoreTest
Confirmed reference IConfigurable* getConfigurable() override W:\20_Sources\IpcAdapter\Core\tst\RuntimeTest.cpp 30 9 IpcAdapterCoreTest
Confirmed reference IConfigurable* getConfigurable() override W:\20_Sources\IpcAdapter\Core\tst\RuntimeTest.cpp 61 9 IpcAdapterCoreTest
Confirmed reference IConfigurable* getConfigurable() override W:\20_Sources\IpcAdapter\Core\tst\RuntimeTest.cpp 77 9 IpcAdapterCoreTest
Confirmed reference IConfigurable* getConfigurable() override W:\20_Sources\IpcAdapter\Core\tst\RuntimeTest.cpp 94 9 IpcAdapterCoreTest
class IpcAdapter::Core::IConfigurable W:\20_Sources\IpcAdapter\Core\api\IConfigurable.h 21 9
Confirmed reference struct AmqpConfigurable: IpcAdapter::Core::IConfigurable W:\20_Sources\IpcAdapter\Components\Sinks\src\AmqpExchangeSink.cpp 91 48 IpcAdapterSinks
Confirmed reference IpcAdapter::Core::IConfigurable* AmqpExchangeSink::getConfigurable() W:\20_Sources\IpcAdapter\Components\Sinks\src\AmqpExchangeSink.cpp 210 19 IpcAdapterSinks
Confirmed reference : IpcAdapter::Core::IConfigurable W:\20_Sources\IpcAdapter\Components\Sinks\src\UdpSink.cpp 29 25 IpcAdapterSinks
Confirmed reference IpcAdapter::Core::IConfigurable* UdpSink::getConfigurable() W:\20_Sources\IpcAdapter\Components\Sinks\src\UdpSink.cpp 96 19 IpcAdapterSinks
class IpcAdapter::Core::IConfigurable W:\20_Sources\IpcAdapter\Core\api\IConfigurable.h 21 9
Confirmed reference Core::IConfigurable* getConfigurable() override; W:\20_Sources\IpcAdapter\Components\Sinks\src\AmqpExchangeSink.h 40 23 IpcAdapterSinksTest
Confirmed reference using IpcAdapter::Core::IConfigurable; W:\20_Sources\IpcAdapter\Components\Sinks\tst\AmqpExchangeSinkTest.cpp 15 25 IpcAdapterSinksTest
Confirmed reference std::function<void(IConfigurable&)> configurationCallback, W:\20_Sources\IpcAdapter\Components\Sinks\tst\AmqpExchangeSinkTest.cpp 61 28 IpcAdapterSinksTest
Confirmed reference Core::IConfigurable* getConfigurable() override; W:\20_Sources\IpcAdapter\Components\Sinks\src\UdpSink.h 39 23 IpcAdapterSinksTest
Confirmed reference std::function<void(IpcAdapter::Core::IConfigurable&)> configurationCallback, W:\20_Sources\IpcAdapter\Components\Sinks\tst\UdpSinkTest.cpp 23 46 IpcAdapterSinksTest
class IpcAdapter::Core::IConfigurable W:\20_Sources\IpcAdapter\Core\api\IConfigurable.h 21 9
Confirmed reference FORWARD_DECLARE(IConfigurable); W:\20_Sources\IpcAdapter\Core\api\IComponent.h 13 25 IpcAdapterSources
Confirmed reference virtual IConfigurable* getConfigurable() = 0; W:\20_Sources\IpcAdapter\Core\api\IComponent.h 34 21 IpcAdapterSources
Confirmed reference class IConfigurable W:\20_Sources\IpcAdapter\Core\api\IConfigurable.h 21 15 IpcAdapterSources
Confirmed reference INTERFACE_DESTRUCTOR(IConfigurable); W:\20_Sources\IpcAdapter\Core\api\IConfigurable.h 24 34 IpcAdapterSources
Confirmed reference struct UdpSource::Data: Core::IConfigurable W:\20_Sources\IpcAdapter\Components\Sources\src\UdpSource.cpp 37 31 IpcAdapterSources
Confirmed reference IpcAdapter::Core::IConfigurable* UdpSource::getConfigurable() W:\20_Sources\IpcAdapter\Components\Sources\src\UdpSource.cpp 146 19 IpcAdapterSources
class IpcAdapter::Core::IConfigurable W:\20_Sources\IpcAdapter\Core\api\IConfigurable.h 21 9
Confirmed reference std::function<void(IpcAdapter::Core::IConfigurable&)> configurationCallback, W:\20_Sources\IpcAdapter\Components\Sources\tst\UdpSourceTest.cpp 33 46 IpcAdapterSourcesTest
AmqpExchangeSink
:
AmqpExchangeSink
to a common shared classvirtual
to unit test invocationC API: see https://docs.tibco.com/pub/ems-zlinux/8.5.0/doc/pdf/TIB_ems_8.5_c_and_cobol_ref.pdf?id=2
IWatchdogTrigger
implementation to report "aliveness" to an external supervisorSometimes building with make -j7 fails with
[ 90%] Linking CXX executable IpcAdapterConvertersTest
make[2]: *** No rule to make target '20_Sources/IpcAdapter/Components/Sinks/CMakeFiles/IpcAdapterSinks.dir/src/UdpSink.cpp.o', needed by '20_Sources/IpcAdapter/Components/Sinks/IpcAdapterSinksTest'. Stop.
make[2]: *** Waiting for unfinished jobs....
[ 91%] Building CXX object 20_Sources/IpcAdapter/Components/Sinks/CMakeFiles/IpcAdapterSinksTest.dir/tst/SinkTestMain.cpp.o
[ 91%] Built target IpcAdapterConvertersTest
Scanning dependencies of target IpcAdapterApplication
[ 92%] Building CXX object 20_Sources/IpcAdapter/Application/CMakeFiles/IpcAdapterApplication.dir/IpcAdapterApplication_autogen/mocs_compilation.cpp.o
make[2]: *** No rule to make target '20_Sources/IpcAdapter/Components/Sinks/CMakeFiles/IpcAdapterSinks.dir/src/UdpSink.cpp.o', needed by '20_Sources/IpcAdapter/Application/IpcAdapterApplication'. Stop.
make[2]: *** Waiting for unfinished jobs....
[ 94%] Building CXX object 20_Sources/IpcAdapter/Application/CMakeFiles/IpcAdapterApplication.dir/src/IpcAdapterApplication.cpp.o
[ 95%] Building CXX object 20_Sources/IpcAdapter/Components/Sinks/CMakeFiles/IpcAdapterSinks.dir/src/AmqpExchangeSink.cpp.o
[ 97%] Linking CXX executable IpcAdapterSourcesTest
[ 97%] Built target IpcAdapterSourcesTest
add_library( ... OBJECT... )
?Some components (as the ByteStreamReader
and ByteStreamWriter
) need a more complex structured configuration element in our XML, as basically key-value pairs is not sufficient for them.
Make components provide their own XML namespace and configuration handler for that.
<?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>
<s:configuration id="cfgSample" xmlns:s="urn:ipca-configuration-for-sample-v1">
<s:root version="1">
<s:any>
<s:other>
<s:structure is="possible"/>
</s:other>
</s:any>
</s:root>
</sample:configuration>
</configurations>
<components>
<component id="otherComponent" type="SampleComponent">
<configuration ref="cfgSample"/>
</component>
....
IXmlDefaultHandler*
abstraction
startElement(...)
and endElement(...)
from QXmlDefaultHandler
we can't use it directlybool configure(IComponent& aComponent)
so that the handler instance can configure a component with the information it parsedConfigurationHandler
implementation of HandlerStack
to carry IXmlDefaultHandler*
XmlHandlerFactory
s are stored in a GlobalXmlHandlerFactoryRegistry
(same mechanism as used for component factories)configuration
element , it queries the GlobalXmlHandlerFactoryRegistry
for a factory for the XML namespace encountered
HandlerFactory
must be registered by the XML namespace they can parse
<?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">
<param-lists>
<param-list id="paramsHostConfiguration">
<param key="host" value="localhost"/>
</param-list>
</param-lists>
<components>
<component id="udpSource" type="UdpSource">
<param-list ref="paramsHostConfiguration"/>
<param key="port" value="9999"/>
</component>
<component id="udpSink" type="UdpSink">
<param-list ref="paramsHostConfiguration"/>
<param key="port" value="9998"/>
</component>
...
Core::IConfigurator
that provides bool doConfigure(IConfigurable&)
method; returns false
if any parameter was rejectedParamListConfigurator
that is IConfigurable
and only stores the key
and value
passed to itParamListConfigurator
instances in RuntimeConfiguration
with addParamList(QString const& anId, shared_ptr<ParamList> const&)
IRuntimeConfiguration::getParamList(QString const&)
<component/>
parser to resolve it from <param-list ref=""/>
and apply itA declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.