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/03/25 11:46:23 UTC
[incubator-plc4x] branch develop updated: Add Classes from Folders
Messages, Events and Connection (in part)
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/incubator-plc4x.git
The following commit(s) were added to refs/heads/develop by this push:
new 00e0716 Add Classes from Folders Messages, Events and Connection (in part)
new 74a23ad Merge branch 'develop' of https://gitbox.apache.org/repos/asf/incubator-plc4x into develop
00e0716 is described below
commit 00e071639b0a0484bc6b22bdf272e27df5aadf3c
Author: Markus Sommer <ms...@apache.org>
AuthorDate: Mon Mar 25 12:45:45 2019 +0100
Add Classes from Folders Messages, Events and Connection (in part)
---
.../cpp/base/connection/AbstractPlcConnection.cpp | 55 ++++++
.../cpp/base/connection/AbstractPlcConnection.h | 79 ++++++++
.../plc4x/cpp/base/connection/ChannelFactory.cpp | 39 ++++
.../plc4x/cpp/base/connection/ChannelFactory.h | 59 ++++++
.../cpp/base/connection/DefaultPlcFieldHandler.cpp | 111 ++++++++++++
.../cpp/base/connection/DefaultPlcFieldHandler.h | 96 ++++++++++
.../plc4x/cpp/base/connection/PlcFieldHandler.cpp | 39 ++++
.../plc4x/cpp/base/connection/PlcFieldHandler.h | 99 ++++++++++
.../apache/plc4x/cpp/base/events/ConnectEvent.cpp | 39 ++++
.../apache/plc4x/cpp/base/events/ConnectEvent.h | 48 +++++
.../plc4x/cpp/base/events/ConnectedEvent.cpp | 39 ++++
.../apache/plc4x/cpp/base/events/ConnectedEvent.h | 47 +++++
.../cpp/base/messages/DefaultPlcReadRequest.cpp | 122 +++++++++++++
.../cpp/base/messages/DefaultPlcReadRequest.h | 81 +++++++++
.../cpp/base/messages/DefaultPlcWriteRequest.cpp | 120 ++++++++++++
.../cpp/base/messages/DefaultPlcWriteRequest.h | 81 +++++++++
.../cpp/base/messages/InternalPlcFieldRequest.cpp | 42 +++++
.../cpp/base/messages/InternalPlcFieldRequest.h | 54 ++++++
.../cpp/base/messages/InternalPlcFieldResponse.cpp | 39 ++++
.../cpp/base/messages/InternalPlcFieldResponse.h | 53 ++++++
.../messages/InternalPlcProprietaryRequest.cpp | 40 ++++
.../base/messages/InternalPlcProprietaryRequest.h | 52 ++++++
.../messages/InternalPlcProprietaryResponse.cpp | 40 ++++
.../base/messages/InternalPlcProprietaryResponse.h | 52 ++++++
.../cpp/base/messages/InternalPlcReadRequest.cpp | 39 ++++
.../cpp/base/messages/InternalPlcReadRequest.h | 54 ++++++
.../plc4x/cpp/base/messages/InternalPlcRequest.cpp | 39 ++++
.../plc4x/cpp/base/messages/InternalPlcRequest.h | 53 ++++++
.../cpp/base/messages/InternalPlcResponse.cpp | 39 ++++
.../plc4x/cpp/base/messages/InternalPlcResponse.h | 53 ++++++
.../cpp/base/messages/InternalPlcWriteRequest.cpp | 39 ++++
.../cpp/base/messages/InternalPlcWriteRequest.h | 60 ++++++
.../cpp/base/messages/PlcProprietaryRequest.cpp | 39 ++++
.../cpp/base/messages/PlcProprietaryRequest.h | 54 ++++++
.../cpp/base/messages/PlcProprietaryResponse.cpp | 40 ++++
.../cpp/base/messages/PlcProprietaryResponse.h | 53 ++++++
.../apache/plc4x/cpp/base/messages/PlcReader.cpp | 39 ++++
.../org/apache/plc4x/cpp/base/messages/PlcReader.h | 49 +++++
.../apache/plc4x/cpp/base/messages/PlcWriter.cpp | 39 ++++
.../org/apache/plc4x/cpp/base/messages/PlcWriter.h | 55 ++++++
.../base/messages/items/BaseDefaultFieldItem.cpp | 43 +++++
.../cpp/base/messages/items/BaseDefaultFieldItem.h | 136 ++++++++++++++
.../messages/items/DefaultBigDecimalFieldItem.cpp | 196 ++++++++++++++++++++
.../messages/items/DefaultBigDecimalFieldItem.h | 83 +++++++++
.../messages/items/DefaultBigIntegerFieldItem.cpp | 201 +++++++++++++++++++++
.../messages/items/DefaultBigIntegerFieldItem.h | 84 +++++++++
.../messages/items/DefaultBooleanFieldItem.cpp | 196 ++++++++++++++++++++
.../base/messages/items/DefaultBooleanFieldItem.h | 80 ++++++++
.../messages/items/DefaultByteArrayFieldItem.cpp | 196 ++++++++++++++++++++
.../messages/items/DefaultByteArrayFieldItem.h | 81 +++++++++
.../base/messages/items/DefaultByteFieldItem.cpp | 196 ++++++++++++++++++++
.../cpp/base/messages/items/DefaultByteFieldItem.h | 81 +++++++++
.../base/messages/items/DefaultDoubleFieldItem.cpp | 196 ++++++++++++++++++++
.../base/messages/items/DefaultDoubleFieldItem.h | 81 +++++++++
.../base/messages/items/DefaultFloatFieldItem.cpp | 196 ++++++++++++++++++++
.../base/messages/items/DefaultFloatFieldItem.h | 81 +++++++++
.../messages/items/DefaultIntegerFieldItem.cpp | 196 ++++++++++++++++++++
.../base/messages/items/DefaultIntegerFieldItem.h | 81 +++++++++
.../messages/items/DefaultLocalDateFieldItem.cpp | 196 ++++++++++++++++++++
.../messages/items/DefaultLocalDateFieldItem.h | 81 +++++++++
.../messages/items/DefaultLocalDateTimeFieldItem.h | 71 ++++++++
.../items/DefaultLocalDateTimeFieldltem.cpp | 95 ++++++++++
.../messages/items/DefaultLocalTimeFieldItem.cpp | 95 ++++++++++
.../messages/items/DefaultLocalTimeFieldItem.h | 71 ++++++++
.../base/messages/items/DefaultLongFieldItem.cpp | 196 ++++++++++++++++++++
.../cpp/base/messages/items/DefaultLongFieldItem.h | 82 +++++++++
.../base/messages/items/DefaultShortFieldItem.cpp | 196 ++++++++++++++++++++
.../base/messages/items/DefaultShortFieldItem.h | 82 +++++++++
.../base/messages/items/DefaultStringFieldItem.cpp | 59 ++++++
.../base/messages/items/DefaultStringFieldItem.h | 66 +++++++
70 files changed, 5964 insertions(+)
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
new file mode 100644
index 0000000..af47faa
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/AbstractPlcConnection.cpp
@@ -0,0 +1,55 @@
+/*
+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 "AbstractPlcConnection.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace connection
+ {
+ PlcConnectionMetadata& AbstractPlcConnection::getMetadata()
+ {
+ return *this;
+ }
+ bool AbstractPlcConnection::canRead()
+ {
+ return false;
+ }
+ bool AbstractPlcConnection::canWrite()
+ {
+ return false;
+ }
+ bool AbstractPlcConnection::canSubscribe()
+ {
+ return false;
+ }
+ }
+ }
+ }
+ }
+ }
+}
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
new file mode 100644
index 0000000..4f85192
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/AbstractPlcConnection.h
@@ -0,0 +1,79 @@
+/*
+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 _ABSTRCT_PLC_HANDLER
+#define _ABSTRCT_PLC_HANDLER
+
+#include <boost/system/error_code.hpp>
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/PlcConnection.h"
+#include <string>
+
+using namespace org::apache::plc4x::cpp::api;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace connection
+ {
+ /**
+ * Base class for implementing connections.
+ * Per default, all operations (read, write, subscribe) are unsupported.
+ * Concrete implementations should override the methods indicating connection capabilities
+ * and for obtaining respective request builders.
+ */
+ class AbstractPlcConnection : public PlcConnection, PlcConnectionMetadata
+ {
+
+ public:
+ PlcConnectionMetadata& getMetadata();
+ bool canRead();
+ bool canWrite();
+ bool canSubscribe();
+
+ virtual void open() = 0;
+ virtual void close() = 0;
+ virtual bool send(unsigned char* pBytesToSend, int iNumBytesToSend) = 0;
+
+ // Todo: Check if required
+ //PlcReadRequest.Builder readRequestBuilder();
+ // PlcWriteRequest.Builder writeRequestBuilder();
+ // PlcSubscriptionRequest.Builder subscriptionRequestBuilder();
+ // PlcUnsubscriptionRequest.Builder nsubscriptionRequestBuilder();
+
+ protected:
+ virtual void onReceive(const boost::system::error_code& errorCode, std::size_t bytes_transferred) = 0;
+ private:
+
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
+
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/ChannelFactory.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/ChannelFactory.cpp
new file mode 100644
index 0000000..129dbb2
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/ChannelFactory.cpp
@@ -0,0 +1,39 @@
+/*
+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 "ChannelFactory.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace connection
+ {
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/ChannelFactory.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/ChannelFactory.h
new file mode 100644
index 0000000..b44fa0a
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/ChannelFactory.h
@@ -0,0 +1,59 @@
+/*
+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 _CHANNEL_FACTORY
+#define _CHANNEL_FACTORY
+
+#include <boost/system/error_code.hpp>
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/ip/tcp.hpp>
+
+#include <string>
+
+using namespace boost::asio;
+using namespace boost::asio::ip;
+using boost::asio::ip::address;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace connection
+ {
+ class ChannelFactory
+ {
+
+ public:
+ virtual tcp::socket* createChannel() = 0;
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/DefaultPlcFieldHandler.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/DefaultPlcFieldHandler.cpp
new file mode 100644
index 0000000..af769a3
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/DefaultPlcFieldHandler.cpp
@@ -0,0 +1,111 @@
+/*
+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 "DefaultPlcFieldHandler.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace connection
+ {
+ BaseDefaultFieldItem<bool>* DefaultPlcFieldhandler::encodeBoolean(PlcField field, std::vector<void*> values)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/*Todo: +std::string((field)*/);
+ }
+
+ BaseDefaultFieldItem<char>* DefaultPlcFieldhandler::encodeByte(PlcField field, std::vector<void*>)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* Todo: + field*/);
+ }
+
+ BaseDefaultFieldItem<short>* DefaultPlcFieldhandler::encodeShort(PlcField field, std::vector<void*> values)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* + field*/);
+ }
+
+ BaseDefaultFieldItem<int>* DefaultPlcFieldhandler::encodeInteger(PlcField field, std::vector<void*> values)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* + field*/);
+ }
+
+ BaseDefaultFieldItem<long long>* DefaultPlcFieldhandler::encodeBigInteger(PlcField field, std::vector<void*>)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* + field*/);
+ }
+
+ BaseDefaultFieldItem<long>* DefaultPlcFieldhandler::encodeLong(PlcField field, std::vector<void*>)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* + field*/);
+ }
+
+ BaseDefaultFieldItem<float>* DefaultPlcFieldhandler::encodeFloat(PlcField field, std::vector<void*>)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type " /*+ field*/);
+
+ }
+
+ BaseDefaultFieldItem<cpp_dec_float_100>* DefaultPlcFieldhandler::encodeBigDecimal(PlcField field, std::vector<void*> values)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* + field*/);
+ }
+
+ BaseDefaultFieldItem<double>* DefaultPlcFieldhandler::encodeDouble(PlcField field, std::vector<void*>)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* + field*/);
+ }
+
+ BaseDefaultFieldItem<std::string>* DefaultPlcFieldhandler::encodeString(PlcField field, std::vector<void*> values)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* + field*/);
+ }
+
+ BaseDefaultFieldItem<time_t>* DefaultPlcFieldhandler::encodeTime(PlcField field, std::vector<void*> values)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* + field*/);
+ }
+
+ BaseDefaultFieldItem<tm>* DefaultPlcFieldhandler::encodeDate(PlcField field, std::vector<void*> values)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* + field*/);
+ }
+
+ BaseDefaultFieldItem<tm>* DefaultPlcFieldhandler::encodeDateTime(PlcField field, std::vector<void*> values)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* + field*/);
+ }
+
+ BaseDefaultFieldItem<char*>* DefaultPlcFieldhandler::encodeByteArray(PlcField field, std::vector<void*> values)
+ {
+ throw new PlcRuntimeException("Invalid encoder for type "/* + field*/);
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/DefaultPlcFieldHandler.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/DefaultPlcFieldHandler.h
new file mode 100644
index 0000000..7cfad35
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/DefaultPlcFieldHandler.h
@@ -0,0 +1,96 @@
+/*
+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 _DEFAULT_PLC_FIELD_HANDLER
+#define _DEFAULT_PLC_FIELD_HANDLER
+
+#include <boost/system/error_code.hpp>
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/PlcConnection.h"
+#include <string>
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#include <boost/functional/hash.hpp>
+#include <ctime>
+#include <array>
+#include <vector>
+
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/model/PlcField.h"
+#include "PlcFieldHandler.h"
+#include "../messages/items/BaseDefaultFieldItem.h"
+
+using namespace org::apache::plc4x::cpp::api::model;
+using namespace org::apache::plc4x::cpp::base::messages::items;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace connection
+ {
+ /**
+ * Base Implementation of {@link PlcFieldHandler} which throws a {@link PlcRuntimeException} for all
+ * encodeXXX methods.
+ */
+ class DefaultPlcFieldhandler : public PlcFieldHandler
+ {
+
+ public:
+
+ BaseDefaultFieldItem<bool>* encodeBoolean(PlcField plcField, std::vector<void*> pValues) override;
+
+ BaseDefaultFieldItem<char>* encodeByte(PlcField plcField, std::vector<void*> pValues) override;
+
+ BaseDefaultFieldItem<short>* encodeShort(PlcField plcField, std::vector<void*> pValues) override;
+
+ BaseDefaultFieldItem<int>* encodeInteger(PlcField plcField, std::vector<void*> pValues) override;
+
+ BaseDefaultFieldItem<long long>* encodeBigInteger(PlcField plcField, std::vector<void*> pValues) override;
+
+ BaseDefaultFieldItem<long>* encodeLong(PlcField plcField, std::vector<void*> pValues) override;
+
+ BaseDefaultFieldItem<float>* encodeFloat(PlcField plcField, std::vector<void*> pValues) override;
+
+ BaseDefaultFieldItem<cpp_dec_float_100>* encodeBigDecimal(PlcField plcField,std::vector<void*> pValues) override;
+
+ BaseDefaultFieldItem<double>* encodeDouble(PlcField plcField, std::vector<void*> pValues) override;
+
+ BaseDefaultFieldItem<std::string>* encodeString(PlcField plcField, std::vector<void*> pValues) override;
+
+ BaseDefaultFieldItem<time_t>* encodeTime(PlcField plcField, std::vector<void*> pValues) override;
+
+ BaseDefaultFieldItem<tm>* encodeDate(PlcField plcField, std::vector<void*> pValues) override;
+
+ BaseDefaultFieldItem<tm>* encodeDateTime(PlcField plcField, std::vector<void*> pValues) override;
+
+ BaseDefaultFieldItem<char*>* encodeByteArray(PlcField plcField, std::vector<void*> pValues) override;
+
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/PlcFieldHandler.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/PlcFieldHandler.cpp
new file mode 100644
index 0000000..71f739b
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/PlcFieldHandler.cpp
@@ -0,0 +1,39 @@
+/*
+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 "PlcFieldHandler.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace connection
+ {
+ }
+ }
+ }
+ }
+ }
+}
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
new file mode 100644
index 0000000..1d166d7
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/connection/PlcFieldHandler.h
@@ -0,0 +1,99 @@
+/*
+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_FIELD_HANDLER
+#define _PLC_FIELD_HANDLER
+
+#include <boost/system/error_code.hpp>
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/PlcConnection.h"
+#include <string>
+#include <vector>
+#include <ctime>
+
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/model/PlcField.h"
+#include "../messages/items/BaseDefaultFieldItem.h"
+
+using namespace org::apache::plc4x::cpp::api::model;
+using namespace org::apache::plc4x::cpp::base::messages;
+using namespace org::apache::plc4x::cpp::base::messages::items;
+using namespace boost::multiprecision;
+
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace connection
+ {
+ /**
+ * Base class for implementing connections.
+ * Per default, all operations (read, write, subscribe) are unsupported.
+ * Concrete implementations should override the methods indicating connection capabilities
+ * and for obtaining respective request builders.
+ */
+ class PlcFieldHandler
+ {
+
+ public:
+
+ virtual PlcField createField(std::string strFieldQuery) = 0;
+
+ virtual BaseDefaultFieldItem<bool>* encodeBoolean(PlcField plcField, std::vector<void*> pValues) = 0;
+
+ virtual BaseDefaultFieldItem<char>* encodeByte(PlcField plcField, std::vector<void*> pValues)= 0;
+
+ virtual BaseDefaultFieldItem<short>* encodeShort(PlcField plcField, std::vector<void*> pValues) = 0;
+
+ virtual BaseDefaultFieldItem<int>* encodeInteger(PlcField plcField, std::vector<void*> pValues) = 0;
+
+ virtual BaseDefaultFieldItem<long long>* encodeBigInteger(PlcField plcField,std::vector<void*> pValues) = 0;
+
+ virtual BaseDefaultFieldItem<long>* encodeLong(PlcField plcField, std::vector<void*> pValues) = 0;
+
+ virtual BaseDefaultFieldItem<float>* encodeFloat(PlcField plcField, std::vector<void*> pValues) = 0;
+
+ virtual BaseDefaultFieldItem< cpp_dec_float_100>* encodeBigDecimal(PlcField plcField, std::vector<void*> pValues) = 0;
+
+ virtual BaseDefaultFieldItem<double>* encodeDouble(PlcField plcField, std::vector<void*> pValues) = 0;
+
+ virtual BaseDefaultFieldItem<std::string>* encodeString(PlcField plcField, std::vector<void*> pValues) = 0;
+
+ virtual BaseDefaultFieldItem<time_t>* encodeTime(PlcField plcField, std::vector<void*> pValues) = 0;
+
+ virtual BaseDefaultFieldItem<tm>* encodeDate(PlcField plcField, std::vector<void*> pValues) = 0;
+
+ virtual BaseDefaultFieldItem<tm>* encodeDateTime(PlcField plcField, std::vector<void*> pValues)= 0;
+
+ virtual BaseDefaultFieldItem<char*>* encodeByteArray(PlcField fieplcFieldld,std::vector<void*> pValues) = 0;
+
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectEvent.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectEvent.cpp
new file mode 100644
index 0000000..585eae3
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectEvent.cpp
@@ -0,0 +1,39 @@
+/*
+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 "ConnectEvent.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace events
+ {
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectEvent.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectEvent.h
new file mode 100644
index 0000000..77732dd
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectEvent.h
@@ -0,0 +1,48 @@
+/*
+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 _CONNECT_EVENT
+#define _CONNECT_EVENT
+
+#include <string>
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace events
+ {
+
+ class ConnectEvent
+ {
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectedEvent.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectedEvent.cpp
new file mode 100644
index 0000000..84b5e4a
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectedEvent.cpp
@@ -0,0 +1,39 @@
+/*
+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 "ConnectedEvent.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace events
+ {
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectedEvent.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectedEvent.h
new file mode 100644
index 0000000..315b9c6
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/events/ConnectedEvent.h
@@ -0,0 +1,47 @@
+/*
+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 _CONNECTED_EVENT
+#define _CONNECTED_EVENT
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace events
+ {
+
+ class ConnectedEvent
+ {
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
+
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
new file mode 100644
index 0000000..21005b7
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcReadRequest.cpp
@@ -0,0 +1,122 @@
+/*
+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 "DefaultPlcReadRequest.h"
+
+using namespace org::apache::plc4x::cpp::api::model;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ // =========================================================
+ DefaultPlcReadRequest::DefaultPlcReadRequest()
+ {
+ }
+
+ // =========================================================
+ DefaultPlcReadRequest::DefaultPlcReadRequest(PlcReader* reader, std::map<std::string, PlcField> fields)
+ {
+ this->_reader = reader;
+ this->_fields = fields;
+ }
+
+ // ==========================================================
+ int DefaultPlcReadRequest::getNumberOfFields()
+ {
+ return _fields.size();
+ }
+
+ // =========================================================
+ 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);
+
+ if (iterator == _fields.end())
+ {
+ return nullptr;
+ }
+
+ return &(iterator->second);
+
+ }
+
+ // ======================================================
+ 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()
+ {
+ return _reader;
+ }
+
+ // =====================================================
+ 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);
+ }
+
+ return vNames;
+ }
+
+ // =========================================================
+ 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;
+ }
+ }
+ }
+ }
+ }
+ }
+}
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
new file mode 100644
index 0000000..f6047f1
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcReadRequest.h
@@ -0,0 +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
+
+ 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 _DEFAULT_PLC_READ_REQUEST
+#define _DEFAULT_PLC_READ_REQUEST
+
+#include "InternalPlcReadRequest.h"
+#include "InternalPlcFieldRequest.h"
+#include "PlcReader.h"
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/model/PlcField.h"
+
+#include <map>
+#include <boost/foreach.hpp>
+
+using namespace org::apache::plc4x::cpp::api::messages;
+
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+
+ class DefaultPlcReadRequest : public InternalPlcReadRequest //, public InternalPlcFieldRequest
+ {
+ public:
+ // Todo:
+ /*CompletableFuture<PlcReadResponse> execute()
+ {
+ return reader.read(this);
+ }*/
+
+ // Todo: implement java Builder-pattern for C++
+
+ DefaultPlcReadRequest(PlcReader* reader, 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();
+
+ protected:
+ PlcReader* getReader();
+
+
+ private:
+ DefaultPlcReadRequest();
+ PlcReader* _reader;
+ std::map<std::string, PlcField> _fields;
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
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
new file mode 100644
index 0000000..bccc0c3
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcWriteRequest.cpp
@@ -0,0 +1,120 @@
+/*
+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 "DefaultPlcReadRequest.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ // =========================================================
+ DefaultPlcReadRequest::DefaultPlcReadRequest()
+ {
+ }
+
+ // =========================================================
+ DefaultPlcReadRequest::DefaultPlcReadRequest(PlcReader* reader, std::map<std::string, PlcField> fields)
+ {
+ this->_reader = reader;
+ this->_fields = fields;
+ }
+
+ // ==========================================================
+ int DefaultPlcReadRequest::getNumberOfFields()
+ {
+ return _fields.size();
+ }
+
+ // =========================================================
+ 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);
+
+ if (iterator == _fields.end())
+ {
+ return nullptr;
+ }
+
+ return &(iterator->second);
+
+ }
+
+ // ======================================================
+ 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()
+ {
+ return _reader;
+ }
+
+ // =====================================================
+ 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);
+ }
+
+ return vNames;
+ }
+
+ // =========================================================
+ 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;
+ }
+ }
+ }
+ }
+ }
+ }
+}
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
new file mode 100644
index 0000000..163c64b
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/DefaultPlcWriteRequest.h
@@ -0,0 +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
+
+ 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 _DEFAULT_PLC_WRITE_REQUEST
+#define _DEFAULT_PLC_WRITE_REQUEST
+
+#include "InternalPlcWriteRequest.h"
+#include "InternalPlcFieldRequest.h"
+#include "PlcWriter.h"
+
+#include <map>
+#include <boost/foreach.hpp>
+
+using namespace org::apache::plc4x::cpp::api::messages;
+
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+
+ class DefaultPlcWriteRequest : public InternalPlcWriteRequest
+ {
+ public:
+ // Todo:
+ /*CompletableFuture<PlcReadResponse> execute()
+ {
+ return reader.read(this);
+ }*/
+
+ // Todo: implement java Builder-pattern for C++
+
+ 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();
+ // Todo: implement callback to: execute() { _writer.write(this); }
+
+ protected:
+ PlcWriter* getWriter();
+
+
+ private:
+ DefaultPlcWriteRequest();
+ PlcWriter* _writer;
+ std::map<std::string, PlcField> _fields;
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcFieldRequest.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcFieldRequest.cpp
new file mode 100644
index 0000000..4ebe4ef
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcFieldRequest.cpp
@@ -0,0 +1,42 @@
+/*
+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 "InternalPlcFieldRequest.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ InternalPlcFieldRequest::InternalPlcFieldRequest()
+ {
+ }
+ }
+ }
+ }
+ }
+ }
+}
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
new file mode 100644
index 0000000..a772d4c
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcFieldRequest.h
@@ -0,0 +1,54 @@
+/*
+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 _INTERNAL_PLC_FIELD_REQUEST
+#define _INTERNAL_PLC_FIELD_REQUEST
+
+#include "InternalPlcRequest.h"
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcFieldRequest.h"
+
+#include <map>
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+
+ class InternalPlcFieldRequest : public InternalPlcRequest, PlcFieldRequest
+ {
+ public:
+ virtual std::map<std::string, PlcField> getNamedFields() = 0;
+ InternalPlcFieldRequest();
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcFieldResponse.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcFieldResponse.cpp
new file mode 100644
index 0000000..4aa84d7
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcFieldResponse.cpp
@@ -0,0 +1,39 @@
+/*
+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 "InternalPlcFieldResponse.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcFieldResponse.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcFieldResponse.h
new file mode 100644
index 0000000..04cee48
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcFieldResponse.h
@@ -0,0 +1,53 @@
+/*
+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 _INTERNAL_PLC_FIELD_RESPONSE
+#define _INTERNAL_PLC_FIELD_RESPONSE
+
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcFieldResponse.h"
+
+using namespace org::apache::plc4x::cpp::api::messages;
+
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+
+ class InternalPlcFieldResponse : public PlcFieldResponse
+ {
+ public:
+
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcProprietaryRequest.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcProprietaryRequest.cpp
new file mode 100644
index 0000000..52e0795
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcProprietaryRequest.cpp
@@ -0,0 +1,40 @@
+/*
+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 "InternalPlcProprietaryRequest.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcProprietaryRequest.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcProprietaryRequest.h
new file mode 100644
index 0000000..cf31f85
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcProprietaryRequest.h
@@ -0,0 +1,52 @@
+/*
+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 _INTERNAL_PLC_PROPRIETARY_REQUEST
+#define _INTERNAL_PLC_PROPRIETARY_REQUEST
+
+#include "PlcProprietaryRequest.h"
+#include "InternalPlcRequest.h"
+
+using namespace org::apache::plc4x::cpp::api::messages;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ //template<typename T>
+ class InternalPlcProprietaryRequest : public PlcProprietaryRequest, public InternalPlcRequest
+ {
+ public:
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcProprietaryResponse.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcProprietaryResponse.cpp
new file mode 100644
index 0000000..ce9c1da
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcProprietaryResponse.cpp
@@ -0,0 +1,40 @@
+/*
+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 "InternalPlcProprietaryResponse.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcProprietaryResponse.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcProprietaryResponse.h
new file mode 100644
index 0000000..593c398
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcProprietaryResponse.h
@@ -0,0 +1,52 @@
+/*
+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 _INTERNAL_PLC_PROPRIETARY_RESPONSE
+#define _INTERNAL_PLC_PROPRIETARY_RESPONSE
+
+#include "PlcProprietaryResponse.h"
+#include "InternalPlcRequest.h"
+
+using namespace org::apache::plc4x::cpp::api::messages;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ //template<typename T>
+ class InternalPlcProprietaryResponse : public PlcProprietaryResponse, public InternalPlcRequest
+ {
+ public:
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcReadRequest.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcReadRequest.cpp
new file mode 100644
index 0000000..22f3abb
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcReadRequest.cpp
@@ -0,0 +1,39 @@
+/*
+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 "InternalPlcReadRequest.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcReadRequest.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcReadRequest.h
new file mode 100644
index 0000000..5641ed7
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcReadRequest.h
@@ -0,0 +1,54 @@
+/*
+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 _INTERNAL_PLC_READ_REQUEST
+#define _INTERNAL_PLC_READ_REQUEST
+
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcReadRequest.h"
+#include "InternalPlcFieldRequest.h"
+
+using namespace org::apache::plc4x::cpp::api::messages;
+
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+
+ class InternalPlcReadRequest : public PlcReadRequest, public InternalPlcFieldRequest
+ {
+ public:
+
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcRequest.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcRequest.cpp
new file mode 100644
index 0000000..836a78e
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcRequest.cpp
@@ -0,0 +1,39 @@
+/*
+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 "InternalPlcRequest.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcRequest.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcRequest.h
new file mode 100644
index 0000000..e7e22bb
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcRequest.h
@@ -0,0 +1,53 @@
+/*
+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 _INTERNAL_PLC_REQUEST
+#define _INTERNAL_PLC_REQUEST
+
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcRequest.h"
+
+using namespace org::apache::plc4x::cpp::api::messages;
+
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+
+ class InternalPlcRequest : public PlcRequest
+ {
+ public:
+
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcResponse.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcResponse.cpp
new file mode 100644
index 0000000..4f5b49f
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcResponse.cpp
@@ -0,0 +1,39 @@
+/*
+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 "InternalPlcResponse.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcResponse.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcResponse.h
new file mode 100644
index 0000000..1f6baee
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcResponse.h
@@ -0,0 +1,53 @@
+/*
+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 _INTERNAL_PLC_RESPONSE
+#define _INTERNAL_PLC_RESPONSE
+
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcResponse.h"
+
+using namespace org::apache::plc4x::cpp::api::messages;
+
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+
+ class InternalPlcResponse : public PlcResponse
+ {
+ public:
+
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcWriteRequest.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcWriteRequest.cpp
new file mode 100644
index 0000000..e0665cb
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcWriteRequest.cpp
@@ -0,0 +1,39 @@
+/*
+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 "InternalPlcWriteRequest.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcWriteRequest.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcWriteRequest.h
new file mode 100644
index 0000000..9d5e0fc
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/InternalPlcWriteRequest.h
@@ -0,0 +1,60 @@
+/*
+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 _INTERNAL_PLC_WRITE_REQUEST
+#define _INTERNAL_PLC_WRITE_REQUEST
+
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcWriteRequest.h"
+#include "./items/BaseDefaultFieldItem.h"
+#include "InternalPlcFieldRequest.h"
+#include <vector>
+#include <tuple>
+
+using namespace org::apache::plc4x::cpp::api::messages;
+using namespace org::apache::plc4x::cpp::base::messages::items;
+
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+
+ class InternalPlcWriteRequest : public PlcWriteRequest, public InternalPlcFieldRequest
+ {
+ public:
+ virtual ValueTypeObject getFieldItem(std::string name) = 0;
+ virtual std::vector<ValueTypeObject> getFieldItems(std::string name)= 0;
+ virtual std::tuple<std::string, PlcField, ValueTypeObject> getNamedFieldTriples() = 0;
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcProprietaryRequest.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcProprietaryRequest.cpp
new file mode 100644
index 0000000..abe5335
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcProprietaryRequest.cpp
@@ -0,0 +1,39 @@
+/*
+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 "PlcProprietaryRequest.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcProprietaryRequest.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcProprietaryRequest.h
new file mode 100644
index 0000000..d381c3e
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcProprietaryRequest.h
@@ -0,0 +1,54 @@
+/*
+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_PROPRIETARY_REQUEST
+#define _PLC_PROPRIETARY_REQUEST
+
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/messages/REQUEST.h"
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcRequest.h"
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api//messages/RequestTemplate.h"
+
+using namespace org::apache::plc4x::cpp::api::messages;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+
+ class PlcProprietaryRequest : public PlcRequest, public RequestTemplate<REQUEST>
+ {
+ public:
+ virtual REQUEST getProprietaryRequest() = 0;
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcProprietaryResponse.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcProprietaryResponse.cpp
new file mode 100644
index 0000000..ce4074e
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcProprietaryResponse.cpp
@@ -0,0 +1,40 @@
+/*
+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 "PlcProprietaryResponse.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcProprietaryResponse.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcProprietaryResponse.h
new file mode 100644
index 0000000..aa9d9d7
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcProprietaryResponse.h
@@ -0,0 +1,53 @@
+/*
+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_PROPRIETARY_RESPONSE
+#define _PLC_PROPRIETARY_RESPONSE
+
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/messages/RESPONSE.h"
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/messages/PlcResponse.h"
+#include "../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/messages/ResponseTemplate.h"
+
+using namespace org::apache::plc4x::cpp::api::messages;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ //template<typename T>
+ class PlcProprietaryResponse : public PlcResponse, public ResponseTemplate<RESPONSE>
+ {
+ public:
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcReader.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcReader.cpp
new file mode 100644
index 0000000..c88119f
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcReader.cpp
@@ -0,0 +1,39 @@
+/*
+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 "PlcReader.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcReader.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcReader.h
new file mode 100644
index 0000000..298ae37
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcReader.h
@@ -0,0 +1,49 @@
+/*
+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_READER
+#define _PLC_READER
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+
+ class PlcReader
+ {
+ // Todo: implement java-CompletableFuture
+ public:
+
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcWriter.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcWriter.cpp
new file mode 100644
index 0000000..6d1d537
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcWriter.cpp
@@ -0,0 +1,39 @@
+/*
+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 "PlcWriter.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcWriter.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcWriter.h
new file mode 100644
index 0000000..a24e19a
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/PlcWriter.h
@@ -0,0 +1,55 @@
+/*
+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_WRITER
+#define _PLC_WRITER
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+
+ class PlcWriter
+ {
+ /**
+ * Writes a given value to a PLC.
+ *
+ * @param writeRequest object describing the type, location and value that whould be written.
+ * @return a {@link CompletableFuture} giving async access to the response of the write operation.
+ */
+ // Todo: CompletableFuture<PlcWriteResponse> write(PlcWriteRequest writeRequest);
+ public:
+
+ };
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/BaseDefaultFieldItem.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/BaseDefaultFieldItem.cpp
new file mode 100644
index 0000000..e90ddd0
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/BaseDefaultFieldItem.cpp
@@ -0,0 +1,43 @@
+/*
+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 "BaseDefaultFieldItem.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ }
+
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/BaseDefaultFieldItem.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/BaseDefaultFieldItem.h
new file mode 100644
index 0000000..56db3e9
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/BaseDefaultFieldItem.h
@@ -0,0 +1,136 @@
+/*
+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 _BASE_DEFAULT_FIELD_ITEM
+#define _BASE_DEFAULT_FIELD_ITEM
+
+#include <boost/system/error_code.hpp>
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#include <boost/functional/hash.hpp>
+#include <ctime>
+#include <array>
+
+#include "../../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/exceptions/PlcIncompatibleDatatypeException.h"
+#include "../../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/exceptions/PlcFieldRangeException.h"
+#include "../../../../../../../../../../../../../api/src/main/cpp/org/apache/plc4x/cpp/api/types/ValueTypeObject.h"
+
+#include <string>
+
+using namespace org::apache::plc4x::cpp::api::exceptions;
+using namespace org::apache::plc4x::cpp::api::types;
+
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ template<typename T>
+ class BaseDefaultFieldItem : public ValueTypeObject
+ {
+
+ public:
+ inline int getNumberOfValues() { return _values.length; }
+ virtual T getObject(int index) = 0;
+ inline bool isValidBoolean(int index) { return false; }
+ inline bool getBoolean(int index) { throw new PlcIncompatibleDatatypeException("bool", index); }
+ inline bool isValidByte(int index) { return false; }
+ inline char getByte(int index) { throw new PlcIncompatibleDatatypeException("byte", index); }
+ inline bool isValidShort(int index) { return false; }
+ inline short getShort(int index) { throw new PlcIncompatibleDatatypeException("short", index); }
+ inline bool isValidInteger(int index) { return false; }
+ inline int getInteger(int index) { throw new PlcIncompatibleDatatypeException("int", index); }
+ inline bool isValidLong(int index) { return false; }
+ inline long getLong(int index) { throw new PlcIncompatibleDatatypeException("long", index); }
+ inline bool isValidBigInteger(int index) { return false; }
+ inline long long getBigInteger(int index) { throw new PlcIncompatibleDatatypeException("long long", index); }
+ inline bool isValidFloat(int index) { return false; }
+ inline float getFloat(int index) { throw new PlcIncompatibleDatatypeException("float", index); }
+ inline bool isValidDouble(int index) { return false; }
+ inline double getDouble(int index) { throw new PlcIncompatibleDatatypeException("double", index); }
+ inline bool isValidBigDecimal(int index) { return false; }
+ inline long long getBigDecimal(int index) { throw new PlcIncompatibleDatatypeException("long long", index); }
+ inline bool isValidString(int index) { return false; }
+ inline std::string getString(int index) { throw new PlcIncompatibleDatatypeException("string", index); }
+ inline bool isValidTime(int index) { return false; }
+ inline tm* getTime(int index) { throw new PlcIncompatibleDatatypeException("tm*", index); }
+ inline bool isValidDate(int index) { return false; }
+ inline tm* getDate(int index) { throw new PlcIncompatibleDatatypeException("tm*", index); }
+ inline bool isValidDateTime(int index) { return false; }
+ inline tm* getDateTime(int index) { throw new PlcIncompatibleDatatypeException("tm*", index); }
+ inline bool isValidByteArray(int index) { return false; }
+ inline char* getByteArray(int index) { throw new PlcIncompatibleDatatypeException("char", index); }
+ inline std::vector<T>* getValues() { return &_values; }
+ inline int hashCode() { return int_hash(_values); } // Todo: @Override
+ inline std::string toString() // Todo: @Override
+ {
+ return "BaseDefaultFielditem { values=" + std::string(_values) + "}";
+ };
+
+ // Todo: add methods for unsigned data types?
+
+ /* Todo:
+ @Override
+ bool equals(Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (!(o instanceof BaseDefaultFieldItem))
+ {
+ return false;
+ }
+ BaseDefaultFieldItem< ? > fieldItem = (BaseDefaultFieldItem< ? >) o;
+ return Arrays.equals(values, fieldItem.values);
+ }*/
+
+ protected:
+ //BaseDefaultFieldItem() { this._values = new array<T>(0); }
+ inline BaseDefaultFieldItem(T* values) { this._values = values; }
+ inline T getValue(int index)
+ {
+ if ((index < 0 || (index >= _values.size())))
+ {
+ throw new PlcFieldRangeException((_values.size() == 0) ? -1 : _values.size() - 1, index);
+ }
+ return _values[index];
+ }
+
+ std::vector<T> _values;
+ };
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
+
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultBigDecimalFieldItem.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultBigDecimalFieldItem.cpp
new file mode 100644
index 0000000..9965282
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultBigDecimalFieldItem.cpp
@@ -0,0 +1,196 @@
+/*
+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 "DefaultBigDecimalFieldItem.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ // ==================================================
+ bool DefaultBigDecimalFieldItem::getBoolean(int index)
+ {
+ if (!isValidBoolean(index))
+ {
+ throw new PlcIncompatibleDatatypeException("bool", index);
+ }
+
+ return getValue(index) == 1;
+ }
+
+ // ===================================================
+ bool DefaultBigDecimalFieldItem::isValidByte(int index)
+ {
+ cpp_dec_float_100 value = getValue(index);
+ return value <= -127 && value >= -128;
+ }
+
+ // ===================================================
+ char DefaultBigDecimalFieldItem::getByte(int index)
+ {
+ if (!isValidByte(index))
+ {
+ throw new PlcIncompatibleDatatypeException("char", index);
+ }
+ return (char) getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultBigDecimalFieldItem::isValidShort(int index)
+ {
+ cpp_dec_float_100 value = getValue(index);
+ return value >= -32768 && value <= 32767;
+ }
+
+ // ===================================================
+ short DefaultBigDecimalFieldItem::getShort(int index)
+ {
+ if (!isValidShort(index))
+ {
+ throw new PlcIncompatibleDatatypeException("short", index);
+ }
+
+ return (short)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultBigDecimalFieldItem::isValidInteger(int index)
+ {
+ cpp_dec_float_100 value = getValue(index);
+ return value >= 0 && value <= 2147483647;
+ }
+
+ // ===================================================
+ int DefaultBigDecimalFieldItem::getInteger(int index)
+ {
+ if (!isValidInteger(index))
+ {
+ throw new PlcIncompatibleDatatypeException("int", index);
+ }
+
+ return (int)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultBigDecimalFieldItem::isValidLong(int index)
+ {
+ cpp_dec_float_100 value = getValue(index);
+ return value >= -(2 ^ 63) && value <= (2 ^ 63) - 1;
+ }
+
+ // ===================================================
+ long DefaultBigDecimalFieldItem::getLong(int index)
+ {
+ if (!isValidLong(index))
+ {
+ throw new PlcIncompatibleDatatypeException("long", index);
+ }
+
+ return (long)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultBigDecimalFieldItem::isValidBigInteger(int index)
+ {
+ return true;
+ }
+
+ // ===================================================
+ long long DefaultBigDecimalFieldItem::getBigInteger(int index)
+ {
+ if (!isValidBigInteger(index))
+ {
+ throw new PlcIncompatibleDatatypeException("long long", index);
+ }
+
+ // Todo: add conversion from cpp_dec_float_100 TO long long
+ return (long)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultBigDecimalFieldItem::isValidFloat(int index)
+ {
+ cpp_dec_float_100 value = getValue(index);
+ return value >= -3.4e38 && value <= 3.4e38;
+ }
+
+ // ===================================================
+ float DefaultBigDecimalFieldItem::getFloat(int index)
+ {
+ if (!isValidFloat(index))
+ {
+ throw new PlcIncompatibleDatatypeException("float", index);
+ }
+
+ return (float)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultBigDecimalFieldItem::isValidDouble(int index)
+ {
+ cpp_dec_float_100 value = getValue(index);
+ return value >= -1.7e308 && value <= 1.7e308;
+ }
+
+ // ===================================================
+ double DefaultBigDecimalFieldItem::getDouble(int index)
+ {
+ if (!isValidDouble(index))
+ {
+ throw new PlcIncompatibleDatatypeException("double", index);
+ }
+
+ return (double)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultBigDecimalFieldItem::isValidBigDecimal(int index)
+ {
+ // same limits but higher precision
+ return isValidDouble(index);
+ }
+
+ // ===================================================
+ cpp_dec_float_100 DefaultBigDecimalFieldItem::getBigDecimal(int index)
+ {
+ if (!isValidBigDecimal(index))
+ {
+ throw new PlcIncompatibleDatatypeException("cpp_dec_float_100", index);
+ }
+
+ return (cpp_dec_float_100)getValue(index);
+ }
+ }
+
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultBigDecimalFieldItem.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultBigDecimalFieldItem.h
new file mode 100644
index 0000000..14bae84
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultBigDecimalFieldItem.h
@@ -0,0 +1,83 @@
+/*
+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 _DEFAULT_BIG_DECIMAL_FIELD_ITEM
+#define _DEFAULT_BIG_DECIMAL_FIELD_ITEM
+
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#include "BaseDefaultFieldItem.h"
+
+using namespace org::apache::plc4x::cpp::api::exceptions;
+using namespace boost::multiprecision;
+
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+
+ class DefaultBigDecimalFieldItem : public BaseDefaultFieldItem<cpp_dec_float_100>
+ {
+
+ public:
+ template<typename T>
+ DefaultBigDecimalFieldItem(std::vector<T> values);
+
+ template<typename T>
+ inline T getObject(int index) { return BaseDefaultFieldItem::getValue(index); }
+ inline bool isValidBoolean(int index) { return getValue(index) <= 1 && getValue(index) >= 0; }
+ bool getBoolean(int index);
+ bool isValidByte(int index);
+ char getByte(int index);
+ bool isValidShort(int index);
+ short getShort(int index);
+ bool isValidInteger(int index);
+ int getInteger(int index);
+ bool isValidLong(int index);
+ long getLong(int index);
+ bool isValidBigInteger(int index);
+ long long getBigInteger(int index);
+ bool isValidFloat(int index);
+ float getFloat(int index);
+ bool isValidDouble(int index);
+ double getDouble(int index);
+ bool isValidBigDecimal(int index);
+ cpp_dec_float_100 getBigDecimal(int index);
+
+ private:
+ };
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultBigIntegerFieldItem.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultBigIntegerFieldItem.cpp
new file mode 100644
index 0000000..fb1266e
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultBigIntegerFieldItem.cpp
@@ -0,0 +1,201 @@
+/*
+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 "DefaultBigIntegerFieldItem.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ // ==================================================
+ bool DefaultBigIntegerFieldItem::getBoolean(int index)
+ {
+ if (!isValidBoolean(index))
+ {
+ throw new PlcIncompatibleDatatypeException("bool", index);
+ }
+
+ return getValue(index) == 1;
+ }
+
+ // ===================================================
+ bool DefaultBigIntegerFieldItem::isValidByte(int index)
+ {
+ long long value = getValue(index);
+ return value <= -127 && value >= -128;
+ }
+
+ // ===================================================
+ char DefaultBigIntegerFieldItem::getByte(int index)
+ {
+ if (!isValidByte(index))
+ {
+ throw new PlcIncompatibleDatatypeException("char", index);
+ }
+
+ long long value = getValue(index);
+
+ return (char) getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultBigIntegerFieldItem::isValidShort(int index)
+ {
+ long long value = getValue(index);
+
+ return value >= -32768 && value <= 32767;
+ }
+
+ // ===================================================
+ short DefaultBigIntegerFieldItem::getShort(int index)
+ {
+ if (!isValidShort(index))
+ {
+ throw new PlcIncompatibleDatatypeException("short", index);
+ }
+
+ return (short)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultBigIntegerFieldItem::isValidInteger(int index)
+ {
+ long long value = getValue(index);
+
+ return value >= 0 && value <= 2147483647;
+ }
+
+ // ===================================================
+ int DefaultBigIntegerFieldItem::getInteger(int index)
+ {
+ if (!isValidInteger(index))
+ {
+ throw new PlcIncompatibleDatatypeException("int", index);
+ }
+
+ return (int)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultBigIntegerFieldItem::isValidLong(int index)
+ {
+ long long value = getValue(index);
+
+ return value >= -(2 ^ 63) && value <= (2 ^ 63) - 1;
+ }
+
+ // ===================================================
+ long DefaultBigIntegerFieldItem::getLong(int index)
+ {
+ if (!isValidLong(index))
+ {
+ throw new PlcIncompatibleDatatypeException("long", index);
+ }
+
+ return (long)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultBigIntegerFieldItem::isValidBigInteger(int index)
+ {
+ return true;
+ }
+
+ // ===================================================
+ long long DefaultBigIntegerFieldItem::getBigInteger(int index)
+ {
+ if (!isValidBigInteger(index))
+ {
+ throw new PlcIncompatibleDatatypeException("long long", index);
+ }
+
+ // Todo: add conversion from cpp_dec_float_100 TO InfInt
+ return (long)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultBigIntegerFieldItem::isValidFloat(int index)
+ {
+ long long value = getValue(index);
+ return value >= -3.4e38 && value <= 3.4e38;
+ }
+
+ // ===================================================
+ float DefaultBigIntegerFieldItem::getFloat(int index)
+ {
+ if (!isValidFloat(index))
+ {
+ throw new PlcIncompatibleDatatypeException("float", index);
+ }
+
+ return (float)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultBigIntegerFieldItem::isValidDouble(int index)
+ {
+ long long value = getValue(index);
+ return value >= -1.7e308 && value <= 1.7e308;
+ }
+
+ // ===================================================
+ double DefaultBigIntegerFieldItem::getDouble(int index)
+ {
+ if (!isValidDouble(index))
+ {
+ throw new PlcIncompatibleDatatypeException("double", index);
+ }
+
+ return (double)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultBigIntegerFieldItem::isValidBigDecimal(int index)
+ {
+ return true;
+ }
+
+ // ===================================================
+ cpp_dec_float_100 DefaultBigIntegerFieldItem::getBigDecimal(int index)
+ {
+ if (!isValidDouble(index))
+ {
+ throw new PlcIncompatibleDatatypeException("cpp_dec_float_100", index);
+ }
+
+ return (cpp_dec_float_100)getValue(index);
+ }
+ }
+
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultBigIntegerFieldItem.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultBigIntegerFieldItem.h
new file mode 100644
index 0000000..817d534
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultBigIntegerFieldItem.h
@@ -0,0 +1,84 @@
+/*
+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 _DEFAULT_BIG_INTEGER_FIELD_ITEM
+#define _DEFAULT_BIG_INTEGER_FIELD_ITEM
+
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#include "BaseDefaultFieldItem.h"
+
+using namespace org::apache::plc4x::cpp::api::exceptions;
+using namespace boost::multiprecision;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+
+ class DefaultBigIntegerFieldItem : public BaseDefaultFieldItem<long long>
+ {
+
+ public:
+ template<typename T>
+ DefaultBigIntegerFieldItem(std::vector<T> values);
+
+ template<typename T>
+ inline T getObject(int index) { return BaseDefaultFieldItem::getValue(index); }
+
+ inline bool isValidBoolean(int index) { return getValue(index) <= 1 && getValue(index) >= 0; }
+ bool getBoolean(int index);
+ bool isValidByte(int index);
+ char getByte(int index);
+ bool isValidShort(int index);
+ short getShort(int index);
+ bool isValidInteger(int index);
+ int getInteger(int index);
+ bool isValidLong(int index);
+ long getLong(int index);
+ bool isValidBigInteger(int index);
+ long long getBigInteger(int index);
+ bool isValidFloat(int index);
+ float getFloat(int index);
+ bool isValidDouble(int index);
+ double getDouble(int index);
+ bool isValidBigDecimal(int index);
+ cpp_dec_float_100 getBigDecimal(int index);
+
+ private:
+ };
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
+
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultBooleanFieldItem.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultBooleanFieldItem.cpp
new file mode 100644
index 0000000..0b695c6
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultBooleanFieldItem.cpp
@@ -0,0 +1,196 @@
+/*
+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 "DefaultBooleanFieldItem.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ // ==================================================
+ bool DefaultBooleanFieldItem::getBoolean(int index)
+ {
+ if (!isValidBoolean(index))
+ {
+ throw new PlcIncompatibleDatatypeException("bool", index);
+ }
+
+ return getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultBooleanFieldItem::isValidByte(int index)
+ {
+ bool value = getValue(index);
+ return value <= -127 && value >= -128;
+ }
+
+ // ===================================================
+ char DefaultBooleanFieldItem::getByte(int index)
+ {
+ if (!isValidByte(index))
+ {
+ throw new PlcIncompatibleDatatypeException("char", index);
+ }
+ return (char) getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultBooleanFieldItem::isValidShort(int index)
+ {
+ bool value = getValue(index);
+ return value >= -32768 && value <= 32767;
+ }
+
+ // ===================================================
+ short DefaultBooleanFieldItem::getShort(int index)
+ {
+ if (!isValidShort(index))
+ {
+ throw new PlcIncompatibleDatatypeException("short", index);
+ }
+
+ return (short)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultBooleanFieldItem::isValidInteger(int index)
+ {
+ bool value = getValue(index);
+ return value >= 0 && value <= 2147483647;
+ }
+
+ // ===================================================
+ int DefaultBooleanFieldItem::getInteger(int index)
+ {
+ if (!isValidInteger(index))
+ {
+ throw new PlcIncompatibleDatatypeException("int", index);
+ }
+
+ return (int)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultBooleanFieldItem::isValidLong(int index)
+ {
+ bool value = getValue(index);
+ return value >= -(2 ^ 63) && value <= (2 ^ 63) - 1;
+ }
+
+ // ===================================================
+ long DefaultBooleanFieldItem::getLong(int index)
+ {
+ if (!isValidLong(index))
+ {
+ throw new PlcIncompatibleDatatypeException("long", index);
+ }
+
+ return (long)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultBooleanFieldItem::isValidBigInteger(int index)
+ {
+ return true;
+ }
+
+ // ===================================================
+ long long DefaultBooleanFieldItem::getBigInteger(int index)
+ {
+ if (!isValidBigInteger(index))
+ {
+ throw new PlcIncompatibleDatatypeException("long long", index);
+ }
+
+ // Todo: add conversion from cpp_dec_float_100 TO long long
+ return (long)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultBooleanFieldItem::isValidFloat(int index)
+ {
+ bool value = getValue(index);
+ return value >= -3.4e38 && value <= 3.4e38;
+ }
+
+ // ===================================================
+ float DefaultBooleanFieldItem::getFloat(int index)
+ {
+ if (!isValidFloat(index))
+ {
+ throw new PlcIncompatibleDatatypeException("float", index);
+ }
+
+ return (float)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultBooleanFieldItem::isValidDouble(int index)
+ {
+ bool value = getValue(index);
+ return value >= -1.7e308 && value <= 1.7e308;
+ }
+
+ // ===================================================
+ double DefaultBooleanFieldItem::getDouble(int index)
+ {
+ if (!isValidDouble(index))
+ {
+ throw new PlcIncompatibleDatatypeException("double", index);
+ }
+
+ return (double)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultBooleanFieldItem::isValidBigDecimal(int index)
+ {
+ // same limits but higher precision
+ return isValidDouble(index);
+ }
+
+ // ===================================================
+ cpp_dec_float_100 DefaultBooleanFieldItem::getBigDecimal(int index)
+ {
+ if (!isValidBigDecimal(index))
+ {
+ throw new PlcIncompatibleDatatypeException("cpp_dec_float_100", index);
+ }
+
+ return (cpp_dec_float_100)getValue(index);
+ }
+ }
+
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultBooleanFieldItem.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultBooleanFieldItem.h
new file mode 100644
index 0000000..eda13a3
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultBooleanFieldItem.h
@@ -0,0 +1,80 @@
+/*
+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 _DEFAULT_BIG_BOOLEAN_FIELD_ITEM
+#define _DEFAULT_BIG_BOOLEAN_FIELD_ITEM
+
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#include "BaseDefaultFieldItem.h"
+
+using namespace org::apache::plc4x::cpp::api::exceptions;
+using namespace boost::multiprecision;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ class DefaultBooleanFieldItem : public BaseDefaultFieldItem<bool>
+ {
+
+ public:
+ template<typename T>
+ DefaultBooleanFieldItem(std::vector<T> values);
+
+ template<typename T>
+ inline T getObject(int index) { return BaseDefaultFieldItem::getValue(index); }
+ inline bool isValidBoolean(int index) { return true; }
+ bool getBoolean(int index);
+ bool isValidByte(int index);
+ char getByte(int index);
+ bool isValidShort(int index);
+ short getShort(int index);
+ bool isValidInteger(int index);
+ int getInteger(int index);
+ bool isValidLong(int index);
+ long getLong(int index);
+ bool isValidBigInteger(int index);
+ long long getBigInteger(int index);
+ bool isValidFloat(int index);
+ float getFloat(int index);
+ bool isValidDouble(int index);
+ double getDouble(int index);
+ bool isValidBigDecimal(int index);
+ cpp_dec_float_100 getBigDecimal(int index);
+
+ private:
+ };
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultByteArrayFieldItem.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultByteArrayFieldItem.cpp
new file mode 100644
index 0000000..e5957e6
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultByteArrayFieldItem.cpp
@@ -0,0 +1,196 @@
+/*
+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 "DefaultByteArrayFieldItem.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ // ==================================================
+ bool DefaultByteArrayFieldItem::getBoolean(int index)
+ {
+ if (!isValidBoolean(index))
+ {
+ throw new PlcIncompatibleDatatypeException("bool", index);
+ }
+
+ return getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultByteArrayFieldItem::isValidByte(int index)
+ {
+ char value = getValue(index);
+ return value <= -127 && value >= -128;
+ }
+
+ // ===================================================
+ char DefaultByteArrayFieldItem::getByte(int index)
+ {
+ if (!isValidByte(index))
+ {
+ throw new PlcIncompatibleDatatypeException("char", index);
+ }
+ return (char) getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultByteArrayFieldItem::isValidShort(int index)
+ {
+ char value = getValue(index);
+ return value >= -32768 && value <= 32767;
+ }
+
+ // ===================================================
+ short DefaultByteArrayFieldItem::getShort(int index)
+ {
+ if (!isValidShort(index))
+ {
+ throw new PlcIncompatibleDatatypeException("short", index);
+ }
+
+ return (short)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultByteArrayFieldItem::isValidInteger(int index)
+ {
+ char value = getValue(index);
+ return value >= 0 && value <= 2147483647;
+ }
+
+ // ===================================================
+ int DefaultByteArrayFieldItem::getInteger(int index)
+ {
+ if (!isValidInteger(index))
+ {
+ throw new PlcIncompatibleDatatypeException("int", index);
+ }
+
+ return (int)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultByteArrayFieldItem::isValidLong(int index)
+ {
+ char value = getValue(index);
+ return value >= -(2 ^ 63) && value <= (2 ^ 63) - 1;
+ }
+
+ // ===================================================
+ long DefaultByteArrayFieldItem::getLong(int index)
+ {
+ if (!isValidLong(index))
+ {
+ throw new PlcIncompatibleDatatypeException("long", index);
+ }
+
+ return (long)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultByteArrayFieldItem::isValidBigInteger(int index)
+ {
+ return true;
+ }
+
+ // ===================================================
+ long long DefaultByteArrayFieldItem::getBigInteger(int index)
+ {
+ if (!isValidBigInteger(index))
+ {
+ throw new PlcIncompatibleDatatypeException("long long", index);
+ }
+
+ // Todo: add conversion from cpp_dec_float_100 TO InfInt
+ return (long)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultByteArrayFieldItem::isValidFloat(int index)
+ {
+ char value = getValue(index);
+ return value >= -3.4e38 && value <= 3.4e38;
+ }
+
+ // ===================================================
+ float DefaultByteArrayFieldItem::getFloat(int index)
+ {
+ if (!isValidFloat(index))
+ {
+ throw new PlcIncompatibleDatatypeException("float", index);
+ }
+
+ return (float)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultByteArrayFieldItem::isValidDouble(int index)
+ {
+ char value = getValue(index);
+ return value >= -1.7e308 && value <= 1.7e308;
+ }
+
+ // ===================================================
+ double DefaultByteArrayFieldItem::getDouble(int index)
+ {
+ if (!isValidDouble(index))
+ {
+ throw new PlcIncompatibleDatatypeException("double", index);
+ }
+
+ return (double)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultByteArrayFieldItem::isValidBigDecimal(int index)
+ {
+ // same limits but higher precision
+ return isValidDouble(index);
+ }
+
+ // ===================================================
+ cpp_dec_float_100 DefaultByteArrayFieldItem::getBigDecimal(int index)
+ {
+ if (!isValidBigDecimal(index))
+ {
+ throw new PlcIncompatibleDatatypeException("cpp_dec_float_100", index);
+ }
+
+ return (cpp_dec_float_100)getValue(index);
+ }
+ }
+
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultByteArrayFieldItem.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultByteArrayFieldItem.h
new file mode 100644
index 0000000..9275f01
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultByteArrayFieldItem.h
@@ -0,0 +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
+
+ 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 _DEFAULT_BYTE_ARRAY_FIELD_ITEM
+#define _DEFAULT_BYTE_ARRAY_FIELD_ITEM
+
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#include "BaseDefaultFieldItem.h"
+
+using namespace org::apache::plc4x::cpp::api::exceptions;
+using namespace boost::multiprecision;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ class DefaultByteArrayFieldItem : public BaseDefaultFieldItem<char>
+ {
+
+ public:
+ template<typename T>
+ DefaultByteArrayFieldItem(std::vector<T> values);
+
+ template<typename T>
+ inline T getObject(int index) { return BaseDefaultFieldItem::getValue(index); }
+ inline bool isValidBoolean(int index) { return true; }
+ bool getBoolean(int index);
+ bool isValidByte(int index);
+ char getByte(int index);
+ bool isValidShort(int index);
+ short getShort(int index);
+ bool isValidInteger(int index);
+ int getInteger(int index);
+ bool isValidLong(int index);
+ long getLong(int index);
+ bool isValidBigInteger(int index);
+ long long getBigInteger(int index);
+ bool isValidFloat(int index);
+ float getFloat(int index);
+ bool isValidDouble(int index);
+ double getDouble(int index);
+ bool isValidBigDecimal(int index);
+ cpp_dec_float_100 getBigDecimal(int index);
+
+ private:
+ };
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultByteFieldItem.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultByteFieldItem.cpp
new file mode 100644
index 0000000..5f2c132
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultByteFieldItem.cpp
@@ -0,0 +1,196 @@
+/*
+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 "DefaultByteFieldItem.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ // ==================================================
+ bool DefaultByteFieldItem::getBoolean(int index)
+ {
+ if (!isValidBoolean(index))
+ {
+ throw new PlcIncompatibleDatatypeException("bool", index);
+ }
+
+ return getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultByteFieldItem::isValidByte(int index)
+ {
+ char value = getValue(index);
+ return value <= -127 && value >= -128;
+ }
+
+ // ===================================================
+ char DefaultByteFieldItem::getByte(int index)
+ {
+ if (!isValidByte(index))
+ {
+ throw new PlcIncompatibleDatatypeException("char", index);
+ }
+ return (char) getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultByteFieldItem::isValidShort(int index)
+ {
+ char value = getValue(index);
+ return value >= -32768 && value <= 32767;
+ }
+
+ // ===================================================
+ short DefaultByteFieldItem::getShort(int index)
+ {
+ if (!isValidShort(index))
+ {
+ throw new PlcIncompatibleDatatypeException("short", index);
+ }
+
+ return (short)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultByteFieldItem::isValidInteger(int index)
+ {
+ char value = getValue(index);
+ return value >= 0 && value <= 2147483647;
+ }
+
+ // ===================================================
+ int DefaultByteFieldItem::getInteger(int index)
+ {
+ if (!isValidInteger(index))
+ {
+ throw new PlcIncompatibleDatatypeException("int", index);
+ }
+
+ return (int)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultByteFieldItem::isValidLong(int index)
+ {
+ char value = getValue(index);
+ return value >= -(2 ^ 63) && value <= (2 ^ 63) - 1;
+ }
+
+ // ===================================================
+ long DefaultByteFieldItem::getLong(int index)
+ {
+ if (!isValidLong(index))
+ {
+ throw new PlcIncompatibleDatatypeException("long", index);
+ }
+
+ return (long)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultByteFieldItem::isValidBigInteger(int index)
+ {
+ return true;
+ }
+
+ // ===================================================
+ long long DefaultByteFieldItem::getBigInteger(int index)
+ {
+ if (!isValidBigInteger(index))
+ {
+ throw new PlcIncompatibleDatatypeException("long long", index);
+ }
+
+ // Todo: add conversion from cpp_dec_float_100 TO long long
+ return (long)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultByteFieldItem::isValidFloat(int index)
+ {
+ char value = getValue(index);
+ return value >= -3.4e38 && value <= 3.4e38;
+ }
+
+ // ===================================================
+ float DefaultByteFieldItem::getFloat(int index)
+ {
+ if (!isValidFloat(index))
+ {
+ throw new PlcIncompatibleDatatypeException("float", index);
+ }
+
+ return (float)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultByteFieldItem::isValidDouble(int index)
+ {
+ char value = getValue(index);
+ return value >= -1.7e308 && value <= 1.7e308;
+ }
+
+ // ===================================================
+ double DefaultByteFieldItem::getDouble(int index)
+ {
+ if (!isValidDouble(index))
+ {
+ throw new PlcIncompatibleDatatypeException("double", index);
+ }
+
+ return (double)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultByteFieldItem::isValidBigDecimal(int index)
+ {
+ // same limits but higher precision
+ return isValidDouble(index);
+ }
+
+ // ===================================================
+ cpp_dec_float_100 DefaultByteFieldItem::getBigDecimal(int index)
+ {
+ if (!isValidBigDecimal(index))
+ {
+ throw new PlcIncompatibleDatatypeException("cpp_dec_float_100", index);
+ }
+
+ return (cpp_dec_float_100)getValue(index);
+ }
+ }
+
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultByteFieldItem.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultByteFieldItem.h
new file mode 100644
index 0000000..64715bb
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultByteFieldItem.h
@@ -0,0 +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
+
+ 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 _DEFAULT_BYTE_FIELD_ITEM
+#define _DEFAULT_BYTE_FIELD_ITEM
+
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#include "BaseDefaultFieldItem.h"
+
+using namespace org::apache::plc4x::cpp::api::exceptions;
+using namespace boost::multiprecision;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ class DefaultByteFieldItem : public BaseDefaultFieldItem<char>
+ {
+
+ public:
+ template<typename T>
+ DefaultByteFieldItem(std::vector<T> values);
+
+ template<typename T>
+ inline T getObject(int index) { return BaseDefaultFieldItem::getValue(index); }
+ inline bool isValidBoolean(int index) { return true; }
+ bool getBoolean(int index);
+ bool isValidByte(int index);
+ char getByte(int index);
+ bool isValidShort(int index);
+ short getShort(int index);
+ bool isValidInteger(int index);
+ int getInteger(int index);
+ bool isValidLong(int index);
+ long getLong(int index);
+ bool isValidBigInteger(int index);
+ long long getBigInteger(int index);
+ bool isValidFloat(int index);
+ float getFloat(int index);
+ bool isValidDouble(int index);
+ double getDouble(int index);
+ bool isValidBigDecimal(int index);
+ cpp_dec_float_100 getBigDecimal(int index);
+
+ private:
+ };
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultDoubleFieldItem.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultDoubleFieldItem.cpp
new file mode 100644
index 0000000..aa09435
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultDoubleFieldItem.cpp
@@ -0,0 +1,196 @@
+/*
+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 "DefaultDoubleFieldItem.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ // ==================================================
+ bool DefaultDoubleFieldItem::getBoolean(int index)
+ {
+ if (!isValidBoolean(index))
+ {
+ throw new PlcIncompatibleDatatypeException("bool", index);
+ }
+
+ return getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultDoubleFieldItem::isValidByte(int index)
+ {
+ double value = getValue(index);
+ return value <= -127 && value >= -128;
+ }
+
+ // ===================================================
+ char DefaultDoubleFieldItem::getByte(int index)
+ {
+ if (!isValidByte(index))
+ {
+ throw new PlcIncompatibleDatatypeException("char", index);
+ }
+ return (char) getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultDoubleFieldItem::isValidShort(int index)
+ {
+ double value = getValue(index);
+ return value >= -32768 && value <= 32767;
+ }
+
+ // ===================================================
+ short DefaultDoubleFieldItem::getShort(int index)
+ {
+ if (!isValidShort(index))
+ {
+ throw new PlcIncompatibleDatatypeException("short", index);
+ }
+
+ return (short)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultDoubleFieldItem::isValidInteger(int index)
+ {
+ double value = getValue(index);
+ return value >= 0 && value <= 2147483647;
+ }
+
+ // ===================================================
+ int DefaultDoubleFieldItem::getInteger(int index)
+ {
+ if (!isValidInteger(index))
+ {
+ throw new PlcIncompatibleDatatypeException("int", index);
+ }
+
+ return (int)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultDoubleFieldItem::isValidLong(int index)
+ {
+ double value = getValue(index);
+ return value >= -(2 ^ 63) && value <= (2 ^ 63) - 1;
+ }
+
+ // ===================================================
+ long DefaultDoubleFieldItem::getLong(int index)
+ {
+ if (!isValidLong(index))
+ {
+ throw new PlcIncompatibleDatatypeException("long", index);
+ }
+
+ return (long)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultDoubleFieldItem::isValidBigInteger(int index)
+ {
+ return true;
+ }
+
+ // ===================================================
+ long long DefaultDoubleFieldItem::getBigInteger(int index)
+ {
+ if (!isValidBigInteger(index))
+ {
+ throw new PlcIncompatibleDatatypeException("long long", index);
+ }
+
+ // Todo: add conversion from cpp_dec_float_100 TO long long
+ return (long)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultDoubleFieldItem::isValidFloat(int index)
+ {
+ double value = getValue(index);
+ return value >= -3.4e38 && value <= 3.4e38;
+ }
+
+ // ===================================================
+ float DefaultDoubleFieldItem::getFloat(int index)
+ {
+ if (!isValidFloat(index))
+ {
+ throw new PlcIncompatibleDatatypeException("float", index);
+ }
+
+ return (float)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultDoubleFieldItem::isValidDouble(int index)
+ {
+ double value = getValue(index);
+ return value >= -1.7e308 && value <= 1.7e308;
+ }
+
+ // ===================================================
+ double DefaultDoubleFieldItem::getDouble(int index)
+ {
+ if (!isValidDouble(index))
+ {
+ throw new PlcIncompatibleDatatypeException("double", index);
+ }
+
+ return (double)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultDoubleFieldItem::isValidBigDecimal(int index)
+ {
+ // same limits but higher precision
+ return isValidDouble(index);
+ }
+
+ // ===================================================
+ cpp_dec_float_100 DefaultDoubleFieldItem::getBigDecimal(int index)
+ {
+ if (!isValidBigDecimal(index))
+ {
+ throw new PlcIncompatibleDatatypeException("cpp_dec_float_100", index);
+ }
+
+ return (cpp_dec_float_100)getValue(index);
+ }
+ }
+
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultDoubleFieldItem.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultDoubleFieldItem.h
new file mode 100644
index 0000000..2ee39d9
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultDoubleFieldItem.h
@@ -0,0 +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
+
+ 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 _DEFAULT_DOUBLE_FIELD_ITEM
+#define _DEFAULT_DOUBLE_FIELD_ITEM
+
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#include "BaseDefaultFieldItem.h"
+
+using namespace org::apache::plc4x::cpp::api::exceptions;
+using namespace boost::multiprecision;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ class DefaultDoubleFieldItem : public BaseDefaultFieldItem<double>
+ {
+
+ public:
+ template<typename T>
+ DefaultDoubleFieldItem(std::vector<T> values);
+
+ template<typename T>
+ inline T getObject(int index) { return BaseDefaultFieldItem::getValue(index); }
+ inline bool isValidBoolean(int index) { return true; }
+ bool getBoolean(int index);
+ bool isValidByte(int index);
+ char getByte(int index);
+ bool isValidShort(int index);
+ short getShort(int index);
+ bool isValidInteger(int index);
+ int getInteger(int index);
+ bool isValidLong(int index);
+ long getLong(int index);
+ bool isValidBigInteger(int index);
+ long long getBigInteger(int index);
+ bool isValidFloat(int index);
+ float getFloat(int index);
+ bool isValidDouble(int index);
+ double getDouble(int index);
+ bool isValidBigDecimal(int index);
+ cpp_dec_float_100 getBigDecimal(int index);
+
+ private:
+ };
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultFloatFieldItem.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultFloatFieldItem.cpp
new file mode 100644
index 0000000..afabdbd
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultFloatFieldItem.cpp
@@ -0,0 +1,196 @@
+/*
+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 "DefaultFloatFieldItem.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ // ==================================================
+ bool DefaultFloatFieldItem::getBoolean(int index)
+ {
+ if (!isValidBoolean(index))
+ {
+ throw new PlcIncompatibleDatatypeException("bool", index);
+ }
+
+ return getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultFloatFieldItem::isValidByte(int index)
+ {
+ float value = getValue(index);
+ return value <= -127 && value >= -128;
+ }
+
+ // ===================================================
+ char DefaultFloatFieldItem::getByte(int index)
+ {
+ if (!isValidByte(index))
+ {
+ throw new PlcIncompatibleDatatypeException("char", index);
+ }
+ return (char) getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultFloatFieldItem::isValidShort(int index)
+ {
+ float value = getValue(index);
+ return value >= -32768 && value <= 32767;
+ }
+
+ // ===================================================
+ short DefaultFloatFieldItem::getShort(int index)
+ {
+ if (!isValidShort(index))
+ {
+ throw new PlcIncompatibleDatatypeException("short", index);
+ }
+
+ return (short)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultFloatFieldItem::isValidInteger(int index)
+ {
+ float value = getValue(index);
+ return value >= 0 && value <= 2147483647;
+ }
+
+ // ===================================================
+ int DefaultFloatFieldItem::getInteger(int index)
+ {
+ if (!isValidInteger(index))
+ {
+ throw new PlcIncompatibleDatatypeException("int", index);
+ }
+
+ return (int)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultFloatFieldItem::isValidLong(int index)
+ {
+ float value = getValue(index);
+ return value >= -(2 ^ 63) && value <= (2 ^ 63) - 1;
+ }
+
+ // ===================================================
+ long DefaultFloatFieldItem::getLong(int index)
+ {
+ if (!isValidLong(index))
+ {
+ throw new PlcIncompatibleDatatypeException("long", index);
+ }
+
+ return (long)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultFloatFieldItem::isValidBigInteger(int index)
+ {
+ return true;
+ }
+
+ // ===================================================
+ long long DefaultFloatFieldItem::getBigInteger(int index)
+ {
+ if (!isValidBigInteger(index))
+ {
+ throw new PlcIncompatibleDatatypeException("long long", index);
+ }
+
+ // Todo: add conversion from cpp_dec_float_100 TO long long
+ return (long)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultFloatFieldItem::isValidFloat(int index)
+ {
+ float value = getValue(index);
+ return value >= -3.4e38 && value <= 3.4e38;
+ }
+
+ // ===================================================
+ float DefaultFloatFieldItem::getFloat(int index)
+ {
+ if (!isValidFloat(index))
+ {
+ throw new PlcIncompatibleDatatypeException("float", index);
+ }
+
+ return (float)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultFloatFieldItem::isValidDouble(int index)
+ {
+ double value = getValue(index);
+ return value >= -1.7e308 && value <= 1.7e308;
+ }
+
+ // ===================================================
+ double DefaultFloatFieldItem::getDouble(int index)
+ {
+ if (!isValidDouble(index))
+ {
+ throw new PlcIncompatibleDatatypeException("double", index);
+ }
+
+ return (double)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultFloatFieldItem::isValidBigDecimal(int index)
+ {
+ // same limits but higher precision
+ return isValidDouble(index);
+ }
+
+ // ===================================================
+ cpp_dec_float_100 DefaultFloatFieldItem::getBigDecimal(int index)
+ {
+ if (!isValidBigDecimal(index))
+ {
+ throw new PlcIncompatibleDatatypeException("cpp_dec_float_100", index);
+ }
+
+ return (cpp_dec_float_100)getValue(index);
+ }
+ }
+
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultFloatFieldItem.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultFloatFieldItem.h
new file mode 100644
index 0000000..f59a44c
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultFloatFieldItem.h
@@ -0,0 +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
+
+ 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 _DEFAULT_FLOAT_FIELD_ITEM
+#define _DEFAULT_FLOAT_FIELD_ITEM
+
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#include "BaseDefaultFieldItem.h"
+
+using namespace org::apache::plc4x::cpp::api::exceptions;
+using namespace boost::multiprecision;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ class DefaultFloatFieldItem : public BaseDefaultFieldItem<float>
+ {
+
+ public:
+ template<typename T>
+ DefaultFloatFieldItem(std::vector<T> values);
+
+ template<typename T>
+ inline T getObject(int index) { return BaseDefaultFieldItem::getValue(index); }
+ inline bool isValidBoolean(int index) { return true; }
+ bool getBoolean(int index);
+ bool isValidByte(int index);
+ char getByte(int index);
+ bool isValidShort(int index);
+ short getShort(int index);
+ bool isValidInteger(int index);
+ int getInteger(int index);
+ bool isValidLong(int index);
+ long getLong(int index);
+ bool isValidBigInteger(int index);
+ long long getBigInteger(int index);
+ bool isValidFloat(int index);
+ float getFloat(int index);
+ bool isValidDouble(int index);
+ double getDouble(int index);
+ bool isValidBigDecimal(int index);
+ cpp_dec_float_100 getBigDecimal(int index);
+
+ private:
+ };
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultIntegerFieldItem.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultIntegerFieldItem.cpp
new file mode 100644
index 0000000..3d34f67
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultIntegerFieldItem.cpp
@@ -0,0 +1,196 @@
+/*
+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 "DefaultIntegerFieldItem.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ // ==================================================
+ bool DefaultIntegerFieldItem::getBoolean(int index)
+ {
+ if (!isValidBoolean(index))
+ {
+ throw new PlcIncompatibleDatatypeException("bool", index);
+ }
+
+ return getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultIntegerFieldItem::isValidByte(int index)
+ {
+ int value = getValue(index);
+ return value <= -127 && value >= -128;
+ }
+
+ // ===================================================
+ char DefaultIntegerFieldItem::getByte(int index)
+ {
+ if (!isValidByte(index))
+ {
+ throw new PlcIncompatibleDatatypeException("char", index);
+ }
+ return (char) getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultIntegerFieldItem::isValidShort(int index)
+ {
+ int value = getValue(index);
+ return value >= -32768 && value <= 32767;
+ }
+
+ // ===================================================
+ short DefaultIntegerFieldItem::getShort(int index)
+ {
+ if (!isValidShort(index))
+ {
+ throw new PlcIncompatibleDatatypeException("short", index);
+ }
+
+ return (short)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultIntegerFieldItem::isValidInteger(int index)
+ {
+ int value = getValue(index);
+ return value >= 0 && value <= 2147483647;
+ }
+
+ // ===================================================
+ int DefaultIntegerFieldItem::getInteger(int index)
+ {
+ if (!isValidInteger(index))
+ {
+ throw new PlcIncompatibleDatatypeException("int", index);
+ }
+
+ return (int)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultIntegerFieldItem::isValidLong(int index)
+ {
+ int value = getValue(index);
+ return value >= -(2 ^ 63) && value <= (2 ^ 63) - 1;
+ }
+
+ // ===================================================
+ long DefaultIntegerFieldItem::getLong(int index)
+ {
+ if (!isValidLong(index))
+ {
+ throw new PlcIncompatibleDatatypeException("long", index);
+ }
+
+ return (long)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultIntegerFieldItem::isValidBigInteger(int index)
+ {
+ return true;
+ }
+
+ // ===================================================
+ long long DefaultIntegerFieldItem::getBigInteger(int index)
+ {
+ if (!isValidBigInteger(index))
+ {
+ throw new PlcIncompatibleDatatypeException("long long", index);
+ }
+
+ // Todo: add conversion from cpp_dec_float_100 TO long long
+ return (long)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultIntegerFieldItem::isValidFloat(int index)
+ {
+ int value = getValue(index);
+ return value >= -3.4e38 && value <= 3.4e38;
+ }
+
+ // ===================================================
+ float DefaultIntegerFieldItem::getFloat(int index)
+ {
+ if (!isValidFloat(index))
+ {
+ throw new PlcIncompatibleDatatypeException("float", index);
+ }
+
+ return (float)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultIntegerFieldItem::isValidDouble(int index)
+ {
+ int value = getValue(index);
+ return value >= -1.7e308 && value <= 1.7e308;
+ }
+
+ // ===================================================
+ double DefaultIntegerFieldItem::getDouble(int index)
+ {
+ if (!isValidDouble(index))
+ {
+ throw new PlcIncompatibleDatatypeException("double", index);
+ }
+
+ return (double)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultIntegerFieldItem::isValidBigDecimal(int index)
+ {
+ // same limits but higher precision
+ return isValidDouble(index);
+ }
+
+ // ===================================================
+ cpp_dec_float_100 DefaultIntegerFieldItem::getBigDecimal(int index)
+ {
+ if (!isValidBigDecimal(index))
+ {
+ throw new PlcIncompatibleDatatypeException("cpp_dec_float_100", index);
+ }
+
+ return (cpp_dec_float_100)getValue(index);
+ }
+ }
+
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultIntegerFieldItem.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultIntegerFieldItem.h
new file mode 100644
index 0000000..c3325e9
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultIntegerFieldItem.h
@@ -0,0 +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
+
+ 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 _DEFAULT_INTEGER_FIELD_ITEM
+#define _DEFAULT_INTEGER_FIELD_ITEM
+
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#include "BaseDefaultFieldItem.h"
+
+using namespace org::apache::plc4x::cpp::api::exceptions;
+using namespace boost::multiprecision;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ class DefaultIntegerFieldItem : public BaseDefaultFieldItem<int>
+ {
+
+ public:
+ template<typename T>
+ DefaultIntegerFieldItem(std::vector<T> values);
+
+ template<typename T>
+ inline T getObject(int index) { return BaseDefaultFieldItem::getValue(index); }
+ inline bool isValidBoolean(int index) { return true; }
+ bool getBoolean(int index);
+ bool isValidByte(int index);
+ char getByte(int index);
+ bool isValidShort(int index);
+ short getShort(int index);
+ bool isValidInteger(int index);
+ int getInteger(int index);
+ bool isValidLong(int index);
+ long getLong(int index);
+ bool isValidBigInteger(int index);
+ long long getBigInteger(int index);
+ bool isValidFloat(int index);
+ float getFloat(int index);
+ bool isValidDouble(int index);
+ double getDouble(int index);
+ bool isValidBigDecimal(int index);
+ cpp_dec_float_100 getBigDecimal(int index);
+
+ private:
+ };
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLocalDateFieldItem.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLocalDateFieldItem.cpp
new file mode 100644
index 0000000..6d3e97d
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLocalDateFieldItem.cpp
@@ -0,0 +1,196 @@
+/*
+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 "DefaultLocalDateFieldItem.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ // ==================================================
+ bool DefaultLocalDateFieldItem::getBoolean(int index)
+ {
+ if (!isValidBoolean(index))
+ {
+ throw new PlcIncompatibleDatatypeException("bool", index);
+ }
+
+ return getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultLocalDateFieldItem::isValidByte(int index)
+ {
+ data_type value = getValue(index);
+ return value <= -127 && value >= -128;
+ }
+
+ // ===================================================
+ char DefaultLocalDateFieldItem::getByte(int index)
+ {
+ if (!isValidByte(index))
+ {
+ throw new PlcIncompatibleDatatypeException("char", index);
+ }
+ return (char) getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultLocalDateFieldItem::isValidShort(int index)
+ {
+ data_type value = getValue(index);
+ return value >= -32768 && value <= 32767;
+ }
+
+ // ===================================================
+ short DefaultLocalDateFieldItem::getShort(int index)
+ {
+ if (!isValidShort(index))
+ {
+ throw new PlcIncompatibleDatatypeException("short", index);
+ }
+
+ return (short)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultLocalDateFieldItem::isValidInteger(int index)
+ {
+ data_type value = getValue(index);
+ return value >= 0 && value <= 2147483647;
+ }
+
+ // ===================================================
+ int DefaultLocalDateFieldItem::getInteger(int index)
+ {
+ if (!isValidInteger(index))
+ {
+ throw new PlcIncompatibleDatatypeException("int", index);
+ }
+
+ return (int)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultLocalDateFieldItem::isValidLong(int index)
+ {
+ data_type value = getValue(index);
+ return value >= -(2 ^ 63) && value <= (2 ^ 63) - 1;
+ }
+
+ // ===================================================
+ long DefaultLocalDateFieldItem::getLong(int index)
+ {
+ if (!isValidLong(index))
+ {
+ throw new PlcIncompatibleDatatypeException("long", index);
+ }
+
+ return (long)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultLocalDateFieldItem::isValidBigInteger(int index)
+ {
+ return true;
+ }
+
+ // ===================================================
+ long long DefaultLocalDateFieldItem::getBigInteger(int index)
+ {
+ if (!isValidBigInteger(index))
+ {
+ throw new PlcIncompatibleDatatypeException("long long", index);
+ }
+
+ // Todo: add conversion from cpp_dec_float_100 TO long long
+ return (long)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultLocalDateFieldItem::isValidFloat(int index)
+ {
+ data_type value = getValue(index);
+ return value >= -3.4e38 && value <= 3.4e38;
+ }
+
+ // ===================================================
+ float DefaultLocalDateFieldItem::getFloat(int index)
+ {
+ if (!isValidFloat(index))
+ {
+ throw new PlcIncompatibleDatatypeException("float", index);
+ }
+
+ return (float)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultLocalDateFieldItem::isValidDouble(int index)
+ {
+ data_type value = getValue(index);
+ return value >= -1.7e308 && value <= 1.7e308;
+ }
+
+ // ===================================================
+ double DefaultLocalDateFieldItem::getDouble(int index)
+ {
+ if (!isValidDouble(index))
+ {
+ throw new PlcIncompatibleDatatypeException("double", index);
+ }
+
+ return (double)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultLocalDateFieldItem::isValidBigDecimal(int index)
+ {
+ // same limits but higher precision
+ return isValidDouble(index);
+ }
+
+ // ===================================================
+ cpp_dec_float_100 DefaultLocalDateFieldItem::getBigDecimal(int index)
+ {
+ if (!isValidBigDecimal(index))
+ {
+ throw new PlcIncompatibleDatatypeException("cpp_dec_float_100", index);
+ }
+
+ return (cpp_dec_float_100)getValue(index);
+ }
+ }
+
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLocalDateFieldItem.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLocalDateFieldItem.h
new file mode 100644
index 0000000..1811c21
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLocalDateFieldItem.h
@@ -0,0 +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
+
+ 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 _DEFAULT_LOCAL_DATE_FIELD_ITEM
+#define _DEFAULT_LOCAL_DATE_FIELD_ITEM
+
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#include "BaseDefaultFieldItem.h"
+
+using namespace org::apache::plc4x::cpp::api::exceptions;
+using namespace boost::multiprecision;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ class DefaultLocalDateFieldItem : public BaseDefaultFieldItem<time_t>
+ {
+ typedef time_t data_type;
+ public:
+ template<typename T>
+ DefaultLocalDateFieldItem(std::vector<T> values);
+
+ template<typename T>
+ inline T getObject(int index) { return BaseDefaultFieldItem::getValue(index); }
+ inline bool isValidBoolean(int index) { return true; }
+ bool getBoolean(int index);
+ bool isValidByte(int index);
+ char getByte(int index);
+ bool isValidShort(int index);
+ short getShort(int index);
+ bool isValidInteger(int index);
+ int getInteger(int index);
+ bool isValidLong(int index);
+ long getLong(int index);
+ bool isValidBigInteger(int index);
+ long long getBigInteger(int index);
+ bool isValidFloat(int index);
+ float getFloat(int index);
+ bool isValidDouble(int index);
+ double getDouble(int index);
+ bool isValidBigDecimal(int index);
+ cpp_dec_float_100 getBigDecimal(int index);
+
+ private:
+ };
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLocalDateTimeFieldItem.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLocalDateTimeFieldItem.h
new file mode 100644
index 0000000..efc0e7f
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLocalDateTimeFieldItem.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 _DEFAULT_LOCAL_DATE_TIME_FIELD_ITEM
+#define _DEFAULT_LOCAL_DATE_TIME_FIELD_ITEM
+
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#include <boost/date_time/posix_time/conversion.hpp>
+#include <ctime>
+#include "BaseDefaultFieldItem.h"
+
+using namespace org::apache::plc4x::cpp::api::exceptions;
+using namespace boost::multiprecision;
+using namespace boost::posix_time;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ class DefaultLocalDateTimeFieldItem : public BaseDefaultFieldItem<time_t>
+ {
+ typedef time_t data_type;
+ public:
+ template<typename T>
+ DefaultLocalDateTimeFieldItem(std::vector<T> values);
+
+ template<typename T>
+ inline T getObject(int index) { return BaseDefaultFieldItem::getValue(index); }
+ bool isValidTime(int index);
+ time_t getTime(int index);
+ bool isValidDate(int index);
+ tm getDate(int index);
+ bool isValidDateTime(int index);
+ time_t getDateTime(int index);
+ private:
+ };
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLocalDateTimeFieldltem.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLocalDateTimeFieldltem.cpp
new file mode 100644
index 0000000..a4ba5ee
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLocalDateTimeFieldltem.cpp
@@ -0,0 +1,95 @@
+/*
+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 "DefaultLocalDateTimeFieldItem.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ // ==================================================
+ bool DefaultLocalDateTimeFieldItem::isValidTime(int index)
+ {
+ return getValue(index) != NULL; ;
+ }
+
+ // ===================================================
+ time_t DefaultLocalDateTimeFieldItem::getTime(int index)
+ {
+ return getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultLocalDateTimeFieldItem::isValidDateTime(int index)
+ {
+ return isValidTime(index);
+ }
+
+ // ===================================================
+ time_t DefaultLocalDateTimeFieldItem::getDateTime(int index)
+ {
+ if (!isValidDateTime(index))
+ {
+ throw new PlcIncompatibleDatatypeException("time_t", index);
+ }
+
+ return getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultLocalDateTimeFieldItem::isValidDate(int index)
+ {
+ return getValue(index) != NULL;
+ }
+
+ // ===================================================
+ tm DefaultLocalDateTimeFieldItem::getDate(int index)
+ {
+ if (!isValidDateTime(index))
+ {
+ throw new PlcIncompatibleDatatypeException("time_t", index);
+ }
+
+ time_t time = getValue(index);
+
+ #pragma warning(suppress : 4996)
+ tm* date = gmtime(&time);
+
+ return *date;
+ }
+
+
+ }
+
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLocalTimeFieldItem.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLocalTimeFieldItem.cpp
new file mode 100644
index 0000000..f1538ec
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLocalTimeFieldItem.cpp
@@ -0,0 +1,95 @@
+/*
+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 "DefaultLocalTimeFieldItem.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ // ==================================================
+ bool DefaultLocalTimeFieldItem::isValidTime(int index)
+ {
+ return getValue(index) != NULL; ;
+ }
+
+ // ===================================================
+ time_t DefaultLocalTimeFieldItem::getTime(int index)
+ {
+ return getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultLocalTimeFieldItem::isValidDateTime(int index)
+ {
+ return isValidTime(index);
+ }
+
+ // ===================================================
+ time_t DefaultLocalTimeFieldItem::getDateTime(int index)
+ {
+ if (!isValidDateTime(index))
+ {
+ throw new PlcIncompatibleDatatypeException("time_t", index);
+ }
+
+ return getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultLocalTimeFieldItem::isValidDate(int index)
+ {
+ return getValue(index) != NULL;
+ }
+
+ // ===================================================
+ tm DefaultLocalTimeFieldItem::getDate(int index)
+ {
+ if (!isValidDateTime(index))
+ {
+ throw new PlcIncompatibleDatatypeException("time_t", index);
+ }
+
+ time_t time = getValue(index);
+
+ #pragma warning(suppress : 4996)
+ tm* date = gmtime(&time);
+
+ return *date;
+ }
+
+
+ }
+
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLocalTimeFieldItem.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLocalTimeFieldItem.h
new file mode 100644
index 0000000..cd5eb3d
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLocalTimeFieldItem.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 _DEFAULT_LOCAL_TIME_FIELD_ITEM
+#define _DEFAULT_LOCAL_TIME_FIELD_ITEM
+
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#include <boost/date_time/posix_time/conversion.hpp>
+#include <ctime>
+#include "BaseDefaultFieldItem.h"
+
+using namespace org::apache::plc4x::cpp::api::exceptions;
+using namespace boost::multiprecision;
+using namespace boost::posix_time;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ class DefaultLocalTimeFieldItem : public BaseDefaultFieldItem<time_t>
+ {
+ typedef time_t data_type;
+ public:
+ template<typename T>
+ DefaultLocalTimeFieldItem(std::vector<T> values);
+
+ template<typename T>
+ inline T getObject(int index) { return BaseDefaultFieldItem::getValue(index); }
+ bool isValidTime(int index);
+ time_t getTime(int index);
+ bool isValidDate(int index);
+ tm getDate(int index);
+ bool isValidDateTime(int index);
+ time_t getDateTime(int index);
+ private:
+ };
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLongFieldItem.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLongFieldItem.cpp
new file mode 100644
index 0000000..e66678b
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLongFieldItem.cpp
@@ -0,0 +1,196 @@
+/*
+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 "DefaultLongFieldItem.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ // ==================================================
+ bool DefaultLongFieldItem::getBoolean(int index)
+ {
+ if (!isValidBoolean(index))
+ {
+ throw new PlcIncompatibleDatatypeException("bool", index);
+ }
+
+ return getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultLongFieldItem::isValidByte(int index)
+ {
+ data_type value = getValue(index);
+ return value <= -127 && value >= -128;
+ }
+
+ // ===================================================
+ char DefaultLongFieldItem::getByte(int index)
+ {
+ if (!isValidByte(index))
+ {
+ throw new PlcIncompatibleDatatypeException("char", index);
+ }
+ return (char) getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultLongFieldItem::isValidShort(int index)
+ {
+ data_type value = getValue(index);
+ return value >= -32768 && value <= 32767;
+ }
+
+ // ===================================================
+ short DefaultLongFieldItem::getShort(int index)
+ {
+ if (!isValidShort(index))
+ {
+ throw new PlcIncompatibleDatatypeException("short", index);
+ }
+
+ return (short)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultLongFieldItem::isValidInteger(int index)
+ {
+ data_type value = getValue(index);
+ return value >= 0 && value <= 2147483647;
+ }
+
+ // ===================================================
+ int DefaultLongFieldItem::getInteger(int index)
+ {
+ if (!isValidInteger(index))
+ {
+ throw new PlcIncompatibleDatatypeException("int", index);
+ }
+
+ return (int)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultLongFieldItem::isValidLong(int index)
+ {
+ data_type value = getValue(index);
+ return value >= -(2 ^ 63) && value <= (2 ^ 63) - 1;
+ }
+
+ // ===================================================
+ long DefaultLongFieldItem::getLong(int index)
+ {
+ if (!isValidLong(index))
+ {
+ throw new PlcIncompatibleDatatypeException("long", index);
+ }
+
+ return (long)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultLongFieldItem::isValidBigInteger(int index)
+ {
+ return true;
+ }
+
+ // ===================================================
+ long long DefaultLongFieldItem::getBigInteger(int index)
+ {
+ if (!isValidBigInteger(index))
+ {
+ throw new PlcIncompatibleDatatypeException("long long", index);
+ }
+
+ // Todo: add conversion from cpp_dec_float_100 TO long long
+ return (long)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultLongFieldItem::isValidFloat(int index)
+ {
+ data_type value = getValue(index);
+ return value >= -3.4e38 && value <= 3.4e38;
+ }
+
+ // ===================================================
+ float DefaultLongFieldItem::getFloat(int index)
+ {
+ if (!isValidFloat(index))
+ {
+ throw new PlcIncompatibleDatatypeException("float", index);
+ }
+
+ return (float)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultLongFieldItem::isValidDouble(int index)
+ {
+ data_type value = getValue(index);
+ return value >= -1.7e308 && value <= 1.7e308;
+ }
+
+ // ===================================================
+ double DefaultLongFieldItem::getDouble(int index)
+ {
+ if (!isValidDouble(index))
+ {
+ throw new PlcIncompatibleDatatypeException("double", index);
+ }
+
+ return (double)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultLongFieldItem::isValidBigDecimal(int index)
+ {
+ // same limits but higher precision
+ return isValidDouble(index);
+ }
+
+ // ===================================================
+ cpp_dec_float_100 DefaultLongFieldItem::getBigDecimal(int index)
+ {
+ if (!isValidBigDecimal(index))
+ {
+ throw new PlcIncompatibleDatatypeException("cpp_dec_float_100", index);
+ }
+
+ return (cpp_dec_float_100)getValue(index);
+ }
+ }
+
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLongFieldItem.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLongFieldItem.h
new file mode 100644
index 0000000..e6d31fc
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultLongFieldItem.h
@@ -0,0 +1,82 @@
+/*
+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 _DEFAULT_LONG_FIELD_ITEM
+#define _DEFAULT_LONG_FIELD_ITEM
+
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#include "BaseDefaultFieldItem.h"
+
+using namespace org::apache::plc4x::cpp::api::exceptions;
+using namespace boost::multiprecision;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ class DefaultLongFieldItem : public BaseDefaultFieldItem<short>
+ {
+
+ public:
+ template<typename T>
+ DefaultLongFieldItem(std::vector<T> values);
+
+ template<typename T>
+ inline T getObject(int index) { return BaseDefaultFieldItem::getValue(index); }
+ inline bool isValidBoolean(int index) { return true; }
+ bool getBoolean(int index);
+ bool isValidByte(int index);
+ char getByte(int index);
+ bool isValidShort(int index);
+ short getShort(int index);
+ bool isValidInteger(int index);
+ int getInteger(int index);
+ bool isValidLong(int index);
+ long getLong(int index);
+ bool isValidBigInteger(int index);
+ long long getBigInteger(int index);
+ bool isValidFloat(int index);
+ float getFloat(int index);
+ bool isValidDouble(int index);
+ double getDouble(int index);
+ bool isValidBigDecimal(int index);
+ cpp_dec_float_100 getBigDecimal(int index);
+
+ private:
+ typedef long data_type;
+ };
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultShortFieldItem.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultShortFieldItem.cpp
new file mode 100644
index 0000000..6a8950a
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultShortFieldItem.cpp
@@ -0,0 +1,196 @@
+/*
+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 "DefaultShortFieldItem.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ // ==================================================
+ bool DefaultShortFieldItem::getBoolean(int index)
+ {
+ if (!isValidBoolean(index))
+ {
+ throw new PlcIncompatibleDatatypeException("bool", index);
+ }
+
+ return getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultShortFieldItem::isValidByte(int index)
+ {
+ data_type value = getValue(index);
+ return value <= -127 && value >= -128;
+ }
+
+ // ===================================================
+ char DefaultShortFieldItem::getByte(int index)
+ {
+ if (!isValidByte(index))
+ {
+ throw new PlcIncompatibleDatatypeException("char", index);
+ }
+ return (char) getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultShortFieldItem::isValidShort(int index)
+ {
+ data_type value = getValue(index);
+ return value >= -32768 && value <= 32767;
+ }
+
+ // ===================================================
+ short DefaultShortFieldItem::getShort(int index)
+ {
+ if (!isValidShort(index))
+ {
+ throw new PlcIncompatibleDatatypeException("short", index);
+ }
+
+ return (short)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultShortFieldItem::isValidInteger(int index)
+ {
+ data_type value = getValue(index);
+ return value >= 0 && value <= 2147483647;
+ }
+
+ // ===================================================
+ int DefaultShortFieldItem::getInteger(int index)
+ {
+ if (!isValidInteger(index))
+ {
+ throw new PlcIncompatibleDatatypeException("int", index);
+ }
+
+ return (int)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultShortFieldItem::isValidLong(int index)
+ {
+ data_type value = getValue(index);
+ return value >= -(2 ^ 63) && value <= (2 ^ 63) - 1;
+ }
+
+ // ===================================================
+ long DefaultShortFieldItem::getLong(int index)
+ {
+ if (!isValidLong(index))
+ {
+ throw new PlcIncompatibleDatatypeException("long", index);
+ }
+
+ return (long)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultShortFieldItem::isValidBigInteger(int index)
+ {
+ return true;
+ }
+
+ // ===================================================
+ long long DefaultShortFieldItem::getBigInteger(int index)
+ {
+ if (!isValidBigInteger(index))
+ {
+ throw new PlcIncompatibleDatatypeException("long long", index);
+ }
+
+ // Todo: add conversion from cpp_dec_float_100 TO long long
+ return (long)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultShortFieldItem::isValidFloat(int index)
+ {
+ data_type value = getValue(index);
+ return value >= -3.4e38 && value <= 3.4e38;
+ }
+
+ // ===================================================
+ float DefaultShortFieldItem::getFloat(int index)
+ {
+ if (!isValidFloat(index))
+ {
+ throw new PlcIncompatibleDatatypeException("float", index);
+ }
+
+ return (float)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultShortFieldItem::isValidDouble(int index)
+ {
+ data_type value = getValue(index);
+ return value >= -1.7e308 && value <= 1.7e308;
+ }
+
+ // ===================================================
+ double DefaultShortFieldItem::getDouble(int index)
+ {
+ if (!isValidDouble(index))
+ {
+ throw new PlcIncompatibleDatatypeException("double", index);
+ }
+
+ return (double)getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultShortFieldItem::isValidBigDecimal(int index)
+ {
+ // same limits but higher precision
+ return isValidDouble(index);
+ }
+
+ // ===================================================
+ cpp_dec_float_100 DefaultShortFieldItem::getBigDecimal(int index)
+ {
+ if (!isValidBigDecimal(index))
+ {
+ throw new PlcIncompatibleDatatypeException("cpp_dec_float_100", index);
+ }
+
+ return (cpp_dec_float_100)getValue(index);
+ }
+ }
+
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultShortFieldItem.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultShortFieldItem.h
new file mode 100644
index 0000000..9a8ac2b
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultShortFieldItem.h
@@ -0,0 +1,82 @@
+/*
+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 _DEFAULT_SHORT_FIELD_ITEM
+#define _DEFAULT_SHORT_FIELD_ITEM
+
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#include "BaseDefaultFieldItem.h"
+
+using namespace org::apache::plc4x::cpp::api::exceptions;
+using namespace boost::multiprecision;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ class DefaultShortFieldItem : public BaseDefaultFieldItem<short>
+ {
+
+ public:
+ template<typename T>
+ DefaultShortFieldItem(std::vector<T> values);
+
+ template<typename T>
+ inline T getObject(int index) { return BaseDefaultFieldItem::getValue(index); }
+ inline bool isValidBoolean(int index) { return true; }
+ bool getBoolean(int index);
+ bool isValidByte(int index);
+ char getByte(int index);
+ bool isValidShort(int index);
+ short getShort(int index);
+ bool isValidInteger(int index);
+ int getInteger(int index);
+ bool isValidLong(int index);
+ long getLong(int index);
+ bool isValidBigInteger(int index);
+ long long getBigInteger(int index);
+ bool isValidFloat(int index);
+ float getFloat(int index);
+ bool isValidDouble(int index);
+ double getDouble(int index);
+ bool isValidBigDecimal(int index);
+ cpp_dec_float_100 getBigDecimal(int index);
+
+ private:
+ typedef short data_type;
+ };
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultStringFieldItem.cpp b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultStringFieldItem.cpp
new file mode 100644
index 0000000..cc66fd0
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultStringFieldItem.cpp
@@ -0,0 +1,59 @@
+/*
+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 "DefaultStringFieldItem.h"
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ // ==================================================
+ std::string DefaultStringFieldItem::getString(int index)
+ {
+ if (!isValidString(index))
+ {
+ throw new PlcIncompatibleDatatypeException("std::string", index);
+ }
+
+ return getValue(index);
+ }
+
+ // ===================================================
+ bool DefaultStringFieldItem::isValidString(int index)
+ {
+ return true;
+ }
+ }
+
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultStringFieldItem.h b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultStringFieldItem.h
new file mode 100644
index 0000000..4e97cdd
--- /dev/null
+++ b/plc4cpp/protocols/driver-bases/base/src/main/cpp/org/apache/plc4x/cpp/base/messages/items/DefaultStringFieldItem.h
@@ -0,0 +1,66 @@
+/*
+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 _DEFAULT_STRING_FIELD_ITEM
+#define _DEFAULT_STRING_FIELD_ITEM
+
+#include <boost/multiprecision/cpp_dec_float.hpp>
+#include "BaseDefaultFieldItem.h"
+
+using namespace org::apache::plc4x::cpp::api::exceptions;
+using namespace boost::multiprecision;
+
+namespace org
+{
+ namespace apache
+ {
+ namespace plc4x
+ {
+ namespace cpp
+ {
+ namespace base
+ {
+ namespace messages
+ {
+ namespace items
+ {
+ class DefaultStringFieldItem : public BaseDefaultFieldItem<std::string>
+ {
+
+ public:
+ template<typename T>
+ DefaultStringFieldItem(std::vector<T> values);
+
+ template<typename T>
+ inline T getObject(int index) { return BaseDefaultFieldItem::getValue(index); }
+ inline bool isValidString(int index);
+ std::string getString(int index);
+
+ private:
+ typedef std::string data_type;
+ };
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file