2 * This file was generated by the CommonAPI Generators.
3 * Used org.genivi.commonapi.core 2.1.5.qualifier.
4 * Used org.franca.core 0.8.10.201309262002.
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/.
10 #include <commonapi/tests/managed/SecondRootStubDefault.h>
16 SecondRootStubDefault::SecondRootStubDefault():
17 autoInstanceCounter_(0),
18 remoteEventHandler_(this),
19 interfaceVersion_(SecondRoot::getInterfaceVersion()) {
22 const CommonAPI::Version& SecondRootStubDefault::getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> clientId) {
23 return interfaceVersion_;
26 SecondRootStubRemoteEvent* SecondRootStubDefault::initStubAdapter(const std::shared_ptr<SecondRootStubAdapter>& stubAdapter) {
27 CommonAPI::Stub<SecondRootStubAdapter, SecondRootStubRemoteEvent>::stubAdapter_ = stubAdapter;
28 return &remoteEventHandler_;
34 bool SecondRootStubDefault::registerManagedStubLeafInterfaceAutoInstance(std::shared_ptr<LeafInterfaceStub> stub) {
35 autoInstanceCounter_++;
37 ss << stubAdapter_->getInstanceId() << ".i" << autoInstanceCounter_;
38 std::string instance = ss.str();
39 return stubAdapter_->registerManagedStubLeafInterface(stub, instance);
41 bool SecondRootStubDefault::registerManagedStubLeafInterface(std::shared_ptr<LeafInterfaceStub> stub, const std::string& instance) {
42 return stubAdapter_->registerManagedStubLeafInterface(stub, instance);
44 bool SecondRootStubDefault::deregisterManagedStubLeafInterface(const std::string& instance) {
45 return stubAdapter_->deregisterManagedStubLeafInterface(instance);
47 std::set<std::string>& SecondRootStubDefault::getLeafInterfaceInstances() {
48 return stubAdapter_->getLeafInterfaceInstances();
51 SecondRootStubDefault::RemoteEventHandler::RemoteEventHandler(SecondRootStubDefault* defaultStub):
52 defaultStub_(defaultStub) {
55 } // namespace managed
57 } // namespace commonapi