file: filter.h

/*************************************************************************** filter filter Class made in C++ ***************************************************************************/ /* This file contains the "class" declaration and method declarations for the filter class. define inlined methods: filter::filter() -sets up a nop instruction. //OVERLOAD CALL: filter: filter.cc(filter), filter.h(filter) Revision History: First made by John Langford on 3/4/97 */ /* Class: filter Description: This class implements a filter from arguments as short int's to a fully specified opcode. Private Members: unsigned short int mask; - base instruction opcode with all arguments set to 0. vector<unsigned short int> fields - a vector that contains a list of 1 past high bits. error err - the error handling object. Static Members: none Base Classes: none. Friend Classes: none Static Members: none Public Members: none Constructors: filter(unsigned short int newmask,const vector<unsigned short int>& newfields); //OVERLOAD CALL: filter: filter.cc(filter), filter.h(filter) filter();//basically creates a nop. //OVERLOAD CALL: filter: filter.cc(filter), filter.h(filter) Methods: public: unsigned short int args(const vector<unsigned short int>& args) const; //given the arguments, returns an opcode with the arguments filled in. void printstate() const - prints out the state of the object. Usefull for debugging. Error Handler: err */ #ifndef FILTER_H #define FILTER_H #include <iostream.h> #include <stl.h> #include "error.h" const unsigned short int maxbitfield=4096; //2^12 class filter{ private: unsigned short int mask;//basic instruction vector<unsigned short int> fields;//beginning and ending locations of fields //in the opcode error err; // the error handling object. public: filter(unsigned short int newmask,const vector<unsigned short int>& newfields); //OVERLOAD CALL: filter: filter.cc(filter), filter.h(filter) filter();//basically creates a nop. //OVERLOAD CALL: filter: filter.cc(filter), filter.h(filter) unsigned short int args(const vector<unsigned short int>& args) const; //given the arguments, returns an opcode with the arguments filled in. void printstate() const; }; inline filter::filter() {//duh mask=0; } #endif


Back to Source File Index


C++ to HTML Conversion by ctoohtml