File: simulator.h

package info (click to toggle)
simrisc 16.05.00-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,568 kB
  • sloc: cpp: 6,877; fortran: 665; makefile: 112; ansic: 112; sh: 107
file content (39 lines) | stat: -rw-r--r-- 1,099 bytes parent folder | download | duplicates (2)
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
#ifndef INCLUDED_SIMULATOR_
#define INCLUDED_SIMULATOR_

#include <fstream>
#include <cstdint>

// analyses specfy different parameters, like screeningRound, iterations,
//  nWomen

class Simulator
{
//data
    bool d_next = false;                        // true if 'run()' should run
                                                // an analysis

    uint16_t d_lineNr = 1;                      // updated by 'fileAnalysis'
    std::ifstream d_ifstream;                   // multiple analysis specs

    std::string (Simulator::*d_nextSpecs)();    // ptr to function handling
                                                // the (next) analysis spec.
//=
    public:
        Simulator();

        void run();

    private:
        bool nextAnalysis();

        void setAnalysisSource();       // extra specifications either on the
                                        // cmd line or the next 'analysis:'
                                        // specification from file

        std::string cmdLineAnalysis();
        std::string fileAnalysis();
        std::string endOfSpecs();
};

#endif