File: kernel.h

package info (click to toggle)
korelib 0.0.1-8
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,788 kB
  • ctags: 1,918
  • sloc: sh: 8,555; cpp: 3,989; makefile: 633; ansic: 65
file content (76 lines) | stat: -rw-r--r-- 1,986 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef KERNEL_H
#define KERNEL_H

#include <kore/kore.h>
#include <kore/serviceprovider.h>

namespace kore
{

class ServiceManager;
class PluginLoader;
class ModuleManager;
class PluginManager;

/**
 * class core::Kernel - the Kernel
 * This class is responsible for providing kore services to runtime modules
 * This is a singleton, use kore::Kernel::instance() for getting access to an instance
 */
class KORE_API Kernel: public ServiceProvider
{
public:
    /**
     * Gets the single instance of Kernel
     * @return - the only instance of this class
     */
    static Kernel* instance();
    /**
     * Gets the Kore ServiceManager.
     * @return - the ServiceManager associated to this Kernel
     */
    ServiceManager* serviceManager() const;

    /**
     * Destructor.
     */
    virtual ~Kernel();
protected:
    /**
     * Default contructor. Protected in order to prevent random instantion
     * outside this class, while allowing sub-classing.
     */
    Kernel();
    /**
     * Helper method for setting the Kernel single instance.
     * @param inst - the Kernel instance to be returned by Kernel::instance().
     */
    static void setInstance(Kernel* inst);
    /**
     * Helper method for setting the ServiceManager associated to this Kernel.
     * @param sm - the ServiceManager to be returned by
     * Kernel::instance()::serviceManager().
     */
    void setServiceManager(ServiceManager* sm);
private:
    // current kernel version
    const Version* _version;
    // Kernel info
    const Info* _info;
    // basic Kernel service
    const Service* _kernelService;
    // the Kernel single instance
    static Kernel* _instance;
    // the ServiceManager associated to this Kernel
    ServiceManager* _serviceManager;
    // the default Kore PluginLoader
    PluginLoader* _pluginLoader;
    // the default Kore ModuleManager
    ModuleManager* _moduleManager;
    // the default Kore PluginManager
    PluginManager* _pluginManager;
};

};

#endif