18 #ifndef GLOBUS_OBJECT_H
19 #define GLOBUS_OBJECT_H
34 typedef void (*globus_object_copy_func_t) (
void * src_instance_data,
35 void ** dst_instance_data);
37 typedef void (*globus_object_destructor_func_t) (
void * instance_data);
39 typedef struct globus_object_type_s {
40 const struct globus_object_type_s *
const parent_type;
41 globus_object_copy_func_t
const copy_func;
42 globus_object_destructor_func_t
const destructor;
43 void *
const class_data;
44 } globus_object_type_t;
46 typedef struct globus_object_s {
47 const globus_object_type_t * type;
48 struct globus_object_s * parent_object;
53 typedef char * (*globus_object_printable_string_func_t)
54 (globus_object_t * error);
61 extern globus_object_t *
62 globus_object_construct (
const globus_object_type_t * create_type);
66 extern globus_object_t *
67 globus_object_initialize_base (globus_object_t *
object);
69 extern globus_object_t *
70 globus_object_construct_base ();
72 #define globus_object_static_initializer(object_type, \
81 extern globus_object_t *
82 globus_object_copy (
const globus_object_t *
object);
87 globus_object_reference(globus_object_t *
object);
90 globus_object_free (globus_object_t *
object);
94 #define globus_object_type_static_initializer(parent_type, \
105 #define globus_object_printable_type_static_initializer(pt,cf,df,s) \
106 globus_object_type_static_initializer((pt),(cf),(df),(void *)(s))
108 extern globus_object_t *
109 globus_object_initialize_printable (globus_object_t *
object);
111 extern globus_object_t *
112 globus_object_construct_printable ();
119 extern const globus_object_type_t GLOBUS_OBJECT_TYPE_BASE_DEFINITION;
120 #define GLOBUS_OBJECT_TYPE_BASE (&GLOBUS_OBJECT_TYPE_BASE_DEFINITION)
122 extern const globus_object_type_t
123 GLOBUS_OBJECT_TYPE_PRINTABLE_DEFINITION;
124 #define GLOBUS_OBJECT_TYPE_PRINTABLE \
125 (&GLOBUS_OBJECT_TYPE_PRINTABLE_DEFINITION)
131 extern globus_object_t GLOBUS_OBJECT_BASE_STATIC_PROTOTYPE;
132 #define GLOBUS_OBJECT_BASE_PROTOTYPE (&GLOBUS_OBJECT_BASE_STATIC_PROTOTYPE)
134 extern globus_object_t
135 GLOBUS_OBJECT_PRINTABLE_STATIC_PROTOTYPE;
136 #define GLOBUS_OBJECT_PRINTABLE_PROTOTYPE \
137 (&GLOBUS_OBJECT_PRINTABLE_STATIC_PROTOTYPE)
143 extern const globus_object_type_t *
144 globus_object_get_type (
const globus_object_t *
object);
148 extern const globus_object_type_t *
149 globus_object_type_get_parent_type (
const globus_object_type_t * type);
154 globus_object_is_static (
const globus_object_t *
object);
160 globus_object_type_get_class_data (
const globus_object_type_t * type);
165 globus_object_type_match (
const globus_object_type_t * subtype,
166 const globus_object_type_t * supertype);
170 extern globus_object_t *
171 globus_object_upcast (globus_object_t *
object,
172 const globus_object_type_t * desired_type);
180 globus_object_set_local_instance_data (globus_object_t *
object,
181 void * instance_data);
185 globus_object_get_local_instance_data (
const globus_object_t *
object);
191 globus_object_printable_to_string (globus_object_t *
object);
193 extern globus_object_printable_string_func_t
194 globus_object_printable_get_string_func (globus_object_t *
object);
200 #define GLOBUS_OBJECT_MODULE (&globus_i_object_module)
int globus_bool_t
Boolean type.
Definition: globus_types.h:93
Reference Counting Module Activation and Deactivation.
Module Descriptor.
Definition: globus_module.h:71