]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/jdb/jdb_factory.cpp
update
[l4.git] / kernel / fiasco / src / jdb / jdb_factory.cpp
1 IMPLEMENTATION:
2
3 #include <climits>
4 #include <cstring>
5 #include <cstdio>
6
7 #include "jdb.h"
8 #include "jdb_core.h"
9 #include "jdb_module.h"
10 #include "jdb_screen.h"
11 #include "jdb_kobject.h"
12 #include "kernel_console.h"
13 #include "keycodes.h"
14 #include "factory.h"
15 #include "simpleio.h"
16 #include "static_init.h"
17
18 class Jdb_factory : public Jdb_kobject_handler
19 {
20 public:
21   Jdb_factory() FIASCO_INIT;
22 };
23
24 IMPLEMENT
25 Jdb_factory::Jdb_factory()
26   : Jdb_kobject_handler(Factory::static_kobj_type)
27 {
28   Jdb_kobject::module()->register_handler(this);
29 }
30
31 PUBLIC
32 bool
33 Jdb_factory::show_kobject(Kobject_common *, int )
34 {
35   return true;
36 }
37
38 PUBLIC
39 char const *
40 Jdb_factory::kobject_type() const
41 {
42   return JDB_ANSI_COLOR(yellow) "Factory" JDB_ANSI_COLOR(default);
43 }
44
45 PUBLIC
46 void
47 Jdb_factory::show_kobject_short(String_buffer *buf, Kobject_common *o)
48 {
49   Factory *t = Kobject::dcast<Factory*>(o);
50   buf->printf(" c=%ld l=%ld", t->current(), t->limit());
51 }
52
53 static Jdb_factory jdb_factory INIT_PRIORITY(JDB_MODULE_INIT_PRIO);