Skip to content

Functions tables

emmateva18 edited this page Mar 15, 2021 · 10 revisions

Contents:

  1. Logic.h
  2. AdvancedFileOperations.h
  3. BasicFileOperations.h
  4. ServerConnection.h
  1. Presentation.h
  2. ClientConnection.h
  3. Menu.h
  1. CommunicationLibrary.h

Server:

1. Logic.h

Name of function and its type Arguments Short description Returned value
void init vector& schools Initializing data in the vector schools of type SCHOOL Returns nothing
void createStudent SCHOOL& school, STUDENT student Creates student in school Returns nothing
void createTeacher SCHOOL& school, TEACHER teacher Creates teacher in school Returns nothing
void createTeam SCHOOL& school, TEAM team Creates team in school Returns nothing
void createSchool vector& schools, SCHOOL school Creates school Returns nothing
void createTeamIdInTeacher TEACHER& teacher, int teamId Creates teamId in teacher Returns nothing
void deleteStudent SCHOOL& school, int studentId Deletes student from school by studentId Returns nothing
void deleteTeacher SCHOOL& school, int teacherId Deletes teacher from school by teacherId Returns nothing
void deleteRoles SCHOOL& school, int teamId Deletes role from school by teamId Returns nothing
void deleteSchool vector& schools, int schoolId Deletes school by schoolId Returns nothing
void deleteTeam SCHOOL& school, int teamId Deletes team from school by teamId Returns nothing
void deleteTeamIdInTeacher TEACHER& teacher, int teamIdIndex Deletes teamId from teacher by teamIdIndex Returns nothing
void updateStudentFirstName STUDENT& student, string newFirstName Updates students' first name Returns nothing
void updateStudentMiddleName STUDENT& student, string newMiddleName Updates students' middle name Returns nothing
void updateStudentSurname STUDENT& student, string newSurname Updates students' surname Returns nothing
void updateStudentGrade STUDENT& student, string newGrade Updates students' grade Returns nothing
void updateStudentEmail STUDENT& student, string newEmail Updates students' email Returns nothing
void updateTeacherFirstName TEACHER& teacher, string newFirstName Updates teachers' first name Returns nothing
void updateTeacherMiddleName TEACHER& teacher, string newMiddleName Updates teachers' middle name Returns nothing
void updateTeacherSurname TEACHER& teacher, string newSurname Updates teachers' surname Returns nothing
void updateTeacherEmail TEACHER& teacher, string newEmail Updates teachers' email Returns nothing
void updateTeamIdInTeacher TEACHER& teacher, int teamIdIndex, int newId Updates teachers' teamId Returns nothing
void updateTeamName TEAM& team, string newName Updates teams' name Returns nothing
void updateTeamDesc TEAM& team, string newDesc Updates teams' description Returns nothing
void updateTeamDayOfSetUp TEAM& team, int newDay Updates teams' day of set up Returns nothing
void updateTeamMonthOfSetUp TEAM& team, int newMonth Updates teams' month of set up Returns nothing
void updateTeamYearOfSetUp TEAM& team, int newYear Updates teams' year of set up Returns nothing
void updateTeamStatus TEAM& team, STATUS newStatus Updates teams' status Returns nothing
void updateSchoolName SCHOOL& school, string newName Updates schools' name Returns nothing
void updateSchoolCity SCHOOL& school, string newCity Updates schools' city Returns nothing
void updateSchoolAdress SCHOOL& school, string newAddress Updates schools' address Returns nothing

2. AdvancedFileOperations.h

Name of function and its type Arguments Short description Returned value
void readRecord std::fstream& file, STUDENT& student Reads record for student in the file Returns nothing
void readRecord std::fstream& file, TEACHER& teacher Reads record for teacher in the file Returns nothing
void readRecord std::fstream& file, DATE& date Reads record for date in the file Returns nothing
void readRecord std::fstream& file, TEAM_MEMBER& member Reads record for team member in the file Returns nothing
void readRecord std::fstream& file, TEAM& member Reads record for member in the file Returns nothing
void readRecord std::fstream& file, SCHOOL& school Reads record for school in the file Returns nothing
void readDataBase std::vector& schools Reads record of school from file Returns nothing
void saveDataBase std::vector& schools Saves record of school from file Returns nothing
void save std::fstream& file, ROLE role Saves records for role in file Returns nothing
void save std::fstream& file, STUDENT student Saves records for role in file Returns nothing
void save std::fstream& file, TEACHER teacher Saves records for teacher in file Returns nothing
void save std::fstream& file, DATE date Saves records for date in file Returns nothing
void save std::fstream& file, TEAM_MEMBER member Saves records for team member in file Returns nothing
void save std::fstream& file, TEAM team Saves records for team in file Returns nothing
void save std::fstream& file, SCHOOL school Saves records for school in file Returns nothing

3. BasicFileOperations.h

Name of function and its type Arguments Short description Returned value
void saveStr std::fstream& file, std::string str Saves variable of type string in file Returns nothing
void saveBool std::fstream& file, bool a Saves variable of type bool in file Returns nothing
void saveInt std::fstream& file, int integer Saves variable of type int in file Returns nothing
void saveShortInt std::fstream& file, uint16_t num Saves variable of type short int in file Returns nothing
void saveVec std::fstream& file, std::vector vec Saves vector of type int in file Returns nothing
void saveVec std::fstream& file, std::vectorstd::string vec Saves vector of type string in file Returns nothing
void readStr std::fstream& file, std::string& str Read variable of type string from file Returns nothing
void readInt std::fstream& file, int& num Read variable of type int from file Returns nothing
void readShortInt std::fstream& file, uint16_t& num Read variable of type short int from file Returns nothing
void readBool std::fstream& file, bool& a Read variable of type bool from file Returns nothing
void readVec std::fstream& file, std::vectorstd::string& vec Read vector of type string from file Returns nothing
void readVec std::fstream& file, std::vector& vec Read vector of type int from file Returns nothing

4. ServerConnection.h

Name of function and its type Arguments Short description Returned value
string getCurrentHour - Returns the time that a function was called in string format Returns the time that a function was called in string format
string codeToString SYSTEM_CODE code Converts the system code to a string Returns the system code as a string
void logRecord asio::ip::tcp::socket& socket, SYSTEM_CODE code Documents the proccess in the "logs.txt" file Returns nothing
void processRequest asio::ip::tcp::socket& socket, std::vector<SCHOOL>& schools Processing the users' input Returns nothing
void startServer std::vector<SCHOOL> schools Starts the server Returns nothing

Client:

1. Presentation.h

Name of function and its type Arguments Short description Returned value
string statusToString STATUS status Converts picked status to a string Returns the status as a string
string nameToString string fName, string mName, string surname Converts name to a string Returns the status as a string
string vectorIntToString vector vec Converts a vector of int to a string Returns the vector of int as a string
vector assignStudentInTeamMenu SCHOOL& school Assigns a student in team based on their ids Returns the students' and teams' ids
void listSchoolsDetails vector schools Displays all schools' id and name Returns nothing
void listSchoolDetails SCHOOL school Displays one schools' id and name Returns nothing
void clearInputStream - Checks if there is data in the stream and if there is- it removes it Returns nothing
STUDENT enterStudent - A function for entering the students' data: names, grade and email Returns the students' data
TEACHER enterTeacher - A function for entering the teachers' data: names, grade and email Returns the teachers' data
TEAM enterTeam int maxPlayerPerTeam A function for entering the teams' data: name and description Returns the teams' data
ROLE enterRole - A function for entering the roles' data: name Returns the roles' data
bool isStringInputValid string input Checks if an element of the string is not a letter and if the string does not begin with space Returns true if the string is valid and false if it is not
void enterString string& str, string text A function for inputting a string that calls the "isStringInputValid" to check is the inputed string is valid or not Returns nothing
int tryReadInt - Checks if the entered data is from type int If the entered data if of type int- it returns it, if it is not- it throws an exception
void enterInt int& variable, string text A function for inputting a variable if type int that calls the "tryReadInt" to check is the inputed int is valid or not Returns nothing
void enterEmail string& email, string text A function for inputting an email that checks if it is valid or not Returns nothing
void enterGrade string& grade, string text A function for inputting the students' grade that checks if it is valid or not Returns nothing
void enterBool bool& boolean, string text A function for inputting a variable of type bool that checks if it is valid or not Returns nothing
void enterVectorOfIntegers vector& vec A function for inputting a vector of type int Returns nothing

2. ClientConnection.h

