You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by ms...@apache.org on 2019/05/10 13:43:29 UTC

[plc4x] branch develop updated (ac506ff -> 315a769)

This is an automated email from the ASF dual-hosted git repository.

msommer pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git.


    from ac506ff  - Adjusted the README to work after the introduction of the 'with-java' profile.
     new f89fafa  Add PlcDriverManager for dynamic Loading PLCDrivers
     new 4753c55  Bugfixes for Debug-Mode
     new 9f936ee  Bugfix double word PUBLIC
     new 003477d  Merge branch 'develop' of https://gitbox.apache.org/repos/asf/plc4x into develop
     new 1800d4b  Nested Classes for Builder, PLcConnection modified CMakelists with central import of Boost
     new 1d86db6  CMakelists with central import of Boost
     new 2ab73c3  Nested Class Builder CMakelists with central import of Boost
     new bfe56b0  CMakelists with central import of Boost
     new 315a769  Merge branch 'develop' of https://gitbox.apache.org/repos/asf/plc4x into develop

The 9 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitignore                                         |   1 -
 .vscode/settings.json                              |   8 -
 Jenkinsfile                                        |   6 +-
 README                                             |  28 +-
 {plc4j/examples => examples}/dummy-driver/pom.xml  |   6 +-
 .../java/examples/dummydriver/DummyDriver.java     |   4 +-
 .../dummydriver/connection/DummyConnection.java    |   0
 .../examples/dummydriver/model/DummyField.java     |   0
 .../examples/dummydriver/netty/DummyProtocol.java  |   0
 .../services/org.apache.plc4x.java.spi.PlcDriver   |   0
 .../hello-cloud-azure/pom.xml                      |   6 +-
 .../java/examples/cloud/azure/CliOptions.java      |   0
 .../cloud/azure/S7PlcToAzureIoTHubSample.java      |   0
 .../hello-cloud-google/README.md                   |   0
 .../hello-cloud-google/pom.xml                     |   6 +-
 .../java/examples/cloud/google/CliOptions.java     |   0
 .../cloud/google/S7PlcToGoogleIoTCoreSample.java   |   0
 .../src/main/resources/logback.xml                 |   0
 .../hello-connectivity-kafka/kafka-connector.yml   |   0
 .../hello-connectivity-kafka/pom.xml               |   6 +-
 .../hello-connectivity-kafka/server.sh             |   0
 .../connectivity/kafka/KafkaConnector.java         |   0
 .../connectivity/kafka/model/Configuration.java    |   0
 .../connectivity/kafka/model/KafkaConfig.java      |   0
 .../connectivity/kafka/model/PlcConfig.java        |   0
 .../connectivity/kafka/model/PlcFieldConfig.java   |   0
 .../connectivity/kafka/model/PlcMemoryBlock.java   |   0
 .../src/main/resources/logback.xml                 |   0
 .../hello-connectivity-mqtt/mqtt-connector.yml     |   0
 .../hello-connectivity-mqtt/pom.xml                |   6 +-
 .../examples/connectivity/mqtt/MqttConnector.java  |   0
 .../connectivity/mqtt/model/Configuration.java     |   0
 .../connectivity/mqtt/model/MqttConfig.java        |   0
 .../connectivity/mqtt/model/PlcConfig.java         |   0
 .../connectivity/mqtt/model/PlcFieldConfig.java    |   0
 .../connectivity/mqtt/model/PlcMemoryBlock.java    |   0
 .../src/main/resources/logback.xml                 |   0
 .../hello-integration-edgent/pom.xml               |   6 +-
 .../examples/integration/edgent/CliOptions.java    |   0
 .../examples/integration/edgent/PlcLogger.java     |   0
 .../src/main/resources/logback.xml                 |   0
 {plc4j/examples => examples}/hello-opm/pom.xml     |   6 +-
 .../plc4x/java/examples/helloopm/HelloOpm.java     |   0
 .../hello-opm/src/main/resources/logback.xml       |   0
 .../hello-storage-elasticsearch/README.adoc        |   0
 .../hello-storage-elasticsearch/pom.xml            |   6 +-
 .../elasticsearch/ElasticsearchStorage.java        |   0
 .../src/main/resources/log4j2.xml                  |   0
 .../src/main/resources/logback.xml                 |   0
 .../hello-webapp/client/pom.xml                    |  17 +-
 .../client/src/main/royale/HelloPLC4X.mxml         |   0
 .../client/src/main/royale/service/RobotService.as |   0
 {plc4j/examples => examples}/hello-webapp/pom.xml  |   6 +-
 .../hello-webapp/service/pom.xml                   |   6 +-
 .../robot/controllers/RobotController.java         |   0
 .../hello-webapp/webapp/pom.xml                    |  16 +-
 .../apache/plc4x/examples/robot/Application.java   |   0
 .../src/main/resources/application.properties      |   0
 .../hello-world-plc4x/pom.xml                      |   6 +-
 .../plc4x/java/examples/helloplc4x/CliOptions.java |   0
 .../plc4x/java/examples/helloplc4x/HelloPlc4x.java |   0
 .../src/main/resources/logback.xml                 |   0
 {plc4j/examples => examples}/pom.xml               |  36 +-
 .../apache-brooklyn}/pom.xml                       |   8 +-
 .../apache-calcite/pom.xml                         |   6 +-
 .../main/java/org/apache/plc4x/Plc4xBaseTable.java |   0
 .../main/java/org/apache/plc4x/Plc4xSchema.java    |   0
 .../java/org/apache/plc4x/Plc4xSchemaFactory.java  |   0
 .../java/org/apache/plc4x/Plc4xStreamTable.java    |   0
 .../src/main/java/org/apache/plc4x/Plc4xTable.java |   0
 .../java/org/apache/plc4x/DriverManagerTest.java   |   0
 .../java/org/apache/plc4x/Plc4XBaseTableTest.java  |   0
 .../org/apache/plc4x/Plc4xSchemaFactoryTest.java   |   2 +
 .../apache-calcite/src/test/resources/example.yml  |   0
 .../apache-calcite}/src/test/resources/logback.xml |   0
 .../apache-calcite/src/test/resources/model.json   |   0
 .../apache-camel/pom.xml                           |   7 +-
 .../apache-camel/src/main/docs/PLC4X.adoc          |   0
 .../java/org/apache/plc4x/camel/Constants.java     |   0
 .../org/apache/plc4x/camel/Plc4XComponent.java     |   0
 .../java/org/apache/plc4x/camel/Plc4XConsumer.java |   0
 .../java/org/apache/plc4x/camel/Plc4XEndpoint.java |   0
 .../apache/plc4x/camel/Plc4XPollingConsumer.java   |   0
 .../java/org/apache/plc4x/camel/Plc4XProducer.java |   0
 .../services/org/apache/camel/component/plc4x      |   0
 .../java/org/apache/plc4x/camel/ConstantsTest.java |   0
 .../java/org/apache/plc4x/camel/ManualTest.java    |   0
 .../java/org/apache/plc4x/camel/MockDriver.java    |   0
 .../org/apache/plc4x/camel/Plc4XComponentTest.java |   0
 .../org/apache/plc4x/camel/Plc4XConsumerTest.java  |   0
 .../org/apache/plc4x/camel/Plc4XEndpointTest.java  |   0
 .../plc4x/camel/Plc4XPollingConsumerTest.java      |   0
 .../org/apache/plc4x/camel/Plc4XProducerTest.java  |   0
 .../services/org.apache.plc4x.java.spi.PlcDriver   |   0
 .../src/test/resources/log4j2.properties           |   0
 .../apache-camel}/src/test/resources/logback.xml   |   0
 .../apache-edgent/pom.xml                          |   7 +-
 .../apache/plc4x/edgent/PlcConnectionAdapter.java  |   0
 .../java/org/apache/plc4x/edgent/PlcFunctions.java |   0
 .../java/org/apache/plc4x/edgent/package-info.java |   0
 .../plc4x/edgent/PlcConnectionAdapterTest.java     |   0
 .../org/apache/plc4x/edgent/PlcFunctionsTest.java  |   0
 .../apache/plc4x/edgent/mock/MockConnection.java   |   0
 .../org/apache/plc4x/edgent/mock/MockDriver.java   |   4 +-
 .../org/apache/plc4x/edgent/mock/MockField.java    |   0
 .../apache/plc4x/edgent/mock/MockFieldHandler.java |   0
 .../apache/plc4x/edgent/mock/MockFieldItem.java    |   0
 .../services/org.apache.plc4x.java.spi.PlcDriver   |   0
 .../apache-kafka/README.md                         |   0
 .../apache-kafka/config/sink.properties            |   0
 .../apache-kafka/config/source.properties          |   0
 .../apache-kafka/pom.xml                           |   7 +-
 .../org/apache/plc4x/kafka/Plc4xSinkConnector.java |   5 +-
 .../java/org/apache/plc4x/kafka/Plc4xSinkTask.java |   0
 .../apache/plc4x/kafka/Plc4xSourceConnector.java   |   3 +-
 .../org/apache/plc4x/kafka/Plc4xSourceTask.java    |   0
 .../org/apache/plc4x/kafka/util/VersionUtil.java   |   0
 .../apache-karaf/karaf-ads-feature/pom.xml         |  15 +-
 .../apache-karaf/karaf-demo-server/pom.xml         |  28 +-
 .../apache-karaf/karaf-ethernet-ip-feature/pom.xml |  15 +-
 .../apache-karaf/karaf-modbus-feature/pom.xml      |  15 +-
 .../apache-karaf/karaf-s7-feature/pom.xml          |  15 +-
 .../apache-karaf/karaf-simulated-feature/pom.xml   |  15 +-
 .../apache-karaf/pom.xml                           |  15 +-
 .../apache-mynewt/pom.xml                          |   6 +-
 .../apache-nifi/nifi-plc4x-nar/false-positives.xml |   0
 .../apache-nifi/nifi-plc4x-nar/pom.xml             |  23 +-
 .../apache-nifi/nifi-plc4x-processors/pom.xml      |   6 +-
 .../org/apache/plc4x/nifi/BasePlc4xProcessor.java  |   0
 .../org/apache/plc4x/nifi/Plc4xSinkProcessor.java  |   0
 .../apache/plc4x/nifi/Plc4xSourceProcessor.java    |   0
 .../services/org.apache.nifi.processor.Processor   |   0
 .../plc4x4nifi/Plc4xSinkProcessorTest.java         |   0
 .../plc4x4nifi/Plc4xSourceProcessorTest.java       |   0
 .../apache-nifi/pom.xml                            |   6 +-
 {plc4cpp/integrations => integrations}/pom.xml     |  14 +-
 plc4cpp/CMakeLists.txt                             |  16 +-
 plc4cpp/api/CMakeLists.txt                         |   7 +-
 .../cpp/org/apache/plc4x/cpp/PlcDriverManager.cpp  | 175 ++++++++++
 .../cpp/org/apache/plc4x/cpp/PlcDriverManager.h    |  71 ++++
 .../cpp/org/apache/plc4x/cpp/api/PlcConnection.cpp |  93 ++++--
 .../cpp/org/apache/plc4x/cpp/api/PlcConnection.h   | 228 ++++++++-----
 .../plc4x/cpp/api/messages/PlcFieldRequest.h       |  10 +-
 .../plc4x/cpp/api/messages/PlcReadRequest.cpp      |   6 -
 .../apache/plc4x/cpp/api/messages/PlcReadRequest.h |  10 +-
 .../cpp/api/messages/PlcReadRequestBuilder.cpp     |  40 ---
 .../plc4x/cpp/api/messages/PlcReadRequestBuilder.h |  57 ----
 .../plc4x/cpp/api/messages/PlcRequestBuilder.h     |   1 -
 plc4cpp/examples/CMakeLists.txt                    |  20 --
 plc4cpp/examples/pom.xml                           |  55 ---
 plc4cpp/integrations/CMakeLists.txt                |  21 --
 plc4cpp/integrations/apache-mynewt/CMakeLists.txt  |  20 --
 plc4cpp/integrations/edgex-foundry/CMakeLists.txt  |  20 --
 plc4cpp/integrations/edgex-foundry/pom.xml         |  38 ---
 plc4cpp/pom.xml                                    |   3 -
 plc4cpp/protocols/driver-bases/base/CMakeLists.txt |   7 +-
 .../cpp/base/connection/AbstractPlcConnection.cpp  |  31 +-
 .../cpp/base/connection/AbstractPlcConnection.h    |   5 +-
 .../plc4x/cpp/base/connection/PlcFieldHandler.h    |   2 +-
 .../cpp/base/messages/DefaultPlcReadRequest.cpp    | 100 +++---
 .../cpp/base/messages/DefaultPlcReadRequest.h      |  35 +-
 .../cpp/base/messages/DefaultPlcWriteRequest.cpp   | 127 ++++---
 .../cpp/base/messages/DefaultPlcWriteRequest.h     |  11 +-
 .../cpp/base/messages/InternalPlcFieldRequest.h    |   2 +-
 plc4cpp/utils/CMakeLists.txt                       |   2 +
 plc4cpp/utils/logger/CMakeLists.txt                |   6 +
 .../org/apache/plc4x/cpp/utils/logger/DbgTrace.cpp |   6 +-
 .../org/apache/plc4x/cpp/utils/logger/ExLog.cpp    |   2 +-
 plc4j/integrations/pom.xml                         |  44 ---
 plc4j/pom.xml                                      | 296 -----------------
 plc4j/protocols/delta-v/pom.xml                    |  15 -
 plc4j/src/site/asciidoc/users/gettingstarted.adoc  | 178 ----------
 plc4net/.gitignore                                 | 344 -------------------
 plc4net/api/PlcDriverManager.cs                    | 104 ------
 plc4net/api/api.csproj                             |  27 --
 plc4net/api/api/IPlcConnection.cs                  |  89 -----
 plc4net/api/api/IPlcDriver.cs                      |  57 ----
 .../api/api/authentication/IPlcAuthentication.cs   |  29 --
 .../PlcUsernamePasswordAuthentication.cs           |  48 ---
 plc4net/api/api/metadata/IPlcConnectionMetadata.cs |  39 ---
 plc4net/api/exceptions/PlcConnectionException.cs   |  50 ---
 plc4net/api/exceptions/PlcException.cs             |  50 ---
 plc4net/api/exceptions/PlcInvalidFieldException.cs |  46 ---
 plc4net/api/messages/IPlcFieldRequest.cs           |  52 ---
 plc4net/api/messages/IPlcFieldResponse.cs          |  49 ---
 plc4net/api/messages/IPlcMessage.cs                |  29 --
 plc4net/api/messages/IPlcReadRequest.cs            |  29 --
 plc4net/api/messages/IPlcReadRequestBuilder.cs     |  35 --
 plc4net/api/messages/IPlcReadResponse.cs           |  29 --
 plc4net/api/messages/IPlcRequest.cs                |  36 --
 plc4net/api/messages/IPlcRequestBuilder.cs         |  34 --
 plc4net/api/messages/IPlcResponse.cs               |  33 --
 plc4net/api/messages/IPlcSubscriptionEventArgs.cs  |  35 --
 plc4net/api/messages/IPlcSubscriptionRequest.cs    |  29 --
 .../api/messages/IPlcSubscriptionRequestBuilder.cs |  54 ---
 plc4net/api/messages/IPlcSubscriptionResponse.cs   |  42 ---
 plc4net/api/messages/IPlcUnsubscriptionRequest.cs  |  29 --
 .../messages/IPlcUnsubscriptionRequestBuilder.cs   |  45 ---
 plc4net/api/messages/IPlcUnsubscriptionResponse.cs |  29 --
 plc4net/api/messages/IPlcWriteRequest.cs           |  32 --
 plc4net/api/messages/IPlcWriteRequestBuilder.cs    | 134 --------
 plc4net/api/model/IPlcField.cs                     |  39 ---
 plc4net/api/model/IPlcSubscriptionHandle.cs        |  35 --
 plc4net/api/pom.xml                                |  72 ----
 plc4net/api/types/PlcResponseCode.cs               |  35 --
 plc4net/plc4net.driver/plc4net.driver.csproj       |  29 --
 plc4net/plc4net.driver/pom.xml                     |  68 ----
 plc4net/plc4net.sln                                |  44 ---
 plc4net/pom.xml                                    |  46 ---
 plc4py/pom.xml                                     |   4 +-
 .../python/org/apache/plc4x/PlcDriverManager.py    |   1 -
 .../org/apache/plc4x/test_PlcDriverManager.py      |   3 +-
 pom.xml                                            | 368 +++++++++++++++++++--
 src/site/asciidoc/developers/conferences.adoc      |   3 +-
 src/site/asciidoc/users/gettingstarted.adoc        |   3 -
 tools/thrift/src/assembly/python.xml               |   7 -
 216 files changed, 1182 insertions(+), 3377 deletions(-)
 delete mode 100644 .vscode/settings.json
 rename {plc4j/examples => examples}/dummy-driver/pom.xml (94%)
 rename {plc4j/examples => examples}/dummy-driver/src/main/java/org/apache/plc4x/java/examples/dummydriver/DummyDriver.java (100%)
 rename {plc4j/examples => examples}/dummy-driver/src/main/java/org/apache/plc4x/java/examples/dummydriver/connection/DummyConnection.java (100%)
 rename {plc4j/examples => examples}/dummy-driver/src/main/java/org/apache/plc4x/java/examples/dummydriver/model/DummyField.java (100%)
 rename {plc4j/examples => examples}/dummy-driver/src/main/java/org/apache/plc4x/java/examples/dummydriver/netty/DummyProtocol.java (100%)
 rename {plc4j/examples => examples}/dummy-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver (100%)
 rename {plc4j/examples => examples}/hello-cloud-azure/pom.xml (94%)
 rename {plc4j/examples => examples}/hello-cloud-azure/src/main/java/org/apache/plc4x/java/examples/cloud/azure/CliOptions.java (100%)
 rename {plc4j/examples => examples}/hello-cloud-azure/src/main/java/org/apache/plc4x/java/examples/cloud/azure/S7PlcToAzureIoTHubSample.java (100%)
 rename {plc4j/examples => examples}/hello-cloud-google/README.md (100%)
 rename {plc4j/examples => examples}/hello-cloud-google/pom.xml (95%)
 rename {plc4j/examples => examples}/hello-cloud-google/src/main/java/org/apache/plc4x/java/examples/cloud/google/CliOptions.java (100%)
 rename {plc4j/examples => examples}/hello-cloud-google/src/main/java/org/apache/plc4x/java/examples/cloud/google/S7PlcToGoogleIoTCoreSample.java (100%)
 rename {plc4j/examples => examples}/hello-cloud-google/src/main/resources/logback.xml (100%)
 rename {plc4j/examples => examples}/hello-connectivity-kafka/kafka-connector.yml (100%)
 rename {plc4j/examples => examples}/hello-connectivity-kafka/pom.xml (96%)
 rename {plc4j/examples => examples}/hello-connectivity-kafka/server.sh (100%)
 rename {plc4j/examples => examples}/hello-connectivity-kafka/src/main/java/org/apache/plc4x/java/examples/connectivity/kafka/KafkaConnector.java (100%)
 rename {plc4j/examples => examples}/hello-connectivity-kafka/src/main/java/org/apache/plc4x/java/examples/connectivity/kafka/model/Configuration.java (100%)
 rename {plc4j/examples => examples}/hello-connectivity-kafka/src/main/java/org/apache/plc4x/java/examples/connectivity/kafka/model/KafkaConfig.java (100%)
 rename {plc4j/examples => examples}/hello-connectivity-kafka/src/main/java/org/apache/plc4x/java/examples/connectivity/kafka/model/PlcConfig.java (100%)
 rename {plc4j/examples => examples}/hello-connectivity-kafka/src/main/java/org/apache/plc4x/java/examples/connectivity/kafka/model/PlcFieldConfig.java (100%)
 rename {plc4j/examples => examples}/hello-connectivity-kafka/src/main/java/org/apache/plc4x/java/examples/connectivity/kafka/model/PlcMemoryBlock.java (100%)
 rename {plc4j/examples/hello-connectivity-mqtt => examples/hello-connectivity-kafka}/src/main/resources/logback.xml (100%)
 rename {plc4j/examples => examples}/hello-connectivity-mqtt/mqtt-connector.yml (100%)
 rename {plc4j/examples => examples}/hello-connectivity-mqtt/pom.xml (96%)
 rename {plc4j/examples => examples}/hello-connectivity-mqtt/src/main/java/org/apache/plc4x/java/examples/connectivity/mqtt/MqttConnector.java (100%)
 rename {plc4j/examples => examples}/hello-connectivity-mqtt/src/main/java/org/apache/plc4x/java/examples/connectivity/mqtt/model/Configuration.java (100%)
 rename {plc4j/examples => examples}/hello-connectivity-mqtt/src/main/java/org/apache/plc4x/java/examples/connectivity/mqtt/model/MqttConfig.java (100%)
 rename {plc4j/examples => examples}/hello-connectivity-mqtt/src/main/java/org/apache/plc4x/java/examples/connectivity/mqtt/model/PlcConfig.java (100%)
 rename {plc4j/examples => examples}/hello-connectivity-mqtt/src/main/java/org/apache/plc4x/java/examples/connectivity/mqtt/model/PlcFieldConfig.java (100%)
 rename {plc4j/examples => examples}/hello-connectivity-mqtt/src/main/java/org/apache/plc4x/java/examples/connectivity/mqtt/model/PlcMemoryBlock.java (100%)
 rename {plc4j/examples/hello-connectivity-kafka => examples/hello-connectivity-mqtt}/src/main/resources/logback.xml (100%)
 rename {plc4j/examples => examples}/hello-integration-edgent/pom.xml (95%)
 rename {plc4j/examples => examples}/hello-integration-edgent/src/main/java/org/apache/plc4x/java/examples/integration/edgent/CliOptions.java (100%)
 rename {plc4j/examples => examples}/hello-integration-edgent/src/main/java/org/apache/plc4x/java/examples/integration/edgent/PlcLogger.java (100%)
 rename {plc4j/examples/hello-world-plc4x => examples/hello-integration-edgent}/src/main/resources/logback.xml (100%)
 rename {plc4j/examples => examples}/hello-opm/pom.xml (95%)
 rename {plc4j/examples => examples}/hello-opm/src/main/java/org/apache/plc4x/java/examples/helloopm/HelloOpm.java (100%)
 rename {plc4j/examples => examples}/hello-opm/src/main/resources/logback.xml (100%)
 rename {plc4j/examples => examples}/hello-storage-elasticsearch/README.adoc (100%)
 rename {plc4j/examples => examples}/hello-storage-elasticsearch/pom.xml (96%)
 rename {plc4j/examples => examples}/hello-storage-elasticsearch/src/main/java/org/apache/plc4x/java/examples/storage/elasticsearch/ElasticsearchStorage.java (100%)
 rename {plc4j/examples => examples}/hello-storage-elasticsearch/src/main/resources/log4j2.xml (100%)
 rename {plc4j/examples => examples}/hello-storage-elasticsearch/src/main/resources/logback.xml (100%)
 rename {plc4j/examples => examples}/hello-webapp/client/pom.xml (86%)
 rename {plc4j/examples => examples}/hello-webapp/client/src/main/royale/HelloPLC4X.mxml (100%)
 rename {plc4j/examples => examples}/hello-webapp/client/src/main/royale/service/RobotService.as (100%)
 rename {plc4j/examples => examples}/hello-webapp/pom.xml (94%)
 rename {plc4j/examples => examples}/hello-webapp/service/pom.xml (93%)
 rename {plc4j/examples => examples}/hello-webapp/service/src/main/java/org/apache/plc4x/examples/robot/controllers/RobotController.java (100%)
 rename {plc4j/examples => examples}/hello-webapp/webapp/pom.xml (88%)
 rename {plc4j/examples => examples}/hello-webapp/webapp/src/main/java/org/apache/plc4x/examples/robot/Application.java (100%)
 rename {plc4j/examples => examples}/hello-webapp/webapp/src/main/resources/application.properties (100%)
 rename {plc4j/examples => examples}/hello-world-plc4x/pom.xml (95%)
 rename {plc4j/examples => examples}/hello-world-plc4x/src/main/java/org/apache/plc4x/java/examples/helloplc4x/CliOptions.java (100%)
 rename {plc4j/examples => examples}/hello-world-plc4x/src/main/java/org/apache/plc4x/java/examples/helloplc4x/HelloPlc4x.java (100%)
 rename {plc4j/examples/hello-integration-edgent => examples/hello-world-plc4x}/src/main/resources/logback.xml (100%)
 rename {plc4j/examples => examples}/pom.xml (80%)
 copy {plc4cpp/integrations/apache-mynewt => integrations/apache-brooklyn}/pom.xml (87%)
 rename {plc4j/integrations => integrations}/apache-calcite/pom.xml (95%)
 rename {plc4j/integrations => integrations}/apache-calcite/src/main/java/org/apache/plc4x/Plc4xBaseTable.java (100%)
 rename {plc4j/integrations => integrations}/apache-calcite/src/main/java/org/apache/plc4x/Plc4xSchema.java (100%)
 rename {plc4j/integrations => integrations}/apache-calcite/src/main/java/org/apache/plc4x/Plc4xSchemaFactory.java (100%)
 rename {plc4j/integrations => integrations}/apache-calcite/src/main/java/org/apache/plc4x/Plc4xStreamTable.java (100%)
 rename {plc4j/integrations => integrations}/apache-calcite/src/main/java/org/apache/plc4x/Plc4xTable.java (100%)
 rename {plc4j/integrations => integrations}/apache-calcite/src/test/java/org/apache/plc4x/DriverManagerTest.java (100%)
 rename {plc4j/integrations => integrations}/apache-calcite/src/test/java/org/apache/plc4x/Plc4XBaseTableTest.java (100%)
 rename {plc4j/integrations => integrations}/apache-calcite/src/test/java/org/apache/plc4x/Plc4xSchemaFactoryTest.java (96%)
 rename {plc4j/integrations => integrations}/apache-calcite/src/test/resources/example.yml (100%)
 rename {plc4j/integrations/apache-camel => integrations/apache-calcite}/src/test/resources/logback.xml (100%)
 rename {plc4j/integrations => integrations}/apache-calcite/src/test/resources/model.json (100%)
 rename {plc4j/integrations => integrations}/apache-camel/pom.xml (97%)
 rename {plc4j/integrations => integrations}/apache-camel/src/main/docs/PLC4X.adoc (100%)
 rename {plc4j/integrations => integrations}/apache-camel/src/main/java/org/apache/plc4x/camel/Constants.java (100%)
 rename {plc4j/integrations => integrations}/apache-camel/src/main/java/org/apache/plc4x/camel/Plc4XComponent.java (100%)
 rename {plc4j/integrations => integrations}/apache-camel/src/main/java/org/apache/plc4x/camel/Plc4XConsumer.java (100%)
 rename {plc4j/integrations => integrations}/apache-camel/src/main/java/org/apache/plc4x/camel/Plc4XEndpoint.java (100%)
 rename {plc4j/integrations => integrations}/apache-camel/src/main/java/org/apache/plc4x/camel/Plc4XPollingConsumer.java (100%)
 rename {plc4j/integrations => integrations}/apache-camel/src/main/java/org/apache/plc4x/camel/Plc4XProducer.java (100%)
 rename {plc4j/integrations => integrations}/apache-camel/src/main/resources/META-INF/services/org/apache/camel/component/plc4x (100%)
 rename {plc4j/integrations => integrations}/apache-camel/src/test/java/org/apache/plc4x/camel/ConstantsTest.java (100%)
 rename {plc4j/integrations => integrations}/apache-camel/src/test/java/org/apache/plc4x/camel/ManualTest.java (100%)
 rename {plc4j/integrations => integrations}/apache-camel/src/test/java/org/apache/plc4x/camel/MockDriver.java (100%)
 rename {plc4j/integrations => integrations}/apache-camel/src/test/java/org/apache/plc4x/camel/Plc4XComponentTest.java (100%)
 rename {plc4j/integrations => integrations}/apache-camel/src/test/java/org/apache/plc4x/camel/Plc4XConsumerTest.java (100%)
 rename {plc4j/integrations => integrations}/apache-camel/src/test/java/org/apache/plc4x/camel/Plc4XEndpointTest.java (100%)
 rename {plc4j/integrations => integrations}/apache-camel/src/test/java/org/apache/plc4x/camel/Plc4XPollingConsumerTest.java (100%)
 rename {plc4j/integrations => integrations}/apache-camel/src/test/java/org/apache/plc4x/camel/Plc4XProducerTest.java (100%)
 rename {plc4j/integrations => integrations}/apache-camel/src/test/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver (100%)
 rename {plc4j/integrations => integrations}/apache-camel/src/test/resources/log4j2.properties (100%)
 rename {plc4j/integrations/apache-calcite => integrations/apache-camel}/src/test/resources/logback.xml (100%)
 rename {plc4j/integrations => integrations}/apache-edgent/pom.xml (94%)
 rename {plc4j/integrations => integrations}/apache-edgent/src/main/java/org/apache/plc4x/edgent/PlcConnectionAdapter.java (100%)
 rename {plc4j/integrations => integrations}/apache-edgent/src/main/java/org/apache/plc4x/edgent/PlcFunctions.java (100%)
 rename {plc4j/integrations => integrations}/apache-edgent/src/main/java/org/apache/plc4x/edgent/package-info.java (100%)
 rename {plc4j/integrations => integrations}/apache-edgent/src/test/java/org/apache/plc4x/edgent/PlcConnectionAdapterTest.java (100%)
 rename {plc4j/integrations => integrations}/apache-edgent/src/test/java/org/apache/plc4x/edgent/PlcFunctionsTest.java (100%)
 rename {plc4j/integrations => integrations}/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockConnection.java (100%)
 rename {plc4j/integrations => integrations}/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockDriver.java (100%)
 rename {plc4j/integrations => integrations}/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockField.java (100%)
 rename {plc4j/integrations => integrations}/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockFieldHandler.java (100%)
 rename {plc4j/integrations => integrations}/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockFieldItem.java (100%)
 rename {plc4j/integrations => integrations}/apache-edgent/src/test/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver (100%)
 rename {plc4j/integrations => integrations}/apache-kafka/README.md (100%)
 rename {plc4j/integrations => integrations}/apache-kafka/config/sink.properties (100%)
 rename {plc4j/integrations => integrations}/apache-kafka/config/source.properties (100%)
 rename {plc4j/integrations => integrations}/apache-kafka/pom.xml (94%)
 rename {plc4j/integrations => integrations}/apache-kafka/src/main/java/org/apache/plc4x/kafka/Plc4xSinkConnector.java (95%)
 rename {plc4j/integrations => integrations}/apache-kafka/src/main/java/org/apache/plc4x/kafka/Plc4xSinkTask.java (100%)
 rename {plc4j/integrations => integrations}/apache-kafka/src/main/java/org/apache/plc4x/kafka/Plc4xSourceConnector.java (98%)
 rename {plc4j/integrations => integrations}/apache-kafka/src/main/java/org/apache/plc4x/kafka/Plc4xSourceTask.java (100%)
 rename {plc4j/integrations => integrations}/apache-kafka/src/main/java/org/apache/plc4x/kafka/util/VersionUtil.java (100%)
 rename {plc4j/integrations => integrations}/apache-karaf/karaf-ads-feature/pom.xml (76%)
 rename {plc4j/integrations => integrations}/apache-karaf/karaf-demo-server/pom.xml (73%)
 rename {plc4j/integrations => integrations}/apache-karaf/karaf-ethernet-ip-feature/pom.xml (75%)
 rename {plc4j/integrations => integrations}/apache-karaf/karaf-modbus-feature/pom.xml (76%)
 rename {plc4j/integrations => integrations}/apache-karaf/karaf-s7-feature/pom.xml (76%)
 rename {plc4j/integrations => integrations}/apache-karaf/karaf-simulated-feature/pom.xml (75%)
 rename {plc4j/integrations => integrations}/apache-karaf/pom.xml (87%)
 rename {plc4cpp/integrations => integrations}/apache-mynewt/pom.xml (89%)
 rename {plc4j/integrations => integrations}/apache-nifi/nifi-plc4x-nar/false-positives.xml (100%)
 rename {plc4j/integrations => integrations}/apache-nifi/nifi-plc4x-nar/pom.xml (73%)
 rename {plc4j/integrations => integrations}/apache-nifi/nifi-plc4x-processors/pom.xml (92%)
 rename {plc4j/integrations => integrations}/apache-nifi/nifi-plc4x-processors/src/main/java/org/apache/plc4x/nifi/BasePlc4xProcessor.java (100%)
 rename {plc4j/integrations => integrations}/apache-nifi/nifi-plc4x-processors/src/main/java/org/apache/plc4x/nifi/Plc4xSinkProcessor.java (100%)
 rename {plc4j/integrations => integrations}/apache-nifi/nifi-plc4x-processors/src/main/java/org/apache/plc4x/nifi/Plc4xSourceProcessor.java (100%)
 rename {plc4j/integrations => integrations}/apache-nifi/nifi-plc4x-processors/src/main/resources/META-INF/services/org.apache.nifi.processor.Processor (100%)
 rename {plc4j/integrations => integrations}/apache-nifi/nifi-plc4x-processors/src/test/java/org/apache/plc4x/processors/plc4x4nifi/Plc4xSinkProcessorTest.java (100%)
 rename {plc4j/integrations => integrations}/apache-nifi/nifi-plc4x-processors/src/test/java/org/apache/plc4x/processors/plc4x4nifi/Plc4xSourceProcessorTest.java (100%)
 rename {plc4j/integrations => integrations}/apache-nifi/pom.xml (96%)
 rename {plc4cpp/integrations => integrations}/pom.xml (78%)
 create mode 100644 plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/PlcDriverManager.cpp
 create mode 100644 plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/PlcDriverManager.h
 delete mode 100755 plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcReadRequestBuilder.cpp
 delete mode 100755 plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcReadRequestBuilder.h
 delete mode 100644 plc4cpp/examples/CMakeLists.txt
 delete mode 100644 plc4cpp/examples/pom.xml
 delete mode 100644 plc4cpp/integrations/CMakeLists.txt
 delete mode 100644 plc4cpp/integrations/apache-mynewt/CMakeLists.txt
 delete mode 100644 plc4cpp/integrations/edgex-foundry/CMakeLists.txt
 delete mode 100644 plc4cpp/integrations/edgex-foundry/pom.xml
 delete mode 100644 plc4j/integrations/pom.xml
 delete mode 100644 plc4j/src/site/asciidoc/users/gettingstarted.adoc
 delete mode 100644 plc4net/.gitignore
 delete mode 100644 plc4net/api/PlcDriverManager.cs
 delete mode 100644 plc4net/api/api.csproj
 delete mode 100644 plc4net/api/api/IPlcConnection.cs
 delete mode 100644 plc4net/api/api/IPlcDriver.cs
 delete mode 100644 plc4net/api/api/authentication/IPlcAuthentication.cs
 delete mode 100644 plc4net/api/api/authentication/PlcUsernamePasswordAuthentication.cs
 delete mode 100644 plc4net/api/api/metadata/IPlcConnectionMetadata.cs
 delete mode 100644 plc4net/api/exceptions/PlcConnectionException.cs
 delete mode 100644 plc4net/api/exceptions/PlcException.cs
 delete mode 100644 plc4net/api/exceptions/PlcInvalidFieldException.cs
 delete mode 100644 plc4net/api/messages/IPlcFieldRequest.cs
 delete mode 100644 plc4net/api/messages/IPlcFieldResponse.cs
 delete mode 100644 plc4net/api/messages/IPlcMessage.cs
 delete mode 100644 plc4net/api/messages/IPlcReadRequest.cs
 delete mode 100644 plc4net/api/messages/IPlcReadRequestBuilder.cs
 delete mode 100644 plc4net/api/messages/IPlcReadResponse.cs
 delete mode 100644 plc4net/api/messages/IPlcRequest.cs
 delete mode 100644 plc4net/api/messages/IPlcRequestBuilder.cs
 delete mode 100644 plc4net/api/messages/IPlcResponse.cs
 delete mode 100644 plc4net/api/messages/IPlcSubscriptionEventArgs.cs
 delete mode 100644 plc4net/api/messages/IPlcSubscriptionRequest.cs
 delete mode 100644 plc4net/api/messages/IPlcSubscriptionRequestBuilder.cs
 delete mode 100644 plc4net/api/messages/IPlcSubscriptionResponse.cs
 delete mode 100644 plc4net/api/messages/IPlcUnsubscriptionRequest.cs
 delete mode 100644 plc4net/api/messages/IPlcUnsubscriptionRequestBuilder.cs
 delete mode 100644 plc4net/api/messages/IPlcUnsubscriptionResponse.cs
 delete mode 100644 plc4net/api/messages/IPlcWriteRequest.cs
 delete mode 100644 plc4net/api/messages/IPlcWriteRequestBuilder.cs
 delete mode 100644 plc4net/api/model/IPlcField.cs
 delete mode 100644 plc4net/api/model/IPlcSubscriptionHandle.cs
 delete mode 100644 plc4net/api/pom.xml
 delete mode 100644 plc4net/api/types/PlcResponseCode.cs
 delete mode 100644 plc4net/plc4net.driver/plc4net.driver.csproj
 delete mode 100644 plc4net/plc4net.driver/pom.xml
 delete mode 100644 plc4net/plc4net.sln
 delete mode 100644 plc4net/pom.xml


