-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsampleMap.h
More file actions
65 lines (55 loc) · 1.63 KB
/
sampleMap.h
File metadata and controls
65 lines (55 loc) · 1.63 KB
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
/**
* @file
*
* @author Christopher Blöcker
*/
#ifndef __SAMPLEMAP_H__
#define __SAMPLEMAP_H__
/* -------------------------------------------------------------------------- */
#include <stdio.h>
/* -------------------------------------------------------------------------- */
#include "vector.h"
/* -------------------------------------------------------------------------- */
/* A sample map, i.e. a collection of samples */
typedef struct {
/* Capacity of the sample map */
unsigned size;
/* Number of elements in the sample map */
unsigned items;
/* The elements of the sample map */
Vector * samples;
} SampleMap;
/* -------------------------------------------------------------------------- */
/**
* Created a new sample map.
*
* @param[in] size Size of the sample map to create.
*
* @return The new sample map with space for the given number of samples.
*/
extern SampleMap sampleMapMake(int size);
/**
* Inserts a sample into the sample map.
*
* @param[in] s The sample map.
* @param[in] sample The sample that should be intserted into the sample map.
*
* @return The new sample map containing the new sample.
*/
extern SampleMap sampleMapPut(SampleMap s, Vector sample);
/**
* Frees the memory used by the given sample map.
*
* @param[in] s Sample map that should be freed.
*
* @return NULL.
*/
extern SampleMap sampleMapFree(SampleMap s);
/**
* Prints information about the given sample map in stream.
*
* @param[in] s The sample map information should be printed about.
* @param[in] stream Where to print the information.
*/
extern void sampleMapPrint(SampleMap s, FILE * stream);
#endif