Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Do not mark all public function as potentially inline since it breaks on mac (get...
[simgrid.git] / src / include / surf / trace_mgr.h
1 /*      $Id$     */
2
3 /* Copyright (c) 2004 Arnaud Legrand. All rights reserved.                  */
4
5 /* This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package. */
7
8 #ifndef _SURF_TMGR_H
9 #define _SURF_TMGR_H
10
11 #include "xbt/heap.h"
12 #include "xbt/dynar.h"
13 #include "surf/maxmin.h"
14 #include "surf/datatypes.h"
15
16 /* Creation functions */
17 XBT_PUBLIC(tmgr_history_t) tmgr_history_new(void);
18 XBT_PUBLIC(void) tmgr_history_free(tmgr_history_t history);
19
20 XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new(const char *filename);
21 XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_from_string(const char *id,
22                                                     const char *input,
23                                                     double periodicity);
24 XBT_PUBLIC(tmgr_trace_t) tmgr_empty_trace_new(void);
25 XBT_INLINE XBT_PUBLIC(void) tmgr_trace_free(tmgr_trace_t trace);
26 /**
27  * \brief Free a trace event structure
28  *
29  * This function frees a trace_event if it can be freed, ie, if it has the free_me flag set to 1. This flag indicates whether the structure is still used somewhere or not.
30  * \param       trace_event             Trace event structure
31  * \return 1 if the structure was freed, 0 otherwise
32 */
33 XBT_PUBLIC(int) tmgr_trace_event_free(tmgr_trace_event_t trace_event);
34
35 XBT_PUBLIC(tmgr_trace_event_t) tmgr_history_add_trace(tmgr_history_t history,
36                                                       tmgr_trace_t trace,
37                                                       double start_time,
38                                                       unsigned int offset,
39                                                       void *model);
40
41 /* Access functions */
42 XBT_PUBLIC(double) tmgr_history_next_date(tmgr_history_t history);
43 XBT_PUBLIC(tmgr_trace_event_t) tmgr_history_get_next_event_leq(tmgr_history_t
44                                                                history,
45                                                                double date,
46                                                                double *value,
47                                                                void **model);
48
49 XBT_PUBLIC(void) tmgr_finalize(void);
50
51 #endif /* _SURF_TMGR_H */