creator-level saving new files in fat
[quarnos.git] / manes / component.cpp
blobcd6c1f7c428fa2efbafd614a086ffea8fe7746f6
1 /* Quarn OS
3 * Component class
5 * Copyright (C) 2008 Pawel Dziepak
8 */
10 #include "component.h"
11 #include "implementation.h"
12 #include "manec.h"
14 using namespace manes;
16 void implementation::set_owner(component *own) {
17 owner = own;
20 component *implementation::get_parent() {
21 component *comp = owner; //->get_parent();
22 //asm ("cli\nhlt"::"a"(comp));
23 return comp;
26 component::component(component *_parent, type *_type, interface *_intf, implementation *_impl) : intf(_intf), impl(_impl), obj_type(_type), parent(_parent), me(new component_name(_type->get_name(), "a")) {
27 assert("component: attempt to create component without impl", impl == 0);
28 assert("component: attempt to create component without type", obj_type == 0);
30 impl->set_owner(this);
33 const component_name *component::get_name() const {
34 return me;
37 component *component::get_parent() const {
38 return parent;
41 const type *component::get_type() const {
42 return obj_type;
45 component::obj_location component::get_location() const {
46 return local_kernel; //locate;
49 interface *component::get_interface() const {
50 return intf;
53 component::operator interface*() {
54 return get_interface();
57 implementation *component::get_implementation() const {
58 void inject_caller(void *object);
60 inject_caller(impl);
61 return impl;
64 component::operator implementation*() {
65 return get_implementation();