Design Patterns
print_n_employees.h
Go to the documentation of this file.
1 // Based on "Design Patterns: Elements of Reusable Object-Oriented Software"
2 // book by Erich Gamma, John Vlissides, Ralph Johnson, and Richard Helm
3 //
4 // Created by Bartosz Rachwal. The National Institute of Advanced Industrial Science and Technology, Japan.
5 
6 #ifndef OPERATIONAL_ITERATOR_PRINT_N_EMPLOYEES_H_
7 #define OPERATIONAL_ITERATOR_PRINT_N_EMPLOYEES_H_
8 
9 #include "list_traverser.h"
10 #include "employee.h"
11 
12 namespace operational
13 {
14 namespace iterator
15 {
16 class PrintNEmployees : public ListTraverser<Employee*>
17 {
18  public:
19  PrintNEmployees(List<Employee*>* aList, int n);
20  ~PrintNEmployees() override;
21 
22  bool Traverse() override;
23 
24  protected:
25  bool ProcessItem(Employee* const&) override;
26 
27  private:
28  int total_;
29  int count_;
30 };
31 }
32 }
33 
34 #endif
35 
bool Traverse() override
Definition: print_n_employees.cc:15
Definition: application.cc:10
Definition: list.h:17
Definition: employee.h:15
~PrintNEmployees() override
Definition: print_n_employees.cc:13
Definition: list_traverser.h:17
Definition: print_n_employees.h:16
PrintNEmployees(List< Employee * > *aList, int n)
Definition: print_n_employees.cc:20
bool ProcessItem(Employee *const &) override
Definition: print_n_employees.cc:24