[BACK]Return to Event.h CVS log [TXT][DIR] Up to [Development] / fam / fam

Annotation of fam/fam/Event.h, Revision 1.1.1.1

1.1       trev        1: //  Copyright (C) 1999 Silicon Graphics, Inc.  All Rights Reserved.
                      2: //
                      3: //  This program is free software; you can redistribute it and/or modify it
                      4: //  under the terms of version 2 of the GNU General Public License as
                      5: //  published by the Free Software Foundation.
                      6: //
                      7: //  This program is distributed in the hope that it would be useful, but
                      8: //  WITHOUT ANY WARRANTY; without even the implied warranty of
                      9: //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  Further, any
                     10: //  license provided herein, whether implied or otherwise, is limited to
                     11: //  this program in accordance with the express provisions of the GNU
                     12: //  General Public License.  Patent licenses, if any, provided herein do not
                     13: //  apply to combinations of this program with other product or programs, or
                     14: //  any other product whatsoever.  This program is distributed without any
                     15: //  warranty that the program is delivered free of the rightful claim of any
                     16: //  third person by way of infringement or the like.  See the GNU General
                     17: //  Public License for more details.
                     18: //
                     19: //  You should have received a copy of the GNU General Public License along
                     20: //  with this program; if not, write the Free Software Foundation, Inc., 59
                     21: //  Temple Place - Suite 330, Boston MA 02111-1307, USA.
                     22:
                     23: #ifndef Event_included
                     24: #define Event_included
                     25:
                     26: #include <fam.h>
                     27: #include <assert.h>
                     28:
                     29:
                     30: //  An Event is a FAM event (not an imon event or a select event).  An
                     31: //  Event has a type, which corresponds to the FAMCodes types defined
                     32: //  in <fam.h>.
                     33:
                     34: class Event {
                     35:
                     36: public:
                     37:
                     38:     const char *name()    const;
                     39:     char code()           const;
                     40:     static const Event* getEventFromOpcode(char);
                     41:     int operator == (const Event& other) const  {return this == &other;}
                     42:
                     43:     static const Event Changed;
                     44:     static const Event Deleted;
                     45:     static const Event Executing;
                     46:     static const Event Exited;
                     47:     static const Event Created;
                     48: //  Moved is not supported
                     49: //    static const Event Moved;
                     50:     static const Event Acknowledge;
                     51:     static const Event Exists;
                     52:     static const Event EndExist;
                     53:
                     54: private:
                     55:     static const Event Error;
                     56:     enum Type {
                     57: 	ChangedT     = FAMChanged,        // 'c'
                     58: 	DeletedT     = FAMDeleted,        // 'A'
                     59: 	ExecutingT   = FAMStartExecuting, // 'X'
                     60: 	ExitedT      = FAMStopExecuting,  // 'Q'
                     61: 	CreatedT     = FAMCreated,        // 'F'
                     62:         MovedT       = FAMMoved,          // 'M'  (Not supported)
                     63: 	AcknowledgeT = FAMAcknowledge,    // 'G'
                     64: 	ExistsT      = FAMExists,         // 'e'
                     65: 	EndExistT    = FAMEndExist,       // 'P'
                     66:         ErrorT                            // '?'
                     67:     };
                     68:     Event(Type n)                       : which(n){};
                     69:
                     70:     const unsigned char which;
                     71:
                     72:     // We don't want anyone using any Events that aren't the static
                     73:     // constant ones, so make it so Events can't be created or copied
                     74:     Event();                       // Don't use
                     75:     void operator =(const Event&); // Don't use
                     76:
                     77:
                     78: };
                     79:
                     80: #endif /* !Event_included */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>