-
Notifications
You must be signed in to change notification settings - Fork 0
/
modelsblock.h
72 lines (55 loc) · 1.24 KB
/
modelsblock.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
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
66
67
68
69
70
71
72
/*
* modelsblock.h
*
* Created on: Jan 9, 2015
* Author: minh
*/
#ifndef MODELSBLOCK_H_
#define MODELSBLOCK_H_
#include "ncl/ncl.h"
const int NM_ATOMIC = 1; // NxsModel is not mixture or +G etc. model
const int NM_FREQ = 2; // NxsModel contains state frequency
class NxsModel {
public:
/* model name */
string name;
/* model description */
string description;
/* flag as NM_ATOMIC or NM_FREQ or both */
int flag;
NxsModel() {
flag = 0;
}
NxsModel(string name) {
this->name = name;
flag = 0;
}
virtual ~NxsModel() {}
};
/**
* Class to parse MODELS block in NEXUS file
*/
class ModelsBlock: public NxsBlock, public vector<NxsModel> {
public:
/** constructor */
ModelsBlock();
/** destructor */
virtual ~ModelsBlock();
/**
@param name model name
@return pointer to model with the name or NULL if not found
*/
NxsModel *findModel(string &name);
/**
@param name model name
@return pointer to a mixed model with the name or NULL if not found
*/
NxsModel *findMixModel(string &name);
protected:
/**
main method to read block from file
@param token a token reader
*/
virtual void Read(NxsToken &token);
};
#endif /* MODELSBLOCK_H_ */