调整项目结构

main
lensfrex 3 years ago
parent dd3cd0db58
commit 39e83887ca
Signed by: lensfrex
GPG Key ID: 0F69A0A2FBEE98A0
  1. 4
      work20220325/.idea/encodings.xml
  2. 2
      work20220325/CMakeLists.txt
  3. 4
      work20220325/main.cpp
  4. 2
      work20220325/person/TeachAssistant.cpp
  5. 9
      work20220325/person/TeachAssistant.h
  6. 0
      work20220325/person/base/Person.cpp
  7. 2
      work20220325/person/base/Person.h
  8. 2
      work20220325/person/students/Student.h
  9. 2
      work20220325/person/teachers/Teacher.h

@ -3,9 +3,9 @@
<component name="Encoding" defaultCharsetForPropertiesFiles="GBK"> <component name="Encoding" defaultCharsetForPropertiesFiles="GBK">
<file url="file://$PROJECT_DIR$/main.cpp" charset="GBK" /> <file url="file://$PROJECT_DIR$/main.cpp" charset="GBK" />
<file url="file://$PROJECT_DIR$/person" charset="GBK" /> <file url="file://$PROJECT_DIR$/person" charset="GBK" />
<file url="file://$PROJECT_DIR$/person/Person.cpp" charset="GBK" /> <file url="file://$PROJECT_DIR$/person/TeachAssistant.h" charset="GBK" />
<file url="file://$PROJECT_DIR$/person/base/Person.cpp" charset="GBK" />
<file url="file://$PROJECT_DIR$/person/students/Graduate.cpp" charset="GBK" /> <file url="file://$PROJECT_DIR$/person/students/Graduate.cpp" charset="GBK" />
<file url="file://$PROJECT_DIR$/person/students/TeachAssistant.h" charset="GBK" />
<file url="PROJECT" charset="GBK" /> <file url="PROJECT" charset="GBK" />
</component> </component>
</project> </project>

@ -7,4 +7,4 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_compile_options(-finput-charset=GBK -fexec-charset=GBK) add_compile_options(-finput-charset=GBK -fexec-charset=GBK)
endif () 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)

@ -1,7 +1,7 @@
#include <iostream> #include <iostream>
#include "person/Person.h" #include "person/base/Person.h"
#include "person/students/Graduate.h" #include "person/students/Graduate.h"
#include "person/students/TeachAssistant.h" #include "person/TeachAssistant.h"
int main() { int main() {
/* /*

@ -13,3 +13,5 @@ std::string TeachAssistant::toString() {
<< Teacher::toString(); << Teacher::toString();
return output.str(); return output.str();
} }
TeachAssistant::TeachAssistant(const TeachAssistant &teachAssistant) : Graduate(teachAssistant), Teacher(teachAssistant), Person(teachAssistant) {}

@ -1,11 +1,11 @@
#ifndef WORK20220325_TEACHASSISTANT_H #ifndef WORK20220325_TEACHASSISTANT_H
#define WORK20220325_TEACHASSISTANT_H #define WORK20220325_TEACHASSISTANT_H
#include "Student.h" #include "students/Student.h"
#include "../teachers/Teacher.h" #include "teachers/Teacher.h"
#include "Graduate.h" #include "students/Graduate.h"
class TeachAssistant : public Graduate , Teacher { class TeachAssistant : public Graduate, Teacher {
public: public:
TeachAssistant(int classId, const Person &person, const std::string &subject, const Teacher &adviser, TeachAssistant(int classId, const Person &person, const std::string &subject, const Teacher &adviser,
const std::string &job, const std::string &department); const std::string &job, const std::string &department);
@ -14,6 +14,7 @@ public:
std::string toString(); std::string toString();
TeachAssistant(const TeachAssistant &teachAssistant);
}; };

@ -2,7 +2,7 @@
#define WORK20220325_PERSON_H #define WORK20220325_PERSON_H
#include <string> #include <string>
#include "../date/Date.h" #include "../../date/Date.h"
class Person { class Person {
protected: protected:

@ -2,7 +2,7 @@
#define WORK20220325_STUDENT_H #define WORK20220325_STUDENT_H
#include "../Person.h" #include "../base/Person.h"
class Student : virtual public Person { class Student : virtual public Person {
protected: protected:

@ -2,7 +2,7 @@
#define WORK20220325_TEACHER_H #define WORK20220325_TEACHER_H
#include "../Person.h" #include "../base/Person.h"
class Teacher : virtual Person { class Teacher : virtual Person {
protected: protected:

Loading…
Cancel
Save