Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

BufferList.h

Go to the documentation of this file.
00001 #ifndef BUFFERLIST_H 00002 #define BUFFERLIST_H 00003 00004 // DEPRECATED!!! 00005 #include <algorithm> 00006 #include <list> 00007 using std::list; 00008 #include "Timestamp.h" 00009 #include <vector> 00010 using std::vector; 00011 00012 00013 00014 class BufferList 00015 { 00016 00017 public: 00018 00019 00020 struct node 00021 { 00022 char *att; // Null delimited 00023 char *tuple; 00024 00025 // To answer the comment below, this is doing POINTER comparisons. I hope that's what is meant. -- eddie 00026 bool operator== (node other) 00027 { 00028 if (this->att != other.att) // or is it MEMCMP????????????? 00029 return false; 00030 else if (this->tuple != other.tuple) 00031 return false; 00032 else 00033 return true; 00034 } 00035 }; 00036 00037 00038 00039 // first constructor for BSort 00040 BufferList(char *group_by, int group_by_size); 00041 00042 // second constructor for join 00043 BufferList(char *group_by_values, int group_by_size, char *group_by_values_str, int group_by_size_str, char order_att_type); 00044 00045 BufferList(char order_att_type); 00046 00047 ~BufferList() {}; 00048 00049 // It would be good here to say "Why we use a list" 00050 // My stab: 00051 // list gives constant time for inserts and removes. its only random access 00052 // that is slowed down. since we really only care about the "smallest value" each time 00053 // this works great for us -eddie 00054 list<node> _buffer; // doubly linked list 00055 00056 int size(); 00057 node front(); 00058 node back(); 00059 list<node>::iterator begin(); 00060 list<node>::iterator end(); 00061 00062 bool isEmpty(); 00063 void push_back(node new_node); 00064 void push_front(node new_node); 00065 void insert(list<node>::iterator iter, node new_node); 00066 node pop_front(); 00067 00068 char *getGroupByValues(); 00069 int getGroupBySize(); 00070 Timestamp getLastEmittedTime(); 00071 void setLastEmittedTime(Timestamp ts); 00072 00073 // NEW 00074 int getGroupByStrSize(); 00075 char* getGroupByStr(); 00076 00077 int getSlack(); 00078 void increaseSlack(); 00079 void setSlack(int new_slack); 00080 char* getThreshold(); 00081 void setThreshold(char *new_threshold, int size); 00082 void increaseThreshold(); 00083 int countAndClearVector(); 00084 void addToVector(char *value); 00085 void erase(char *threshold, int size); 00086 00087 void setTimeIncrement(long num); 00088 00089 private: 00090 00091 // int _max_size; 00092 char *_group_by_values; 00093 int _group_by_size; 00094 Timestamp _last_time_emitted; 00095 00096 // new from here for join 00097 char *_group_by_values_str; 00098 int _group_by_size_str; 00099 00100 char _order_att_type; 00101 00102 int _curr_slack; 00103 char *_curr_threshold; 00104 00105 int _time_increment; 00106 // long _hello; 00107 00108 vector<char*> _values_gt_threshold; 00109 vector<char*>::iterator _vector_iter; 00110 00111 }; 00112 00113 #endif

Generated on Fri Nov 12 15:15:20 2004 for Borealis by doxygen 1.3.8