-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPetDatabaseSortable.h
More file actions
44 lines (33 loc) · 937 Bytes
/
PetDatabaseSortable.h
File metadata and controls
44 lines (33 loc) · 937 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
38
39
40
41
42
43
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: PetDatabaseSortable.h
* Author: Chris Frey
*
* Created on February 12, 2018, 8:19 PM
*/
#ifndef PETDATABASESORTABLE_H
#define PETDATABASESORTABLE_H
#include "PetDatabase.h"
#include "SortableVector.h"
class PetDatabaseSortable : public PetDatabase, public SortableVector{
public:
// Default Constructor
PetDatabaseSortable(){}
PetDatabaseSortable(std::vector<Pet*> pets)
: PetDatabase(pets){}
virtual ~PetDatabaseSortable(){}
virtual unsigned int getSize() const{
return m_pets.size();
}
// implement it
virtual void swap(int i, int j){
Pet* temp = m_pets[i];
m_pets[i]=m_pets[j];
m_pets[j]=temp;
}
};
#endif /* PETDATABASESORTABLE_H */