os: Split Session_label from Session_policy

By splitting Session_policy into two classes, we make it more flexible.
Originally, the constructor accepted solely an args string, which made it
unusable for situations where we already have extracted the session
label (e.g., stored in the session meta data of a server). Now, the
extraction of the label from the args string is performed by the new
Session_label class instead, which, in turn, can be passed to the
constructor of Session_policy.

This change causes a minor API change. The following code

  Session_policy policy(session_args);

Must be turned into

  Session_label  label(session_args);
  Session_policy policy(label);
This commit is contained in:
Norman Feske
2013-09-09 22:32:07 +02:00
parent f371aef346
commit 6575856624
9 changed files with 61 additions and 33 deletions

View File

@ -458,7 +458,8 @@ namespace Terminal {
Genode::size_t io_buffer_size = 4096;
try {
Genode::Session_policy policy(args);
Genode::Session_label label(args);
Genode::Session_policy policy(label);
unsigned tcp_port = 0;
policy.attribute("port").value(&tcp_port);