Commit 4d9417d6 authored by AtonCode's avatar AtonCode
Browse files

Eureka

parent 4b165925
......@@ -2,17 +2,25 @@
#define CONTROLLER_H
#include "../Model/Message.h"
#include "../Model/Agent.h"
#include <string>
#include <list>
class Controller
{
private:
Message* message;
std::list<Agent> agents;
public:
Controller();
~Controller();
void printEncryptedMessage();
void printDecryptedMessage();
void sendMessage(Message message);
void makeAgent(std::string name, std::string public_Key, std::string password);
void loginAgentByPublicKey(std::string public_Key);
void update();
void errase_all();
};
......
#ifndef AGENT_H
#define AGENT_H
#include "Message.h"
#include <string>
#include <stack>
class Agent
{
private:
int id;
int number_of_messagesForRead;
std::string name;
std::string password;
std::string public_Key;
std::stack<Message> messagesForRead;
public:
Agent();
~Agent();
void setName(std::string name);
std::string getName();
void setPublicKey(std::string public_Key);
std::string getPublicKey();
void addMessage(Message message);
Message getMessage();
void setPassword(std::string password);
void decrypt();
};
#endif /* AGENT_H */
#ifndef MESSAGE_H
#define MESSAGE_H
#include <string>
class Message
{
private:
char* message;
char* public_Key;
int length;
std::string message;
std::string public_Key_Sender;
std::string public_Key_Receiver;
public:
Message();
~Message();
void setMessage(char* message);
void setPublicKey(char* public_Key);
void setMessage(std::string message);
std::string getMessage();
void setPublicKeySender(std::string public_Key);
std::string getPublicKeySender();
void setPublicKeyReceiver(std::string public_Key);
std::string getPublicKeyReceiver();
void encrypt();
void decrypt();
};
......
g++ main.cpp -o main && ./main && rm main;
\ No newline at end of file
clear;
g++ main.cpp -o main && ./main && rm main;
......@@ -5,6 +5,7 @@ using namespace std;
int main(){
cout<<"Hello World!"<<endl;
cout<<"---- CONFIDENTIAL ----"<<endl;
cout<<"----------------------"<<endl;
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment