genode/repos/hello_tutorial/include/hello_session/client.h

43 lines
964 B
C
Raw Normal View History

2011-12-22 16:19:25 +01:00
/*
* \brief Client-side interface of the Hello service
* \author Björn Döbel
* \date 2008-03-20
*/
/*
* Copyright (C) 2008-2017 Genode Labs GmbH
2011-12-22 16:19:25 +01:00
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
2011-12-22 16:19:25 +01:00
*/
#ifndef _INCLUDE__HELLO_SESSION_H__CLIENT_H_
#define _INCLUDE__HELLO_SESSION_H__CLIENT_H_
#include <hello_session/hello_session.h>
#include <base/rpc_client.h>
2016-05-20 14:49:45 +02:00
#include <base/log.h>
2011-12-22 16:19:25 +01:00
2016-05-20 14:49:45 +02:00
namespace Hello { struct Session_client; }
2011-12-22 16:19:25 +01:00
2016-05-20 14:49:45 +02:00
struct Hello::Session_client : Genode::Rpc_client<Session>
{
Session_client(Genode::Capability<Session> cap)
: Genode::Rpc_client<Session>(cap) { }
void say_hello() override
2016-05-20 14:49:45 +02:00
{
Genode::log("issue RPC for saying hello");
call<Rpc_say_hello>();
Genode::log("returned from 'say_hello' RPC call");
}
int add(int a, int b) override
2011-12-22 16:19:25 +01:00
{
2016-05-20 14:49:45 +02:00
return call<Rpc_add>(a, b);
}
};
2011-12-22 16:19:25 +01:00
#endif /* _INCLUDE__HELLO_SESSION_H__CLIENT_H_ */