Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Files | Data Structures | Macros | Functions

Files

file  afw_object_meta.h
 afw_object Interface meta helpers.
 

Data Structures

struct  afw_object_meta_object_s
 

Macros

#define afw_object_meta_object(instance)    (const afw_object_t *)((instance)->meta.meta_object)
 Return meta object for an object or NULL if there is not one. More...
 
#define afw_object_meta_add_error_z(instance, message_z, xctx)
 Add a null terminated error message to instance's meta. More...
 
#define afw_object_meta_add_error_fz(instance, xctx, format_z, ...)
 Add a formatted error message to instance's meta. More...
 
#define afw_object_meta_add_property_error_z(instance, property_name, message_z, xctx)
 Add a null terminate error message for a property to instance's meta. More...
 
#define afw_object_meta_add_property_error_fz(instance, property_name, xctx, format_z, ...)
 Add a formatted error message for a property to instance's meta. More...
 
#define afw_object_meta_get_property(instance, property_name, xctx)
 Get a meta property. More...
 
#define afw_object_meta_get_property_as_string(instance, property_name, xctx)
 Get a meta property as single string. More...
 
#define afw_object_meta_get_embedding_object(instance, xctx)   ((instance)->embedding_object)
 Get entity object's embedding object. More...
 
#define afw_object_meta_get_object_type_id(instance, xctx)
 Get object's object_type_id. More...
 
#define afw_object_meta_set_property(instance, property_name, value, xctx)
 Set a property in the meta of an object. More...
 
#define afw_object_meta_set_property_from_utf8_z(instance, property_name, string_z, xctx)
 Set a string property in the meta of an object from utf8_z. More...
 
#define afw_object_meta_set_property_as(instance, property_name, data_type, value, xctx)
 Set a property in the meta of an object as a value and data type. More...
 
#define afw_object_meta_set_property_type_property(instance, property_name, property_type_property_name, value, xctx)
 Set a property type property for a property in the meta of an object. More...
 
#define afw_object_meta_set_property_type_property_from_utf8_z(instance, property_name, property_type_property_name, string_z, xctx)
 Set a property type string property for a property in the meta of an object from utf8_z. More...
 
#define afw_object_meta_set_property_type_property_as(instance, property_name, property_type_property_name, data_type, value, xctx)
 Set a property type property for a property in the meta of an object as a value and data type. More...
 

Functions

void afw_object_meta_add_error (const afw_object_t *instance, const afw_utf8_t *message, afw_xctx_t *xctx)
 Add an error message to instance's meta. More...
 
void afw_object_meta_add_needed_object_type (const afw_object_t *instance, const afw_object_t *object_type, afw_xctx_t *xctx)
 Add a needed object type object. More...
 
void afw_object_meta_add_thrown_error (const afw_object_t *instance, const afw_error_t *error, afw_xctx_t *xctx)
 Add a thrown error to instance's meta. More...
 
void afw_object_meta_add_property_error (const afw_object_t *instance, const afw_utf8_t *property_name, const afw_utf8_t *message, afw_xctx_t *xctx)
 Add an error message for a property to instance's meta. More...
 
void afw_object_meta_add_thrown_property_error (const afw_object_t *instance, const afw_utf8_t *property_name, afw_integer_t index, const afw_error_t *error, afw_xctx_t *xctx)
 Add a thrown error for a property to instance's meta. More...
 
afw_boolean_t afw_object_meta_has_errors (const afw_object_t *instance, afw_xctx_t *xctx)
 Check if object flagged for errors. More...
 
void afw_object_meta_log_errors (const afw_object_t *instance, const afw_utf8_t *source_location, afw_xctx_t *xctx)
 Log meta errors. More...
 
const afw_object_tafw_object_meta_create_accessor_with_options (const afw_object_t *instance, const afw_object_options_t *options, const afw_pool_t *p, afw_xctx_t *xctx)
 Create an object instance to access an object's meta with options. More...
 
const afw_object_meta_object_tafw_object_meta_get_nonempty_meta_object (const afw_object_t *instance, afw_xctx_t *xctx)
 Return meta object for an object creating an empty one if needed. More...
 
const afw_object_tafw_object_meta_get_nonempty_delta (const afw_object_t *instance, afw_xctx_t *xctx)
 Return meta delta object for an object creating an empty one if needed. More...
 
const afw_utf8_tafw_object_meta_get_object_id (const afw_object_t *instance, afw_xctx_t *xctx)
 Get entity object's object id. More...
 
const afw_utf8_tafw_object_meta_get_property_name (const afw_object_t *instance, afw_xctx_t *xctx)
 Get object's property name in embedding object. More...
 
const afw_value_string_tafw_object_meta_get_object_id_value (const afw_object_t *instance, afw_xctx_t *xctx)
 Get entity object's object id value. More...
 
void afw_object_meta_add_parent_path (const afw_object_t *instance, const afw_utf8_t *parent_path, afw_xctx_t *xctx)
 Add a parent path to instance's meta. More...
 
const afw_value_list_tafw_object_meta_get_parent_paths_value (const afw_object_t *instance, afw_xctx_t *xctx)
 Get meta parentPaths property value. More...
 
const afw_utf8_tafw_object_meta_get_path (const afw_object_t *instance, afw_xctx_t *xctx)
 Get an object's path. More...
 
const afw_object_tafw_object_meta_get_property_type (const afw_object_t *instance, const afw_utf8_t *property_name, afw_xctx_t *xctx)
 Get the property type object for an object's property from the meta of an object, creating it if needed. More...
 
 afw_object_meta_set_meta_object (const afw_object_t *instance, const afw_object_t *meta, afw_xctx_t *xctx)
 Set an object's meta from a meta object. More...
 
const afw_object_tafw_object_meta_set_empty (const afw_object_t *instance, afw_xctx_t *xctx)
 Create and set object's meta to an empty object and return delta. More...
 
void afw_object_meta_set_ids (const afw_object_t *instance, const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, afw_xctx_t *xctx)
 Set object's ids. More...
 
void afw_object_meta_set_ids_using_path (const afw_object_t *instance, const afw_utf8_t *path, afw_xctx_t *xctx)
 Set object's ids using path. More...
 
void afw_object_meta_set_read_only (const afw_object_t *instance, afw_xctx_t *xctx)
 Set object's meta to indicate object is read-only. More...
 
void afw_object_meta_set_object_type (const afw_object_t *instance, const afw_object_type_t *object_type, afw_xctx_t *xctx)
 Set object's object type id. More...
 
void afw_object_meta_set_object_type_id (const afw_object_t *instance, const afw_utf8_t *object_type_id, afw_xctx_t *xctx)
 Set object's object type id. More...
 
void afw_object_meta_set_parent_paths (const afw_object_t *instance, const afw_value_list_t *parent_paths, afw_xctx_t *xctx)
 Set meta parentPaths property. More...
 
void afw_object_meta_clone_and_set (const afw_object_t *instance, const afw_object_t *from, afw_xctx_t *xctx)
 Set object's meta using a clone of the meta of another object. More...
 

Detailed Description

Provide afw_object interface common support.

Macro Definition Documentation

◆ afw_object_meta_add_error_fz

#define afw_object_meta_add_error_fz (   instance,
  xctx,
  format_z,
  ... 
)
Value:
afw_utf8_printf((instance)->p, xctx, format_z, __VA_ARGS__), \
xctx)
void afw_object_meta_add_error(const afw_object_t *instance, const afw_utf8_t *message, afw_xctx_t *xctx)
Add an error message to instance's meta.
afw_utf8_printf(const afw_pool_t *p, afw_xctx_t *xctx, const afw_utf8_z_t *format,...)
Create a utf-8 string using a c format string in specified pool.
Definition: afw_utf8.c:459

