Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Data Structures | Macros | Typedefs | Functions
afw_object.h File Reference

Header for interface afw_object helpers. More...

#include "afw_interface.h"

Go to the source code of this file.

Data Structures

struct  afw_object_properties_callback_entry_s
 Struct for afw_object_properties_callback_entry_t. More...
 

Macros

#define AFW_OBJECT_Q_CORE_ID_PREFIX   AFW_Q__Adaptive
 Quoted prefix for all core adaptive object types.
 
#define AFW_OBJECT_S_CORE_ID_PREFIX   afw_s__Adaptive
 String prefix for all core adaptive object types.
 
#define AFW_OBJECT_Q_OBJECT_TYPE_ID_OBJECT   AFW_Q__AdaptiveObject_
 Quoted object type id for untyped adaptive object.
 
#define AFW_OBJECT_S_OBJECT_TYPE_ID_OBJECT   afw_s__AdaptiveObject_
 String object type id for untyped adaptive object.
 
#define AFW_OBJECT_Q_OBJECT_TYPE_ID_OBJECT_TYPE   AFW_Q__AdaptiveObjectType_
 Quoted object type id for Object Type object.
 
#define AFW_OBJECT_S_OBJECT_TYPE_ID_OBJECT_TYPE   afw_s__AdaptiveObjectType_
 String object type id for Object Type object.
 
#define AFW_OBJECT_Q_OBJECT_TYPE_ID_VALUE_META   AFW_Q__AdaptiveValueMeta_
 Quoted object type id for Value Meta object.
 
#define AFW_OBJECT_S_OBJECT_TYPE_ID_VALUE_META   afw_s__AdaptiveValueMeta_
 String object type id for Property Type object.
 
#define AFW_OBJECT_Q_OBJECT_TYPE_ID_DATA_TYPE   AFW_Q__AdaptiveDataType_
 Quoted object type id for Data Type object.
 
#define AFW_OBJECT_S_OBJECT_TYPE_ID_DATA_TYPE   afw_s__AdaptiveDataType_
 String object type id for Data Type object.
 
#define AFW_OBJECT_Q_OBJECT_TYPE_ID_JOURNAL_ENTRY   AFW_Q__AdaptiveJournalEntry_
 Quoted object type id for Journal Entry object.
 
#define AFW_OBJECT_S_OBJECT_TYPE_ID_JOURNAL_ENTRY   afw_s__AdaptiveJournalEntry_
 String object type id for Journal Entry object.
 
#define AFW_OBJECT_Q_OBJECT_TYPE_ID_PROVISIONING_PEER   AFW_Q__AdaptiveProvisioningPeer_
 Quoted object type id for Provisioning Peer object.
 
#define AFW_OBJECT_S_OBJECT_TYPE_ID_PROVISIONING_PEER   afw_s__AdaptiveProvisioningPeer_
 String object type id for Provisioning Peer object.
 
#define AFW_OBJECT_Q_OBJECT_TYPE_ID_RESPONSE   AFW_Q__AdaptiveResponse_
 Quoted object type id for Response.
 
#define AFW_OBJECT_S_OBJECT_TYPE_ID_RESPONSE   afw_s__AdaptiveResponse_
 String object type id for Response.
 
#define AFW_OBJECT_Q_PN_META   AFW_Q__meta_
 Quoted pseudo meta property name.
 
#define AFW_OBJECT_S_PN_META   afw_s__meta_
 String pseudo meta property name.
 
#define AFW_OBJECT_Q_PN_OBJECT_ID   AFW_Q_objectId
 Quoted pseudo meta property name for objectId.
 
#define AFW_OBJECT_S_PN_OBJECT_ID   afw_s_objectId
 String pseudo meta property name for objectId.
 
#define AFW_OBJECT_Q_PN_PATH   AFW_Q_path
 Quoted pseudo meta property name for path.
 
#define AFW_OBJECT_S_PN_PATH   afw_s_path
 String pseudo meta property name for path.
 
#define AFW_OBJECT_Q_PN_ADAPTOR_ID   AFW_Q_adaptorId
 Quoted pseudo meta property name for adaptorId.
 
#define AFW_OBJECT_S_PN_ADAPTOR_ID   afw_s_adaptorId
 String pseudo meta property name for adaptorId.
 
#define AFW_OBJECT_Q_PN_OBJECT_TYPE   AFW_Q_objectType
 Quoted pseudo meta property name for objectType.
 
#define AFW_OBJECT_S_PN_OBJECT_TYPE   afw_s_objectType
 String pseudo meta property name for objectType.
 
#define AFW_OBJECT_Q_PN_PARENT_PATHS   AFW_Q_parentPaths
 Quoted pseudo meta property name for parentPaths.
 
#define AFW_OBJECT_S_PN_PARENT_PATHS   afw_s_parentPaths
 String pseudo meta property name for parentPaths.
 
#define AFW_OBJECT_Q_PN_PROPERTY_TYPES   AFW_Q_propertyTypes
 Quoted pseudo meta property name for property types.
 
#define AFW_OBJECT_S_PN_PROPERTY_TYPES   afw_s_propertyTypes
 String pseudo meta property name for property types.
 
#define AFW_OBJECT_Q_PN_META_OBJECTTYPE    AFW_OBJECT_Q_PN_META "." AFW_OBJECT_Q_PN_OBJECT_TYPE
 Quoted meta.objectType.
 
#define AFW_OBJECT_S_PN_META_OBJECTTYPE   afw_s_a_meta_objectType
 String meta.objectType.
 
#define AFW_OBJECT_ID_IS_OBJECT_TYPE(OBJECT_TYPE_ID)    afw_utf8_equal((OBJECT_TYPE_ID), &afw_s__AdaptiveObjectType_)
 The object type id for object type objects is AdaptiveObjectType.
 
#define AFW_OBJECT_IS_CORE_OBJECT_TYPE_ID(OBJECT_TYPE_ID, OBJECT_ID)
 Core object type objects have an object id starting with _Adaptive. More...
 
#define AFW_OBJECT_IS_CORE_TYPE_ID(ID)    afw_utf8_starts_with((ID), &afw_s__Adaptive)
 Core type ids starting with _Adaptive.
 
#define afw_object_is_immutable(instance, xctx)   (afw_object_get_setter(instance, xctx) == NULL)
 Determine if object is immutable. More...
 
#define AFW_OBJECT_IMPL_ERROR_OBJECT_NOT_ENTITY   AFW_THROW_ERROR_Z(general, "Object is not an entity", xctx)
 
#define AFW_OBJECT_ASSERT_ENTITY(instance, xctx)
 Asserts that an object is an entity. More...
 
#define AFW_OBJECT_ERROR_OBJECT_IMMUTABLE   AFW_THROW_ERROR_Z(read_only, "Object immutable", xctx)
 
#define AFW_OBJECT_ASSERT_MUTABLE(instance, xctx)
 Asserts that an object is mutable. More...
 
#define AFW_OBJECT_ERROR_PROPERTY_IMMUTABLE(property_name)
 
#define AFW_OBJECT_GET_ENTITY(entity, object)
 Macro to get entity for object. More...
 
#define AFW_OBJECT_MEMORY_OPTION_default   0
 Default object behaviour. More...
 
#define AFW_OBJECT_MEMORY_OPTION_unmanaged   (1 << 0)
 Object should be unmanaged. More...
 
#define AFW_OBJECT_MEMORY_OPTION_cede_p   (1 << 1)
 Object cedes control of the specified pool. More...
 
#define AFW_OBJECT_MEMORY_OPTION_clone_on_set   (1 << 2)
 Clone values on set. More...
 
#define AFW_OBJECT_MEMORY_OPTION_cede_p_and_clone_on_set
 Object cedes control of the specified pool and clone on set. More...
 
#define AFW_OBJECT_MEMORY_OPTION_IS(options_mask, option)    ((((options_mask) & (AFW_OBJECT_MEMORY_OPTION_ ## option))) != 0)
 Test memory object option mask option.
 
#define afw_object_create_and_cede_p(p, xctx)
 Create an empty entity object in memory in specified pool and cede control of the pool to the object. More...
 
#define afw_object_create_managed(p, xctx)
 Create an empty entity object in its own pool. More...
 
#define afw_object_create_clone_on_set(p, xctx)
 Create an empty entity object in its own pool and clone values on set. More...
 
#define afw_object_create(p, xctx)
 Create an empty unmanaged object in memory. More...
 
#define AFW_OBJECT_CREATE_ENTITY_OR_EMBEDDED(result, embedding_object, property_name, always_create_unmanaged, cede_p, entity_p, xctx)
 Helper macro to create a new entity or embedded object. More...
 
#define afw_object_create_clone_to_managed_object(object, p, xctx)
 Clone an object to a managed object. More...
 

Typedefs

typedef const afw_value_t *(* afw_object_properties_callback_entry_get_t) (void *data, const afw_utf8_t *property_name, afw_xctx_t *xctx)
 Typedef for an object property get callback. More...
 
typedef void(* afw_object_properties_callback_entry_set_t) (void *data, const afw_utf8_t *property_name, const afw_value_t *value, afw_xctx_t *xctx)
 Typedef for an object property set callback. More...
 

Functions

afw_size_t afw_object_property_count (const afw_object_t *object, afw_xctx_t *xctx)
 Count the number of properties in an object. More...
 
void afw_object_set_immutable (const afw_object_t *instance, afw_xctx_t *xctx)
 Set an object to immutable if it is not already. More...
 
void afw_object_remove_property (const afw_object_t *instance, const afw_utf8_t *property_name, afw_xctx_t *xctx)
 Remove a property from object. More...
 
void afw_object_set_property (const afw_object_t *instance, const afw_utf8_t *property_name, const afw_value_t *value, afw_xctx_t *xctx)
 Set the value of an object's property. More...
 
void afw_object_set_property_as_date_from_parts (const afw_object_t *instance, const afw_utf8_t *property_name, int year, int month, int day, int tz_hours_offset, int tz_minutes_offset, afw_xctx_t *xctx)
 Set a date property from parts. More...
 
void afw_object_set_property_as_dateTime_from_parts (const afw_object_t *instance, const afw_utf8_t *property_name, int year, int month, int day, int hour, int minute, int second, int microsecond, int tz_hours_offset, int tz_minutes_offset, afw_xctx_t *xctx)
 Set a dateTime property from parts. More...
 
void afw_object_set_property_as_dayTimeDuration_from_parts (const afw_object_t *instance, const afw_utf8_t *property_name, afw_boolean_t is_positive, int days, int hours, int minutes, int seconds, int microseconds, afw_xctx_t *xctx)
 Set a dayTimeDuration property from parts. More...
 
void afw_object_set_property_as_time_from_parts (const afw_object_t *instance, const afw_utf8_t *property_name, int hour, int minute, int second, int microsecond, int tz_hours_offset, int tz_minutes_offset, afw_xctx_t *xctx)
 Set a time property from parts. More...
 
void afw_object_set_property_as_yearMonthDuration_from_parts (const afw_object_t *instance, const afw_utf8_t *property_name, afw_boolean_t is_positive, int years, int months, afw_xctx_t *xctx)
 Set a yearMonthDuration property from parts. More...
 
void afw_object_set_property_as_string_from_utf8_z (const afw_object_t *instance, const afw_utf8_t *property_name, const afw_utf8_z_t *string_z, afw_xctx_t *xctx)
 Set an string property from utf8_z. More...
 
void afw_object_parse_entity_path_from_path (afw_utf8_t *entity_path, const afw_utf8_t *path)
 Parse entity path from path. More...
 
const afw_object_tafw_object_get_entity (const afw_object_t *object, afw_xctx_t *xctx)
 Get entity for object. More...
 
const afw_object_tafw_object_resolve_instance (const afw_object_t *object, const afw_utf8_t *path, afw_xctx_t *xctx)
 Resolve an object's instance pointer. More...
 
const afw_value_tafw_object_get_property_compile_as (const afw_object_t *instance, const afw_utf8_t *property_name, const afw_utf8_t *source_location, afw_compile_type_t compile_type, const afw_pool_t *p, afw_xctx_t *xctx)
 Compile a property value using specified compile type. More...
 
const afw_value_tafw_object_get_property_compile_and_evaluate_as (const afw_object_t *instance, const afw_utf8_t *property_name, const afw_utf8_t *source_location, afw_compile_type_t compile_type, const afw_pool_t *p, afw_xctx_t *xctx)
 Compile and evaluate a property value using specified compile type. More...
 
const afw_value_tafw_object_get_property_extended (const afw_object_t *instance, const afw_utf8_t *property_name, afw_xctx_t *xctx)
 Get the value of an object's own property or embedded property. More...
 