[plc4x] 04/09: Merge branch 'develop' of https://gitbox.apache.org/repos/asf/plc4x into develop

Posted by ms...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

msommer pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 003477d5156db431d33715a2761f0e071fc42390
Merge: 9f936ee 44bd9d0
Author: Markus Sommer <ms...@apache.org>
AuthorDate: Fri May 3 09:31:02 2019 +0200

    Merge branch 'develop' of https://gitbox.apache.org/repos/asf/plc4x into develop

 .gitignore                                         |    5 +-
 Jenkinsfile                                        |    4 +-
 README                                             |   62 +
 .../300ppi/PLC4X logo without mascot@300x.png      |  Bin 0 -> 18418 bytes
 media/logos/300ppi/PLC4X.png                       |  Bin 0 -> 87342 bytes
 media/logos/300ppi/logo PLC4X black line@300x.png  |  Bin 0 -> 50768 bytes
 media/logos/300ppi/logo PLC4X color CMYK@300x.png  |  Bin 0 -> 87342 bytes
 media/logos/300ppi/logo PLC4X on dark bg@300x.png  |  Bin 0 -> 86925 bytes
 media/logos/300ppi/logo PLC4X white line@300x.png  |  Bin 0 -> 46417 bytes
 .../mascot color with apache feather@300x.png      |  Bin 0 -> 127847 bytes
 .../300ppi/mascot color without feather@300x.png   |  Bin 0 -> 91523 bytes
 media/logos/PDF/PLC4X logo without mascot.pdf      |  Bin 0 -> 66597 bytes
 media/logos/PDF/logo PLC4X black line.pdf          |  Bin 0 -> 123655 bytes
 media/logos/PDF/logo PLC4X color CMYK@300x.pdf     |  Bin 0 -> 252702 bytes
 media/logos/PDF/logo PLC4X on dark bg.pdf          |  Bin 0 -> 252970 bytes
 media/logos/PDF/logo PLC4X white line.pdf          |  Bin 0 -> 123558 bytes
 .../logos/PDF/mascot color with apache feather.pdf |  Bin 0 -> 271570 bytes
 media/logos/PDF/mascot color without feather.pdf   |  Bin 0 -> 249178 bytes
 media/logos/SVG/PLC4X logo without mascot.svg      |   59 +
 media/logos/SVG/logo PLC4X black line.svg          | 1598 +++++++++++++
 media/logos/SVG/logo PLC4X color CMYK@300x.svg     | 1492 ++++++++++++
 media/logos/SVG/logo PLC4X on dark bg.svg          | 1492 ++++++++++++
 media/logos/SVG/logo PLC4X white line.svg          | 1598 +++++++++++++
 .../logos/SVG/mascot color with apache feather.svg | 2462 ++++++++++++++++++++
 media/logos/SVG/mascot color without feather.svg   | 1403 +++++++++++
 plc4cpp/README.md                                  |    8 +-
 plc4cpp/api/CMakeLists.txt                         |    2 +-
 plc4cpp/api/pom.xml                                |   51 +-
 plc4cpp/api/src/assembly/cpp.xml                   |   47 +
 plc4cpp/libs/boost/pom.xml                         |  158 ++
 plc4cpp/libs/boost/src/assembly/cpp-windows.xml    |   47 +
 .../libs/boost/src/assembly/cpp.xml                |   51 +-
 plc4cpp/libs/pom.xml                               |  122 +-
 plc4cpp/pom.xml                                    |  162 +-
 .../pom.xml => plc4cpp/protocols/CMakeLists.txt    |   29 +-
 .../protocols/driver-bases/CMakeLists.txt          |   29 +-
 plc4cpp/protocols/driver-bases/base/CMakeLists.txt |    3 +-
 plc4cpp/protocols/driver-bases/base/pom.xml        |   54 +-
 .../driver-bases/base/src/assembly/cpp.xml         |   47 +
 protocols/pom.xml => plc4cpp/utils/CMakeLists.txt  |   29 +-
 plc4cpp/utils/logger/CMakeLists.txt                |    3 +-
 .../driver-bases/base => utils/logger}/pom.xml     |   62 +-
 plc4cpp/utils/logger/src/assembly/cpp.xml          |   47 +
 {protocols => plc4cpp/utils}/pom.xml               |   16 +-
 plc4j/drivers/s7/pom.xml                           |    6 -
 .../java/s7/connection/S7PlcConnectionIT.java      |    2 +
 .../java/ads/protocol/Plc4x2AdsProtocolTest.java   |    3 +
 .../java/modbus/netty/Plc4XModbusProtocolTest.java |   17 -
 plc4j/utils/interop/pom.xml                        |  198 ++
 plc4j/utils/interop/src/assembly/assembly.xml      |   41 +
 .../java/org/apache/plc4x/interop/impl/Client.java |   60 +
 .../org/apache/plc4x/interop/impl/Handler.java     |  160 ++
 .../java/org/apache/plc4x/interop/impl/Server.java |   91 +
 plc4j/utils/pom.xml                                |    9 +
 plc4py/README.md                                   |   58 +
 plc4py/pom.xml                                     |  201 ++
 plc4py/setup.py                                    |   67 +
 plc4py/src/assembly/python.xml                     |   47 +
 plc4py/src/main/python/__init__.py                 |   26 +
 plc4py/src/main/python/org/__init__.py             |   17 +
 plc4py/src/main/python/org/apache/__init__.py      |   17 +
 .../main/python/org/apache/plc4x/InteropClient.py  |   45 +
 .../main/python/org/apache/plc4x/PlcConnection.py  |   75 +
 .../python/org/apache/plc4x/PlcDriverManager.py    |   78 +
 .../src/main/python/org/apache/plc4x/__init__.py   |   17 +
 plc4py/src/main/resources/lib/log4j2.xml           |   32 +
 plc4py/src/test/python/__init__.py                 |   26 +
 plc4py/src/test/python/org/__init__.py             |   26 +
 plc4py/src/test/python/org/apache/__init__.py      |   26 +
 .../src/test/python/org/apache/plc4x/__init__.py   |   17 +
 .../org/apache/plc4x/test_PlcDriverManager.py      |  142 ++
 pom.xml                                            |  121 +-
 protocols/pom.xml                                  |   12 +
 protocols/{ => proxy}/pom.xml                      |   16 +-
 protocols/proxy/src/main/java/.keepMe              |   20 +
 .../apache/plc4x/protocols/proxy/interop.thrift    |   93 +
 sandbox/dynamic-driver-s7/pom.xml                  |    5 +
 src/site/asciidoc/index.adoc                       |   14 +-
 src/site/resources/plc4x-doap.rdf                  |    5 +-
 tools/README.md                                    |   72 +
 {protocols => tools}/pom.xml                       |   19 +-
 tools/thrift/pom.xml                               |  246 ++
 .../thrift/src/assembly/compiler.xml               |   50 +-
 .../pom.xml => tools/thrift/src/assembly/cpp.xml   |   48 +-
 tools/thrift/src/assembly/python.xml               |   54 +
 85 files changed, 12915 insertions(+), 506 deletions(-)



