/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk
27 by Gustav Hartvigsson
* added skeleton for the SBox type.
1
#ifndef __H_BOX__
2
#define __H_BOX__
3
#include "defs.h"
4
#include "baseobject.h"
43 by Gustav Hartvigsson
* Code cleanup
5
#include "Func.h"
27 by Gustav Hartvigsson
* added skeleton for the SBox type.
6
44 by Gustav Hartvigsson
* Started to structuce the dectumentation a little better.
7
BEGIN_DECLS
8
27 by Gustav Hartvigsson
* added skeleton for the SBox type.
9
/** @file
44 by Gustav Hartvigsson
* Started to structuce the dectumentation a little better.
10
 * @defgroup SBox SBox
11
 * @addtogroup SBox
12
 * @{
27 by Gustav Hartvigsson
* added skeleton for the SBox type.
13
 * An SBox is a boxed type.
14
 */
15
16
17
/** @brief
44 by Gustav Hartvigsson
* Started to structuce the dectumentation a little better.
18
 * A reference counted box sitting on top of an SObject.
27 by Gustav Hartvigsson
* added skeleton for the SBox type.
19
 */
43 by Gustav Hartvigsson
* Code cleanup
20
typedef struct SBox SBox;
21
22
typedef struct SBoxClass SBoxClass;
23
24
typedef struct SBoxPrivate SBoxPrivate;
25
26
struct SBox {
27 by Gustav Hartvigsson
* added skeleton for the SBox type.
27
  SObject parent;
28
  SBoxPrivate * priv;
43 by Gustav Hartvigsson
* Code cleanup
29
};
27 by Gustav Hartvigsson
* added skeleton for the SBox type.
30
43 by Gustav Hartvigsson
* Code cleanup
31
struct SBoxClass {
27 by Gustav Hartvigsson
* added skeleton for the SBox type.
32
  SObjectClass parent_class;
43 by Gustav Hartvigsson
* Code cleanup
33
};
34
35
/**
36
 * Creates a new SBox object.
37
 * 
38
 * @param object The object to be boxed.
39
 * @param type The type of object that is being boxed.
40
 * @param freefunc The Function to be used when freeing the boxed object.
41
 *
42
 * @return A new SBox object.
43
 *
44
 * @note if freefunc is NULL, then standard free() will be used.
45
 */
46
SBox * s_box_new (spointer object, SType type, FreeFunc freefunc);
47
48
/**
49
 * Free the an SBox.
50
 *
51
 * @param box The SBox to be freed.
52
 *
44 by Gustav Hartvigsson
* Started to structuce the dectumentation a little better.
53
 * @warning Freeing an SBox will free the object that is held by it.
43 by Gustav Hartvigsson
* Code cleanup
54
 */
55
void s_box_free (SBox * box);
56
57
/**
58
 * Get the object that is contained inside the SBox.
59
 *
60
 * @param box The SBox to get the object from.
61
 *
62
 * @return a pointer to the object.
63
 */
64
spointer s_box_get_object (SBox * box);
65
66
/**
67
 * Gets the SType of the object that is stored in the SBox.
68
 */
69
SType s_box_get_object_type (SBox * box);
70
71
/**
72
 * Gets the type name of the object.
73
 *
74
 * @param box The SBox to get the type name from.
75
 * @return A String containing the name of the type.
76
 * 
44 by Gustav Hartvigsson
* Started to structuce the dectumentation a little better.
77
 * @note caller must free the string.
43 by Gustav Hartvigsson
* Code cleanup
78
 */
79
char * s_box_get_object_type_name (SBox * box);
27 by Gustav Hartvigsson
* added skeleton for the SBox type.
80
44 by Gustav Hartvigsson
* Started to structuce the dectumentation a little better.
81
/** @} */
82
27 by Gustav Hartvigsson
* added skeleton for the SBox type.
83
END_DECLS
84
85
#endif