const afw_value_t *const * afw_object_old_get_property_as_array_of_values (const afw_object_t *instance, const afw_utf8_t *property_name, const afw_pool_t *p, afw_xctx_t *xctx)
 Return a NULL terminated list of values for an object property in a specified pool. More...
 
const afw_utf8_t *const * afw_object_old_get_property_as_array_of_strings (const afw_object_t *instance, const afw_utf8_t *property_name, const afw_pool_t *p, afw_xctx_t *xctx)
 Return a NULL terminated list of strings for an object property in a specified pool. More...
 
const afw_value_tafw_object_old_get_property_as_compiled_hybrid (const afw_object_t *instance, const afw_utf8_t *property_name, const afw_utf8_t *source_location, const afw_compile_shared_t *shared, const afw_pool_t *p, afw_xctx_t *xctx)
 Return a compiled hybrid property value. More...
 
afw_boolean_t afw_object_old_get_property_as_boolean_deprecated (const afw_object_t *instance, const afw_utf8_t *property_name, afw_xctx_t *xctx)
 Get an object's property value as a boolean. More...
 
afw_integer_t afw_object_old_get_property_as_integer_deprecated (const afw_object_t *instance, const afw_utf8_t *property_name, afw_boolean_t *found, afw_xctx_t *xctx)
 Get an object's property value as an integer. More...
 
const afw_utf8_tafw_object_old_get_property_as_utf8 (const afw_object_t *instance, const afw_utf8_t *property_name, const afw_pool_t *p, afw_xctx_t *xctx)
 Get an object's property value as a string in specified pool. More...
 
const afw_utf8_z_tafw_object_old_get_property_as_utf8_z (const afw_object_t *instance, const afw_utf8_t *property_name, const afw_pool_t *p, afw_xctx_t *xctx)
 Get an object's property value including ancestors as utf8_z in specified pool. More...
 
void afw_object_merge (const afw_object_t *instance, const afw_object_t *from, afw_boolean_t replace, afw_xctx_t *xctx)
 Merge properties from one object into another. More...
 
const afw_object_associative_array_tafw_object_memory_associative_array_create (const afw_pool_t *p, afw_xctx_t *xctx)
 Create memory object associative array. More...
 
const afw_object_tafw_object_create_with_options (int options, const afw_pool_t *p, afw_xctx_t *xctx)
 Create an empty entity object with options. More...
 
const afw_object_tafw_object_create_composite (afw_boolean_t mutable, const afw_pool_t *p, afw_xctx_t *xctx,...)
 Create a composite of immutable objects. More...
 
const afw_object_tafw_object_create_properties_callback (void *data, afw_size_t count, const afw_object_properties_callback_entry_t callbacks[], const afw_pool_t *p, afw_xctx_t *xctx)
 Create a mutable composite of unmutable objects. More...
 
const afw_object_tafw_object_create_embedded (const afw_object_t *embedding_object, const afw_utf8_t *property_name, afw_xctx_t *xctx)
 Create an empty embedded object in a memory object. More...
 
const afw_object_tafw_object_insure_embedded_exists (const afw_object_t *embedding_object, const afw_utf8_t *property_name, afw_xctx_t *xctx)
 Insure embedded object exists creating if necessary. More...
 
const afw_object_tafw_object_create_clone (const afw_object_t *object, const afw_pool_t *p, afw_xctx_t *xctx)
 Clone an object to a specified pool. More...
 
const afw_object_tafw_object_create_merged (const afw_object_t *primary, const afw_object_t *secondary, const afw_pool_t *p, afw_xctx_t *xctx)
 Create a memory object with properties from two other objects. More...
 
const afw_object_tafw_object_aggregate_external_create (const afw_object_t *const *object_list, const afw_pool_t *p, afw_xctx_t *xctx)
 Create an aggregate object with an external object list. More...
 
const afw_object_tafw_object_create_const_from_key_value_strings_z (const afw_utf8_t *path, const afw_utf8_z_t *const *pairs, const afw_pool_t *p, afw_xctx_t *xctx)
 Create a const object from key/value utf-8 null terminated strings. More...
 

Detailed Description

Header for interface afw_object helpers.

Definition in file afw_object.h.