[plc4x] 06/09: CMakelists with central import of Boost

Posted by ms...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

msommer pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 1d86db6596fb493666fe0c20da0bf1dff159d5b6
Author: Markus Sommer <ms...@apache.org>
AuthorDate: Fri May 10 15:29:28 2019 +0200

    CMakelists with central import of Boost
---
 plc4cpp/utils/CMakeLists.txt        | 2 ++
 plc4cpp/utils/logger/CMakeLists.txt | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/plc4cpp/utils/CMakeLists.txt b/plc4cpp/utils/CMakeLists.txt
index 557916a..be2e8f8 100644
--- a/plc4cpp/utils/CMakeLists.txt
+++ b/plc4cpp/utils/CMakeLists.txt
@@ -18,3 +18,5 @@
 ]]
 
 add_subdirectory(logger)
+add_subdirectory(systemconfig)
+
diff --git a/plc4cpp/utils/logger/CMakeLists.txt b/plc4cpp/utils/logger/CMakeLists.txt
index eccf20e..8c4a38d 100644
--- a/plc4cpp/utils/logger/CMakeLists.txt
+++ b/plc4cpp/utils/logger/CMakeLists.txt
@@ -34,4 +34,10 @@ add_library(plc4cpp-utils-logger
 #[[
     Import the headers for boost and the plc4cpp-utils module
 ]]