Add a formatted error message to instance's meta.

Parameters
instanceof object.
xctxof caller.
format_zformat for error message.
...for format_z.

Definition at line 90 of file afw_object_meta.h.

◆ afw_object_meta_add_error_z

#define afw_object_meta_add_error_z (   instance,
  message_z,
  xctx 
)
Value:
afw_utf8_create(message_z, AFW_UTF8_Z_LEN, (instance)->p, xctx), \
xctx)
#define AFW_UTF8_Z_LEN
String is NUL (0) terminate.
Definition: afw_common.h:266
#define afw_utf8_create(s, len, p, xctx)
Create utf-8 string without copy unless necessary in pool specified.
Definition: afw_utf8.h:239

Add a null terminated error message to instance's meta.

Parameters
instanceof object.
message_znull terminated string error message.
xctxof caller.

Definition at line 75 of file afw_object_meta.h.

◆ afw_object_meta_add_property_error_fz

#define afw_object_meta_add_property_error_fz (   instance,
  property_name,
  xctx,
  format_z,
  ... 
)
Value:
afw_object_meta_add_property_error(instance, property_name, \
afw_utf8_printf((instance)->p, xctx, format_z, __VA_ARGS__), \
xctx)
void afw_object_meta_add_property_error(const afw_object_t *instance, const afw_utf8_t *property_name, const afw_utf8_t *message, afw_xctx_t *xctx)
Add an error message for a property to instance's meta.

Add a formatted error message for a property to instance's meta.

Parameters
instanceof object.
property_nameof property.
xctxof caller.
format_zformat for error message.
...for format_z.

Definition at line 169 of file afw_object_meta.h.

◆ afw_object_meta_add_property_error_z

#define afw_object_meta_add_property_error_z (   instance,
  property_name,
  message_z,
  xctx 
)
Value:
afw_object_meta_add_property_error(instance, property_name, \
afw_utf8_create(message_z, AFW_UTF8_Z_LEN, (instance)->p, xctx), \
xctx)

Add a null terminate error message for a property to instance's meta.

Parameters
instanceof object.
property_nameof property.
message_znull terminated string error message.
xctxof caller.

Definition at line 153 of file afw_object_meta.h.

◆ afw_object_meta_get_embedding_object

#define afw_object_meta_get_embedding_object (   instance,
  xctx 
)    ((instance)->embedding_object)

Get entity object's embedding object.

Parameters
instanceof object.
xctxof caller.
Returns
embedding object or NULL.

Definition at line 313 of file afw_object_meta.h.

◆ afw_object_meta_get_object_type_id

#define afw_object_meta_get_object_type_id (   instance,
  xctx 
)
Value:
( \
(instance)->meta.object_type_uri && \
(instance)->meta.object_type_uri->len != 0 \
) \
? (instance)->meta.object_type_uri : NULL

Get object's object_type_id.

Parameters
instanceof object.
xctxof caller.
Returns
embedding object or NULL.

Definition at line 336 of file afw_object_meta.h.

◆ afw_object_meta_get_property

#define afw_object_meta_get_property (   instance,
  property_name,
  xctx 
)
Value:
(instance->meta.meta_object) \
property_name, xctx) \
: NULL
#define afw_object_get_property(instance, property_name, xctx)
Call method get_property of interface afw_object.
#define afw_object_meta_object(instance)
Return meta object for an object or NULL if there is not one.

Get a meta property.

Parameters
instanceof object.
property_nameof meta property. Can be dotted.
xctxof caller.
Returns
value of meta property.

Definition at line 282 of file afw_object_meta.h.

◆ afw_object_meta_get_property_as_string

#define afw_object_meta_get_property_as_string (   instance,
  property_name,
  xctx 
)
Value:
(instance->meta.meta_object) \
property_name, xctx) \
: NULL
#define afw_object_old_get_property_as_string(object, property_name, xctx)
Get property function for data type string value.

Get a meta property as single string.

Parameters
instanceof object.
property_nameof meta property. Can be dotted.
xctxof caller.
Returns
value of meta property.

Definition at line 297 of file afw_object_meta.h.

◆ afw_object_meta_object

#define afw_object_meta_object (   instance)     (const afw_object_t *)((instance)->meta.meta_object)

Return meta object for an object or NULL if there is not one.

Parameters
instanceof object whose meta object is to be returned.
Returns
meta object.

Definition at line 50 of file afw_object_meta.h.

◆ afw_object_meta_set_property

#define afw_object_meta_set_property (   instance,
  property_name,
  value,
  xctx 
)
Value:
afw_object_meta_get_nonempty_delta(instance, xctx), property_name, value, xctx)
const afw_object_t * afw_object_meta_get_nonempty_delta(const afw_object_t *instance, afw_xctx_t *xctx)
Return meta delta object for an object creating an empty one if needed.
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.
Definition: afw_object.c:46

Set a property in the meta of an object.

Parameters
instanceof object.
property_nameof meta property to set.
valueto set.
xctxof caller.

Definition at line 579 of file afw_object_meta.h.

◆ afw_object_meta_set_property_as

#define afw_object_meta_set_property_as (   instance,
  property_name,
  data_type,
  value,
  xctx 
)
Value:
afw_object_set_property_as_ ## data_type( \
property_name, value, xctx)

Set a property in the meta of an object as a value and data type.

Parameters
instanceof object.
property_nameof meta property to set.
data_typeunquoted id
valueto set.
xctxof caller.

Definition at line 608 of file afw_object_meta.h.

◆ afw_object_meta_set_property_from_utf8_z

#define afw_object_meta_set_property_from_utf8_z (   instance,
  property_name,
  string_z,
  xctx 
)
Value:
property_name, string_z, xctx)
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.
Definition: afw_object.c:194

Set a string property in the meta of an object from utf8_z.

Parameters
instanceof object.
property_nameof meta property to set.
string_zzero terminate string.
xctxof caller.

Definition at line 592 of file afw_object_meta.h.

◆ afw_object_meta_set_property_type_property

#define afw_object_meta_set_property_type_property (   instance,
  property_name,
  property_type_property_name,
  value,
  xctx 
)
Value:
afw_object_meta_get_property_type(instance, property_name, xctx), \
property_type_property_name, value, xctx)
const afw_object_t * afw_object_meta_get_property_type(const afw_object_t *instance, const afw_utf8_t *property_name, afw_xctx_t *xctx)
Get the property type object for an object's property from the meta of an object, creating it if need...

Set a property type property for a property in the meta of an object.

Parameters
instanceof object.
property_nameof property in instance.
property_type_property_nameis name of property in property type.
valueto set.
xctxof caller.

Definition at line 624 of file afw_object_meta.h.

◆ afw_object_meta_set_property_type_property_as

#define afw_object_meta_set_property_type_property_as (   instance,
  property_name,
  property_type_property_name,
  data_type,
  value,
  xctx 
)
Value:
afw_object_set_property_as_ ## data_type( \
afw_object_meta_get_property_type(instance, property_name, xctx), \
property_type_property_name, value, xctx)

Set a property type property for a property in the meta of an object as a value and data type.

Parameters
instanceof object.
property_nameof meta property to set.
property_type_property_nameis name of property in property type.
data_typeunquoted id
valueto set.
xctxof caller.

Definition at line 659 of file afw_object_meta.h.

◆ afw_object_meta_set_property_type_property_from_utf8_z

#define afw_object_meta_set_property_type_property_from_utf8_z (   instance,
  property_name,
  property_type_property_name,
  string_z,
  xctx 
)
Value:
afw_object_meta_get_property_type(instance, property_name, xctx), \
property_type_property_name, string_z, xctx)

