feisty meow concerns codebase  2.140
os_event.h
Go to the documentation of this file.
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 
29 
30 class OS_event : public letter, public virtual basis::text_formable
31 {
32 public:
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  }
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 
a_sprintf is a specialization of astring that provides printf style support.
Definition: astring.h:440
Provides a dynamically resizable ASCII character string.
Definition: astring.h:35
Defines the base class for all string processing objects in hoople.
Definition: base_string.h:28
virtual base_string & assign(const base_string &s)=0
Sets the contents of this string to "s".
A base class for objects that can provide a synopsis of their current state.
Definition: contracts.h:142
Models an OS-level event so we can represent activities occurring there.
Definition: os_event.h:31
basis::astring text_form() const
Definition: os_event.h:45
DEFINE_CLASS_NAME("OS_event")
basis::un_int _parm2
Definition: os_event.h:35
basis::un_int _parm1
Definition: os_event.h:34
basis::un_int _message
Definition: os_event.h:33
virtual void text_form(basis::base_string &fill) const
Provides a text view of all the important info owned by this object.
Definition: os_event.h:42
OS_event(int event_type, basis::un_int message, basis::un_int parm1, basis::un_int parm2)
Definition: os_event.h:39
A virtual base class for pieces of "mail". Used by the mailbox object.
Definition: letter.h:25
unsigned int un_int
Abbreviated name for unsigned integers.
Definition: definitions.h:62