+
+TARGET_LINK_LIBRARIES (plc4cpp-utils-logger ${Boost_LIBRARIES})
+
+
 target_include_directories (plc4cpp-utils-logger PUBLIC target/dependencies/include)
+target_include_directories (plc4cpp-utils-logger PUBLIC ${Boost_INCLUDE_DIRS})
+


[plc4x] 09/09: Merge branch 'develop' of https://gitbox.apache.org/repos/asf/plc4x into develop

Posted by ms...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

msommer pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 315a769c0ff9dd28fb7f53ef38e89f37c17eff4b
Merge: bfe56b0 ac506ff
Author: Markus Sommer <ms...@apache.org>
AuthorDate: Fri May 10 15:42:01 2019 +0200

    Merge branch 'develop' of https://gitbox.apache.org/repos/asf/plc4x into develop
    
    # Conflicts:
    #	plc4cpp/CMakeLists.txt

 plc4cpp/CMakeLists.txt | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --cc plc4cpp/CMakeLists.txt
index b8ef0e3,668ef96..f5ac41a
--- a/plc4cpp/CMakeLists.txt
+++ b/plc4cpp/CMakeLists.txt
@@@ -41,7 -29,8 +41,6 @@@ endforeach(
      Build all the modules of PLC4Cpp
  ]]
  add_subdirectory(api)
- add_subdirectory(protocols/driver-bases/base)
- add_subdirectory(drivers/s7)
+ add_subdirectory(protocols)
  add_subdirectory(utils)
- add_subdirectory(examples/hello-world-plc4x)
 -
 -add_subdirectory(examples)
 -add_subdirectory(integrations)
++add_subdirectory(examples)


[plc4x] 05/09: Nested Classes for Builder, PLcConnection modified CMakelists with central import of Boost

Posted by ms...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

msommer pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 1800d4b119847f03ab4229852a787b583fbd79d6
Author: Markus Sommer <ms...@apache.org>
AuthorDate: Fri May 10 15:29:06 2019 +0200

    Nested Classes for Builder, PLcConnection modified
    CMakelists with central import of Boost
---
 plc4cpp/api/CMakeLists.txt                         |   3 +-
 .../cpp/org/apache/plc4x/cpp/api/PlcConnection.cpp |  93 ++++++---
 .../cpp/org/apache/plc4x/cpp/api/PlcConnection.h   | 228 +++++++++++++--------
 .../plc4x/cpp/api/messages/PlcFieldRequest.h       |  10 +-
 .../plc4x/cpp/api/messages/PlcReadRequest.cpp      |   6 -
 .../apache/plc4x/cpp/api/messages/PlcReadRequest.h |  10 +-
 .../cpp/api/messages/PlcReadRequestBuilder.cpp     |  40 ----
 .../plc4x/cpp/api/messages/PlcReadRequestBuilder.h |  57 ------
 .../plc4x/cpp/api/messages/PlcRequestBuilder.h     |   1 -
 9 files changed, 222 insertions(+), 226 deletions(-)

diff --git a/plc4cpp/api/CMakeLists.txt b/plc4cpp/api/CMakeLists.txt
index 48c5d12..9d442d3 100644
--- a/plc4cpp/api/CMakeLists.txt
+++ b/plc4cpp/api/CMakeLists.txt
@@ -44,7 +44,6 @@ add_library(plc4cpp-api
         src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcFieldResponse.cpp
         src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcMessage.cpp
         src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcReadRequest.cpp
-        src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcReadRequestBuilder.cpp
         src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcReadResponse.cpp
         src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcRequest.cpp
         src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcRequestBuilder.cpp
@@ -75,4 +74,6 @@ add_library(plc4cpp-api
     Import the boost headers
 ]]
 target_include_directories (plc4cpp-api PUBLIC target/dependencies/include)
