Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include "Animal.h"
- #include "Compare.h"
- Compare::Compare()
- {
- }
- bool Compare::sortByName(Animal * first, Animal * second)
- {
- return (first->getName() < second->getName());
- }
- bool Compare::sortByID(Animal * first, Animal * second)
- {
- return (first->getID() < second->getID());
- }
- bool Compare::search(Animal * first, Animal * second)
- {
- return (first->getID() == second->getID());
- }
- Compare::cmpByID::cmpByID(const int ID)
- :ID(ID)
- {
- }
- bool Compare::cmpByID::operator()(const Animal * first) const
- {
- return (first->getID() == ID);
- }
- Compare::cmpByName::cmpByName(std::string const & name)
- : Name(name)
- {
- }
- bool Compare::cmpByName::operator()(const Animal * first) const
- {
- return (first->getName() == Name);
- }
- Compare::~Compare()
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment