Merge branch 'dev' of feistymeow.org:feisty_meow into dev
[feisty_meow.git] / nucleus / library / processes / process_entry.h
1 #ifndef PROCESS_ENTRY_CLASS
2 #define PROCESS_ENTRY_CLASS
3
4 /*****************************************************************************\
5 *                                                                             *
6 *  Name   : process_entry                                                     *
7 *  Author : Chris Koeritz                                                     *
8 *                                                                             *
9 *******************************************************************************
10 * Copyright (c) 2000-$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 <basis/array.h>
19 #include <basis/astring.h>
20 #include <basis/contracts.h>
21 #include <basis/definitions.h>
22
23 namespace processes {
24
25 //! Encapsulates information about OS processes.
26
27 class process_entry : public virtual basis::text_formable
28 {
29 public:
30   basis::un_int _process_id;  //!< the OS identifier of this process.
31   basis::un_int _references;  //!< the number of references to (users of) this process.
32   basis::un_int _threads;  //!< the number of threads in use by this process.
33   basis::un_int _parent_process_id;  //!< the process id of the owning process.
34   basis::un_short _module16;  //!< non-zero if this process is a 16-bit application.
35
36   process_entry();
37   process_entry(const process_entry &to_copy);
38   ~process_entry();
39
40   DEFINE_CLASS_NAME("process_entry");
41
42   process_entry &operator =(const process_entry &to_copy);
43
44   const basis::astring &path() const;
45   void path(const basis::astring &new_path);
46
47   basis::astring text_form() const;
48     //!< returns a descriptive string for the information here.
49
50   void text_form(basis::base_string &fill) const;   //!< base class requirement.
51
52 private:
53   basis::astring *_process_path;
54 };
55
56 //////////////
57
58 //! a handy class that implements an array of process entries.
59
60 class process_entry_array : public basis::array<process_entry> {};
61
62 //////////////
63
64 } //namespace.
65
66 #endif
67