mapgd  0.4
A program for the Maximum-likelihood analysis of population genomic data.
 All Data Structures Functions Variables Friends Groups Pages
bed_file.h
1 /* An bed */
2 
3 #ifndef _BED_FILE_H_
4 #define _BED_FILE_H_
5 
6 #include <iostream>
7 #include <cfloat>
8 #include <iomanip>
9 #include <vector>
10 
11 #ifndef NOLZ4
12 #include "state.h"
13 #endif
14 
15 #include "external-file.h"
16 #include "external-data.h"
17 
18 #include "typedef.h"
19 #include "datatypes.h"
20 #include "raw.h"
21 #include "stream_tools.h"
22 
23 //Bed files do not contain sufficient information to be interpreted without other files (because they are terribly designed,
24 
25 class Bed_data : public External_data {
26 private:
27 public:
28  size_t size_;
29  uint8_t *buffer_;
30  Bed_data ();
31  Bed_data (const size_t &);
32 
33  void put (const Data *, ...);
34  void get (Data *, ...) const;
35 
36 #ifndef NOLZ4
37  id1_t get (State &) const;
38 #endif
39 
40 };
41 
42 
43 class Bed_file : public External_file <Bed_data> {
44 private:
45  using Base_file::in_;
46  using Base_file::out_;
47  using Base_file::open_;
49 // htsFile *file_;
50 public:
51  void open(const std::ios_base::openmode &);
52  void open(const char *, const std::ios_base::openmode &);
53  void close(void);
54  void read (Bed_data &);
55 };
56 
57 #endif
void put(const Data *,...)
The write function must be defined in the child class.
Definition: bed_file.cc:122
Definition: bed_file.h:25
void open_no_extention(const char *, const std::ios::openmode &)
The function that opens a indexed_file (if file).
Definition: map_file.cc:59
An interface for reading and writing data specified outside of mapgd.
Definition: external-file.h:36
std::istream * in_
All data is read from in.
Definition: map_file.h:85
Definition: state.h:31
An interface used to read/write data from outside of mapgd.
Definition: external-data.h:17
Definition: bed_file.h:43
std::ostream * out_
All data is written is written to out.
Definition: map_file.h:86
bool open_
indicates whether the iostream opened succesfully
Definition: map_file.h:60
A class which can be written as flat text file or into an SQL database.
Definition: data.h:34