summaryrefslogtreecommitdiffstats
path: root/src/roof.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/roof.h')
-rw-r--r--src/roof.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/roof.h b/src/roof.h
new file mode 100644
index 0000000..316e8ed
--- /dev/null
+++ b/src/roof.h
@@ -0,0 +1,46 @@
+#ifndef __ROOF_H
+#define __ROOF_H
+
+typedef struct _Roof Roof;
+
+#include "roof-config.h"
+#include "roof-buffer.h"
+#include "roof-read.h"
+#include "roof-thread.h"
+
+struct _Roof {
+ RoofConfig *cfg; // Parsed ROOF parameters
+ RoofBuffer *buf; // Ring buffer for incomming UDP packet
+ RoofReadInterface **rdi; // Reader interface abstraction, one per socket (no threading)
+ RoofReadContext **rdc; // Reader context: common structures, one per socket (no threading)
+ RoofThread **rdt; // Threading context: multiple reader contexts per thread
+
+ guint n_threads; // Number of schedulled threads
+ HWSched sched; // OpenMP-style thread scheduler
+
+ gboolean simulate; // Indicates if we are running in network or simulation modes
+ gchar *path; // UFO file path for simulation mode
+ guint first_file_number; // Number of a first simulated file (0 or 1)
+
+ guint max_datasets; // Number of datasets to read
+
+// guint64 announced; // For debugging
+// guint64 generated; // Total number for control
+
+// struct timespec last_fragment_timestamp;
+
+};
+
+
+Roof *roof_new(RoofConfig *cfg, GError **error);
+void roof_free(Roof *ctx);
+
+void roof_configure_simulation(Roof *ctx, const gchar *path, guint first_file_number, GError **error);
+void roof_configure_stop_mode(Roof *ctx, const gulong max, GError **error);
+//void roof_configure_writer(Roof *ctx, ...);
+//void roof_configure_filter(Roof *ctx, ...);
+void roof_setup(Roof *ctx, GError **error);
+
+void roof_read(Roof *ctx, void *buffer, GError **error);
+
+#endif \ No newline at end of file