Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MAIN.CPP
- #include <iostream>
- #include <string>
- // Классы для работы с аккаунтами пользователей и электронными кошельками
- #include "modules/money/money.h"
- #include "modules/account/account.h"
- // ORM - система ( в данном случае 1 класс ) для работы с "БД"
- #include "modules/orm/orm.h"
- using namespace std;
- int main()
- {
- return 0;
- }
- ACCOUNT.H
- #pragma once
- #include <string>
- #include "password.h"
- #include "../money/money.h"
- // Возможные уровни привелигерованности
- enum available_privileges { ordinary=0, defendent, admin };
- // Класс стандартного пользователя
- class Account
- {
- protected:
- char* FIO;
- long INN;
- available_privileges privileges;
- WalletList wallet;
- public:
- Account (string newFIO, long newINN);
- virtual ~Account();
- bool CreateWallet( char Currency[4] );
- void DeleteWallet( char Currency[4] );
- bool AddMoney( long Summ, Money Wallet );
- bool SendMoney( long INN, char Currency[4], long Summ );
- };
- // Класс стандартного пользователя, чьи данные защищены паролем
- class AccountSecure : public Account {
- protected:
- SecurePassword password;
- };
- // Класс контейнер аккаунтов
- template<typename type>
- class AccountList {
- private:
- struct AccountData {
- type data;
- AccountData* next;
- };
- AccountData *head, *tail;
- public:
- AccountList();
- ~AccountList();
- void AddAccount(type account); // Добавление аккаунта
- void DeleteAccount(type account); // Удаление аккаунта
- };
- // Класс администора
- class AccountAdmin : protected AccountSecure {
- private:
- // Списки обычных и защищенных пароле аккаунтов
- AccountList<Account> ListAccount;
- AccountList<AccountSecure> ListSecureAccount;
- public:
- AccountAdmin();
- ~AccountAdmin();
- };
- ACCOUNT.CPP
- #include "account.h"
- using namespace std;
- Account::Account(string newFIO, long newINN) {
- this->privileges = ordinary;
- this->INN = newINN;
- this->FIO = new char[newFIO.length + 1];
- strcpy( this->FIO, newFIO.c_str());
- }
- Account::~Account() {
- this->wallet.~WalletList();
- delete[] this->FIO;
- }
- MONEY.H
- #pragma once
- class Money
- {
- private:
- char Currency[4];
- long Summ;
- public:
- Money(char Currency[4]);
- ~Money();
- char* GetCurrency(); // Получить наименование валюты
- long GetSum(); // Получить кол-во средств на счету
- void operator+ (long Summ); // Положить на счет
- bool operator- (long Summ); // Снять со счета
- };
- class WalletList
- {
- private:
- struct WalletData
- {
- Money data;
- WalletData *next;
- };
- WalletData *head, *tail;
- public:
- WalletList();
- ~WalletList();
- void AddMoney( Money &money );
- void DeleteMoney( Money &money);
- };
- ОШИБКИ:
- dmitry@dmitry-Lenovo-ideapad-100-15IBY:~/Рабочий стол/Курсовая работа$ make -f MAKE.txt
- g++ -c modules/account/account.cpp -o bin/account.o
- In file included from modules/account/account.cpp:1:0:
- modules/account/account.h:22:19: error: expected ‘)’ before ‘newFIO’
- Account (string newFIO, long newINN);
- ^~~~~~
- modules/account/account.cpp:5:1: error: prototype for ‘Account::Account(std::__cxx11::string, long int)’ does not match any in class ‘Account’
- Account::Account(string newFIO, long newINN) {
- ^~~~~~~
- In file included from modules/account/account.cpp:1:0:
- modules/account/account.h:12:7: error: candidates are: constexpr Account::Account(const Account&)
- class Account
- ^~~~~~~
- modules/account/account.h:12:7: error: Account::Account()
- MAKE.txt:10: recipe for target 'bin/account.o' failed
- make: *** [bin/account.o] Error 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement