/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk

« back to all changes in this revision

Viewing changes to libssts/baseobject.h

  • Committer: Gustav Hartvigsson
  • Date: 2015-10-26 16:45:37 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20151026164537-4akey17vtdz35kb3
* Removed depricaded functions from SObject code.
* changed cast to "sugger" macro in s_dynamic_array_free ()

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
 * @addtogroup SObject SObject
37
37
 * @{
38
38
 * An SObject represents the base of the Super Simple Type System.
39
 
 * 
 
39
 *
40
40
 * Almost all other data structures in this library are children to this object
41
41
 * type.
42
42
 *
49
49
 * @endpar
50
50
 */
51
51
 
52
 
/* ---------------------------------------------------
53
 
 * This is just a test of creating a small typesystem.
54
 
 * It will include refrence counting.
55
 
 * ---------------------------------------------------
56
 
 */
57
 
 
58
52
/**
59
53
 * The class holds all the "virtual" functions, also knows  as methods
60
54
 * that are to be used with the object.
61
 
 * 
 
55
 *
62
56
 */
63
57
typedef struct SObjectClass SObjectClass;
64
58
 
65
59
/**
66
60
 * The instance holds the data that is associated with the object.
67
61
 * it also holds a pointer to the class of the object.
68
 
 * 
 
62
 *
69
63
 */
70
64
typedef struct SObject SObject;
71
65
 
80
74
typedef char * (* ToStringFunc)(SObject *);
81
75
 
82
76
/**
83
 
 * 
 
77
 *
84
78
 */
85
79
typedef void (* MethodFunc)(SObject *);
86
80
 
123
117
 * -----------------
124
118
 */
125
119
 
126
 
/** @deprecated This function was never used.
127
 
 * This function is used to set the method to initialize a new instance of an
128
 
 * object.
129
 
 * 
130
 
 * 
131
 
 */
132
 
DEPRECATED
133
 
void
134
 
s_object_set_initialize_method (SObject * self, MethodFunc method);
135
 
 
136
 
/** @deprecated This was never used
137
 
 * This function is used to set the method to deinitialize an object.
138
 
 * 
139
 
 * set it to a method that deinitialize your object.
140
 
 */
141
 
DEPRECATED
142
 
void
143
 
s_object_set_deinitialize_method (SObject * self, MethodFunc method);
144
120
 
145
121
/**
146
122
 * This function is used to set the ref method.
147
 
 * 
 
123
 *
148
124
 * @warning DO NOT USE THIS UNLESS YOU KNOW WHAT YOU ARE DOING.
149
125
 */
150
126
void
152
128
 
153
129
/**
154
130
 * This function is used to set the unref method.
155
 
 * 
 
131
 *
156
132
 * @warning DO NOT USE THIS UNLESS YOU KNOW WHAT YOU ARE DOING.
157
133
 */
158
134
void
160
136
 
161
137
/**
162
138
 * This function is used to set the get_refcount method.
163
 
 * 
 
139
 *
164
140
 * @warning DO NOT USE THIS UNLESS YOU KNOW WHAT YOU ARE DOING.
165
141
 */
166
142
void
190
166
/**
191
167
 * @brief
192
168
 * Initializes an SObject
193
 
 * 
 
169
 *
194
170
 * @param self The object to initialize.
195
 
 * 
 
171
 *
196
172
 * This function initializes an instance of the SObject, it also sets
197
173
 * the methods to be used with the object and sets the reference count to one.
198
174
 */
201
177
 
202
178
/** @brief
203
179
 * This function creates a new base object.
204
 
 * 
 
180
 *
205
181
 * @return a new SObject
206
182
 */
207
183
SObject *
230
206
 * This function is used to decrese the reference count of an object.
231
207
 * When an object reaches zero, it will deinitialize the object using the
232
208
 * objects deinitialize method.
233
 
 * 
 
209
 *
234
210
 * It returns the current (after change) reference count.
235
211
 */
236
212
sint