📄 train_link_list.h
字号:
// file: train_link_list.h//// this is the header file for the linked list class// make sure definitions are made only once//#ifndef __ISIP_TRAIN_LINK_LIST#define __ISIP_TRAIN_LINK_LIST// isip include files//#ifndef __ISIP_INTEGRAL#include <integral.h>#endif// forward declaration of classes//#ifndef __ISIP_TRAIN_LINK_NODE#include <train_link_node.h>#endif#ifndef __ISIP_TRAIN_MEMORY_MANAGER#include <train_memory_manager.h>#endif// Train_Link_list//// this file defines a class that implements a bi-directional linked list//class Train_Link_list { //--------------------------------------------------------------------------- // // protected data // //---------------------------------------------------------------------------protected: // link pointers // Train_Link_node* head_d; // head of the filled link list Train_Link_node* curr_d; // current position of the list // memory manager // static Train_Memory_manager* manager_d; // memory manager for the list //--------------------------------------------------------------------------- // // public methods // //---------------------------------------------------------------------------public: // required methods // char_1* name_cc(); volatile void error_handler_cc(char_1* mname, char_1* msg); logical_1 debug_cc(FILE* fp, char_1* message); int_4 size_cc(); // destructors/constructors // ~Train_Link_list(); Train_Link_list(); // default Train_Link_list(const Train_Link_list& list); // copy // methods to access memory manager // static logical_1 set_manager_cc(Train_Memory_manager* manager); static Train_Memory_manager* get_manager_cc(); // methods to set link pointers // logical_1 set_head_cc(Train_Link_node* node); // head link logical_1 set_curr_cc(Train_Link_node* node); // current link // methods to get link pointers // Train_Link_node* get_head_cc(); // head link Train_Link_node* get_curr_cc(); // current link // methods to treat the list like a stack // logical_1 push_cc(Train_Link_node* node); Train_Link_node* pop_cc(); // methods to manipulate links // logical_1 insert_cc(Train_Link_node* node); // insert node logical_1 remove_cc(Train_Link_node* node); // remove node logical_1 insert_cc(void_p item); // insert node with item logical_1 remove_cc(void_p item); // remove node with item // methods to traverse links // Train_Link_node* get_prev_cc(); // prev link of head Train_Link_node* get_next_cc(); // next link of head Train_Link_node* get_prev_cc(Train_Link_node* node); // prev link of node Train_Link_node* get_next_cc(Train_Link_node* node); // next link of node //--------------------------------------------------------------------------- // // private methods // //---------------------------------------------------------------------------private: };// end of include file//#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -