|
nckernel
0.1
|
싱글톤 객체를 사용하는 경우가 잦기 때문에 구현되었다. More...
Data Structures | |
| struct | ston_ops |
Functions | |
| void * | ston_create (struct ston *ston, const void *key) |
| 객체를 생성하거나, 이미 생성된 것을 찾는다. More... | |
| int | ston_destroy (struct ston *ston, void *obj) |
| 객체를 소멸 시킨다. (실제 소멸은 refcnt 에 따른다) More... | |
| int | ston_fini (struct ston *ston) |
| Singleton 객체 관리자를 소멸 시킨다. More... | |
| struct ston * | ston_init (struct ston_ops *ops) |
| Singleton 객체 관리자를 초기화 한다. More... | |
싱글톤 객체를 사용하는 경우가 잦기 때문에 구현되었다.
ston init 을 하면서 필요한 연산자들을 정의한다.
ston_create 는 객체를 생성할 때, key 를 보고, 동일한 key 가 있는지 확인하여(compare연산자 이용) 새로 만들지, 기존에 만들어진 것을 쓸지 결정한다.
| void* ston_create | ( | struct ston * | ston, |
| const void * | key | ||
| ) |
객체를 생성하거나, 이미 생성된 것을 찾는다.
| [in] | ston | |
| [in] | key |
Definition at line 99 of file ston.c.
References ston_ops::create, ston_item::head, items, ston_item::key, malloc(), NULL, ston_item::obj, ops, and ston_item::refcnt.
Referenced by fdc_single_get().


| int ston_destroy | ( | struct ston * | ston, |
| void * | obj | ||
| ) |
객체를 소멸 시킨다. (실제 소멸은 refcnt 에 따른다)
| [in] | ston | |
| [in] | obj |
Definition at line 121 of file ston.c.
References ston_ops::destroy, ENOENT, free(), ston_item::head, ops, and ston_item::refcnt.
Referenced by fdc_single_put().


| int ston_fini | ( | struct ston * | ston) |
Singleton 객체 관리자를 소멸 시킨다.
| [in] | ston |
Definition at line 41 of file ston.c.
References ston_ops::destroy, free(), ston_item::head, items, list_entry, list_for_each_safe, ston_item::obj, and ops.
Referenced by fdc_single_fini().


1.8.4