diff --git a/.gitignore b/.gitignore index a7ac0f8..eaac8ba 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,11 @@ +# 项目的构建文件夹 build/ + +# VSCode的配置文件夹 .vscode/ -.idea/ \ No newline at end of file + +# CLion的配置文件夹 +.idea/ + +# draw.io的缓存文件 +*.bkp \ No newline at end of file diff --git a/docs/概要设计书/auto_pilot_bus.drawio b/docs/概要设计书/auto_pilot_bus.drawio new file mode 100644 index 0000000..20f548a --- /dev/null +++ b/docs/概要设计书/auto_pilot_bus.drawio @@ -0,0 +1 @@ +7VhNc5swEP01HJsBhGl8bGy3PbQznTozbU8d1WxAGYGIELHpr68UVgbZ8UfGTsK0PVn7tJKW95ZnDR6Z5KsPkpbZZ5EA90I/WXlk6oVh4JNL/WOQpkXiKGiBVLKkhfwOmLPfYFciWrMEKsRaSAnBFStdcCGKAhbKwaiUYumm3QieOEBJU3DKMMB8QTlspX1jicoQjf1e+kdgaYZHj+1ETm0yAlVGE7HsQWTmkYkUQrWjfDUBbshzeXm/Y3ZdmIRCHbPg+maS1mnz9Srnd9nsdppW8vpNjLWpxj4wJPr5MRRSZSIVBeWzDr2Soi4SMLv6OupyPglRajDQ4C0o1aCYtFZCQ5nKOc7qgmXz3ay/GNnwB273EExXTtRg1NZqCtxJAUKVqOUC9jy3bSUqU1B78sK1ULrDQeSg69HrJHCq2L1bB8VWS9d5uPSdlLTpJZSCFarq7fzFADoB3xoSj9sd8Z0JI0dZPWh3tFGvtA56UP8JnXD5vxP2dgI5sRN66j1dHNz3nvIaT/LCmCtDphmlZpRTVlwsLK6P6aa2pO2EMyosM6ZgXtIHnpbax12R8GyQClb76d6mBxdE0UZHW3tf9jzVGmXWs9PYfy5Gw3+038/iaFuWFbx1BY7CDeHa9wtXbWh3BvcKxq8h57llOcKGAv9E/U56a9Z3mb+e5h1+9kI077Z7Yj1dX3iVFJyDdE2fDMb0SeB6AgkfMX3/EdMfPZfpkyN4/VVXP5kYKqexPzROx0dweleDbIZKaRDs+Ot6NUrt5ehQnw6VURJGBxkdvyihe+7Pa9okZXyojI78wz16JkZ12H2TaK9n3ZcdMvsD \ No newline at end of file diff --git a/docs/概要设计书/模块结构图.png b/docs/概要设计书/模块结构图.png new file mode 100644 index 0000000..53c6405 Binary files /dev/null and b/docs/概要设计书/模块结构图.png differ diff --git a/include/bus_io.h b/include/bus_io.h index 8bac72d..a140e72 100644 --- a/include/bus_io.h +++ b/include/bus_io.h @@ -35,18 +35,15 @@ rail_node_t* ReadConfigFile(); /** * 读取标准输入流中的输入 - * @param up_queries 上车的请求队列 - * @param down_queries 下车的请求队列 + * @param inputString 输入的字符串 * @return 当前读取的状态 */ -read_state_t ReadInput(up_bus_t* up_queries, down_bus_t* down_queries); +read_state_t ReadInput(char* inputString); /** * 打印当前的状态 - * @param up_queries 上车的请求队列 - * @param down_queries 下车的请求队列 * @param rails 轨道链表 */ -void PrintState(up_bus_t* up_queries, down_bus_t* down_queries, rail_node_t* rails); +void PrintState(); #endif //AUTO_PILOT_BUS_BUS_IO_H diff --git a/include/query.h b/include/query.h index bc1c6da..68c1c91 100644 --- a/include/query.h +++ b/include/query.h @@ -43,7 +43,14 @@ typedef struct up_bus up_bus_t; */ typedef struct down_bus down_bus_t; +/** + * 全局的上车请求链表头节点地址,也就是当前未处理的首个请求 + */ extern up_bus_t *up_queries; + +/** + * 全局的下车请求链表头节点地址,也就是当前未处理的首个请求 + */ extern down_bus_t *down_queries; /** diff --git a/include/rail.h b/include/rail.h index 02f237d..8f98f75 100644 --- a/include/rail.h +++ b/include/rail.h @@ -29,6 +29,9 @@ struct { */ typedef struct rail_node rail_node_t; +/** + * 全局的轨道链表头节点,也就是第一个公交站 + */ extern rail_node_t* rails; /** diff --git a/test/io_test.cpp b/test/io_test.cpp index 77a01a1..e9d404d 100644 --- a/test/io_test.cpp +++ b/test/io_test.cpp @@ -3,10 +3,15 @@ // #include "gtest/gtest.h" #include "gmock/gmock.h" +// 在C++中引用C语言中的函数 +#ifdef __cplusplus extern "C" { +#endif #include "rail.h" +#ifdef __cplusplus } +#endif using ::testing::Return; using ::testing::AtLeast;