Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

iarray_allocate(3) [debian man page]

iarray_allocate(3)					     Library Functions Manual						iarray_allocate(3)

NAME
iarray_allocate - get pointer to nth element in iarray SYNTAX
#include <iarray.h> void* iarray_allocate(iarray* x, size_t pos); iarray x; size_t pos; t* p = iarray_allocate(&x,pos); DESCRIPTION
iarray_allocate is similar to iarray_get, but if the requested element is not in the array, the array will be resized. If the resize fails, iarray_allocate returns NULL and leaves the array untouched. This function is safe to use in environments with multiple threads, but it can block for indeterminate time if other threads are reallocat- ing the array at the same time. Note that it is safe to use iarray_allocate where you would otherwise use iarray_get. The only reason to use iarray_get over iarray_allo- cate would be optimization. RETURN VALUE
Return a pointer to the requested element. If there was a memory allocation failure, returns NULL. SEE ALSO
iarray_init(3), iarray_get(3), iarray_free(3) iarray_allocate(3)

Check Out this Related Man Page

Tangram::Type::Array::FromOne(3pm)			User Contributed Perl Documentation			Tangram::Type::Array::FromOne(3pm)

NAME
Tangram::Type::Array::FromOne - map Perl arrays using a foreign key SYNOPSIS
use Tangram; # or use Tangram::Core; use Tangram::Type::Array::FromOne; $schema = Tangram::Schema->new( classes => { Agenda => { fields => { iarray => { # long form entries => { class => 'Entry', coll => 'agenda', }, # or (short form) entries => 'Entry', } DESCRIPTION
This class maps references to a Perl array in an intrusive fashion. The persistent fields are grouped in a hash under the "iarray" key in the field hash. The array may contain only objects of persistent classes. These classes must have a common persistent base class. Tangram uses two columns on the element's table to store: * the id of the object containing the collection * the position of the element in the collection CAUTION: the same object may not be an element of the same collection, in two different objects. This mapping may be used only for one-to- many relationships. The field names are passed in a hash that associates a field name with a field descriptor. The field descriptor may be either a hash or a string. The hash uses the following fields: * class * aggreg * back * coll * slot * deep_update Mandatory field "class" specifies the class of the elements. Optional field "aggreg" specifies that the elements of the collection must be removed (erased) from persistent storage along with the con- taining object. The default is not to aggregate. Optional field "back" sets the name of a field that is inserted in the elements. That field acts as a demand-loaded, read-only reference to the object containing the collection. Optional field "coll" sets the name the column containing the id of the containing object. This defaults to 'C_m', where 'C' is the class of the containing object, and 'm' is the field name. Optional field "slot" sets the name the column containing the id of the containing object. This defaults to 'C_m_slot', where 'C' is the class of the containing object, and 'm' is the field name. The "C" in C_m and C_m_slot are passed through the schema normalisation function before being combined into a column name. Optional field "deep_update" specificies that all elements have to be updated automatically when "update" is called on the collection object. Automatic update ensures consisitency between the Perl representation and the DBMS state, but degrades update performance so use it with caution. The default is not to do automatic updates. If the descriptor is a string, it is interpreted as the name of the element's class. This is equivalent to specifying only the "class" field in the hash variant. perl v5.8.8 2006-03-29 Tangram::Type::Array::FromOne(3pm)
Man Page