+target_include_directories (plc4cpp-api PUBLIC ${Boost_INCLUDE_DIRS})
+target_include_directories (plc4cpp-api PUBLIC ../utils/logger/src/main/cpp)
 
diff --git a/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/PlcConnection.cpp b/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/PlcConnection.cpp
index 12a9e9c..1b4479c 100755
--- a/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/PlcConnection.cpp
+++ b/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/PlcConnection.cpp
@@ -1,36 +1,81 @@
 /*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
 
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
+   http://www.apache.org/licenses/LICENSE-2.0
 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+ 
 #include "PlcConnection.h"
+#include "exceptions/PlcRuntimeException.h"
 
 namespace org
 {
-	namespace apache
-	{
-		namespace plc4x
-		{
-			namespace cpp
+  namespace apache
+  {
+    namespace plc4x
+    {
+	    namespace cpp
+	    {
+			namespace api
 			{
-				namespace api
+                using namespace org::apache::plc4x::cpp::api::exceptions;
+
+				PlcConnection::PlcConnection() :
+                    _bConnected(false),
+					_pSendBuffer(nullptr),
+					_pRecvBuffer(nullptr),
+					_iSendBufferSize(0),
+					_iRecvBufferSize(0)
+				{
+					setSendBufferSize(DEFAULT_BUFFER_SIZE);
+					setRecvBufferSize(DEFAULT_BUFFER_SIZE);
+					_strErrorMessage = "";
+				}
+
+				PlcConnection::~PlcConnection()
+				{
+					if (_pSendBuffer != NULL) delete[] _pSendBuffer;
+					if (_pRecvBuffer != NULL) delete[] _pRecvBuffer;
+				}
+
+				PlcField* PlcConnection::prepareField(std::string strFieldQuery)
+				{
+						BOOST_THROW_EXCEPTION(PlcRuntimeException("Parse method is not implemented for this connection / driver"));
+				}
+				
+				void PlcConnection::setSendBufferSize(int iBufferSize)
+				{
+					if (iBufferSize != _iSendBufferSize)
+					{
+						_iSendBufferSize = iBufferSize;
+						if (_pSendBuffer != NULL) delete[] _pSendBuffer;
+						_pSendBuffer = new unsigned char[_iSendBufferSize];
+					}
+				}
+
+				void PlcConnection::setRecvBufferSize(int iBufferSize)
 				{
+					if (iBufferSize != _iRecvBufferSize)
+					{
+						_iRecvBufferSize = iBufferSize;
+						if (_pRecvBuffer != NULL) delete[] _pRecvBuffer;
+						_pRecvBuffer = new unsigned char[_iRecvBufferSize];
+					}
 				}
 			}
-		}
-	}
+	    }
+    }
+  }
 }
diff --git a/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/PlcConnection.h b/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/PlcConnection.h
index b301696..0dc3762 100755
--- a/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/PlcConnection.h
+++ b/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/PlcConnection.h
@@ -1,22 +1,21 @@
 /*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
 #ifndef _PLC_CONNECTION
 #define _PLC_CONNECTION
 
@@ -26,87 +25,136 @@ under the License.
 #include "../api/messages/PlcSubscriptionRequest.h"
 #include "../api/messages/PlcUnsubscriptionRequest.h"
 
-using namespace org::apache::plc4x::cpp::api::metadata;
-using namespace org::apache::plc4x::cpp::api::messages;
+#include <org/apache/plc4x/cpp/utils/logger/DatDmp.h>
+#include <boost/signals2.hpp>
+#include <boost/thread.hpp>
+
+#define DEFAULT_BUFFER_SIZE	16384
 
 namespace org
 {
-	namespace apache
-	{
-		namespace plc4x
-		{
-			namespace cpp
+  namespace apache
+  {
+    namespace plc4x
+    {
+	    namespace cpp
+	    {
+			namespace api
 			{
-				namespace api
+
+				using namespace boost::signals2;
+                using namespace org::apache::plc4x::cpp::api::metadata;
+                using namespace org::apache::plc4x::cpp::api::messages;
+                using namespace org::apache::plc4x::cpp::utils;
+
+				/**
+				* Interface defining the most basic methods a PLC4X connection should support.
+				* This generally handles the connection establishment itself and the parsing of
+				* field address strings to the platform dependent PlcField instances.
+				*/
+				
+				class PlcConnection
 				{
+				public:
+
+					PlcConnection();
+					~PlcConnection();
+					
+					
 					/**
-					* Interface defining the most basic methods a PLC4X connection should support.
-					* This generally handles the connection establishment itself and the parsing of
-					* field address strings to the platform dependent PlcField instances.
+					* Establishes the connection to the remote PLC.
+					* @throws PlcConnectionException if the connection attempt failed
 					*/
-					class PlcConnection
-					{
-						public:
-							/**
-							* Establishes the connection to the remote PLC.
-							* @throws PlcConnectionException if the connection attempt failed
-							*/
-							virtual void connect() = 0;
-
-							/**
-							* Indicates if the connection is established to a remote PLC.
-							* @return {@code true} if connected, {@code false} otherwise
-							*/
-							virtual bool isConnected() = 0;
-
-							/**
-							 * Closes the connection to the remote PLC.
-							 * @throws Exception if shutting down the connection failed
-							 * Todo: implement java.lang.Autocloseable
-							 */
-						
-								virtual void close() = 0;
-
-							/**
-							 * Provides connection metadata.
-							 */
-							virtual PlcConnectionMetadata* getMetadata() const = 0;
-
-							/**
-							 * Obtain read request builder.
-							 * @throws PlcUnsupportedOperationException if the connection does not support reading
-							 * Todo: implement pendant for java Builder pattern
-							 */
-							virtual PlcReadRequest* readRequestBuilder() = 0;
-
-							/**
-							 * Obtain write request builder.
-							 * @throws PlcUnsupportedOperationException if the connection does not support writing
-							  * Todo: implement pendant for java Builder pattern (PlcWriteRequest.Builder)
-							 */
-							virtual PlcWriteRequest* writeRequestBuilder() = 0;
-
-							/**
-							 * Obtain subscription request builder.
-							 * @throws PlcUnsupportedOperationException if the connection does not support subscription
-							 * Todo: implement pendant for java Builder pattern (PlcSubscriptionRequest.Builder)
-							 */
-							virtual PlcSubscriptionRequest* subscriptionRequestBuilder() = 0;
-
-							/**
-							 * Obtain unsubscription request builder.
-							 * @throws PlcUnsupportedOperationException if the connection does not support subscription
-							 * Todo: implement pendant for java Builder pattern (PlcSubscriptionRequest.Builder)
-
-							 */
-							virtual PlcUnsubscriptionRequest* unsubscriptionRequestBuilder() = 0;
-
-						private:
-					};
-				}
+					virtual void connect() = 0;
+					
+					/**
+					* Indicates if the connection is established to a remote PLC.
+					* @return {@code true} if connected, {@code false} otherwise
+					*/
+					
+					inline bool isConnected() const { return _bConnected; }
+					
+					/**
+					 * Closes the connection to the remote PLC.
+					 * @throws Exception if shutting down the connection failed
+					 */
+					virtual void close() = 0;
+
+					/**
+					 * Parse a fieldQuery for the given connection type.
+					 *
+					 * @throws PlcRuntimeException If the string cannot be parsed
+					 */
+                    PlcField* prepareField(std::string strFieldQuery);
+
+					/**
+					 * Provides connection metadata.
+					 */
+					virtual PlcConnectionMetadata* getMetadata() = 0;
+
+					/**
+					 * Execute a ping query against a remote device to check the availability of the connection.
+					 *
+					 * @return CompletableFuture that is completed successfully (Void) or unsuccessfully with an PlcException.
+					 */
+					virtual void ping() = 0;
+
+					/**
+					 * Obtain read request builder.
+					 * @throws PlcUnsupportedOperationException if the connection does not support reading
+					 */
+					virtual PlcReadRequest::Builder* readRequestBuilder() = 0;
+
+					/**
+					 * Obtain write request builder.
+					 * @throws PlcUnsupportedOperationException if the connection does not support writing
+					 */
+					//virtual void Builder* writeRequestBuilder() = 0;
+
+					/**
+					 * Obtain subscription request builder.
+					 * @throws PlcUnsupportedOperationException if the connection does not support subscription
+					 */
+					//virtual void Builder* subscriptionRequestBuilder() = 0;
+
+					/**
+					 * Obtain unsubscription request builder.
+					 * @throws PlcUnsupportedOperationException if the connection does not support subscription
+					 */
+					//virtual void Builder* unsubscriptionRequestBuilder() = 0;
+
+					
+					virtual bool send(unsigned char* pBytesToSend, int iNumBytesToSend) = 0;
+					
+
+					inline int getSendBufferSize() const { return _iSendBufferSize; }
+					void setSendBufferSize(int iBufferSize);
+				
+					inline int getRecvBufferSize() const { return _iRecvBufferSize; }
+					void setRecvBufferSize(int iBlockSize);
+
+				protected:
+
+					virtual void onReceive(const boost::system::error_code& errorCode, std::size_t szRecvBytes) = 0;
+
+				protected:
+					bool            _bConnected;
+					unsigned char*  _pSendBuffer;
+					int             _iSendBufferSize;
+					unsigned char*  _pRecvBuffer;
+					int             _iRecvBufferSize;
+					std::string     _strErrorMessage;
+
+					boost::mutex              _mtxComLock;
+					boost::condition_variable _condComHandler;
+
+                    DatDmp _dump;
+
+				};
 			}
 		}
-	}
+    }
+  }
 }
 
 #endif
\ No newline at end of file
diff --git a/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcFieldRequest.h b/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcFieldRequest.h
index 16cc1f9..1b4d302 100755
--- a/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcFieldRequest.h
+++ b/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcFieldRequest.h
@@ -24,6 +24,7 @@ under the License.
 #include "PlcFieldResponse.h"
 
 #include <string>
+#include <map>
 
 namespace org
 {
@@ -40,13 +41,14 @@ namespace org
 						/**
 						 * Base type for all messages sent from the plc4x system to a connected plc.
 						 */
-						class PlcFieldRequest : PlcRequest
+						class PlcFieldRequest : public PlcRequest
 						{
 							public:	
 								virtual int getNumberOfFields() = 0;
-								virtual std::vector<std::string>* getFieldNames() const = 0;
-								virtual PlcField* getField(std::string) const = 0;
-								virtual std::vector<PlcField>* getFields() const = 0;
+                                virtual std::vector<std::string> getFieldNames();
+								virtual PlcField* getField(std::string) = 0;
+								virtual std::vector<PlcField*> getFields() = 0;
+                                virtual std::map<std::string, PlcField*> getNamedFields() = 0;
 
 							private:
 						};
diff --git a/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcReadRequest.cpp b/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcReadRequest.cpp
index 88a9b9f..9b9f9a0 100755
--- a/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcReadRequest.cpp
+++ b/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcReadRequest.cpp
@@ -33,18 +33,12 @@ namespace org
 					{
 						PlcReadRequest::PlcReadRequest()
 						{
-                            _pPlcbuilder = nullptr;
 						}
 
 						PlcReadRequest::~PlcReadRequest()
 						{
 							 // TODO Free Pointer eg. use Smartpointer ?
 						}
-
-						PlcReadRequestBuilder* PlcReadRequest::getBuilder() const
-						{ 
-							return _pPlcbuilder;
-						}
 					}
 				}
 			}
diff --git a/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcReadRequest.h b/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcReadRequest.h
index 65dc62b..afcdbe5 100755
--- a/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcReadRequest.h
+++ b/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcReadRequest.h
@@ -22,7 +22,6 @@ under the License.
 
 #include "PlcFieldRequest.h"
 #include "PlcRequestBuilder.h"
-#include "PlcReadRequestBuilder.h"
 
 
 namespace org
@@ -46,10 +45,15 @@ namespace org
 							PlcReadRequest();
 							~PlcReadRequest();
 
-							PlcReadRequestBuilder* getBuilder() const;
+                            class Builder : public PlcRequestBuilder
+                            {
+                            public:
+                                virtual PlcReadRequest* build() = 0;
+                                virtual Builder* addItem(std::string& strName, std::string& strFieldQuery) = 0;
+                            };
 
 						private:
-							PlcReadRequestBuilder* _pPlcbuilder;
+							
 						};
 												
 					}
diff --git a/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcReadRequestBuilder.cpp b/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcReadRequestBuilder.cpp
deleted file mode 100755
index 45f2ced..0000000
--- a/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcReadRequestBuilder.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-#include "PlcReadRequestBuilder.h"
-
-namespace org
-{
-	namespace apache
-	{
-		namespace plc4x
-		{
-			namespace cpp
-			{
-				namespace api
-				{
-					namespace messages
-					{
-
-					}
-				}
-			}
-		}
-	}
-}
diff --git a/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcReadRequestBuilder.h b/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcReadRequestBuilder.h
deleted file mode 100755
index cdb16a7..0000000
--- a/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcReadRequestBuilder.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-#ifndef _PLC_READ_REQUEST_BUILDER
-#define _PLC_READ_REQUEST_BUILDER
-
-#include "PlcRequestBuilder.h"
-
-#include <string>
-
-namespace org
-{
-	namespace apache
-	{
-		namespace plc4x
-		{
-			namespace cpp
-			{
-				namespace api
-				{
-					namespace messages
-					{
-						/**
-						 * Base type for all forms of messages passed between plc and plc4x system.
-						 */
-						class PlcReadRequestBuilder : public PlcRequestBuilder
-						{
-							public:
-								virtual PlcReadRequestBuilder* addItem(std::string& strName, std::string& strFieldQuery) = 0;
-
-						};
-						
-					}
-				}
-			}
-		}
-	}
-}
-
-#endif
-
diff --git a/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcRequestBuilder.h b/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcRequestBuilder.h
index d0732c3..6b80d19 100755
--- a/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcRequestBuilder.h
+++ b/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcRequestBuilder.h
@@ -40,7 +40,6 @@ namespace org
 						class PlcRequestBuilder
 						{
 							public:	
-								virtual PlcRequest* build() = 0;
 
 							private:
 						};


[plc4x] 02/09: Bugfixes for Debug-Mode

Posted by ms...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

msommer pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 4753c5578c8199d13954e5fe2a516a8dad09fa46
Author: Markus Sommer <ms...@apache.org>
AuthorDate: Fri May 3 09:22:52 2019 +0200

    Bugfixes for Debug-Mode
---
 .../src/main/cpp/org/apache/plc4x/cpp/utils/logger/DbgTrace.cpp     | 6 +++---
 .../logger/src/main/cpp/org/apache/plc4x/cpp/utils/logger/ExLog.cpp | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/plc4cpp/utils/logger/src/main/cpp/org/apache/plc4x/cpp/utils/logger/DbgTrace.cpp b/plc4cpp/utils/logger/src/main/cpp/org/apache/plc4x/cpp/utils/logger/DbgTrace.cpp
index 57c99e5..09c8e88 100644
--- a/plc4cpp/utils/logger/src/main/cpp/org/apache/plc4x/cpp/utils/logger/DbgTrace.cpp
+++ b/plc4cpp/utils/logger/src/main/cpp/org/apache/plc4x/cpp/utils/logger/DbgTrace.cpp
@@ -33,9 +33,9 @@ void TracerW(const wchar_t* formatStr, ...)
 	static wchar_t arcBuffer[TRACE_BUFFERSIZE];
 	va_list args;
 	va_start(args, formatStr);
-	_vstprintf_s(arcBuffer, TRACE_BUFFERSIZE, formatStr, args);
+    swprintf_s(arcBuffer, TRACE_BUFFERSIZE, formatStr, args);
 	va_end(args);
-	::OutputDebugString(buffer);
+	::OutputDebugStringW(arcBuffer);
 }
 
 
@@ -46,7 +46,7 @@ void Tracer(const char* formatStr, ...)
 	va_start(args, formatStr);
 	vsprintf_s(arcBuffer, TRACE_BUFFERSIZE, formatStr, args);
 	va_end(args);
-	::OutputDebugStringA(buffer);
+	::OutputDebugStringA(arcBuffer);
 }
 
 #endif
diff --git a/plc4cpp/utils/logger/src/main/cpp/org/apache/plc4x/cpp/utils/logger/ExLog.cpp b/plc4cpp/utils/logger/src/main/cpp/org/apache/plc4x/cpp/utils/logger/ExLog.cpp
index 455d907..6dae0f6 100644
--- a/plc4cpp/utils/logger/src/main/cpp/org/apache/plc4x/cpp/utils/logger/ExLog.cpp
+++ b/plc4cpp/utils/logger/src/main/cpp/org/apache/plc4x/cpp/utils/logger/ExLog.cpp
@@ -19,7 +19,7 @@ under the License.
 
 #include <boost/exception/all.hpp>
 #include <exception>
-#include <boost/lexical_cast.hpp>"
+#include <boost/lexical_cast.hpp>
 #include <typeinfo>
 #include "ErrorInfoException.h"
 


[plc4x] 01/09: Add PlcDriverManager for dynamic Loading PLCDrivers

Posted by ms...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

msommer pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit f89fafab00ed5209bd996bd8a397c27a6166b6ef
Author: Markus Sommer <ms...@apache.org>
AuthorDate: Fri May 3 09:21:43 2019 +0200

    Add PlcDriverManager for dynamic Loading PLCDrivers
---
 plc4cpp/api/CMakeLists.txt                         |   6 +-
 .../cpp/org/apache/plc4x/cpp/PlcDriverManager.cpp  | 175 +++++++++++++++++++++
 .../cpp/org/apache/plc4x/cpp/PlcDriverManager.h    |  71 +++++++++
 3 files changed, 250 insertions(+), 2 deletions(-)

diff --git a/plc4cpp/api/CMakeLists.txt b/plc4cpp/api/CMakeLists.txt
index 84c542c..cf1ee6f 100644
--- a/plc4cpp/api/CMakeLists.txt
+++ b/plc4cpp/api/CMakeLists.txt
@@ -22,7 +22,9 @@ set(CMAKE_CXX_STANDARD 11)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 set(CMAKE_CXX_EXTENSIONS OFF)
 
