KernelEvent.h

00001 /***************************************************************************
00002  *                                                                         *
00003  *   (c) Art Tevs, MPI Informatik Saarbruecken                             *
00004  *       mailto: <tevs@mpi-sb.mpg.de>                                      *
00005  *                                                                         *
00006  *   This program is free software; you can redistribute it and/or modify  *
00007  *   it under the terms of the GNU General Public License as published by  *
00008  *   the Free Software Foundation; either version 2 of the License, or     *
00009  *   (at your option) any later version.                                   *
00010  *                                                                         *
00011  ***************************************************************************/
00012 
00013 
00014 #ifndef _NR_ENGINE_KERNEL_EVENT__H_
00015 #define _NR_ENGINE_KERNEL_EVENT__H_
00016 
00017 //----------------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------------
00020 #include "EngineEvent.h"
00021 #include "../ITask.h"
00022 #include "../Kernel.h"
00023 
00024 namespace nrEngine{
00025 
00026         //! On of the system base events classes (used by kernel to send information)
00027         /**
00028          * KernelEvent is a base class for all possible event classes
00029          * according to the tasking and kernel work. Kernel could
00030          * send this events around if he thinks the application should
00031          * be informed about the things going on.
00032          *
00033          * \ingroup sysevent
00034          **/
00035         class _NRExport KernelEvent : public Event {
00036         
00037                 META_Event(KernelEvent)
00038 
00039                 public:
00040 
00041                         /**
00042                          * Get id of a task about which this message is sent.
00043                          **/
00044                         const TaskId& getTaskID() const { return mTaskId; }
00045 
00046                         /**
00047                          * Get the name of the task of the message
00048                          **/
00049                         const std::string& getName() const { return mTaskName; }
00050 
00051                 protected:
00052 
00053                         //! Only kernel is allowed to change the values here
00054                         friend class Kernel;
00055 
00056                         /**
00057                          * The constructor is protected, so only friend namely kernel
00058                          * is allowed to create events of this type. So think
00059                          * as if this event were a system event which you are not able
00060                          * to send by yourself. Only kernel subsystem could send them around.
00061                          **/
00062                         KernelEvent(const std::string& taskName, TaskId id, Priority prior = Priority::IMMEDIATE);
00063 
00064                         //! Store the id of a task about which we want to send information
00065                         TaskId  mTaskId;
00066 
00067                         //! Store the task name
00068                         std::string mTaskName;
00069 
00070         };
00071 
00072 }; // end namespace
00073 
00074 #endif

Generated on Wed Sep 12 23:19:42 2007 for nrEngine by  doxygen 1.5.1