nckernel  0.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
오브젝트 관리

오브젝트의 생성/소멸, 복사, 링크등 기본적인 연산과 생성/소멸을 구현한다. More...

Data Structures

struct  object
 
struct  object_ops
 

Macros

#define object_get(ptr, type, member)   container_of(ptr, type, member)
 

Functions

int object_copy (struct object *dest, struct object *src)
 객체를 복사한다. More...
 
int object_create (struct object *object, void *data)
 객체를 생성한다. 등록된 생성자를 호출한다. More...
 
int object_destroy (struct object *object)
 객체를 소멸 시킨다. 등록된 소멸자를 호출한다. More...
 
int object_init (struct object *object, struct object_ops *ops)
 객체 연산자들을 초기화 한다. More...
 
struct objectobject_link (struct object *object)
 객체를 참조하는 새로운 객체 연결자를 만든다. 객체에 대한 참조 횟수를 증가시킨다. More...
 

Detailed Description

오브젝트의 생성/소멸, 복사, 링크등 기본적인 연산과 생성/소멸을 구현한다.

Author
Sung-jae Park nices.nosp@m.j@ni.nosp@m.cesj..nosp@m.com

Macro Definition Documentation

#define object_get (   ptr,
  type,
  member 
)    container_of(ptr, type, member)

Definition at line 64 of file object.h.

Function Documentation

int object_copy ( struct object dest,
struct object src 
)

객체를 복사한다.

Parameters
[in]dest객체를 복사할 대상체
[in]src복사할 객체
Returns
int 성공시 0, 실패시 에러 값

Definition at line 58 of file object.c.

References object_ops::copy, EINVAL, memcpy(), ops, refcnt, and intr_info::ret.

Here is the call graph for this function:

int object_create ( struct object object,
void *  data 
)

객체를 생성한다. 등록된 생성자를 호출한다.

Parameters
[in]object초기화 할 객체 포인터
[in]data초기화시 콜백 함수에 전달 할 사용자 데이터
Returns
int 성공시 0, 실패시 에러 값

Definition at line 17 of file object.c.

References object_ops::create, EINVAL, ops, refcnt, and intr_info::ret.

Referenced by open(), and thread_create().

Here is the caller graph for this function:

int object_destroy ( struct object object)

객체를 소멸 시킨다. 등록된 소멸자를 호출한다.

Parameters
[in]object
Returns
int 성공시 0, 실패시 에러 값

Definition at line 35 of file object.c.

References object_ops::destroy, EINVAL, ops, refcnt, and intr_info::ret.

Referenced by close(), and pthread_cancel().

Here is the caller graph for this function:

int object_init ( struct object object,
struct object_ops ops 
)

객체 연산자들을 초기화 한다.

Parameters
[in]object
[in]ops
Returns
int 성공시 0, 실패시 에러 값

Definition at line 9 of file object.c.

References memcpy(), and ops.

Referenced by thread_create().

Here is the call graph for this function:

Here is the caller graph for this function:

struct object* object_link ( struct object object)

객체를 참조하는 새로운 객체 연결자를 만든다. 객체에 대한 참조 횟수를 증가시킨다.

Parameters
[in]dest
Returns
object 성공시 객체 포인터, 실패시 NULL

Definition at line 78 of file object.c.

References object_ops::link, NULL, ops, and refcnt.