File: select.cc

package info (click to toggle)
xd 3.11.0-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 304 kB
  • ctags: 102
  • sloc: cpp: 703; makefile: 139
file content (25 lines) | stat: -rw-r--r-- 375 bytes parent folder | download
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
#include "arbiter.ih"

void Arbiter::select()
{
    if (d_alternatives.size() == 0)
        throw 0;                

    if (d_alternatives.size() == 1)
    {
        msg() << info;
        d_index = 0;            // forced selection: one option
    }
    else
    {
        showAlternatives();
        setIndex();
    }

    cout << d_alternatives[d_index] << endl;
}