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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef __DADA_PWC_NEXUS_H
#define __DADA_PWC_NEXUS_H
/* ************************************************************************
dada_pwc_nexus_t - a struct and associated routines for creation and
management of a dada network
************************************************************************ */
#include "dada_pwc.h"
#include "nexus.h"
#include "monitor.h"
#include "string_array.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
/*! the nexus communication base class */
node_t node;
/*! the unique header for this primary write client */
char* header;
/*! the size of the header */
unsigned header_size;
/*! the state of the node */
dada_pwc_state_t state;
} dada_pwc_node_t;
typedef struct {
/*! the nexus communication base class */
nexus_t nexus;
/*! the pwc communication server */
dada_pwc_t* pwc;
/*! the monitor of the mirror nexus */
monitor_t* monitor;
/*! the template header for all primary write clients */
char* header_template;
/*! pointer to function used to convert between time representations */
struct tm* (*convert_to_tm) (const time_t* timep);
} dada_pwc_nexus_t;
/*! Create a new DADA PWC nexus */
dada_pwc_nexus_t* dada_pwc_nexus_create ();
/*! Destroy a DADA PWC nexus */
int dada_pwc_nexus_destroy (dada_pwc_nexus_t* nexus);
/*! Read the DADA PWC nexus configuration from the specified filename */
int dada_pwc_nexus_configure (dada_pwc_nexus_t* nexus, const char* filename);
/*! Serve PWC */
int dada_pwc_nexus_serve (dada_pwc_nexus_t* nexus);
#ifdef __cplusplus
}
#endif
#endif