mapgd  0.4
A program for the Maximum-likelihood analysis of population genomic data.
 All Data Structures Functions Variables Friends Groups Pages
external-file.h
1 #ifndef _EXTERNAL_FILE_H_
2 #define _EXTERNAL_FILE_H_
3 
4 #include <map>
5 #include <string>
6 #include <iostream>
7 #include <typeinfo>
8 
9 #include "stream_tools.h"
10 #include "typedef.h"
11 #include "stream_tools.h"
12 #include "map_file.h"
13 
14 /* These should all be included from the objects using this code, but I'm not
15  * linking things correctly right now.
16  */
17 
18 //#include "vcf_file.h"
19 
20 // PLEASE LIMIT LINE LENGTH TO 79 CHARACTERS----------------------------------/
21 
23 
35 template <class External_data>
36 class External_file : public Base_file {
37 private :
38 protected :
39  void read_binary( External_data &);
40  void write_binary(const External_data &);
41 
42  virtual void read_text( External_data &){};
43  virtual void write_text(const External_data&){};
44 
45  using Base_file::out_;
46  using Base_file::in_;
47 
48  using Base_file::open_;
49  using Base_file::read_;
50  using Base_file::write_;
51  using Base_file::binary_;
53 public:
54  using Base_file::open;
55 
57  void open(const char *, const std::ios_base::openmode &);
58 
60 
63 
65 
68 
69 // void close(void);
70 };
71 
72 #endif
External_file & read(External_data &)
Reads a row from the file and advances one row.
virtual void write_text(const External_data &)
Read file in text mode.
Definition: external-file.h:43
External_file & write(const External_data &)
Writes a row to the file and advances one row.
void read_binary(External_data &)
Read file in binary mode.
bool binary_
Binary mode flag.
Definition: map_file.h:81
void open(const char *, const std::ios_base::openmode &)
! The function that opens a External_file (if file).
Definition: external-file.cc:4
An interface for reading and writing data specified outside of mapgd.
Definition: external-file.h:36
void write_binary(const External_data &)
Write in binary mode.
bool read_
File is open for reading.
Definition: map_file.h:79
std::istream * in_
All data is read from in.
Definition: map_file.h:85
An interface used to read/write data from outside of mapgd.
Definition: external-data.h:17
bool write_
File is open for writing.
Definition: map_file.h:80
std::ostream * out_
All data is written is written to out.
Definition: map_file.h:86
void open(const std::ios::openmode &)
Opens a Base_file to the cin/cout.
bool open_
indicates whether the iostream opened succesfully
Definition: map_file.h:60
std::string filename_
The name of the file if opened.
Definition: map_file.h:97
A templet which stores data associated with specific locations in a genome.
Definition: map_file.h:50