-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConnectedComponent.cpp
41 lines (30 loc) · 1.11 KB
/
ConnectedComponent.cpp
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
#include "ConnectedComponent.h"
#include <iostream>
//default constructor
PKNNIV001::ConnectedComponent::ConnectedComponent(int no, int ID, std::vector<std::pair<int,int>> pix):
nopix{no}, id{ID}, pixels{pix}{}
PKNNIV001::ConnectedComponent::ConnectedComponent(int ID):
nopix{0}, id{ID}{}
//copy constructor
PKNNIV001::ConnectedComponent::ConnectedComponent(const ConnectedComponent &rhs):
ConnectedComponent{rhs.nopix,rhs.nopix,rhs.pixels}{}
//move constructor
PKNNIV001::ConnectedComponent::ConnectedComponent(ConnectedComponent &&rhs):
nopix{rhs.nopix}, id{rhs.id}, pixels{rhs.pixels}{}
//copy assignment operator overloading
PKNNIV001::ConnectedComponent &PKNNIV001::ConnectedComponent::operator=(const ConnectedComponent &rhs){
nopix = rhs.nopix;
id = rhs.id;
pixels = rhs.pixels;
return *this;
}
//move assignment operator overloading
PKNNIV001::ConnectedComponent &PKNNIV001::ConnectedComponent::operator=(ConnectedComponent &&rhs){
nopix = rhs.nopix;
id = rhs.id;
pixels = rhs.pixels;
return *this;
}
//destructor
PKNNIV001::ConnectedComponent::~ConnectedComponent(){
}