Introduced DBusClientId to identify callers within stubs.
authorStefan Laner <laner@itestra.de>
Wed, 24 Jul 2013 09:58:21 +0000 (11:58 +0200)
committerStefan Laner <laner@itestra.de>
Wed, 31 Jul 2013 12:31:20 +0000 (14:31 +0200)
As a prerequisite for selective broadcasts one has to identify the
callers on stub side. The CommonAPI::ClientId is used for that. This
commit contains the dbus specific implementation for that concept.
Also introduced unit test for DBusClientId.

Change-Id: I886bc28d656dd715de1c199cc18246a1abc171ab

Makefile.am
src/CommonAPI/DBus/DBusClientId.cpp [new file with mode: 0644]
src/CommonAPI/DBus/DBusClientId.h [new file with mode: 0644]
src/CommonAPI/DBus/DBusStubAdapterHelper.h
src/test/DBusClientIdTest.cpp [new file with mode: 0644]
src/test/commonapi/tests/TestInterfaceStub.h
src/test/commonapi/tests/TestInterfaceStubDefault.cpp
src/test/commonapi/tests/TestInterfaceStubDefault.h

index 2bc7241..8e4e89b 100644 (file)
@@ -36,6 +36,7 @@ lib_LTLIBRARIES += libCommonAPI-DBus.la
 
 libCommonAPI_DBus_la_SOURCES = \
         src/CommonAPI/DBus/DBusAddressTranslator.cpp \
+        src/CommonAPI/DBus/DBusClientId.cpp \
         src/CommonAPI/DBus/DBusConfiguration.cpp \
         src/CommonAPI/DBus/DBusConnection.cpp \
         src/CommonAPI/DBus/DBusDaemonProxy.cpp \
@@ -66,6 +67,7 @@ CommonAPI_DBus_includedir=$(includedir)/CommonAPI-${VERSION}/CommonAPI/DBus
 CommonAPI_DBus_include_HEADERS = \
         src/CommonAPI/DBus/DBusAddressTranslator.h \
         src/CommonAPI/DBus/DBusAttribute.h \
+        src/CommonAPI/DBus/DBusClientId.h \
         src/CommonAPI/DBus/DBusConfiguration.h \
         src/CommonAPI/DBus/DBusConnection.h \
         src/CommonAPI/DBus/DBusConnectionBusType.h \
@@ -168,7 +170,8 @@ check_PROGRAMS = \
         DBusDaemonProxyTest \
         DBusCommunicationTest \
         DBusMultipleConnectionTest \
-        DBusServicePublisherTest
+        DBusServicePublisherTest \
+        DBusClientIdTest
 
 
 TESTS = ${check_PROGRAMS}
@@ -311,6 +314,12 @@ DBusDynamicLoadingNoValidityTest_CPPFLAGS = ${AM_CPPFLAGS} ${GTEST_CPPFLAGS}
 DBusDynamicLoadingNoValidityTest_CXXFLAGS = ${GTEST_CXXFLAGS}
 DBusDynamicLoadingNoValidityTest_LDADD = ${LDADD_FOR_GTEST_WITHOUT_LIBCOMMON_API_DBUS}
 
+
+DBusClientIdTest_SOURCES = src/test/DBusClientIdTest.cpp
+DBusClientIdTest_CPPFLAGS = ${AM_CPPFLAGS} ${GTEST_CPPFLAGS}
+DBusClientIdTest_CXXFLAGS = ${GTEST_CXXFLAGS}
+DBusClientIdTest_LDADD = ${LDADD_FOR_GTEST}
+
 endif
 
 
