-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBaseClass.h
More file actions
37 lines (32 loc) · 971 Bytes
/
Copy pathBaseClass.h
File metadata and controls
37 lines (32 loc) · 971 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
28
29
30
31
32
33
34
35
36
37
//
// BaseClass.h
// Scratch_Plate
//
// Created by Joe Ferrucci on 4/28/13.
// Copyright (c) 2013 Joseph Ferrucci. All rights reserved.
//
#ifndef __Scratch_Plate__BaseClass__
#define __Scratch_Plate__BaseClass__
#include <iomanip>
#include <iostream>
class BaseClass
{
public:
BaseClass() : mbIsOn(false) {
std::cout << "Base Constructor called - CElectronicDevice" << std::endl;
incCount();
std::cout << std::setw(70) << "(Con) Object # " << getCount() << std::endl;
}
void incCount () { BaseClass::count++; }
void decCount () { BaseClass::count--; }
int getCount () { return BaseClass::count; }
~BaseClass() {
std::cout << "Base Destructor called - CElectronicDevice" << std::endl;
decCount();
std::cout << std::setw(70) << "(Des) Object # " << getCount() << std::endl;
}
private:
bool mbIsOn;
static int count;
};
#endif /* defined(__Scratch_Plate__BaseClass__) */