From 39e83887ca16f45a6cd051ac4ddea510226073f6 Mon Sep 17 00:00:00 2001 From: lensferno Date: Sat, 26 Mar 2022 16:55:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=A1=B9=E7=9B=AE=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- work20220325/.idea/encodings.xml | 4 ++-- work20220325/CMakeLists.txt | 2 +- work20220325/main.cpp | 4 ++-- work20220325/person/{students => }/TeachAssistant.cpp | 4 +++- work20220325/person/{students => }/TeachAssistant.h | 9 +++++---- work20220325/person/{ => base}/Person.cpp | 0 work20220325/person/{ => base}/Person.h | 2 +- work20220325/person/students/Student.h | 2 +- work20220325/person/teachers/Teacher.h | 2 +- 9 files changed, 16 insertions(+), 13 deletions(-) rename work20220325/person/{students => }/TeachAssistant.cpp (78%) rename work20220325/person/{students => }/TeachAssistant.h (62%) rename work20220325/person/{ => base}/Person.cpp (100%) rename work20220325/person/{ => base}/Person.h (90%) diff --git a/work20220325/.idea/encodings.xml b/work20220325/.idea/encodings.xml index 214ac02..141c5fa 100644 --- a/work20220325/.idea/encodings.xml +++ b/work20220325/.idea/encodings.xml @@ -3,9 +3,9 @@ - + + - \ No newline at end of file diff --git a/work20220325/CMakeLists.txt b/work20220325/CMakeLists.txt index fa2df94..56050a9 100644 --- a/work20220325/CMakeLists.txt +++ b/work20220325/CMakeLists.txt @@ -7,4 +7,4 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") add_compile_options(-finput-charset=GBK -fexec-charset=GBK) endif () -add_executable(work20220325 main.cpp person/Person.cpp person/Person.h date/Date.cpp date/Date.h person/students/Student.cpp person/students/Student.h person/teachers/Teacher.cpp person/teachers/Teacher.h person/students/Graduate.cpp person/students/Graduate.h date/Date.cpp date/Date.h person/students/Student.cpp person/students/Student.h person/teachers/Teacher.cpp person/teachers/Teacher.h person/students/Graduate.cpp person/students/Graduate.h person/students/TeachAssistant.cpp person/students/TeachAssistant.h) +add_executable(work20220325 main.cpp person/base/Person.cpp person/base/Person.h date/Date.cpp date/Date.h person/students/Student.cpp person/students/Student.h person/teachers/Teacher.cpp person/teachers/Teacher.h person/students/Graduate.cpp person/students/Graduate.h date/Date.cpp date/Date.h person/students/Student.cpp person/students/Student.h person/teachers/Teacher.cpp person/teachers/Teacher.h person/students/Graduate.cpp person/students/Graduate.h person/TeachAssistant.cpp person/TeachAssistant.h) diff --git a/work20220325/main.cpp b/work20220325/main.cpp index 4ac5782..c5fbf93 100644 --- a/work20220325/main.cpp +++ b/work20220325/main.cpp @@ -1,7 +1,7 @@ #include -#include "person/Person.h" +#include "person/base/Person.h" #include "person/students/Graduate.h" -#include "person/students/TeachAssistant.h" +#include "person/TeachAssistant.h" int main() { /* diff --git a/work20220325/person/students/TeachAssistant.cpp b/work20220325/person/TeachAssistant.cpp similarity index 78% rename from work20220325/person/students/TeachAssistant.cpp rename to work20220325/person/TeachAssistant.cpp index 7174e4a..70938cd 100644 --- a/work20220325/person/students/TeachAssistant.cpp +++ b/work20220325/person/TeachAssistant.cpp @@ -12,4 +12,6 @@ std::string TeachAssistant::toString() { << "[教师身份信息]" << '\n' << Teacher::toString(); return output.str(); -} \ No newline at end of file +} + +TeachAssistant::TeachAssistant(const TeachAssistant &teachAssistant) : Graduate(teachAssistant), Teacher(teachAssistant), Person(teachAssistant) {} \ No newline at end of file diff --git a/work20220325/person/students/TeachAssistant.h b/work20220325/person/TeachAssistant.h similarity index 62% rename from work20220325/person/students/TeachAssistant.h rename to work20220325/person/TeachAssistant.h index a05607c..bf37ff4 100644 --- a/work20220325/person/students/TeachAssistant.h +++ b/work20220325/person/TeachAssistant.h @@ -1,11 +1,11 @@ #ifndef WORK20220325_TEACHASSISTANT_H #define WORK20220325_TEACHASSISTANT_H -#include "Student.h" -#include "../teachers/Teacher.h" -#include "Graduate.h" +#include "students/Student.h" +#include "teachers/Teacher.h" +#include "students/Graduate.h" -class TeachAssistant : public Graduate , Teacher { +class TeachAssistant : public Graduate, Teacher { public: TeachAssistant(int classId, const Person &person, const std::string &subject, const Teacher &adviser, const std::string &job, const std::string &department); @@ -14,6 +14,7 @@ public: std::string toString(); + TeachAssistant(const TeachAssistant &teachAssistant); }; diff --git a/work20220325/person/Person.cpp b/work20220325/person/base/Person.cpp similarity index 100% rename from work20220325/person/Person.cpp rename to work20220325/person/base/Person.cpp diff --git a/work20220325/person/Person.h b/work20220325/person/base/Person.h similarity index 90% rename from work20220325/person/Person.h rename to work20220325/person/base/Person.h index b1a77f8..d4874f4 100644 --- a/work20220325/person/Person.h +++ b/work20220325/person/base/Person.h @@ -2,7 +2,7 @@ #define WORK20220325_PERSON_H #include -#include "../date/Date.h" +#include "../../date/Date.h" class Person { protected: diff --git a/work20220325/person/students/Student.h b/work20220325/person/students/Student.h index 2863825..5d339ce 100644 --- a/work20220325/person/students/Student.h +++ b/work20220325/person/students/Student.h @@ -2,7 +2,7 @@ #define WORK20220325_STUDENT_H -#include "../Person.h" +#include "../base/Person.h" class Student : virtual public Person { protected: diff --git a/work20220325/person/teachers/Teacher.h b/work20220325/person/teachers/Teacher.h index 783a620..3d61c98 100644 --- a/work20220325/person/teachers/Teacher.h +++ b/work20220325/person/teachers/Teacher.h @@ -2,7 +2,7 @@ #define WORK20220325_TEACHER_H -#include "../Person.h" +#include "../base/Person.h" class Teacher : virtual Person { protected: