creator-level saving new files in fat
[quarnos.git] / manes / type.h
blobfd244841fceef45f21eca07a5ae7c08e8c6296da
1 /* Quarn OS
3 * Type class
5 * Copyright (C) 2008 Pawel Dziepak
8 */
10 #ifndef _TYPE_H_
11 #define _TYPE_H_
13 #include "interface.h"
14 #include "implementation.h"
15 //#include "test.h"
16 #include "type_name.h"
18 #include "libs/delegate.h"
20 namespace manes {
21 class component;
23 class unit_test {};
24 class type {
25 public:
26 typedef enum {
27 /* invalid */
28 zero,
30 /* factories */
31 server,
32 bus,
33 mem_alloc,
35 /* components */
36 service,
37 device,
38 buffer,
40 /* reserved ones */
41 file,
42 module,
43 actor
44 } root_type;
46 private:
47 root_type main_type;
48 type_name base;
49 type_name me;
51 //unit_test *utest;
52 interface *type_interf;
54 delegate<implementation*> create_impl;
56 public:
57 typedef type_name name;
59 type(root_type, type_name, type_name, interface, //unit_test,
60 delegate<implementation*>);
62 type(type&);
64 type_name get_name() const;
66 root_type get_root_type() const;
67 root_type get_child_type() const;
68 type_name get_base_type() const;
70 //unit_test *get_test() const;
71 interface *get_interface() const;
73 component *create_component(component*);
75 bool operator==(type &);
76 bool operator!=(type &);
80 #endif