GATE
|
GATE based type encapsulation support. More...
#include "gate/gate_core_api.h"
#include "gate/gatetypes.h"
#include "gate/strings.h"
#include "gate/objects.h"
#include "gate/times.h"
#include "gate/guids.h"
#include "gate/arrays.h"
#include "gate/maps.h"
#include "gate/structs.h"
#include "gate/blobs.h"
#include "gate/typeids.h"
#include <stddef.h>
Data Structures | |
struct | gate_value_class |
Variable value carrier object. More... | |
Typedefs | |
typedef struct gate_value_class | gate_value_t |
Variable value carrier object. | |
Functions | |
GATE_CORE_API gate_value_t * | gate_value_create (gate_type_id_t value_type, void const *src, gate_value_t *dst) |
Initializes a value type with a copy of given source data type. | |
GATE_CORE_API gate_value_t * | gate_value_clone (gate_value_t const *src, gate_value_t *dst) |
Initializes a new value by copying/cloning the contents of another value object. | |
GATE_CORE_API void | gate_value_release (gate_value_t *dst) |
Releases all allocated data of the contained value type. | |
GATE_CORE_API gate_result_t | gate_value_get (gate_value_t const *src, void *ptrdst, gate_size_t dstlen) |
Creates a copy of a contained value in a destination storage area. | |
GATE_CORE_API void const * | gate_value_get_ptr (gate_value_t const *src) |
Returns a pointer to the content of a value object. | |
GATE_CORE_API gate_type_id_t | gate_value_type (gate_value_t const *src) |
Returns the value type ID of content in a value object. | |
GATE based type encapsulation support.
typedef struct gate_value_class gate_value_t |
Variable value carrier object.
Stores each possible gate type and a related type ID. The different values are stored on a union, no heap allocation is required
GATE_CORE_API gate_value_t * gate_value_create | ( | gate_type_id_t | value_type, |
void const * | src, | ||
gate_value_t * | dst ) |
Initializes a value type with a copy of given source data type.
[in] | value_type | Type-ID specifying the data type of the value to be constructed |
[in] | src | Pointer to native data type to be copied into new value specified by value_type |
[out] | dst | Initialized with value object containing a copy of src |
dst
in case of success, otherwise NULL GATE_CORE_API gate_value_t * gate_value_clone | ( | gate_value_t const * | src, |
gate_value_t * | dst ) |
Initializes a new value by copying/cloning the contents of another value object.
Primitive types are copied, reference types are duplicated and their reference counter is increased
[in] | src | Pointer source value thats content is copied/cloned |
[out] | dst | Initialized with value object containing a cloned content of src |
dst
in case of success, otherwise NULL GATE_CORE_API void gate_value_release | ( | gate_value_t * | dst | ) |
Releases all allocated data of the contained value type.
Reference types' reference counter is decreased, heap allocated objects are freed by their destruction function
[in] | dst | Pointer to value object to be released |
GATE_CORE_API gate_result_t gate_value_get | ( | gate_value_t const * | src, |
void * | ptrdst, | ||
gate_size_t | dstlen ) |
Creates a copy of a contained value in a destination storage area.
[in] | src | Value object thats content is accessed |
[out] | ptrdst | Pointer to target storage that is initialized with a copy of the value content |
[in] | dstlen | Capacity of storage in ptrdst in bytes |
GATE_CORE_API void const * gate_value_get_ptr | ( | gate_value_t const * | src | ) |
Returns a pointer to the content of a value object.
[in] | src | Pointer to value object thats content is accessed |
GATE_CORE_API gate_type_id_t gate_value_type | ( | gate_value_t const * | src | ) |
Returns the value type ID of content in a value object.
[in] | src | Pointer to value object thats content is accessed |