00001 00002 #ifndef INTERP_LIST_HH 00003 #define INTERP_LIST_HH 00004 00005 /* 00006 Mechanism for building lists of arbitrary NML messages, used by 00007 the canonical interface and interpreter to pass planned sequences 00008 to the HME. 00009 00010 Modification history: 00011 00012 25-Jun-2001 made commandbuf part of a union and add dummy variable 00013 to ensure alignment. 00014 25-Jul-1997 FMP changed line number stuff; 00015 changed MAX_EMC_NML_COMMAND_SIZE to MAX_NML_COMMAND_SIZE (I'm trying 00016 to get the EMC prejudice out of here) 00017 22-Oct-1996 WPS attempted to fix alignment problems by moving the 00018 command member of NML_INTERP_LIST_NODE to the begining of the structure. 00019 16-Nov-1995 Fred Proctor created 00020 */ 00021 00022 #define MAX_NML_COMMAND_SIZE 1000 00023 00024 // these go on the interp list 00025 struct NML_INTERP_LIST_NODE 00026 { 00027 int line_number; // line number it was on 00028 union _dummy_union { 00029 int i; 00030 long l; 00031 double d; 00032 float f; 00033 long long ll; 00034 long double ld; 00035 } dummy; // paranoid alignment variable. 00036 00037 union _command_union { 00038 char commandbuf[MAX_NML_COMMAND_SIZE]; // the NML command; 00039 int i; 00040 long l; 00041 double d; 00042 float f; 00043 long long ll; 00044 long double ld; 00045 } command; 00046 }; 00047 00048 // here's the interp list itself 00049 class NML_INTERP_LIST 00050 { 00051 public: 00052 NML_INTERP_LIST(); 00053 ~NML_INTERP_LIST(); 00054 00055 int set_line_number(int line); 00056 int get_line_number(); 00057 int append(NMLmsg &); 00058 int append(NMLmsg *); 00059 NMLmsg *get(); 00060 void clear(); 00061 void print(); 00062 int len(); 00063 00064 private: 00065 RCS_LINKED_LIST *linked_list_ptr; 00066 NML_INTERP_LIST_NODE temp_node; // filled in and put on the list 00067 int next_line_number; // line number used to fill temp_node 00068 int line_number; // line number of node from get() 00069 }; 00070 00071 extern NML_INTERP_LIST interp_list; /* NML Union, for interpreter */ 00072 00073 #endif