Ejemplo n.º 1
0
vector<Order> vect_read(string filename){ //Creates a vector of orders from a file
	vector<Order> v;
	ifstream is(filename.c_str());
	string line;
	while(getline(is, line))
		v.push_back(read_order(line));
	return v;
}
Ejemplo n.º 2
0
list<Order> list_read(string filename){ //Creates a list of orders from a file
	list<Order> l;
	ifstream is(filename.c_str());
	string line;
	while(getline(is, line))
		l.push_back(read_order(line));
	return l;
}
Ejemplo n.º 3
0
void *order_thread_function(void *arg) {
	
	FILE* orders = (FILE*) arg;
	
	printf("order thread started\n");
	
	while(1){
		struct order_info* current = read_order(orders);
		if(current == NULL){
			
			printf("exiting orders thread\n");
			time_to_exit = 1;
			pthread_exit("exited order thread");
			
		}
		
		struct order_queue* cat_queue = get_queue(current->category);
<<<<<<< HEAD
	
		int wait = 0;
	
=======