diff options
feat(Week07): Add solutions
1 files changed, 40 insertions, 0 deletions
| -rw-r--r-- | Week07/Exercise01/LibraryBanking.h | 40 |
diff --git a/Week07/Exercise01/LibraryBanking.h b/Week07/Exercise01/LibraryBanking.h new file mode 100644 index 0000000..08e9d9d --- /dev/null +++ b/Week07/Exercise01/LibraryBanking.h @@ -0,0 +1,40 @@ +#ifndef _LIBRARY_BANKING +#define _LIBRARY_BANKING + +#include "BankClerk.h" +#include "Transaction.h" + +class LibraryBanking { + BankClerk* clerks; + unsigned clerksCount; + unsigned clerksAlloc; + + Transaction* transactions; + unsigned transactionsCount; + unsigned transactionsAlloc; + + void free(); + void copyFrom(const LibraryBanking& other); + + void resizeClerks(); + void resizeTransactions(); + +public: + LibraryBanking(); + ~LibraryBanking(); + LibraryBanking(const LibraryBanking& other); + LibraryBanking& operator=(const LibraryBanking& other); + LibraryBanking(LibraryBanking&& other); + LibraryBanking& operator=(LibraryBanking&& other); + + void RegisterClerk(const BankClerk& clerk); + BankClerk* LoginClerk(unsigned clerkNumber, unsigned dynamicPassword, const String& staticPassword); + + void ListPendingTransactions(); + Transaction* GetTransaction(unsigned index); + const Transaction* RegisterTransaction(const Transaction& transaction); + + void ExportNonPendingTransactions(const String& fileName); +}; + +#endif /* _LIBRARY_BANKING */ |