-add_library(plc4cpp-api src/main/cpp/org/apache/plc4x/cpp/api/PlcConnection.cpp
+add_library(plc4cpp-api 
+        src/main/cpp/org/apache/plc4x/cpp/PlcDriverManager.cpp
+        src/main/cpp/org/apache/plc4x/cpp/api/PlcConnection.cpp
         src/main/cpp/org/apache/plc4x/cpp/api/authentication/PlcAuthentication.cpp
         src/main/cpp/org/apache/plc4x/cpp/api/authentication/PlcUsernamePasswordAuthentication.cpp
         src/main/cpp/org/apache/plc4x/cpp/api/exceptions/PlcConnectionException.cpp
@@ -72,5 +74,5 @@ add_library(plc4cpp-api src/main/cpp/org/apache/plc4x/cpp/api/PlcConnection.cpp
 #[[
     Import the boost headers
 ]]
-target_include_directories (plc4cpp-api PUBLIC ../libs/libs/boost/include)
+target_include_directories (plc4cpp-api PUBLIC PUBLIC ../libs/libs/boost/include)
 
diff --git a/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/PlcDriverManager.cpp b/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/PlcDriverManager.cpp
new file mode 100644
index 0000000..5c3506a
--- /dev/null
+++ b/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/PlcDriverManager.cpp
@@ -0,0 +1,175 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+#include "PlcDriverManager.h"
+#include <windows.h>
+#include <boost/filesystem.hpp>
+#include <boost/regex.hpp>
+#include <iostream>
+
+namespace fs = boost::filesystem;
+
+namespace org
+{
+	namespace apache
+	{
+		namespace plc4x
+		{
+            namespace cpp
+            {
+                PlcDriverManager::PlcDriverManager()
+                {
+                    findDrivers();
+                }
+            
+                PlcDriverManager::~PlcDriverManager()
+				{
+				}
+
+				/**
+					* Connects to a PLC using the given plc connection string.
+					*
+					* @param url plc connection string.
+					* @return PlcConnection object.
+					* @throws PlcConnectionException an exception if the connection attempt failed.
+					*/
+				PlcConnection* PlcDriverManager::getConnection(std::string url)
+				{
+                    PlcDriver* pPlcDriver = NULL;
+                    PlcConnection* pPlcConnection = NULL;
+                    
+                    pPlcDriver = getDriver(url);
+                    if (pPlcDriver != NULL)
+                    { 
+                        pPlcConnection = pPlcDriver->connect(url);
+                    }
+                    
+					return pPlcConnection;
+				}
+
+				/**
+					* Connects to a PLC using the given plc connection string using given authentication credentials.
+					*
+					* @param url            plc connection string.
+					* @param authentication authentication credentials.
+					* @return PlcConnection object.
+					* @throws PlcConnectionException an exception if the connection attempt failed.					
+					**/
+				PlcConnection* PlcDriverManager::getConnection(std::string url, PlcAuthentication& authentication)
+				{
+                    PlcDriver* pPlcDriver = NULL;
+                    PlcConnection* pPlcConnection = NULL;
+                    
+                    pPlcDriver = getDriver(url);
+                    if (pPlcDriver != NULL)
+                    {
+                        pPlcConnection = pPlcDriver->connect(url, authentication);
+                    }
+					
+					return pPlcConnection;
+				}
+
+                PlcDriver* PlcDriverManager::getDriver(std::string url)
+                {
+                    PlcDriver* pPlcDriver = NULL;
+                    std::string strProtocol = "";
+                    
+                    try
+                    {
+                        boost::regex exFilter(REGEX_PROTOCOL.c_str());
+                        boost::smatch what;
+
+                        if (boost::regex_search(url, what, exFilter))
+                        {
+                            if (what.size() > 1)
+                            {
+                                strProtocol = what[1].str();
+                                pPlcDriver = _mapDrivers[strProtocol];
+                            }
+                        }
+
+                        if (pPlcDriver == NULL)
+                        {
+                            BOOST_THROW_EXCEPTION(PlcConnectionException("Unable to find driver for protocol '" + strProtocol + "'"));
+                        }
+                    }
+                    catch (std::exception& ex)
+                    {
+                        BOOST_THROW_EXCEPTION(PlcConnectionException("Invalid plc4; connection string '" + url + "'", ex));
+                    }
+
+                    return pPlcDriver;
+                }
+
+                void PlcDriverManager::findDrivers()
+                {
+                    typedef PlcDriver* (*pfCreatePlcDriver)();
+                    pfCreatePlcDriver CreatePlcDriver;
+                        
+                    boost::regex exFilter(PLC_DRIVER_TEMPLATE);
+                    boost::smatch what;
+                        
+                    for (fs::recursive_directory_iterator itDirFiles("../.."); itDirFiles != fs::recursive_directory_iterator(); itDirFiles++)
+                    {
+                        if (boost::filesystem::is_regular_file(*itDirFiles))
+                        {
+                            std::string strFilename = itDirFiles->path().filename().string();
+
+                            if (boost::regex_search(strFilename, what, exFilter))
+                            {
+                                std::string strDriverName = what[1].str();                                    
+                                    
+                                try
+                                {
+                                    //TODO: Only implemented for Windows
+                                    HINSTANCE hdll = NULL;
+                                    hdll = LoadLibrary((itDirFiles->path().string().c_str()));
+                                    if (hdll != NULL)
+                                    {
+                                        CreatePlcDriver = (pfCreatePlcDriver)GetProcAddress(hdll, PLC_CREATE_DRIVER_INSTANCE.c_str());
+                                        if (CreatePlcDriver != NULL)
+                                        {
+                                            PlcDriver* pPlcDriver = NULL;
+
+                                            pPlcDriver = CreatePlcDriver();
+                                            if (pPlcDriver != NULL)
+                                            {
+                                                _mapDrivers.insert(std::pair<std::string, PlcDriver*>(pPlcDriver->getProtocolCode(), pPlcDriver));
+                                            }
+                                        }
+                                    }
+                                }
+                                catch (...)
+                                {
+                                }
+                            }
+                        }
+                    }
+
+                    if (_mapDrivers.size() == 0)
+                    {
+                        BOOST_THROW_EXCEPTION(PlcConnectionException("Unable to find drivers"));
+                    }
+                   
+                    return;
+                }                
+			}
+		}
+	}
+}
diff --git a/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/PlcDriverManager.h b/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/PlcDriverManager.h
new file mode 100644
index 0000000..227310f
--- /dev/null
+++ b/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/PlcDriverManager.h
@@ -0,0 +1,71 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+#ifndef _PLC_DRIVER_MANAGER
+#define _PLC_DRIVER_MANAGER
+#include <vector>
+#include <map>
+#include <string>
+#include <iostream>
+#include "./api/PlcConnection.h"
+#include "./spi/PlcDriver.h"
+#include "./api/exceptions/PlcConnectionException.h"
+
+using namespace org::apache::plc4x::cpp::api::exceptions;
+using namespace org::apache::plc4x::cpp::spi;
+
+namespace org
+{
+	namespace apache
+	{
+		namespace plc4x
+		{
+			namespace cpp
+			{
+				class PlcDriverManager
+				{				
+
+					public:
+						PlcDriverManager();
+
+						~PlcDriverManager();
+
+						PlcConnection* getConnection(std::string url);
+						PlcConnection* getConnection(std::string url, PlcAuthentication& authentication);
+
+					protected:
+						
+					private:
+						std::map<std::string, PlcDriver*> _mapDrivers;
+						PlcDriver* getDriver(std::string url);
+
+                        void findDrivers();
+
+                        const std::string PLC_DRIVER_TEMPLATE = "plc4cpp-driver-(.*)(.dll|.so)";
+                        const std::string PLC_CREATE_DRIVER_INSTANCE = "_CreatePlcDriverInstance";
+                        const std::string REGEX_PROTOCOL = "^(?<proto>.*)://";
+                        
+
+				};
+			}
+		}
+	}
+}
+
+#endif
\ No newline at end of file


[plc4x] 07/09: Nested Class Builder CMakelists with central import of Boost

Posted by ms...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

msommer pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 2ab73c335e88f06bfdb765f6d83ce81774a5241f
Author: Markus Sommer <ms...@apache.org>
AuthorDate: Fri May 10 15:30:19 2019 +0200

    Nested Class Builder
    CMakelists with central import of Boost
---
 plc4cpp/protocols/driver-bases/base/CMakeLists.txt |   7 +-
 .../cpp/base/connection/AbstractPlcConnection.cpp  |  31 ++++-
 .../cpp/base/connection/AbstractPlcConnection.h    |   5 +-
 .../plc4x/cpp/base/connection/PlcFieldHandler.h    |   2 +-
 .../cpp/base/messages/DefaultPlcReadRequest.cpp    | 100 +++++++++-------
 .../cpp/base/messages/DefaultPlcReadRequest.h      |  35 ++++--
 .../cpp/base/messages/DefaultPlcWriteRequest.cpp   | 127 ++++++++++-----------
 .../cpp/base/messages/DefaultPlcWriteRequest.h     |  11 +-
 .../cpp/base/messages/InternalPlcFieldRequest.h    |   2 +-
 9 files changed, 194 insertions(+), 126 deletions(-)

diff --git a/plc4cpp/protocols/driver-bases/base/CMakeLists.txt b/plc4cpp/protocols/driver-bases/base/CMakeLists.txt
index e3157a7..3c5d607 100644
--- a/plc4cpp/protocols/driver-bases/base/CMakeLists.txt
+++ b/plc4cpp/protocols/driver-bases/base/CMakeLists.txt
@@ -22,7 +22,9 @@ set(CMAKE_CXX_STANDARD 11)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 set(CMAKE_CXX_EXTENSIONS OFF)
 
-add_library(plc4cpp-protocols-driver-base-base src/main/cpp/org/apache/plc4x/cpp/base/connection/AbstractPlcConnection.cpp
+add_library(plc4cpp-protocols-driver-base-base 
+        src/main/cpp/org/apache/plc4x/cpp/base/connection/AbstractPlcConnection.cpp
+        #src/main/cpp/org/apache/plc4x/cpp/base/connection/BoostConnection.cpp
         src/main/cpp/org/apache/plc4x/cpp/base/connection/ChannelFactory.cpp
         src/main/cpp/org/apache/plc4x/cpp/base/connection/DefaultPlcFieldHandler.cpp
         src/main/cpp/org/apache/plc4x/cpp/base/connection/PlcFieldHandler.cpp
@@ -63,3 +65,6 @@ add_library(plc4cpp-protocols-driver-base-base src/main/cpp/org/apache/plc4x/cpp
     Import the headers for boost and the plc4cpp-api module
 ]]
 target_include_directories (plc4cpp-protocols-driver-base-base PUBLIC target/dependencies/include)
+target_include_directories (plc4cpp-protocols-driver-base-base PUBLIC ${Boost_INCLUDE_DIRS})
+target_include_directories (plc4cpp-protocols-driver-base-base PUBLIC ../../../api/src/main/cpp)
+target_include_directories (plc4cpp-protocols-driver-base-base PUBLIC ../../../utils/logger/src/main/cpp)
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/AbstractPlcConnection.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/AbstractPlcConnection.cpp
index af47faa..6a6eab0 100644
--- a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/AbstractPlcConnection.cpp
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/AbstractPlcConnection.cpp
@@ -18,6 +18,7 @@ under the License.
 */
 
 #include "AbstractPlcConnection.h"
+#include <org/apache/plc4x/cpp/api/exceptions/PlcUnsupportedOperationException.h>
 
 namespace org
 {
@@ -31,9 +32,11 @@ namespace org
 				{
 					namespace connection
 					{
-						PlcConnectionMetadata& AbstractPlcConnection::getMetadata()
+                        using namespace org::apache::plc4x::cpp::api::exceptions;
+
+                        PlcConnectionMetadata* AbstractPlcConnection::getMetadata()
 						{
-							return *this;
+							return this;
 						}
 						bool AbstractPlcConnection::canRead()
 						{
@@ -47,6 +50,30 @@ namespace org
 						{
 							return false;
 						}
+
+                        PlcReadRequest::Builder* AbstractPlcConnection::readRequestBuilder()
+                        {
+                            BOOST_THROW_EXCEPTION(PlcUnsupportedOperationException("The connection does not support reading"));
+                        }
+
+                        
+
+                        /*@Override
+                            public PlcWriteRequest.Builder writeRequestBuilder() {
+                            throw new PlcUnsupportedOperationException("The connection does not support writing");
+                        }
+
+                        @Override
+                            public PlcSubscriptionRequest.Builder subscriptionRequestBuilder() {
+                            throw new PlcUnsupportedOperationException("The connection does not support subscription");
+                        }
+
+                        @Override
+                            public PlcUnsubscriptionRequest.Builder unsubscriptionRequestBuilder() {
+                            throw new PlcUnsupportedOperationException("The connection does not support subscription");
+                        }*/
+
+
 					}
 				}
 			}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/AbstractPlcConnection.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/AbstractPlcConnection.h
index e7b0683..c17e933 100644
--- a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/AbstractPlcConnection.h
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/AbstractPlcConnection.h
@@ -48,7 +48,7 @@ namespace org
 						{
 
 						public:
-							PlcConnectionMetadata& getMetadata();
+							PlcConnectionMetadata* getMetadata();
 							bool canRead();
 							bool canWrite();
 							bool canSubscribe();
@@ -57,8 +57,7 @@ namespace org
 							virtual void close() = 0;
 							virtual bool send(unsigned char* pBytesToSend, int iNumBytesToSend) = 0;
 
-							// Todo: Check if required
-							//PlcReadRequest.Builder readRequestBuilder();
+							PlcReadRequest::Builder* readRequestBuilder();
 							// PlcWriteRequest.Builder writeRequestBuilder();
 							// PlcSubscriptionRequest.Builder subscriptionRequestBuilder();
 							// PlcUnsubscriptionRequest.Builder nsubscriptionRequestBuilder();
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/PlcFieldHandler.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/PlcFieldHandler.h
index b26339f..3ee2257 100644
--- a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/PlcFieldHandler.h
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/PlcFieldHandler.h
@@ -58,7 +58,7 @@ namespace org
 
 						public:
 
-							virtual PlcField createField(std::string strFieldQuery) = 0;
+							virtual PlcField* createField(std::string strFieldQuery) = 0;
 
 							virtual BaseDefaultFieldItem<bool>* encodeBoolean(PlcField plcField, std::vector<void*> pValues) = 0;
 
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcReadRequest.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcReadRequest.cpp
index 21005b7..82a53ad 100644
--- a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcReadRequest.cpp
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcReadRequest.cpp
@@ -39,81 +39,103 @@ namespace org
 						}
 
 						// =========================================================
-						DefaultPlcReadRequest::DefaultPlcReadRequest(PlcReader* reader, std::map<std::string, PlcField> fields)
+						DefaultPlcReadRequest::DefaultPlcReadRequest(PlcReader* plcReader, std::map<std::string, PlcField*> mplcFields)
 						{
-							this->_reader = reader;
-							this->_fields = fields;
+                            _plcReader = plcReader;
+                            _mplcFields = mplcFields;
 						}
 
+                        // ====================================================
+                        PlcReader* DefaultPlcReadRequest::getReader()
+                        {
+                            return _plcReader;
+                        }
+
 						// ==========================================================
 						int DefaultPlcReadRequest::getNumberOfFields()
 						{
-							return _fields.size();
+							return _mplcFields.size();
 						}
 
 						// =========================================================
-						PlcField* DefaultPlcReadRequest::getField(std::string name)
+						PlcField* DefaultPlcReadRequest::getField(std::string strName)
 						{
-							// sgl: check 1st, whether the key is contained in vector 
-							// (otherwise an exception is thrown)...
-							std::map<std::string, PlcField>::iterator iterator = _fields.find(name);
+                            PlcField* plcField = nullptr;
+                            
+                            std::map<std::string, PlcField*>::iterator iterator = _mplcFields.find(strName);
 
-							if (iterator == _fields.end())
+							if (iterator != _mplcFields.end())
 							{
-								return nullptr;
+                                plcField = iterator->second;
 							}
 
-							return &(iterator->second);
-							
+							return plcField;							
 						}
 
 						// ======================================================
-						std::map<std::string, PlcField> DefaultPlcReadRequest::getNamedFields()
-						{
-							// Todo:
-							/*return fields.entrySet()
-								.stream()
-								.map(stringPlcFieldEntry->Pair.of(stringPlcFieldEntry.getKey(), stringPlcFieldEntry.getValue()))
-								.collect(Collectors.toCollection(LinkedList::new));
-*/
-							return std::map<std::string, PlcField>();
-						}
-
-						// ====================================================
-						PlcReader* DefaultPlcReadRequest::getReader()
+						std::map<std::string, PlcField*> DefaultPlcReadRequest::getNamedFields()
 						{
-							return _reader;
+							return std::map<std::string, PlcField*>();
 						}
 
 						// =====================================================
-						std::vector<PlcField> DefaultPlcReadRequest::getFields()
+						std::vector<PlcField*> DefaultPlcReadRequest::getFields()
 						{
-							// TODO: check if already exists...
-							std::pair<std::string, PlcField> me;
-							std::vector<PlcField> vNames;
+							std::pair<std::string, PlcField*> me;
+							std::vector<PlcField*> vplcFields;
 
-							BOOST_FOREACH(me, _fields)
+							BOOST_FOREACH(me, _mplcFields)
 							{
-								vNames.push_back(me.second);
+                                vplcFields.push_back(me.second);
 							}
 
-							return vNames;
+							return vplcFields;
 						}
 
 						// =========================================================
 						std::vector<std::string> DefaultPlcReadRequest::getFieldNames()
 						{							
 							// TODO: check if already exists...
-							std::pair<std::string, PlcField> me;
-							std::vector<std::string> vNames;
+							std::pair<std::string, PlcField*> me;
+							std::vector<std::string> vstrNames;
 
-							BOOST_FOREACH(me, _fields)
+							BOOST_FOREACH(me, _mplcFields)
 							{
-								vNames.push_back(me.first);
+                                vstrNames.push_back(me.first);
 							}
 
-							return vNames;
-						}						
+							return vstrNames;
+						}
+
+                        DefaultPlcReadRequest::Builder::Builder(PlcReader* plcReader, PlcFieldHandler* plcFieldHandler)
+                        {
+                            _plcReader = plcReader;
+                            _plcFieldHandler = plcFieldHandler;
+                        }
+
+                        DefaultPlcReadRequest::Builder* DefaultPlcReadRequest::Builder::addItem(std::string strName, std::string strFieldQuery)
+                        {
+                            std::map<std::string, std::string>::iterator iterator = _mFields.find(strName);
+                            if (iterator != _mFields.end())
+                            {
+                                BOOST_THROW_EXCEPTION(PlcRuntimeException("Duplicate field definition '" + strName + "'"));
+                            }
+                            _mFields.insert(std::pair<std::string,std::string>(strName, strFieldQuery));
+                            return this;
+                        }
+
+                        PlcReadRequest* DefaultPlcReadRequest::Builder::build()
+                        {
+                            std::map<std::string, PlcField*> mParsedFields;
+                            std::pair<std::string, std::string> me;
+
+                            BOOST_FOREACH(me, _mFields)
+                            {
+                                PlcField* parsedField = _plcFieldHandler->createField(me.second);
+                                mParsedFields.insert(std::pair<std::string, PlcField*>(me.first, parsedField));
+                            }
+                            return new DefaultPlcReadRequest(_plcReader, mParsedFields);
+                        }
 					}
 				}
 			}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcReadRequest.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcReadRequest.h
