CUBRID Engine  latest
object_accessor.h File Reference
#include <stdarg.h>
#include "area_alloc.h"
#include "class_object.h"
#include "object_fetch.h"
#include "object_template.h"
#include "work_space.h"
Include dependency graph for object_accessor.h:

Go to the source code of this file.

Macros

#define OBJ_HEADER_CHN_OFFSET   0
 
#define OBJ_HEADER_BOUND_BITS_OFFSET   4
 
#define OBJ_HEADER_FIXED_SIZE   4
 
#define OBJ_HEADER_SIZE(nvars)   OBJ_HEADER_FIXED_SIZE + OR_BOUND_BIT_BYTES(nvars)
 
#define OBJ_BOUND_BIT_WORDS   OR_BOUND_BIT_WORDS
 
#define OBJ_BOUND_BIT_BYTES   OR_BOUND_BIT_BYTES
 
#define OBJ_GET_BOUND_BITS(obj)   ((char *)(obj) + OBJ_HEADER_BOUND_BITS_OFFSET)
 
#define OBJ_GET_BOUND_BIT(obj, element)   OR_GET_BOUND_BIT(OBJ_GET_BOUND_BITS(obj), element)
 
#define OBJ_SET_BOUND_BIT(obj, element)   OR_ENABLE_BOUND_BIT(OBJ_GET_BOUND_BITS(obj), element)
 
#define OBJ_CLEAR_BOUND_BIT(obj, element)   OR_CLEAR_BOUND_BIT(OBJ_GET_BOUND_BITS(obj), element)
 

Functions

MOP obj_create (MOP classop)
 
MOP obj_create_by_name (const char *name)
 
MOP obj_copy (MOP op)
 
int obj_delete (MOP op)
 
int obj_get (MOP op, const char *name, DB_VALUE *value)
 
int obj_get_att (MOP op, SM_CLASS *class_, SM_ATTRIBUTE *att, DB_VALUE *value)
 
int obj_get_shared (MOP op, const char *name, DB_VALUE *value)
 
int obj_get_path (DB_OBJECT *object, const char *attpath, DB_VALUE *value)
 
int obj_set (MOP op, const char *name, DB_VALUE *value)
 
int obj_set_shared (MOP op, const char *name, DB_VALUE *value)
 
int obj_assign_value (MOP op, SM_ATTRIBUTE *att, char *mem, DB_VALUE *value)
 
int obj_desc_set (MOP op, SM_DESCRIPTOR *desc, DB_VALUE *value)
 
int obj_desc_get (MOP op, SM_DESCRIPTOR *desc, DB_VALUE *value)
 
int obj_send_va (MOP obj, const char *name, DB_VALUE *returnval, va_list args)
 
int obj_send_list (MOP obj, const char *name, DB_VALUE *returnval, DB_VALUE_LIST *arglist)
 
int obj_send_array (MOP obj, const char *name, DB_VALUE *returnval, DB_VALUE **argarray)
 
int obj_desc_send_va (MOP obj, SM_DESCRIPTOR *desc, DB_VALUE *returnval, va_list args)
 
int obj_desc_send_list (MOP obj, SM_DESCRIPTOR *desc, DB_VALUE *returnval, DB_VALUE_LIST *arglist)
 
int obj_desc_send_array (MOP obj, SM_DESCRIPTOR *desc, DB_VALUE *returnval, DB_VALUE **argarray)
 
int obj_desc_send_array_quick (MOP obj, SM_DESCRIPTOR *desc, DB_VALUE *returnval, int nargs, DB_VALUE **argarray)
 
int obj_isinstance (MOP obj)
 
int obj_is_instance_of (MOP obj, MOP class_mop)
 
int obj_lock (MOP op, int for_write)
 
int obj_class_lock (MOP op, int for_write)
 
int obj_inst_lock (MOP op, int for_write)
 
MOP obj_find_unique (MOP op, const char *attname, DB_VALUE *value, AU_FETCHMODE fetchmode)
 
MOP obj_find_object_by_pkey (MOP classop, DB_VALUE *key, AU_FETCHMODE fetchmode)
 
MOP obj_repl_find_object_by_pkey (MOP classop, DB_VALUE *key, AU_FETCHMODE fetchmode)
 
MOP obj_desc_find_unique (MOP op, SM_DESCRIPTOR *desc, DB_VALUE *value, AU_FETCHMODE fetchmode)
 
void obj_free_memory (SM_CLASS *class_, MOBJ obj)
 
int obj_locate_attribute (MOP op, int attid, int for_write, char **memp, SM_ATTRIBUTE **attp)
 
char * obj_alloc (SM_CLASS *class_, int bound_bit_status)
 
MOP obj_find_primary_key (MOP op, const DB_VALUE **values, int size, AU_FETCHMODE fetchmode)
 
MOP obj_find_multi_attr (MOP op, int size, const char *attr_names[], const DB_VALUE *values[], AU_FETCHMODE fetchmode)
 
MOP obj_find_multi_desc (MOP op, int size, const SM_DESCRIPTOR *desc[], const DB_VALUE *values[], AU_FETCHMODE fetchmode)
 
int obj_get_value (MOP op, SM_ATTRIBUTE *att, void *mem, DB_VALUE *source, DB_VALUE *dest)
 

Macro Definition Documentation

#define OBJ_BOUND_BIT_BYTES   OR_BOUND_BIT_BYTES

Definition at line 75 of file object_accessor.h.

Referenced by classobj_fixup_loaded_class().

#define OBJ_BOUND_BIT_WORDS   OR_BOUND_BIT_WORDS

Definition at line 74 of file object_accessor.h.

#define OBJ_CLEAR_BOUND_BIT (   obj,
  element 
)    OR_CLEAR_BOUND_BIT(OBJ_GET_BOUND_BITS(obj), element)

Definition at line 86 of file object_accessor.h.

Referenced by assign_null_value(), get_object_value(), and ldr_null_db_generic().

#define OBJ_GET_BOUND_BIT (   obj,
  element 
)    OR_GET_BOUND_BIT(OBJ_GET_BOUND_BITS(obj), element)

Definition at line 80 of file object_accessor.h.

Referenced by obj_get_value().

#define OBJ_GET_BOUND_BITS (   obj)    ((char *)(obj) + OBJ_HEADER_BOUND_BITS_OFFSET)

Definition at line 77 of file object_accessor.h.

#define OBJ_HEADER_BOUND_BITS_OFFSET   4

Definition at line 58 of file object_accessor.h.

Referenced by get_current(), obj_alloc(), and put_attributes().

#define OBJ_HEADER_CHN_OFFSET   0

Definition at line 57 of file object_accessor.h.

#define OBJ_HEADER_FIXED_SIZE   4

Definition at line 60 of file object_accessor.h.

#define OBJ_HEADER_SIZE (   nvars)    OBJ_HEADER_FIXED_SIZE + OR_BOUND_BIT_BYTES(nvars)

Definition at line 62 of file object_accessor.h.

Function Documentation

int obj_class_lock ( MOP  op,
int  for_write 
)

Definition at line 4387 of file object_accessor.c.

References AU_ALTER, au_fetch_class(), AU_FETCH_READ, AU_FETCH_UPDATE, AU_SELECT, error(), db_object::is_temp, NO_ERROR, and NULL.

Referenced by obj_lock().

Here is the caller graph for this function:

MOP obj_create ( MOP  classop)

Definition at line 1921 of file object_accessor.c.

References NULL, obt_def_object(), obt_quit(), and obt_update_internal().

Referenced by au_install(), au_make_user(), au_set_password_internal(), db_create_internal(), and obj_create_by_name().

Here is the caller graph for this function:

MOP obj_create_by_name ( const char *  name)

Definition at line 1949 of file object_accessor.c.

References NULL, obj_create(), and sm_find_class().

Referenced by db_create_by_name_internal().

Here is the caller graph for this function:

MOP obj_desc_find_unique ( MOP  op,
SM_DESCRIPTOR desc,
DB_VALUE value,
AU_FETCHMODE  fetchmode 
)

Definition at line 3539 of file object_accessor.c.

References ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_OBJ_INVALID_ARGUMENTS, er_set(), find_unique(), NO_ERROR, NULL, and sm_get_descriptor_component().

Referenced by db_dfind_unique().

