new fortune
[feisty_meow.git] / nucleus / library / processes / os_event.h
1 #ifndef OS_EVENT_CLASS
2 #define OS_EVENT_CLASS
3
4 /*****************************************************************************\
5 *                                                                             *
6 *  Name   : OS_event                                                          *
7 *  Author : Chris Koeritz                                                     *
8 *                                                                             *
9 *******************************************************************************
10 * Copyright (c) 1995-$now By Author.  This program is free software; you can  *
11 * redistribute it and/or modify it under the terms of the GNU General Public  *
12 * License as published by the Free Software Foundation; either version 2 of   *
13 * the License or (at your option) any later version.  This is online at:      *
14 *     http://www.fsf.org/copyleft/gpl.html                                    *
15 * Please send any updates to: fred@gruntose.com                               *
16 \*****************************************************************************/
17
18 #include "letter.h"
19
20 #include <basis/astring.h>
21 #include <basis/contracts.h>
22
23 namespace processes {
24
25 // forward.
26 class post_office;
27
28 //! Models an OS-level event so we can represent activities occurring there.
29
30 class OS_event : public letter, public virtual basis::text_formable
31 {
32 public:
33   basis::un_int _message;
34   basis::un_int _parm1;
35   basis::un_int _parm2;
36
37   DEFINE_CLASS_NAME("OS_event");
38
39   OS_event(int event_type, basis::un_int message, basis::un_int parm1, basis::un_int parm2)
40   : letter(event_type), _message(message), _parm1(parm1), _parm2(parm2) {}
41
42   virtual void text_form(basis::base_string &fill) const {
43     fill.assign(text_form());
44   }
45   basis::astring text_form() const {
46     return basis::a_sprintf("os_event: msg=%d parm1=%d parm2=%d", _message, _parm1, _parm2);
47   }
48 };
49
50 } //namespace.
51
52 #endif
53