Name of function and its type Arguments Short description Returned value
void sendRequest SYSTEM_CODE code, T data, int schoolId Sends request to the server besed on the system code Returns nothing
void tableRequest asio::ip::tcp::socket& socket, SYSTEM_CODE code, SCHOOL& school, int id Requests all the information for a specific table Returns nothing
void readRequest SYSTEM_CODE code, ROLE& role Requests data for the role and reads it Returns nothing
void readRequest SYSTEM_CODE code, STUDENT& student Requests data for the student and reads it Returns nothing
void readRequest SYSTEM_CODE code, TEACHER& teacher Requests data for the teacher and reads it Returns nothing
void readRequest SYSTEM_CODE code, DATE& date Requests data for the date and reads it Returns nothing
void readRequest SYSTEM_CODE code, TEAM_MEMBER& member Requests data for the team members and reads it Returns nothing
void readRequest SYSTEM_CODE code, TEAM& team Requests data for the team and reads it Returns nothing
void readRequest SYSTEM_CODE code, SCHOOL& school, int id Requests data for the school and reads it Returns nothing
void readRequest SYSTEM_CODE code, std::vector& schools Requests data for all schools and reads it Returns nothing
void exitProgram - Exits the program Returns nothing
void requestCrtSch - Sends request to the server to create a school Returns nothing
void requestReadDB - Sends request to the server to read the database Returns nothing
void getSchoolId - Sends request to the server to get the schools's id Returns nothing
int readSchoolId - Sends request to the server to read the schools's id Returns string as int
void requestCrtTeacher - Sends request to the server to create a techer Returns nothing
void requestCrtStudent - Sends request to the server to create a student Returns nothing
void requestCrtRole - Sends request to the server to create a role Returns nothing
void requestDeleteSchool - Sends request to the server to delete a school Returns nothing
void requestDeleteTeam - Sends request to the server to delete a team Returns nothing
void requestDeleteRole - Sends request to the server to delete a role Returns nothing
void requestDeleteStudent - Sends request to the server to delete a student Returns nothing
void requestDeleteTeacher - Sends request to the server to delete a teacher Returns nothing
void requestInputMaxNumOfMem - Sends request to the server to input the maximum number of members in a team Returns nothing
void requestUpdateSchoolName - Sends request to the server to update the schools's name Returns nothing
void requestUpdateSchoolAddress - Sends request to the server to update the schools's address Returns nothing
void requestUpdateSchoolCity - Sends request to the server to update the schools's city Returns nothing
void requestUpdateTeacherFirstName - Sends request to the server to update the teachers' first name Returns nothing
void requestUpdateTeacherMiddleName - Sends request to the server to update the teachers' middle name Returns nothing
void requestUpdateTeacherSurname - Sends request to the server to update the teachers' surname Returns nothing
void requestUpdateTeacherEmail - Sends request to the server to update the teachers' email Returns nothing
void requestUpdateTeacherTeams - Sends request to the server to update the teachers' teams Returns nothing
void requestUpdateTeamName - Sends request to the server to update teams' name Returns nothing
void requestUpdateTeamDescription - Sends request to the server to update teams' description Returns nothing
void requestUpdateTeamStatus - Sends request to the server to update teams' status Returns nothing
void requestUpateTeamMembers - Sends request to the server to update teams' members Returns nothing
void requestUpdateStudentEmail - Sends request to the server to update students' email Returns nothing
void requestUpdateStudentFirstName - Sends request to the server to update students' first name Returns nothing
void requestUpdateStudentMiddleName - Sends request to the server to update students' middle name Returns nothing
void requestUpdateStudentSurname - Sends request to the server to update students' surname Returns nothing
void requestUpdateStudentClass - Sends request to the server to update students' grade Returns nothing
void requestUpdateStudentIsInTeam - Sends request to the server to update if student is in team Returns nothing

3. Menu.h

Name of function and its type Arguments Short description Returned value
void resetPositions vector <MENU> & menus Resets the positions in the menu Returns nothing
bool validate int selection, MENU menu Checks if the user input is correct Returns true id it is, false- if it is not
void getUserInput vector <MENU> menus Function for navigating through thr menu items Returns nothing
vector <MENU> initMenus - Function for initializing the menus Returns the menus

CommunicationLibrary:

1. CommunicationLibrary.h

Name of function and its type Arguments Short description Returned value
void writeShortInt asio::ip::tcp::socket& socket, uint16_t num Sends a variable of type short int to the server Returns nothing
void writeStr asio::ip::tcp::socket& socket, string str Sends a variable of type string to the server Returns nothing
void writeInt asio::ip::tcp::socket& socket, int integer Sends a variable of type int to the server Returns nothing
void writeBool asio::ip::tcp::socket& socket, bool a Sends a variable of type bool to the server Returns nothing
void writeVec asio::ip::tcp::socket& socket, vector<int> vec Sends a vector of type int to the server Returns nothing
void writeVec asio::ip::tcp::socket& socket, vector<string> vec Sends a vector of type string to the server Returns nothing
void readStr asio::ip::tcp::socket& socket, string& str Reads a variable of type string from the server Returns nothing
void readInt asio::ip::tcp::socket& socket, int& num Reads a variable of type int from the server Returns nothing
void readShortInt asio::ip::tcp::socket& socket, uint16_t& num Reads a variable of type short int from the server Returns nothing
void readBool asio::ip::tcp::socket& socket, bool& a Reads a variable of type bool from the server Returns nothing
void readVec asio::ip::tcp::socket& socket, vector<string>& vec Reads a vector of type string from the server Returns nothing
void readVec asio::ip::tcp::socket& socket, vector<int>& vec Reads a vector of type int from the server Returns nothing