-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCnmzComponentList.cpp
More file actions
28 lines (21 loc) · 896 Bytes
/
CnmzComponentList.cpp
File metadata and controls
28 lines (21 loc) · 896 Bytes
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
#include "CnmzComponentList.h"
using namespace std;
void CnmzComponentList::write(FILE* f, int tabs, bool iterative){
//required
string el = "componentList";
if (source.empty()) NMZerrMsg(el, "source");
if (analyzer.empty()) NMZerrMsg(el, "analyzer");
if (detector.empty()) NMZerrMsg(el, "detectir");
if (count != source.size()+analyzer.size()+detector.size()) NMZerrMsg(el, "count match number of source+analyzer+detector");
NMZprintTabs(f, tabs);
fprintf(f, "<componentList");
fprintf(f, " count=\"%d\"", count);
fprintf(f, ">\n");
int t = tabs;
if (t>-1) t++;
for (size_t a = 0; a<source.size(); a++) source[a].write(f, t, iterative);
for (size_t a = 0; a<analyzer.size(); a++) analyzer[a].write(f, t, iterative);
for (size_t a = 0; a<detector.size(); a++) detector[a].write(f, t, iterative);
NMZprintTabs(f, tabs);
fprintf(f, "</componentList>\n");
}