Set a property type string property for a property in the meta of an object from utf8_z.

Parameters
instanceof object.
property_nameof property in instance.
property_type_property_nameis name of property in property type.
string_zzero terminate string.
xctxof caller.

Definition at line 641 of file afw_object_meta.h.

Function Documentation

◆ afw_object_meta_add_error()

void afw_object_meta_add_error ( const afw_object_t instance,
const afw_utf8_t message,
afw_xctx_t xctx 
)

Add an error message to instance's meta.

Parameters
instanceof object.
messageto add.
xctxof caller.

Definition at line 582 of file afw_object_meta.c.

◆ afw_object_meta_add_needed_object_type()

void afw_object_meta_add_needed_object_type ( const afw_object_t instance,
const afw_object_t object_type,
afw_xctx_t xctx 
)

Add a needed object type object.

Parameters
instanceof object.
object_typeobject.
xctxof caller.

An error is thrown if the object is immutable.

This will add/replace a property with then property name of the supplied object type in the meta objectTypes property of the instance's entity.

Definition at line 67 of file afw_object_meta.c.

◆ afw_object_meta_add_parent_path()

void afw_object_meta_add_parent_path ( const afw_object_t instance,
const afw_utf8_t parent_path,
afw_xctx_t xctx 
)

Add a parent path to instance's meta.

Parameters
instanceof object.
parent_path.
xctxof caller.

If the object already has a parent path, this one will be added to the end.

Definition at line 139 of file afw_object_meta.c.

◆ afw_object_meta_add_property_error()

void afw_object_meta_add_property_error ( const afw_object_t instance,
const afw_utf8_t property_name,
const afw_utf8_t message,
afw_xctx_t xctx 
)

Add an error message for a property to instance's meta.

Parameters
instanceof object.
messageto add.
property_nameof property.
xctxof caller.

Definition at line 752 of file afw_object_meta.c.

◆ afw_object_meta_add_thrown_error()

void afw_object_meta_add_thrown_error ( const afw_object_t instance,
const afw_error_t error,
afw_xctx_t xctx 
)

Add a thrown error to instance's meta.

Parameters
instanceof object.
errorto add.
xctxof caller.

Definition at line 729 of file afw_object_meta.c.

◆ afw_object_meta_add_thrown_property_error()

void afw_object_meta_add_thrown_property_error ( const afw_object_t instance,
const afw_utf8_t property_name,
afw_integer_t  index,
const afw_error_t error,
afw_xctx_t xctx 
)

Add a thrown error for a property to instance's meta.

Parameters
instanceof object.
property_nameof property or NULL.
indexif list entry, otherwise -1.
errorto add.
xctxof caller.

If property_name is NULL, afw_object_meta_add_thrown_error() is called.

Todo:
FIXME: Is the desired??? Log error. afw_error_write_log(afw_log_priority_debug, error, xctx);

Definition at line 782 of file afw_object_meta.c.

◆ afw_object_meta_clone_and_set()

void afw_object_meta_clone_and_set ( const afw_object_t instance,
const afw_object_t from,
afw_xctx_t xctx 
)

Set object's meta using a clone of the meta of another object.

Parameters
instanceof object whose meta is to be set.
fromis object whose meta is to be cloned.
xctxof caller.

If the from object has no meta, this function just returns.

If the meta is already set in the instance, an error is thrown.

Definition at line 92 of file afw_object_meta.c.

◆ afw_object_meta_create_accessor_with_options()

const afw_object_t* afw_object_meta_create_accessor_with_options ( const afw_object_t instance,
const afw_object_options_t options,
const afw_pool_t p,
afw_xctx_t xctx 
)

Create an object instance to access an object's meta with options.

Parameters
instanceof object whose meta is to be accessed.
options.
pto use.
xctxof caller.
Returns
Object instance to access meta or NULL if there is none to access.

