This repository was archived by the owner on Jan 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbatch.h
More file actions
148 lines (130 loc) · 9.37 KB
/
Copy pathbatch.h
File metadata and controls
148 lines (130 loc) · 9.37 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/*----------------------------------------------------------------------------+
| Author: Jerome Richards |
| |
| Assignment: Project 10 |
| File: batch.h |
| |
| Instructor: Dr. Roger deBry |
| Class: CNS-1350 Section X01 |
| |
| Date Written: April 03, 2005 |
| |
| Description: CBatch class definition |
+----------------------------------------------------------------------------*/
#ifndef batchH
#define batchH
#include <vector>
#include "productionRun.h"
using namespace std;
class CBatch
{
private:
double itsMean;
double itsSTD;
bool lErrors;
vector< CProductionRun* > itsPR;
public:
/*----------------------------------------------------------------------------+
| Purpose: Initialize the CBatch class object |
| |
| Parameters: none |
| Returns: nothing |
| |
| Pre-conditions: none |
| Post-conditions: none |
+----------------------------------------------------------------------------*/
CBatch();
/*----------------------------------------------------------------------------+
| Purpose: Release any dynamically allocated memory |
| |
| Parameters: none |
| Returns: nothing |
| |
| Pre-conditions: none |
| Post-conditions: none |
+----------------------------------------------------------------------------*/
virtual ~CBatch();
/*----------------------------------------------------------------------------+
| Purpose: Add a poduction run object to its vector |
| |
| Parameters: theProdRun is a CProductionRun data type |
| Returns: nothing |
| |
| Pre-conditions: theProdRun is a valid pointer to a CProductionRun object |
| Post-conditions: none |
+----------------------------------------------------------------------------*/
void addProdRun( CProductionRun* theProdRun );
/*----------------------------------------------------------------------------+
| Purpose: Calculate the standard mean for the batch |
| |
| Parameters: none |
| Returns: nothing |
| |
| Pre-conditions: none |
| Post-conditions: none |
+----------------------------------------------------------------------------*/
void calcMean();
/*----------------------------------------------------------------------------+
| Purpose: Calculate the standard deviation for the batch |
| |
| Parameters: none |
| Returns: nothing |
| |
| Pre-conditions: none |
| Post-conditions: none |
+----------------------------------------------------------------------------*/
void calcSTD();
/*----------------------------------------------------------------------------+
| Purpose: Return the mean hours for the batch |
| |
| Parameters: none |
| Returns: double representing the mean hours |
| |
| Pre-conditions: none |
| Post-conditions: none |
+----------------------------------------------------------------------------*/
double getMean() { return itsMean; }
/*----------------------------------------------------------------------------+
| Purpose: Return the standard deviation for the batch |
| |
| Parameters: none |
| Returns: double representing the standard deviation |
| |
| Pre-conditions: none |
| Post-conditions: none |
+----------------------------------------------------------------------------*/
double getSTD() { return itsSTD; }
/*----------------------------------------------------------------------------+
| Purpose: Return the Begining/Ending iterator for the vector |
| |
| Parameters: none |
| Returns: an iterator for the container |
| |
| Pre-conditions: none |
| Post-conditions: none |
+----------------------------------------------------------------------------*/
vector<CProductionRun* >::iterator getBegin() { return itsPR.begin(); }
vector<CProductionRun* >::iterator getEnd() { return itsPR.end(); }
/*----------------------------------------------------------------------------+
| Purpose: Determine if any production runs fail the quality test |
| |
| Parameters: none |
| Returns: none |
| |
| Pre-conditions: none |
| Post-conditions: none |
+----------------------------------------------------------------------------*/
void analyzeBatch();
/*----------------------------------------------------------------------------+
| Purpose: Used by analyzeBatch to print production runs that fail |
| the quality test |
| |
| Parameters: A pointer to a valid CProductionRun object |
| Returns: none |
| |
| Pre-conditions: thePR is a valid CProductionRun object |
| Post-conditions: none |
+----------------------------------------------------------------------------*/
friend bool checkRun( CProductionRun* thePR );
};
#endif