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

Files

file  afw_object_type.h
 Object type helpers.
 

Data Structures

struct  afw_object_type_s
 Struct for afw_object_type_t. More...
 
struct  afw_object_type_extended_data_type_s
 
struct  afw_object_type_property_type_s
 Struct for afw_object_type_property_type_t. More...
 

Macros

#define afw_object_type_get_property(object_type, property_name, xctx)
 Get a object type property. More...
 
#define afw_object_type_get_property_as_utf8(object_type_object, property_name, xctx)
 Get a meta property as utf8. More...
 

Typedefs

typedef struct afw_object_type_extended_data_type_s afw_object_type_extended_data_type_t
 

Functions

const afw_object_type_tafw_object_type_internal_create (const afw_adaptor_t *adaptor, const afw_object_t *object_type_object, const afw_pool_t *p, afw_xctx_t *xctx)
 Create an object type. More...
 
const afw_object_type_property_type_tafw_object_type_property_type_get (const afw_object_type_t *object_type, const afw_utf8_t *property_name, afw_xctx_t *xctx)
 Get property type object for property. More...
 
const afw_object_type_property_type_tafw_object_type_property_type_get_next (const afw_object_type_t *object_type, const afw_iterator_t **iterator, const afw_utf8_t **property_name, afw_xctx_t *xctx)
 Get next property type for object type. More...
 
const afw_value_tafw_object_type_property_type_normalize (const afw_object_type_property_type_t *pt, const afw_value_t *value, const afw_pool_t *p, afw_xctx_t *xctx)
 Normalize a value based on property type. More...
 
const afw_value_tafw_object_type_property_normalize (const afw_object_type_t *object_type, const afw_utf8_t *property_name, const afw_value_t *value, const afw_pool_t *p, afw_xctx_t *xctx)
 Normalize a value based an object type and property name. More...
 

Detailed Description

Provide afw_object interface common support.

Macro Definition Documentation

◆ afw_object_type_get_property

#define afw_object_type_get_property (   object_type,
  property_name,
  xctx 
)
Value:
afw_object_get_property((object_type)->object_type_object, \
property_name, xctx)
#define afw_object_get_property(instance, property_name, xctx)
Call method get_property of interface afw_object.

Get a object type property.

Parameters
object_type.
property_nameis the object type property name.
xctxof caller.
Returns
value of object type property.

Definition at line 97 of file afw_object_type.h.

◆ afw_object_type_get_property_as_utf8

#define afw_object_type_get_property_as_utf8 (   object_type_object,
  property_name,
  xctx 
)
Value:
afw_object_old_get_property_as_utf8((object_type)->object_type_object, \
property_name, xctx)
afw_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.
Definition: afw_object.c:531

Get a meta property as utf8.

Parameters
object_type.
property_nameis the object type property name.
xctxof caller.
Returns
utf8 or NULL if not found.

Definition at line 110 of file afw_object_type.h.

Function Documentation

◆ afw_object_type_internal_create()

const afw_object_type_t* afw_object_type_internal_create ( const afw_adaptor_t adaptor,
const afw_object_t object_type_object,
const afw_pool_t p,
afw_xctx_t xctx 
)

Create an object type.

Parameters
adaptor
object_type_object.
pfor result.
xctxof caller.
Returns
object type.

Definition at line 62 of file afw_object_type.c.

◆ afw_object_type_property_normalize()

const afw_value_t* afw_object_type_property_normalize ( const afw_object_type_t object_type,
const afw_utf8_t property_name,
const afw_value_t value,
const afw_pool_t p,
afw_xctx_t xctx 
)

Normalize a value based an object type and property name.

Parameters
object_type.
property_nameto get property type for.
valueto normalize.
pto use.
xctxof caller.
Returns
normalized value or original value if already normalized.

Definition at line 222 of file afw_object_type.c.

◆ afw_object_type_property_type_get()

const afw_object_type_property_type_t* afw_object_type_property_type_get ( const afw_object_type_t object_type,
const afw_utf8_t property_name,
afw_xctx_t xctx 
)

Get property type object for property.

Parameters
object_type.
property_nameto get property type for.
xctxof caller.
Returns
property type or NULL if not found.

If there is not a specific property type object for the named property, the otherProperties property type is returned if available.

Definition at line 111 of file afw_object_type.c.

◆ afw_object_type_property_type_get_next()

const afw_object_type_property_type_t* afw_object_type_property_type_get_next ( const afw_object_type_t object_type,
const afw_iterator_t **  iterator,
const afw_utf8_t **  property_name,
afw_xctx_t xctx 
)

Get next property type for object type.

Parameters
object_type.
iteratorpointer. Set to NULL before first call.
property_nameis place to return pointer to property name.
xctxof caller.
Returns
property type or NULL if not found.
Todo:
FIXME: change after compile. This wastes a lot of time and space.

Definition at line 132 of file afw_object_type.c.

◆ afw_object_type_property_type_normalize()

const afw_value_t* afw_object_type_property_type_normalize ( const afw_object_type_property_type_t pt,
const afw_value_t value,
const afw_pool_t p,
afw_xctx_t xctx 
)

Normalize a value based on property type.

Parameters
pt.
valueto normalize.
pto use.
xctxof caller.
Returns
normalized value or original value if already normalized.
Todo:
FIXME: normalize list entries.

Definition at line 168 of file afw_object_type.c.