diff --git a/src/CommonAPI/DBus/DBusClientId.cpp b/src/CommonAPI/DBus/DBusClientId.cpp
new file mode 100644 (file)
index 0000000..cf0f9a3
--- /dev/null
@@ -0,0 +1,33 @@
+/* Copyright (C) 2013 BMW Group
+ * Author: Manfred Bathelt (manfred.bathelt@bmw.de)
+ * Author: Juergen Gehring (juergen.gehring@bmw.de)
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "DBusClientId.h"
+#include <typeinfo>
+
+namespace CommonAPI {
+namespace DBus {
+
+DBusClientId::DBusClientId(std::string dbusId) :
+                dbusId_(dbusId) {
+}
+
+bool DBusClientId::operator==(CommonAPI::ClientId& clientIdToCompare) {
+    try {
+        DBusClientId clientIdToCompareDBus = DBusClientId(dynamic_cast<DBusClientId&>(clientIdToCompare));
+        return (&clientIdToCompareDBus == this);
+    }
+    catch (const std::bad_cast& e) {
+        return false;
+    }
+}
+
+bool DBusClientId::operator==(DBusClientId& clientIdToCompare) {
+    return (clientIdToCompare.dbusId_ == dbusId_);
+}
+
+} /* namespace DBus */
+} /* namespace CommonAPI */
diff --git a/src/CommonAPI/DBus/DBusClientId.h b/src/CommonAPI/DBus/DBusClientId.h
new file mode 100644 (file)
index 0000000..7818969
--- /dev/null
@@ -0,0 +1,39 @@
+/* Copyright (C) 2013 BMW Group
+ * Author: Manfred Bathelt (manfred.bathelt@bmw.de)
+ * Author: Juergen Gehring (juergen.gehring@bmw.de)
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#if !defined (COMMONAPI_INTERNAL_COMPILATION)
+#error "Only <CommonAPI/CommonAPI.h> can be included directly, this file may disappear or change contents."
+#endif
+
+#ifndef DBUSCLIENTID_H_
+#define DBUSCLIENTID_H_
+
+#include <CommonAPI/types.h>
+#include <string>
+
+namespace CommonAPI {
+namespace DBus {
+
+/**
+ * \brief Implementation of CommonAPI::ClientId for DBus
+ *
+ * This class represents the DBus specific implementation of CommonAPI::ClientId.
+ * It internally uses a string to identify clients. This string is the unique sender id used by dbus.
+ */
+class DBusClientId: public CommonAPI::ClientId {
+public:
+    DBusClientId(std::string dbusId);
+
+    bool operator==(CommonAPI::ClientId& clientIdToCompare);
+    bool operator==(DBusClientId& clientIdToCompare);
+protected:
+    std::string dbusId_;
+};
+
+} /* namespace DBus */
+} /* namespace CommonAPI */
+#endif /* DBUSCLIENTID_H_ */
index 120aee7..71fcd5d 100644 (file)
@@ -17,6 +17,7 @@
 #include "DBusOutputStream.h"
 #include "DBusHelper.h"
 #include "DBusSerializableArguments.h"
+#include "DBusClientId.h"
 
 #include <memory>
 #include <initializer_list>
@@ -146,7 +147,7 @@ template <
 class DBusMethodStubDispatcher<_StubClass, _In<_InArgs...> >: public DBusStubAdapterHelper<_StubClass>::StubDispatcher {
  public:
     typedef DBusStubAdapterHelper<_StubClass> DBusStubAdapterHelperType;
-    typedef void (_StubClass::*_StubFunctor)(_InArgs...);
+    typedef void (_StubClass::*_StubFunctor)(CommonAPI::ClientId&, _InArgs...);
 
     DBusMethodStubDispatcher(_StubFunctor stubFunctor):
             stubFunctor_(stubFunctor) {
@@ -171,7 +172,9 @@ class DBusMethodStubDispatcher<_StubClass, _In<_InArgs...> >: public DBusStubAda
                 return false;
         }
 
-        (stub.get()->*stubFunctor_)(std::move(std::get<_InArgIndices>(argTuple))...);
+        const DBusClientId clientId = DBusClientId(std::string(dbusMessage.getSenderName()));
+
+        (stub.get()->*stubFunctor_)(clientId, std::move(std::get<_InArgIndices>(argTuple))...);
 
         return true;
     }
@@ -191,7 +194,7 @@ class DBusMethodWithReplyStubDispatcher<_StubClass, _In<_InArgs...>, _Out<_OutAr
             public DBusStubAdapterHelper<_StubClass>::StubDispatcher {
  public:
     typedef DBusStubAdapterHelper<_StubClass> DBusStubAdapterHelperType;
-    typedef void (_StubClass::*_StubFunctor)(_InArgs..., _OutArgs&...);
+    typedef void (_StubClass::*_StubFunctor)(const CommonAPI::ClientId&, _InArgs..., _OutArgs&...);
 
     DBusMethodWithReplyStubDispatcher(_StubFunctor stubFunctor, const char* dbusReplySignature):
             stubFunctor_(stubFunctor),
@@ -223,7 +226,9 @@ class DBusMethodWithReplyStubDispatcher<_StubClass, _In<_InArgs...>, _Out<_OutAr
                 return false;
         }
 