Here is the caller graph for this function:

int obj_desc_get ( MOP  op,
SM_DESCRIPTOR desc,
DB_VALUE value 
)

Definition at line 1470 of file object_accessor.c.

References assert, er_errid(), ER_OBJ_INVALID_ARGUMENTS, error(), ERROR0, NO_ERROR, NULL, obj_get_att(), and sm_get_descriptor_component().

Referenced by db_dget().

Here is the caller graph for this function:

int obj_desc_send_array ( MOP  obj,
SM_DESCRIPTOR desc,
DB_VALUE returnval,
DB_VALUE **  argarray 
)

Definition at line 3254 of file object_accessor.c.

References ER_OBJ_INVALID_ARGUMENTS, error(), ERROR0, NO_ERROR, NULL, obj_send_method_array(), and sm_get_descriptor_component().

Referenced by db_dsend_argarray().

Here is the caller graph for this function:

int obj_desc_send_array_quick ( MOP  obj,
SM_DESCRIPTOR desc,
DB_VALUE returnval,
int  nargs,
DB_VALUE **  argarray 
)
int obj_desc_send_list ( MOP  obj,
SM_DESCRIPTOR desc,
DB_VALUE returnval,
DB_VALUE_LIST arglist 
)

Definition at line 3105 of file object_accessor.c.

References ER_OBJ_INVALID_ARGUMENTS, error(), ERROR0, NO_ERROR, NULL, obj_send_method_list(), and sm_get_descriptor_component().

Referenced by db_dsend_arglist().

Here is the caller graph for this function:

int obj_desc_send_va ( MOP  obj,
SM_DESCRIPTOR desc,
DB_VALUE returnval,
va_list  args 
)

Definition at line 2882 of file object_accessor.c.

References ER_OBJ_INVALID_ARGUMENTS, error(), ERROR0, NO_ERROR, NULL, obj_desc_send_va(), obj_send_method_va(), obj_send_va(), and sm_get_descriptor_component().

Referenced by db_dsend(), and obj_desc_send_va().

Here is the caller graph for this function:

int obj_desc_set ( MOP  op,
SM_DESCRIPTOR desc,
DB_VALUE value 
)

Definition at line 967 of file object_accessor.c.

References assert, DB_TYPE_LAST, DB_VALUE_TYPE, er_errid(), ER_OBJ_INVALID_ARGUMENTS, error(), ERROR0, NO_ERROR, NULL, obj_set_att(), sm_get_descriptor_component(), and sm_descriptor::valid.

Referenced by db_dput_internal(), and ldr_generic().

Here is the caller graph for this function:

MOP obj_find_primary_key ( MOP  op,
const DB_VALUE **  values,
int  size,
AU_FETCHMODE  fetchmode 
)
void obj_free_memory ( SM_CLASS class_,
MOBJ  obj 
)
int obj_get_shared ( MOP  op,
const char *  name,
DB_VALUE value 
)

Definition at line 1549 of file object_accessor.c.

References ER_OBJ_INVALID_ARGUMENTS, error(), ERROR0, find_shared_attribute(), NO_ERROR, NULL, and obj_get_value().

Referenced by db_get_shared().

Here is the caller graph for this function:

int obj_is_instance_of ( MOP  obj,
MOP  class_mop 
)

Definition at line 4305 of file object_accessor.c.

References au_fetch_instance(), AU_FETCH_READ, AU_SELECT, NO_ERROR, NULL, TM_TRAN_READ_FETCH_VERSION, and ws_class_mop().

Referenced by db_is_instance_of().

Here is the caller graph for this function:

MOP obj_repl_find_object_by_pkey ( MOP  classop,
DB_VALUE key,
AU_FETCHMODE  fetchmode 
)
int obj_send_array ( MOP  obj,
const char *  name,
DB_VALUE returnval,
DB_VALUE **  argarray 
)
int obj_send_list ( MOP  obj,
const char *  name,
DB_VALUE returnval,
DB_VALUE_LIST arglist 
)
int obj_send_va ( MOP  obj,
const char *  name,
DB_VALUE returnval,
va_list  args 
)
int obj_set_shared ( MOP  op,
const char *  name,
DB_VALUE value 
)