arbeit
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

EventData.h

Go to the documentation of this file.
00001 //------------------------------------------------------------------------
00002 //
00003 //   Joe Kniss
00004 //     7-1-03
00005 //                   ________    ____   ___ 
00006 //                  |        \  /    | /  /
00007 //                  +---+     \/     |/  /
00008 //                  +--+|  |\    /|     < 
00009 //                  |  ||  | \  / |  |\  \ 
00010 //                  |      |  \/  |  | \  \ 
00011 //                   \_____|      |__|  \__\
00012 //                       Copyright  2003 
00013 //                      Joe Michael Kniss
00014 //                   <<< jmk@cs.utah.edu >>>
00015 //               "All Your Base are Belong to Us"
00016 //-------------------------------------------------------------------------
00017 
00018 ///EventData.h
00019 /// a light weight class for passing events using data connectors
00020 
00021 #ifndef __SIMIAN_EVENT_DATA_DOT_H
00022 #define __SIMIAN_EVENT_DATA_DOT_H
00023 
00024 #include <core/DataObj.h>
00025 
00026 /// a class for monkeying around with loops and such in
00027 //    the simian "core" framework.
00028 
00029 class EventData : public DataObj {
00030 public:
00031    /// Id could be anything 
00032    EventData(int id = 0, const char *name=0)
00033       : DataObj(), _id(id)
00034    {  SimBase::setName(name); }
00035 
00036    virtual ~EventData() {}
00037    
00038    int  getId() const    { return _id; }
00039    void setId(int id)    { _id = id;   }
00040 
00041    ////////////////////////////////////////
00042    /// the events are designed to be
00043    /// or'ed together, even though that 
00044    /// may not be symantically consistant,
00045    /// but hey, that's up to you.
00046    enum BASIC_EVENTS {
00047       FIRST = 1<<0,  ///< init maybe?
00048       START = 1<<1,  ///< basically, exe if you can
00049       FORCE = 1<<2,  ///< Go, damn it
00050       CHECK = 1<<3,  ///< Just check
00051       END   = 1<<4,  ///< You are done
00052       ERROR = 1<<5,  ///< Something bad happened
00053       OK    = 1<<6,  ///< ay-ok
00054       LAST  = 1<<7   ///< custom events enumerate above this value
00055    };
00056    int getEvent() const { return _event; }
00057    void setEvent(int event) 
00058    { 
00059       _event = event; 
00060       if(_event & FORCE) setModified();
00061    }
00062 
00063 protected:
00064    int _id;
00065    int _event;
00066 
00067 };
00068 
00069 #endif
00070 

Send questions, comments, and bug reports to:
jmk