-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathParser.h
35 lines (28 loc) · 874 Bytes
/
Parser.h
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
#ifndef PARSER_H
#define PARSER_H
/******************************************************************************
* Parser is essentially the main function for the child process. Parser is
* used to read the MNIST digit data, flip the endianness, and write it to
* shared memory for NetManager.
******************************************************************************/
#include <string>
#include <vector>
#include <iostream>
#include <cstdlib>
#include "defs.h"
#include "Digit.h"
#include "SharedMem.h"
#include <unistd.h>
using namespace std;
class Parser
{
public:
Parser(SharedMem * shmem, vector<string> file, const string path="MNIST/");
bool fillQueue();
private:
void traversePastHeader(FILE * fp);
unsigned int endianSwap(unsigned int c);
string m_MNISTDataDirectory;
Digit m_digit;
};
#endif