summaryrefslogtreecommitdiff
path: root/CommonAPI-Examples/E07Mainloop/src/E07MainloopStubImpl.cpp
blob: 53a2cd04bfd9958c6e88ff462fc342d07d4f693a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* Copyright (C) 2015 BMW Group
 * Author: Lutz Bichler (lutz.bichler@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 "E07MainloopStubImpl.hpp"

E07MainloopStubImpl::E07MainloopStubImpl() {
	setXAttribute(0);
}

E07MainloopStubImpl::~E07MainloopStubImpl() {
}

void E07MainloopStubImpl::sayHello(const std::shared_ptr<CommonAPI::ClientId> _client,
		std::string _name,
		sayHelloReply_t _reply) {

	std::stringstream messageStream;

    messageStream << "Hello " << _name << "!";
    std::cout << "sayHello('" << _name << "'): '" << messageStream.str() << "'\n";

    _reply(messageStream.str());
}

void E07MainloopStubImpl::incAttrX() {
	int32_t xValue = getXAttribute();
	xValue++;
	setXAttribute((int32_t)xValue);
	std::cout <<  "New counter value = " << xValue << "!" << std::endl;
}