index ef31dd1..4ce2c9c 100644
--- a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcReadRequest.h
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcReadRequest.h
@@ -24,11 +24,12 @@ under the License.
 #include "InternalPlcFieldRequest.h"
 #include "PlcReader.h"
 #include <org/apache/plc4x/cpp/api/model/PlcField.h>
+#include "../connection/PlcFieldHandler.h"
 
 #include <map>
 #include <boost/foreach.hpp>
 
-using namespace org::apache::plc4x::cpp::api::messages;
+
 
 
 namespace org
@@ -43,8 +44,10 @@ namespace org
 				{
 					namespace messages
 					{
-						
-						class DefaultPlcReadRequest : public InternalPlcReadRequest //, public InternalPlcFieldRequest
+                        using namespace org::apache::plc4x::cpp::api::messages;
+                        using namespace org::apache::plc4x::cpp::base::connection;
+
+                        class DefaultPlcReadRequest : public InternalPlcReadRequest
 						{
 						public:
 							// Todo:
@@ -55,21 +58,37 @@ namespace org
 
 							// Todo: implement java Builder-pattern for C++							
 							
-							DefaultPlcReadRequest(PlcReader* reader, std::map<std::string, PlcField> fields);
+							DefaultPlcReadRequest(PlcReader* plcReader, std::map<std::string, PlcField*> mplcFields);
 							int getNumberOfFields();						
 							std::vector<std::string> getFieldNames();			
 							PlcField* getField(std::string name);
-							std::vector<PlcField> getFields();
-							std::map<std::string, PlcField> getNamedFields();
+							std::vector<PlcField*> getFields();
+							std::map<std::string, PlcField*> getNamedFields();
+
+                            class Builder
+                            {
+                            public:
+                                Builder(PlcReader* plcReader, PlcFieldHandler* plcFieldHandler);
+                                Builder* addItem(std::string strName, std::string strFieldQuery);
+                                PlcReadRequest* build();
+
+                            private:
+                                PlcReader* _plcReader;
+                                PlcFieldHandler* _plcFieldHandler;
+                                std::map<std::string, std::string> _mFields;
+                            };
+
 
 						protected:
+
 							PlcReader* getReader();
 							
 
 						private:					
+
 							DefaultPlcReadRequest();
-							PlcReader* _reader;
-							std::map<std::string, PlcField> _fields;
+							PlcReader* _plcReader;
+							std::map<std::string, PlcField*> _mplcFields;
 						};
 					}
 				}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcWriteRequest.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcWriteRequest.cpp
index bccc0c3..e0d6f9d 100644
--- a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcWriteRequest.cpp
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcWriteRequest.cpp
@@ -17,7 +17,7 @@ specific language governing permissions and limitations
 under the License.
 */
 
-#include "DefaultPlcReadRequest.h"
+#include "DefaultPlcWriteRequest.h"
 
 namespace org
 {
@@ -32,86 +32,83 @@ namespace org
 					namespace messages
 					{
 						// =========================================================
-						DefaultPlcReadRequest::DefaultPlcReadRequest()
+                        DefaultPlcWriteRequest::DefaultPlcWriteRequest()
 						{
 						}
 
 						// =========================================================
-						DefaultPlcReadRequest::DefaultPlcReadRequest(PlcReader* reader, std::map<std::string, PlcField> fields)
+						DefaultPlcWriteRequest::DefaultPlcWriteRequest(PlcWriter* plcWriter, std::map<std::string, PlcField*> mplcFields)
 						{
-							this->_reader = reader;
-							this->_fields = fields;
+							_plcWriter = plcWriter;
+                            _mplcFields = mplcFields;
 						}
 
-						// ==========================================================
-						int DefaultPlcReadRequest::getNumberOfFields()
-						{
-							return _fields.size();
-						}
+                        // ====================================================
+                        PlcWriter* DefaultPlcWriteRequest::getWriter()
+                        {
+                            return _plcWriter;
+                        }
 
-						// =========================================================
-						PlcField* DefaultPlcReadRequest::getField(std::string name)
-						{
-							// sgl: check 1st, whether the key is contained in vector 
-							// (otherwise an exception is thrown)...
-							std::map<std::string, PlcField>::iterator iterator = _fields.find(name);
+                        // ==========================================================
+                        int DefaultPlcWriteRequest::getNumberOfFields()
+                        {
+                            return _mplcFields.size();
+                        }
 
-							if (iterator == _fields.end())
-							{
-								return nullptr;
-							}
+                        // =========================================================
+                        PlcField* DefaultPlcWriteRequest::getField(std::string strName)
+                        {
+                            PlcField* plcField = nullptr;
 
-							return &(iterator->second);
-							
-						}
+                            std::map<std::string, PlcField*>::iterator iterator = _mplcFields.find(strName);
 
-						// ======================================================
-						std::map<std::string, PlcField> DefaultPlcReadRequest::getNamedFields()
-						{
-							// Todo:
-							/*return fields.entrySet()
-								.stream()
-								.map(stringPlcFieldEntry->Pair.of(stringPlcFieldEntry.getKey(), stringPlcFieldEntry.getValue()))
-								.collect(Collectors.toCollection(LinkedList::new));
-*/
-							return std::map<std::string, PlcField>();
-						}
+                            if (iterator != _mplcFields.end())
+                            {
+                                plcField = iterator->second;
+                            }
 
-						// ====================================================
-						PlcReader* DefaultPlcReadRequest::getReader()
-						{
-							return _reader;
-						}
+                            return plcField;
 
-						// =====================================================
-						std::vector<PlcField> DefaultPlcReadRequest::getFields()
-						{
-							// TODO: check if already exists...
-							std::pair<std::string, PlcField> me;
-							std::vector<PlcField> vNames;
+                        }
 
-							BOOST_FOREACH(me, _fields)
-							{
-								vNames.push_back(me.second);
-							}
+                        // ======================================================
+                        std::map<std::string, PlcField*> DefaultPlcWriteRequest::getNamedFields()
+                        {
+                            return std::map<std::string, PlcField*>();
+                        }
 
-							return vNames;
-						}
+                        // =====================================================
+                        std::vector<PlcField*> DefaultPlcWriteRequest::getFields()
+                        {
+                            std::pair<std::string, PlcField*> me;
+                            std::vector<PlcField*> vplcFields;
 
-						// =========================================================
-						std::vector<std::string> DefaultPlcReadRequest::getFieldNames()
-						{							
-							// TODO: check if already exists...
-							std::pair<std::string, PlcField> me;
-							std::vector<std::string> vNames;
-
-							BOOST_FOREACH(me, _fields)
-							{
-								vNames.push_back(me.first);
-							}
-
-							return vNames;
-						}						
+                            BOOST_FOREACH(me, _mplcFields)
+                            {
+                                vplcFields.push_back(me.second);
+                            }
+
+                            return vplcFields;
+                        }
+
+                        // =========================================================
+                        std::vector<std::string> DefaultPlcWriteRequest::getFieldNames()
+                        {
+                            // TODO: check if already exists...
+                            std::pair<std::string, PlcField*> me;
+                            std::vector<std::string> vstrNames;
+
+                            BOOST_FOREACH(me, _mplcFields)
+                            {
+                                vstrNames.push_back(me.first);
+                            }
+
+                            return vstrNames;
+                        }
+
+						
+
+											
 					}
 				}
 			}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcWriteRequest.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcWriteRequest.h
index 163c64b..a349dbe 100644
--- a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcWriteRequest.h
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcWriteRequest.h
@@ -54,22 +54,21 @@ namespace org
 
 							// Todo: implement java Builder-pattern for C++							
 							
-							DefaultPlcWriteRequest(PlcWriter* writer, std::map<std::string, PlcField> fields);
+							DefaultPlcWriteRequest(PlcWriter* writer, std::map<std::string, PlcField*> fields);
 							int getNumberOfFields();						
 							std::vector<std::string> getFieldNames();			
 							PlcField* getField(std::string name);
-							std::vector<PlcField> getFields();
-							std::map<std::string, PlcField> getNamedFields();
+							std::vector<PlcField*> getFields();
+							std::map<std::string, PlcField*> getNamedFields();
 							// Todo: implement callback to: execute() { _writer.write(this); }
 
 						protected:
 							PlcWriter* getWriter();
 							
-
 						private:					
 							DefaultPlcWriteRequest();
-							PlcWriter* _writer;
-							std::map<std::string, PlcField> _fields;
+							PlcWriter* _plcWriter;
+							std::map<std::string, PlcField*> _mplcFields;
 						};
 					}
 				}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcFieldRequest.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcFieldRequest.h
index 9247d54..37415ca 100644
--- a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcFieldRequest.h
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcFieldRequest.h
@@ -41,7 +41,7 @@ namespace org
 						class InternalPlcFieldRequest : public InternalPlcRequest, PlcFieldRequest
 						{
 						public:
-							virtual std::map<std::string, PlcField> getNamedFields() = 0;
+							virtual std::map<std::string, PlcField*> getNamedFields() = 0;
 							InternalPlcFieldRequest();
 						};
 					}


[plc4x] 03/09: Bugfix double word PUBLIC

Posted by ms...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

msommer pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 9f936eeff62708643a5b12550815a77bcbf74224
Author: Markus Sommer <ms...@apache.org>
AuthorDate: Fri May 3 09:27:02 2019 +0200

    Bugfix double word PUBLIC
---
 plc4cpp/api/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plc4cpp/api/CMakeLists.txt b/plc4cpp/api/CMakeLists.txt
index cf1ee6f..fb0825f 100644
--- a/plc4cpp/api/CMakeLists.txt
+++ b/plc4cpp/api/CMakeLists.txt
@@ -74,5 +74,5 @@ add_library(plc4cpp-api
 #[[
     Import the boost headers
 ]]
-target_include_directories (plc4cpp-api PUBLIC PUBLIC ../libs/libs/boost/include)
+target_include_directories (plc4cpp-api PUBLIC ../libs/libs/boost/include)
 


[plc4x] 08/09: CMakelists with central import of Boost

Posted by ms...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

msommer pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit bfe56b0796a1d7dc5c2617a5a12b08795d4a90a5
Author: Markus Sommer <ms...@apache.org>
AuthorDate: Fri May 10 15:30:42 2019 +0200

    CMakelists with central import of Boost
---
 plc4cpp/CMakeLists.txt | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/plc4cpp/CMakeLists.txt b/plc4cpp/CMakeLists.txt
index c0fdfef..b8ef0e3 100644
--- a/plc4cpp/CMakeLists.txt
+++ b/plc4cpp/CMakeLists.txt
@@ -24,10 +24,24 @@ set(CMAKE_CXX_EXTENSIONS OFF)
 
 set(PLC4CPP_ROOT_DIR ${CMAKE_SOURCE_DIR})
 
+set(BOOST_ROOT "./libs/boost/target/boost_1_70_0/")
+set(Boost_USE_STATIC_LIBS ON)
+set(Boost_USE_MULTITHREADED ON)
+find_package(Boost COMPONENTS filesystem log REQUIRED)
+
+#[[ Trace CMAKE Variable ]]
+get_cmake_property(_variableNames VARIABLES)
+list (SORT _variableNames)
+foreach (_variableName ${_variableNames})
+    message(STATUS "${_variableName}=${${_variableName}}")
+endforeach()
+
 
 #[[
     Build all the modules of PLC4Cpp
 ]]
 add_subdirectory(api)
 add_subdirectory(protocols/driver-bases/base)
-add_subdirectory(utils/logger)
\ No newline at end of file
+add_subdirectory(drivers/s7)
+add_subdirectory(utils)
+add_subdirectory(examples/hello-world-plc4x)
\ No newline at end of file