Re-generated code
[profile/ivi/common-api-dbus-runtime.git] / src / test / commonapi / tests / managed / RootInterfaceStubDefault.cpp
1 /*
2 * This file was generated by the CommonAPI Generators. 
3 * Used org.genivi.commonapi.core 2.1.3.qualifier.
4 * Used org.franca.core 0.8.10.201309262002.
5 *
6 * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
7 * If a copy of the MPL was not distributed with this file, You can obtain one at
8 * http://mozilla.org/MPL/2.0/.
9 */
10 #include <commonapi/tests/managed/RootInterfaceStubDefault.h>
11
12 namespace commonapi {
13 namespace tests {
14 namespace managed {
15
16 RootInterfaceStubDefault::RootInterfaceStubDefault():
17         autoInstanceCounter_(0),
18         remoteEventHandler_(this) {
19 }
20
21 RootInterfaceStubRemoteEvent* RootInterfaceStubDefault::initStubAdapter(const std::shared_ptr<RootInterfaceStubAdapter>& stubAdapter) {
22     stubAdapter_ = stubAdapter;
23     return &remoteEventHandler_;
24 }
25
26
27 void RootInterfaceStubDefault::testRootMethod(const std::shared_ptr<CommonAPI::ClientId> clientId, int32_t inInt, std::string inString, RootInterface::testRootMethodError& methodError, int32_t& outInt, std::string& outString) {
28     // Call old style methods in default 
29     testRootMethod(inInt, inString, methodError, outInt, outString);
30 }
31 void RootInterfaceStubDefault::testRootMethod(int32_t inInt, std::string inString, RootInterface::testRootMethodError& methodError, int32_t& outInt, std::string& outString) {
32     // No operation in default
33 }
34
35
36
37 bool RootInterfaceStubDefault::registerManagedStubLeafInterfaceAutoInstance(std::shared_ptr<LeafInterfaceStub> stub) {
38     autoInstanceCounter_++;
39     std::stringstream ss;
40     ss << stubAdapter_->getInstanceId() << ".i" << autoInstanceCounter_;
41     std::string instance = ss.str();
42     return stubAdapter_->registerManagedStubLeafInterface(stub, instance);
43 }
44 bool RootInterfaceStubDefault::registerManagedStubLeafInterface(std::shared_ptr<LeafInterfaceStub> stub, const std::string& instance) {
45     return stubAdapter_->registerManagedStubLeafInterface(stub, instance);
46 }
47 bool RootInterfaceStubDefault::deregisterManagedStubLeafInterface(const std::string& instance) {
48     return stubAdapter_->deregisterManagedStubLeafInterface(instance);
49 }
50 std::set<std::string>& RootInterfaceStubDefault::getLeafInterfaceInstances() {
51     return stubAdapter_->getLeafInterfaceInstances();
52 }
53 bool RootInterfaceStubDefault::registerManagedStubBranchInterfaceAutoInstance(std::shared_ptr<BranchInterfaceStub> stub) {
54     autoInstanceCounter_++;
55     std::stringstream ss;
56     ss << stubAdapter_->getInstanceId() << ".i" << autoInstanceCounter_;
57     std::string instance = ss.str();
58     return stubAdapter_->registerManagedStubBranchInterface(stub, instance);
59 }
60 bool RootInterfaceStubDefault::registerManagedStubBranchInterface(std::shared_ptr<BranchInterfaceStub> stub, const std::string& instance) {
61     return stubAdapter_->registerManagedStubBranchInterface(stub, instance);
62 }
63 bool RootInterfaceStubDefault::deregisterManagedStubBranchInterface(const std::string& instance) {
64     return stubAdapter_->deregisterManagedStubBranchInterface(instance);
65 }
66 std::set<std::string>& RootInterfaceStubDefault::getBranchInterfaceInstances() {
67     return stubAdapter_->getBranchInterfaceInstances();
68 }
69
70 RootInterfaceStubDefault::RemoteEventHandler::RemoteEventHandler(RootInterfaceStubDefault* defaultStub):
71         defaultStub_(defaultStub) {
72 }
73
74 } // namespace managed
75 } // namespace tests
76 } // namespace commonapi