This is a special purpose and limited implementation of the afw_object inteface. It only implements the get_next_property() and afw_object_release() methods – all other methods will throw an error.

The original purpose of this implementation is for implementations of the write_value) method of the afw_content_type interface to assist in producing the requested meta information. See afw_json_from_value.c for an example of its use.

Definition at line 36 of file afw_object_meta_accessor.c.

◆ afw_object_meta_get_nonempty_delta()

const afw_object_t* afw_object_meta_get_nonempty_delta ( const afw_object_t instance,
afw_xctx_t xctx 
)

Return meta delta object for an object creating an empty one if needed.

Parameters
instanceof object whose meta object is to be returned.
xctxof caller.
Returns
meta object.

Definition at line 440 of file afw_object_meta.c.

◆ afw_object_meta_get_nonempty_meta_object()

const afw_object_meta_object_t* afw_object_meta_get_nonempty_meta_object ( const afw_object_t instance,
afw_xctx_t xctx 
)

Return meta object for an object creating an empty one if needed.

Parameters
instanceof object whose meta object is to be returned.
xctxof caller.
Returns
meta object.

Definition at line 422 of file afw_object_meta.c.

◆ afw_object_meta_get_object_id()

const afw_utf8_t* afw_object_meta_get_object_id ( const afw_object_t instance,
afw_xctx_t xctx 
)

Get entity object's object id.

Parameters
instanceof object.
xctxof caller.
Returns
object id or NULL.

Definition at line 199 of file afw_object_meta.c.

◆ afw_object_meta_get_object_id_value()

const afw_value_string_t* afw_object_meta_get_object_id_value ( const afw_object_t instance,
afw_xctx_t xctx 
)

Get entity object's object id value.

Parameters
instanceof object.
xctxof caller.
Returns
object id or NULL.
Todo:
FIXME: Check meta first?? Store in meta???

Definition at line 119 of file afw_object_meta.c.

◆ afw_object_meta_get_parent_paths_value()

const afw_value_list_t* afw_object_meta_get_parent_paths_value ( const afw_object_t instance,
afw_xctx_t xctx 
)

Get meta parentPaths property value.

Parameters
instanceof object.
xctxof caller.
Returns
parent paths value or NULL.

Definition at line 171 of file afw_object_meta.c.

◆ afw_object_meta_get_path()

const afw_utf8_t* afw_object_meta_get_path ( const afw_object_t instance,
afw_xctx_t xctx 
)

Get an object's path.

Parameters
instanceof object.
xctxof caller.
Returns
path or NULL.

If the object does not have a path, is an embedded object, and is not a const object (has a p), afw_object_path_make_for_embedded) will be used to make the path and that path will be stored as the object's path. This works this way so that paths do not have to be created for embedded objects unless the are accessed, so as the use of the inheritedFrom object option.

If a object is a const object and does not have a path, NULL is returned.

Todo:
FIXME: prune to just path.

Definition at line 231 of file afw_object_meta.c.

◆ afw_object_meta_get_property_name()

const afw_utf8_t* afw_object_meta_get_property_name ( const afw_object_t instance,
afw_xctx_t xctx 
)

Get object's property name in embedding object.

Parameters
instanceof object.
xctxof caller.
Returns
property name or NULL.

Definition at line 215 of file afw_object_meta.c.

◆ afw_object_meta_get_property_type()

const afw_object_t* afw_object_meta_get_property_type ( const afw_object_t instance,
const afw_utf8_t property_name,
afw_xctx_t xctx 
)

Get the property type object for an object's property from the meta of an object, creating it if needed.

Parameters
instanceof object.
property_nameof property in instance.
xctxof caller.

Definition at line 262 of file afw_object_meta.c.

◆ afw_object_meta_has_errors()

afw_boolean_t afw_object_meta_has_errors ( const afw_object_t instance,
afw_xctx_t xctx 
)

Check if object flagged for errors.

