das2C
das core C utilities (v3)
Loading...
Searching...
No Matches
builder.h
1/* Copyright (C) 2017 Chris Piker <chris-piker@uiowa.edu>
2 *
3 * This file is part of das2C, the Core Das2 C Library.
4 *
5 * Das2C is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU Lesser General Public License version 2.1 as published
7 * by the Free Software Foundation.
8 *
9 * Das2C is distributed in the hope that it will be useful, but WITHOUT ANY
10 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * version 2.1 along with das2C; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef _das_builder_h_
19#define _das_builder_h_
20
21#include <das3/processor.h>
22#include <das3/dataset.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28struct ds_pd_set{
29 PktDesc* pPd;
30 DasDs* pDs;
31};
32
50typedef struct das_builder {
51 StreamHandler base;
52
55 DasStream* pStream;
56
57 bool _released; /* true if stream taken over by some other object */
58
59 /* Das2 allows packet descriptors to be re-defined. This is annoying but
60 * we have to deal with it. Here's the tracking mechanism
61 *
62 * lDsMap - The index in this array is a packet ID
63 * The value is the index in lPairs that holds a copy of the packet
64 * descriptor and it's dataset.
65 *
66 * lPairs - The dataset and corresponding packet descriptors.
67 *
68 * If a packet ID is re-defined, first look to see if the new definition is
69 * actually something that's been seen before and change the value in lDsMap
70 * to the old definition. */
71 int lDsMap[MAX_PKTIDS];
72
73 size_t uValidPairs;
74 struct ds_pd_set* lPairs;
75 size_t uSzPairs;
76
77} DasDsBldr;
78
86DAS_API DasDsBldr* new_DasDsBldr(void);
87
94DAS_API void del_DasDsBldr(DasDsBldr* pThis);
95
105DAS_API void DasDsBldr_release(DasDsBldr* pThis);
106
115DAS_API DasStream* DasDsBldr_getStream(DasDsBldr* pThis);
116
129DAS_DEPRECATED DAS_API DasDs** DasDsBldr_getDataSets(DasDsBldr* pThis, size_t* pLen);
130
142DAS_DEPRECATED DAS_API DasDesc* DasDsBldr_getProps(DasDsBldr* pThis);
143
157DAS_DEPRECATED DAS_API DasDs** build_from_stdin(
158 const char* sProgName, size_t* pSets, DasDesc** ppGlobal
159);
160
171DAS_API DasStream* stream_from_stdin(const char* sProgName);
172
182DAS_API DasStream* stream_from_path(const char* sProg, const char* sFile);
183
184#ifdef __cplusplus
185}
186#endif
187
188#endif /* _das_builder_h_ */
189
Objects which correlate arrays in index space.
Callback processing for das2 stream reads and writes.
Base structure for Stream Header Items.
Definition descriptor.h:74
Das Datasets.
Definition dataset.h:156
Describes the stream itself, in particular the compression used, current packetDescriptors,...
Definition stream.h:91
Holds information for a single packet type in a Das2 stream.
Definition packet.h:138
A set of callbacks used for input and output stream processing.
Definition processor.h:129