summaryrefslogtreecommitdiff
path: root/src/include/cctk_IOMethods.h
blob: 1bbf936d549bc381fa79f9938d76b8ce197c4122 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
 /*@@
   @header    cctk_IOMethods.h
   @date      1999/07/30
   @author    Gabrielle Allen
   @desc
              header file for handling IO methods
   @enddesc
   @version   $Version: cctk_IOMethods.h,v 1.3 2001/10/23 15:40:08 allen Exp $
 @@*/

#ifndef _CCTK_IOMETHODS_H_
#define _CCTK_IOMETHODS_H_

#ifdef __cplusplus
extern "C" {
#endif

struct IOMethod
{
  const char *implementation;
  const char *name;
  int (*OutputGH)      (const cGH *GH);
  int (*OutputVarAs)   (const cGH *GH, const char *vname, const char *alias);
  int (*TriggerOutput) (const cGH *GH, int vindex);
  int (*TimeToOutput)  (const cGH *GH, int vindex);

  /* Timer data */
  int timer_handle;
};

#define CCTK_RegisterIOMethod(a) CCTKi_RegisterIOMethod (CCTK_THORNSTRING, a)
int CCTKi_RegisterIOMethod (const char *thorn, const char *name);
int CCTK_RegisterIOMethodOutputGH (int handle, int (*OutputGH) (const cGH *GH));
int CCTK_RegisterIOMethodTimeToOutput (int handle,
                                       int (*TimeToOutput) (const cGH *GH,
                                                            int vindex));
int CCTK_RegisterIOMethodTriggerOutput (int handle,
                                        int (*TriggerOutput) (const cGH *GH,
                                                              int vindex));
int CCTK_RegisterIOMethodOutputVarAs (int handle,
                                      int (*OutputVarAs) (const cGH *GH,
                                                          const char *vname,
                                                          const char *alias));

const char *CCTK_IOMethodImplementation (int handle);

const char *CCTK_IOMethodName (int handle);

const struct IOMethod *CCTK_IOMethod (int handle);

int CCTK_NumIOMethods (void);

#ifdef __cplusplus
}
#endif

#endif  /* _CCTK_IOMETHODS_H_ */