-        (stub.get()->*stubFunctor_)(std::move(std::get<_InArgIndices>(argTuple))..., std::get<_OutArgIndices>(argTuple)...);
+        const DBusClientId clientId = DBusClientId(std::string(dbusMessage.getSenderName()));
+
+        (stub.get()->*stubFunctor_)(clientId, std::move(std::get<_InArgIndices>(argTuple))..., std::get<_OutArgIndices>(argTuple)...);
 
         DBusMessage dbusMessageReply = dbusMessage.createMethodReturn(dbusReplySignature_);
 
@@ -248,7 +253,7 @@ template <typename _StubClass, typename _AttributeType>
 class DBusGetAttributeStubDispatcher: public DBusStubAdapterHelper<_StubClass>::StubDispatcher {
  public:
     typedef DBusStubAdapterHelper<_StubClass> DBusStubAdapterHelperType;
-    typedef const _AttributeType& (_StubClass::*GetStubFunctor)();
+    typedef const _AttributeType& (_StubClass::*GetStubFunctor)(const CommonAPI::ClientId&);
 
     DBusGetAttributeStubDispatcher(GetStubFunctor getStubFunctor, const char* dbusSignature):
         getStubFunctor_(getStubFunctor),
@@ -264,7 +269,9 @@ class DBusGetAttributeStubDispatcher: public DBusStubAdapterHelper<_StubClass>::
         DBusMessage dbusMessageReply = dbusMessage.createMethodReturn(dbusSignature_);
         DBusOutputStream dbusOutputStream(dbusMessageReply);
 
-        dbusOutputStream << (stub.get()->*getStubFunctor_)();
+        const DBusClientId clientId = DBusClientId(std::string(dbusMessage.getSenderName()));
+
+        dbusOutputStream << (stub.get()->*getStubFunctor_)(clientId);
         dbusOutputStream.flush();
 
         return dbusStubAdapterHelper.getDBusConnection()->sendDBusMessage(dbusMessageReply);
@@ -282,7 +289,7 @@ class DBusSetAttributeStubDispatcher: public DBusGetAttributeStubDispatcher<_Stu
     typedef typename DBusStubAdapterHelperType::RemoteEventHandlerType RemoteEventHandlerType;
 
     typedef typename DBusGetAttributeStubDispatcher<_StubClass, _AttributeType>::GetStubFunctor GetStubFunctor;
-    typedef bool (RemoteEventHandlerType::*OnRemoteSetFunctor)(_AttributeType);
+    typedef bool (RemoteEventHandlerType::*OnRemoteSetFunctor)(const CommonAPI::ClientId&, _AttributeType);
     typedef void (RemoteEventHandlerType::*OnRemoteChangedFunctor)();
 
     DBusSetAttributeStubDispatcher(GetStubFunctor getStubFunctor,
@@ -317,7 +324,9 @@ class DBusSetAttributeStubDispatcher: public DBusGetAttributeStubDispatcher<_Stu
         if (dbusInputStream.hasError())
             return false;
 
-        attributeValueChanged = (dbusStubAdapterHelper.getRemoteEventHandler()->*onRemoteSetFunctor_)(std::move(attributeValue));
+        const DBusClientId clientId = DBusClientId(std::string(dbusMessage.getSenderName()));
+
+        attributeValueChanged = (dbusStubAdapterHelper.getRemoteEventHandler()->*onRemoteSetFunctor_)(clientId, std::move(attributeValue));
 
         return this->sendAttributeValueReply(dbusMessage, stub, dbusStubAdapterHelper);
     }
@@ -326,8 +335,8 @@ class DBusSetAttributeStubDispatcher: public DBusGetAttributeStubDispatcher<_Stu
         (dbusStubAdapterHelper.getRemoteEventHandler()->*onRemoteChangedFunctor_)();
     }
 
-    inline const _AttributeType& getAttributeValue(const std::shared_ptr<_StubClass>& stub) {
-        return (stub.get()->*(this->getStubFunctor_))();
+    inline const _AttributeType& getAttributeValue(const CommonAPI::ClientId& clientId, const std::shared_ptr<_StubClass>& stub) {
+        return (stub.get()->*(this->getStubFunctor_))(clientId);
     }
 
     const OnRemoteSetFunctor onRemoteSetFunctor_;
@@ -364,15 +373,16 @@ class DBusSetObservableAttributeStubDispatcher: public DBusSetAttributeStubDispa
             return false;
 
         if (attributeValueChanged) {
-            fireAttributeValueChanged(dbusStubAdapterHelper, stub);
+            const DBusClientId clientId = DBusClientId(std::string(dbusMessage.getSenderName()));
+            fireAttributeValueChanged(clientId, dbusStubAdapterHelper, stub);
             this->notifyOnRemoteChanged(dbusStubAdapterHelper);
         }
         return true;
     }
 
  private:
-    inline void fireAttributeValueChanged(DBusStubAdapterHelperType& dbusStubAdapterHelper, const std::shared_ptr<_StubClass> stub) {
-        (dbusStubAdapterHelper.getStubAdapter().get()->*fireChangedFunctor_)(this->getAttributeValue(stub));
+    inline void fireAttributeValueChanged(const CommonAPI::ClientId& clientId, DBusStubAdapterHelperType& dbusStubAdapterHelper, const std::shared_ptr<_StubClass> stub) {
+        (dbusStubAdapterHelper.getStubAdapter().get()->*fireChangedFunctor_)(this->getAttributeValue(clientId, stub));
     }
 
     const FireChangedFunctor fireChangedFunctor_;
diff --git a/src/test/DBusClientIdTest.cpp b/src/test/DBusClientIdTest.cpp
new file mode 100644 (file)
index 0000000..85fbe75
--- /dev/null
@@ -0,0 +1,50 @@
+/* Copyright (C) 2013 BMW Group
+ * Author: Manfred Bathelt (manfred.bathelt@bmw.de)
+ * Author: Juergen Gehring (juergen.gehring@bmw.de)
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include <gtest/gtest.h>
+#include "CommonAPI/DBus/DBusClientId.h"
+#include "CommonAPI/types.h"
+
+using namespace CommonAPI::DBus;
+
+class DBusClientIdTest: public ::testing::Test {
+
+public:
+    void SetUp() {
+
+    }
+
+    void TearDown() {
+
+    }
+};
+
+class TestClientId: public CommonAPI::ClientId {
+public:
+    bool operator==(CommonAPI::ClientId& clientIdToCompare) {
+        return false; // doesn't matter, as we are just comparing this class with DBusClientId;
+    }
+
+};
+
+TEST_F(DBusClientIdTest, TestClientIdImplementation) {
+    DBusClientId dbusId1("test1");
+    DBusClientId dbusId2("test2");
+    TestClientId testId;
+
+
+    ASSERT_TRUE(dbusId1 == dbusId1);
+    ASSERT_FALSE(dbusId1 == dbusId2);
+    ASSERT_FALSE(dbusId2 == dbusId1);
+
+    ASSERT_FALSE(dbusId1 == testId);
+}
+
+int main(int argc, char** argv) {
+    ::testing::InitGoogleTest(&argc, argv);
+    return RUN_ALL_TESTS();
+}
index 1ac580c..dd218a1 100644 (file)
@@ -25,6 +25,7 @@
 #include <vector>
 
 #include <CommonAPI/Stub.h>
+#include <CommonAPI/types.h>
 
 #undef COMMONAPI_INTERNAL_COMPILATION
 
@@ -71,17 +72,17 @@ class TestInterfaceStubRemoteEvent {
     virtual ~TestInterfaceStubRemoteEvent() { }
 
     /// Verification callback for remote set requests on the attribute TestPredefinedTypeAttribute.
-    virtual bool onRemoteSetTestPredefinedTypeAttributeAttribute(uint32_t TestPredefinedTypeAttribute) = 0;
+    virtual bool onRemoteSetTestPredefinedTypeAttributeAttribute(const CommonAPI::ClientId& clientId, uint32_t TestPredefinedTypeAttribute) = 0;
     /// Action callback for remote set requests on the attribute TestPredefinedTypeAttribute.
     virtual void onRemoteTestPredefinedTypeAttributeAttributeChanged() = 0;
 
     /// Verification callback for remote set requests on the attribute TestDerivedStructAttribute.
-    virtual bool onRemoteSetTestDerivedStructAttributeAttribute(DerivedTypeCollection::TestStructExtended TestDerivedStructAttribute) = 0;
+    virtual bool onRemoteSetTestDerivedStructAttributeAttribute(const CommonAPI::ClientId& clientId, DerivedTypeCollection::TestStructExtended TestDerivedStructAttribute) = 0;
     /// Action callback for remote set requests on the attribute TestDerivedStructAttribute.
     virtual void onRemoteTestDerivedStructAttributeAttributeChanged() = 0;
 
     /// Verification callback for remote set requests on the attribute TestDerivedArrayAttribute.
-    virtual bool onRemoteSetTestDerivedArrayAttributeAttribute(DerivedTypeCollection::TestArrayUInt64 TestDerivedArrayAttribute) = 0;
+    virtual bool onRemoteSetTestDerivedArrayAttributeAttribute(const CommonAPI::ClientId& clientId, DerivedTypeCollection::TestArrayUInt64 TestDerivedArrayAttribute) = 0;
     /// Action callback for remote set requests on the attribute TestDerivedArrayAttribute.
     virtual void onRemoteTestDerivedArrayAttributeAttributeChanged() = 0;
 
@@ -99,22 +100,22 @@ class TestInterfaceStub : public CommonAPI::Stub<TestInterfaceStubAdapter , Test
     virtual ~TestInterfaceStub() { }
 
     /// Provides getter access to the attribute TestPredefinedTypeAttribute.
-    virtual const uint32_t& getTestPredefinedTypeAttributeAttribute() = 0;
+    virtual const uint32_t& getTestPredefinedTypeAttributeAttribute(const CommonAPI::ClientId& clientId) = 0;
     /// Provides getter access to the attribute TestDerivedStructAttribute.
-    virtual const DerivedTypeCollection::TestStructExtended& getTestDerivedStructAttributeAttribute() = 0;
+    virtual const DerivedTypeCollection::TestStructExtended& getTestDerivedStructAttributeAttribute(const CommonAPI::ClientId& clientId) = 0;
     /// Provides getter access to the attribute TestDerivedArrayAttribute.
-    virtual const DerivedTypeCollection::TestArrayUInt64& getTestDerivedArrayAttributeAttribute() = 0;
+    virtual const DerivedTypeCollection::TestArrayUInt64& getTestDerivedArrayAttributeAttribute(const CommonAPI::ClientId& clientId) = 0;
 
     /// This is the method that will be called on remote calls on the method testEmptyMethod.
-    virtual void testEmptyMethod() = 0;
+    virtual void testEmptyMethod(const CommonAPI::ClientId& clientId) = 0;
     /// This is the method that will be called on remote calls on the method testVoidPredefinedTypeMethod.
-    virtual void testVoidPredefinedTypeMethod(uint32_t uint32Value, std::string stringValue) = 0;
+    virtual void testVoidPredefinedTypeMethod(const CommonAPI::ClientId& clientId, uint32_t uint32Value, std::string stringValue) = 0;
     /// This is the method that will be called on remote calls on the method testPredefinedTypeMethod.
-    virtual void testPredefinedTypeMethod(uint32_t uint32InValue, std::string stringInValue, uint32_t& uint32OutValue, std::string& stringOutValue) = 0;
+    virtual void testPredefinedTypeMethod(const CommonAPI::ClientId& clientId, uint32_t uint32InValue, std::string stringInValue, uint32_t& uint32OutValue, std::string& stringOutValue) = 0;
     /// This is the method that will be called on remote calls on the method testVoidDerivedTypeMethod.
-    virtual void testVoidDerivedTypeMethod(DerivedTypeCollection::TestEnumExtended2 testEnumExtended2Value, DerivedTypeCollection::TestMap testMapValue) = 0;
+    virtual void testVoidDerivedTypeMethod(const CommonAPI::ClientId& clientId, DerivedTypeCollection::TestEnumExtended2 testEnumExtended2Value, DerivedTypeCollection::TestMap testMapValue) = 0;
     /// This is the method that will be called on remote calls on the method testDerivedTypeMethod.
-    virtual void testDerivedTypeMethod(DerivedTypeCollection::TestEnumExtended2 testEnumExtended2InValue, DerivedTypeCollection::TestMap testMapInValue, DerivedTypeCollection::TestEnumExtended2& testEnumExtended2OutValue, DerivedTypeCollection::TestMap& testMapOutValue) = 0;
+    virtual void testDerivedTypeMethod(const CommonAPI::ClientId& clientId, DerivedTypeCollection::TestEnumExtended2 testEnumExtended2InValue, DerivedTypeCollection::TestMap testMapInValue, DerivedTypeCollection::TestEnumExtended2& testEnumExtended2OutValue, DerivedTypeCollection::TestMap& testMapOutValue) = 0;
     
     /// Sends a broadcast event for TestPredefinedTypeBroadcast.
     virtual void fireTestPredefinedTypeBroadcastEvent(const uint32_t& uint32Value, const std::string& stringValue) = 0;
index 4e49232..3f7d13b 100644 (file)
@@ -23,12 +23,20 @@ const uint32_t& TestInterfaceStubDefault::getTestPredefinedTypeAttributeAttribut
     return testPredefinedTypeAttributeAttributeValue_;
 }
 
+const uint32_t& TestInterfaceStubDefault::getTestPredefinedTypeAttributeAttribute(const CommonAPI::ClientId& clientId) {
+    return getTestPredefinedTypeAttributeAttribute();
+}
+
 void TestInterfaceStubDefault::setTestPredefinedTypeAttributeAttribute(uint32_t value) {
     const bool valueChanged = trySetTestPredefinedTypeAttributeAttribute(std::move(value));
     if (valueChanged)
         stubAdapter_->fireTestPredefinedTypeAttributeAttributeChanged(testPredefinedTypeAttributeAttributeValue_);
 }
 
+void TestInterfaceStubDefault::setTestPredefinedTypeAttributeAttribute(const CommonAPI::ClientId& clientId, uint32_t value) {
+       setTestPredefinedTypeAttributeAttribute(value);
+}
+
 void TestInterfaceStubDefault::onRemoteTestPredefinedTypeAttributeAttributeChanged() {
     // No operation in default
 }
@@ -50,6 +58,10 @@ bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestPredefinedType
     return defaultStub_->trySetTestPredefinedTypeAttributeAttribute(std::move(value));
 }
 
+bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestPredefinedTypeAttributeAttribute(const CommonAPI::ClientId& clientId, uint32_t value) {
+    return onRemoteSetTestPredefinedTypeAttributeAttribute(value);
+}
+
 void TestInterfaceStubDefault::RemoteEventHandler::onRemoteTestPredefinedTypeAttributeAttributeChanged() {
     defaultStub_->onRemoteTestPredefinedTypeAttributeAttributeChanged();
 }
@@ -58,12 +70,20 @@ const DerivedTypeCollection::TestStructExtended& TestInterfaceStubDefault::getTe
     return testDerivedStructAttributeAttributeValue_;
 }
 
+const DerivedTypeCollection::TestStructExtended& TestInterfaceStubDefault::getTestDerivedStructAttributeAttribute(const CommonAPI::ClientId& clientId) {
+    return getTestDerivedStructAttributeAttribute();
+}
+
 void TestInterfaceStubDefault::setTestDerivedStructAttributeAttribute(DerivedTypeCollection::TestStructExtended value) {
     const bool valueChanged = trySetTestDerivedStructAttributeAttribute(std::move(value));
     if (valueChanged)
         stubAdapter_->fireTestDerivedStructAttributeAttributeChanged(testDerivedStructAttributeAttributeValue_);
 }
 
+void TestInterfaceStubDefault::setTestDerivedStructAttributeAttribute(const CommonAPI::ClientId& clientId, DerivedTypeCollection::TestStructExtended value) {
+       setTestDerivedStructAttributeAttribute(value);
+}
+
 void TestInterfaceStubDefault::onRemoteTestDerivedStructAttributeAttributeChanged() {
     // No operation in default
 }
@@ -85,6 +105,10 @@ bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedStructA
     return defaultStub_->trySetTestDerivedStructAttributeAttribute(std::move(value));
 }
 
+bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedStructAttributeAttribute(const CommonAPI::ClientId& clientId, DerivedTypeCollection::TestStructExtended value) {
+    return onRemoteSetTestDerivedStructAttributeAttribute(value);
+}
+
 void TestInterfaceStubDefault::RemoteEventHandler::onRemoteTestDerivedStructAttributeAttributeChanged() {
     defaultStub_->onRemoteTestDerivedStructAttributeAttributeChanged();
 }
@@ -93,12 +117,20 @@ const DerivedTypeCollection::TestArrayUInt64& TestInterfaceStubDefault::getTestD
     return testDerivedArrayAttributeAttributeValue_;
 }
 
+const DerivedTypeCollection::TestArrayUInt64& TestInterfaceStubDefault::getTestDerivedArrayAttributeAttribute(const CommonAPI::ClientId& clientId) {
+    return getTestDerivedArrayAttributeAttribute();
+}
+
 void TestInterfaceStubDefault::setTestDerivedArrayAttributeAttribute(DerivedTypeCollection::TestArrayUInt64 value) {
     const bool valueChanged = trySetTestDerivedArrayAttributeAttribute(std::move(value));
     if (valueChanged)
         stubAdapter_->fireTestDerivedArrayAttributeAttributeChanged(testDerivedArrayAttributeAttributeValue_);
 }
 
+void TestInterfaceStubDefault::setTestDerivedArrayAttributeAttribute(const CommonAPI::ClientId& clientId, DerivedTypeCollection::TestArrayUInt64 value) {
+       setTestDerivedArrayAttributeAttribute(value);
+}
+
 void TestInterfaceStubDefault::onRemoteTestDerivedArrayAttributeAttributeChanged() {
     // No operation in default
 }
@@ -120,6 +152,10 @@ bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedArrayAt
     return defaultStub_->trySetTestDerivedArrayAttributeAttribute(std::move(value));
 }
 
+bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedArrayAttributeAttribute(const CommonAPI::ClientId& clientId, DerivedTypeCollection::TestArrayUInt64 value) {
+    return onRemoteSetTestDerivedArrayAttributeAttribute(value);
+}
+
 void TestInterfaceStubDefault::RemoteEventHandler::onRemoteTestDerivedArrayAttributeAttributeChanged() {
     defaultStub_->onRemoteTestDerivedArrayAttributeAttributeChanged();
 }
@@ -129,23 +165,53 @@ void TestInterfaceStubDefault::testEmptyMethod() {
     // No operation in default
 }
 
+
+void TestInterfaceStubDefault::testEmptyMethod(const CommonAPI::ClientId& clientId) {
+    // Call compatibility interface
+    testEmptyMethod();
+}
+
 void TestInterfaceStubDefault::testVoidPredefinedTypeMethod(uint32_t uint32Value, std::string stringValue) {
     // No operation in default
 }
 
+
+void TestInterfaceStubDefault::testVoidPredefinedTypeMethod(const CommonAPI::ClientId& clientId, uint32_t uint32Value, std::string stringValue) {
+    // Call compatibility interface
+    testVoidPredefinedTypeMethod(uint32Value, stringValue);
+}
+
 void TestInterfaceStubDefault::testPredefinedTypeMethod(uint32_t uint32InValue, std::string stringInValue, uint32_t& uint32OutValue, std::string& stringOutValue) {
     // No operation in default
 }
 
+
+void TestInterfaceStubDefault::testPredefinedTypeMethod(const CommonAPI::ClientId& clientId, uint32_t uint32InValue, std::string stringInValue, uint32_t& uint32OutValue, std::string& stringOutValue) {
+    // Call compatibility interface
+    testPredefinedTypeMethod(uint32InValue, stringInValue, uint32OutValue, stringOutValue);
+}
+
 void TestInterfaceStubDefault::testVoidDerivedTypeMethod(DerivedTypeCollection::TestEnumExtended2 testEnumExtended2Value, DerivedTypeCollection::TestMap testMapValue) {
     // No operation in default
 }
 
+
+void TestInterfaceStubDefault::testVoidDerivedTypeMethod(const CommonAPI::ClientId& clientId, DerivedTypeCollection::TestEnumExtended2 testEnumExtended2Value, DerivedTypeCollection::TestMap testMapValue) {
+    // Call compatibility interface
+    testVoidDerivedTypeMethod(testEnumExtended2Value, testMapValue);
+}
+
 void TestInterfaceStubDefault::testDerivedTypeMethod(DerivedTypeCollection::TestEnumExtended2 testEnumExtended2InValue, DerivedTypeCollection::TestMap testMapInValue, DerivedTypeCollection::TestEnumExtended2& testEnumExtended2OutValue, DerivedTypeCollection::TestMap& testMapOutValue) {
     // No operation in default
 }
 
 
+void TestInterfaceStubDefault::testDerivedTypeMethod(const CommonAPI::ClientId& clientId, DerivedTypeCollection::TestEnumExtended2 testEnumExtended2InValue, DerivedTypeCollection::TestMap testMapInValue, DerivedTypeCollection::TestEnumExtended2& testEnumExtended2OutValue, DerivedTypeCollection::TestMap& testMapOutValue) {
+    // Call compatibility interface
+    testDerivedTypeMethod(testEnumExtended2InValue, testMapInValue, testEnumExtended2OutValue, testMapOutValue);
+}
+
+
 void TestInterfaceStubDefault::fireTestPredefinedTypeBroadcastEvent(const uint32_t& uint32Value, const std::string& stringValue) {
     stubAdapter_->fireTestPredefinedTypeBroadcastEvent(uint32Value, stringValue);
 }
index bdef836..f149d37 100644 (file)
@@ -30,24 +30,32 @@ class TestInterfaceStubDefault : public TestInterfaceStub {
     TestInterfaceStubRemoteEvent* initStubAdapter(const std::shared_ptr<TestInterfaceStubAdapter>& stubAdapter);
 
     virtual const uint32_t& getTestPredefinedTypeAttributeAttribute();
+    virtual const uint32_t& getTestPredefinedTypeAttributeAttribute(const CommonAPI::ClientId& clientId);
     virtual void setTestPredefinedTypeAttributeAttribute(uint32_t value);
-
+    virtual void setTestPredefinedTypeAttributeAttribute(const CommonAPI::ClientId& clientId, uint32_t value);
     virtual const DerivedTypeCollection::TestStructExtended& getTestDerivedStructAttributeAttribute();
+    virtual const DerivedTypeCollection::TestStructExtended& getTestDerivedStructAttributeAttribute(const CommonAPI::ClientId& clientId);
     virtual void setTestDerivedStructAttributeAttribute(DerivedTypeCollection::TestStructExtended value);
-
+    virtual void setTestDerivedStructAttributeAttribute(const CommonAPI::ClientId& clientId, DerivedTypeCollection::TestStructExtended value);
     virtual const DerivedTypeCollection::TestArrayUInt64& getTestDerivedArrayAttributeAttribute();
+    virtual const DerivedTypeCollection::TestArrayUInt64& getTestDerivedArrayAttributeAttribute(const CommonAPI::ClientId& clientId);
     virtual void setTestDerivedArrayAttributeAttribute(DerivedTypeCollection::TestArrayUInt64 value);
-
+    virtual void setTestDerivedArrayAttributeAttribute(const CommonAPI::ClientId& clientId, DerivedTypeCollection::TestArrayUInt64 value);
 
     virtual void testEmptyMethod();
+    virtual void testEmptyMethod(const CommonAPI::ClientId& clientId);
 
     virtual void testVoidPredefinedTypeMethod(uint32_t uint32Value, std::string stringValue);
+    virtual void testVoidPredefinedTypeMethod(const CommonAPI::ClientId& clientId, uint32_t uint32Value, std::string stringValue);
 
     virtual void testPredefinedTypeMethod(uint32_t uint32InValue, std::string stringInValue, uint32_t& uint32OutValue, std::string& stringOutValue);
+    virtual void testPredefinedTypeMethod(const CommonAPI::ClientId& clientId, uint32_t uint32InValue, std::string stringInValue, uint32_t& uint32OutValue, std::string& stringOutValue);
 
     virtual void testVoidDerivedTypeMethod(DerivedTypeCollection::TestEnumExtended2 testEnumExtended2Value, DerivedTypeCollection::TestMap testMapValue);
+    virtual void testVoidDerivedTypeMethod(const CommonAPI::ClientId& clientId, DerivedTypeCollection::TestEnumExtended2 testEnumExtended2Value, DerivedTypeCollection::TestMap testMapValue);
 
     virtual void testDerivedTypeMethod(DerivedTypeCollection::TestEnumExtended2 testEnumExtended2InValue, DerivedTypeCollection::TestMap testMapInValue, DerivedTypeCollection::TestEnumExtended2& testEnumExtended2OutValue, DerivedTypeCollection::TestMap& testMapOutValue);
+    virtual void testDerivedTypeMethod(const CommonAPI::ClientId& clientId, DerivedTypeCollection::TestEnumExtended2 testEnumExtended2InValue, DerivedTypeCollection::TestMap testMapInValue, DerivedTypeCollection::TestEnumExtended2& testEnumExtended2OutValue, DerivedTypeCollection::TestMap& testMapOutValue);
 
     
     virtual void fireTestPredefinedTypeBroadcastEvent(const uint32_t& uint32Value, const std::string& stringValue);
@@ -72,12 +80,15 @@ class TestInterfaceStubDefault : public TestInterfaceStub {
         RemoteEventHandler(TestInterfaceStubDefault* defaultStub);
 
         virtual bool onRemoteSetTestPredefinedTypeAttributeAttribute(uint32_t value);
+        virtual bool onRemoteSetTestPredefinedTypeAttributeAttribute(const CommonAPI::ClientId& clientId, uint32_t value);
         virtual void onRemoteTestPredefinedTypeAttributeAttributeChanged();
 
         virtual bool onRemoteSetTestDerivedStructAttributeAttribute(DerivedTypeCollection::TestStructExtended value);
+        virtual bool onRemoteSetTestDerivedStructAttributeAttribute(const CommonAPI::ClientId& clientId, DerivedTypeCollection::TestStructExtended value);
         virtual void onRemoteTestDerivedStructAttributeAttributeChanged();
 
         virtual bool onRemoteSetTestDerivedArrayAttributeAttribute(DerivedTypeCollection::TestArrayUInt64 value);
+        virtual bool onRemoteSetTestDerivedArrayAttributeAttribute(const CommonAPI::ClientId& clientId, DerivedTypeCollection::TestArrayUInt64 value);
         virtual void onRemoteTestDerivedArrayAttributeAttributeChanged();