drake  1.0.0
include/drake/stream.h
Go to the documentation of this file.
00001 /*
00002  Copyright 2015 Nicolas Melot
00003 
00004  This file is part of Drake.
00005 
00006  Drake is free software: you can redistribute it and/or modify
00007  it under the terms of the GNU General Public License as published by
00008  the Free Software Foundation, either version 3 of the License, or
00009  (at your option) any later version.
00010 
00011  Drake is distributed in the hope that it will be useful,
00012  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014  GNU General Public License for more details.
00015 
00016  You should have received a copy of the GNU General Public License
00017  along with Drake. If not, see <http://www.gnu.org/licenses/>.
00018 
00019 */
00020 
00021 
00022 #include <stddef.h>
00023 #include <drake/mapping.h>
00024 #include <drake/processor.h>
00025 #include <drake/platform.h>
00026 #include <drake/schedule.h>
00027 
00028 #ifndef DRAKE_STREAM_H
00029 #define DRAKE_STREAM_H
00030 
00032 typedef struct {
00034         mapping_t *mapping;
00036         processor_t *proc;
00038         size_t local_memory_size;
00040         drake_time_t stage_time;
00042         drake_time_t stage_start_time;
00044         drake_time_t stage_stop_time;
00046         drake_time_t stage_sleep_time;
00048         void (*schedule_destroy)();
00050         drake_schedule_t schedule;
00052         void* (*func)(size_t id, task_status_t status);
00054         drake_platform_t platform;
00056         drake_time_t zero;
00057 } drake_stream_t;
00058 
00064 drake_stream_t drake_stream_create_explicit(void (*schedule_init)(), void (*schedule_destroy)(drake_schedule_t*), void* (*task_function)(size_t id, task_status_t status), drake_platform_t pt);
00069 int drake_stream_init(drake_stream_t* stream, void* arg);
00071 int drake_stream_run(drake_stream_t*);
00073 int drake_stream_destroy(drake_stream_t*);
00074 
00075 #endif