Subversion Repositories programming

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
321 ira 1
#include <cstdio>
2
#include <unistd.h>
3
using namespace std;
4
 
5
#include <boost/thread/thread.hpp>
6
#include <boost/bind.hpp>
7
 
8
#include "controller.h"
9
#include "elevator.h"
10
 
11
int main (int argc, char *argv[])
12
{
13
    int i = 0;
329 ira 14
    //Elevator e1 (10);
321 ira 15
    Controller c (10, 5);
16
 
17
    vector<Elevator> elevators (5, Elevator (10));
18
 
329 ira 19
    elevators[1].thread_start ();
20
    //elevators[2].thread_start ();
321 ira 21
 
328 ira 22
    // do some useful stuff here
329 ira 23
    sleep (2);
24
    elevators[1].push_button (4);
25
    //elevators[2].push_button (8);
26
    //elevators[2].push_button (2);
27
    sleep (24);
321 ira 28
 
329 ira 29
    elevators[1].thread_exit ();
30
    //elevators[2].thread_exit ();
321 ira 31
 
32
 
33
    return 0;
34
}
35