Parameters
instanceof object.
xctxof caller.
Returns
true if meta property hasError is true.

Definition at line 610 of file afw_object_meta.c.

◆ afw_object_meta_log_errors()

void afw_object_meta_log_errors ( const afw_object_t instance,
const afw_utf8_t source_location,
afw_xctx_t xctx 
)

Log meta errors.

Parameters
instanceof object.
source_locationto preface log messages.
xctxof caller.

Definition at line 653 of file afw_object_meta.c.

◆ afw_object_meta_set_empty()

const afw_object_t* afw_object_meta_set_empty ( const afw_object_t instance,
afw_xctx_t xctx 
)

Create and set object's meta to an empty object and return delta.

Parameters
instanceof object whose meta is to be set to empty object.
xctxof caller.
Returns
meta object added.

Create an new unmanaged object to hold the object meta in the pool of the instance and set instance->meta to that object.

Definition at line 398 of file afw_object_meta.c.

◆ afw_object_meta_set_ids()

void afw_object_meta_set_ids ( const afw_object_t instance,
const afw_utf8_t adaptor_id,
const afw_utf8_t object_type_id,
const afw_utf8_t object_id,
afw_xctx_t xctx 
)

Set object's ids.

Parameters
instanceof object.
adaptor_id
object_type_id
object_id
xctxof caller.

This produces the same results as afw_object_meta_set_ids_using_path().

An error is thrown if the object is immutable.

Definition at line 510 of file afw_object_meta.c.

◆ afw_object_meta_set_ids_using_path()

void afw_object_meta_set_ids_using_path ( const afw_object_t instance,
const afw_utf8_t path,
afw_xctx_t xctx 
)

Set object's ids using path.

Parameters
instanceof object.
path
xctxof caller.

This produces the same results as afw_object_meta_set_ids().

An error is thrown if the object is immutable.

Definition at line 538 of file afw_object_meta.c.

◆ afw_object_meta_set_meta_object()

afw_object_meta_set_meta_object ( const afw_object_t instance,
const afw_object_t meta,
afw_xctx_t xctx 
)

Set an object's meta from a meta object.

Parameters
instanceof object whose meta is to be set.
metaobject.
xctxof caller.

This will set an instances parentPaths and path meta from a meta object. The meta must have a lifetime as long as the instance.

Todo:
FIXME: Decide if meta object is validated at this point or later. Probably now or with a different call.

Definition at line 315 of file afw_object_meta.c.

◆ afw_object_meta_set_object_type()

void afw_object_meta_set_object_type ( const afw_object_t instance,
const afw_object_type_t object_type,
afw_xctx_t xctx 
)

Set object's object type id.

Parameters
instanceof object.
object_typeof object.
xctxof caller.

An error is thrown if the object is immutable.

Definition at line 460 of file afw_object_meta.c.

◆ afw_object_meta_set_object_type_id()

void afw_object_meta_set_object_type_id ( const afw_object_t instance,
const afw_utf8_t object_type_id,
afw_xctx_t xctx 
)

Set object's object type id.

Parameters
instanceof object.
object_type_idof object.
xctxof caller.

An error is thrown if the object is immutable.

Definition at line 479 of file afw_object_meta.c.

◆ afw_object_meta_set_parent_paths()

void afw_object_meta_set_parent_paths ( const afw_object_t instance,
const afw_value_list_t parent_paths,
afw_xctx_t xctx 
)

Set meta parentPaths property.

Parameters
instanceof object.
parent_pathsvalue.
xctxof caller.

Definition at line 493 of file afw_object_meta.c.

◆ afw_object_meta_set_read_only()

void afw_object_meta_set_read_only ( const afw_object_t instance,
afw_xctx_t xctx 
)

Set object's meta to indicate object is read-only.

Parameters
instanceof object.
xctxof caller.

This sets allowChange and allowDelete to false in meta.

Definition at line 569 of file afw_object_meta.c.