Classes | Functions | Variables
protobuf/php/ext/google/protobuf/array.c File Reference
#include "array.h"
#include <Zend/zend_API.h>
#include <Zend/zend_interfaces.h>
#include <ext/spl/spl_iterators.h>
#include <Zend/zend_exceptions.h>
#include "arena.h"
#include "convert.h"
#include "def.h"
#include "message.h"
#include "php-upb.h"
#include "protobuf.h"
Include dependency graph for protobuf/php/ext/google/protobuf/array.c:

Go to the source code of this file.

Classes

struct  RepeatedField
 
struct  RepeatedFieldIter
 

Functions

void Array_ModuleInit ()
 
bool ArrayEq (const upb_array *a1, const upb_array *a2, TypeInfo type)
 
 PHP_METHOD (RepeatedField, __construct)
 
 PHP_METHOD (RepeatedField, append)
 
 PHP_METHOD (RepeatedField, count)
 
 PHP_METHOD (RepeatedField, getIterator)
 
 PHP_METHOD (RepeatedField, offsetExists)
 
 PHP_METHOD (RepeatedField, offsetGet)
 
 PHP_METHOD (RepeatedField, offsetSet)
 
 PHP_METHOD (RepeatedField, offsetUnset)
 
 PHP_METHOD (RepeatedFieldIter, current)
 
 PHP_METHOD (RepeatedFieldIter, key)
 
 PHP_METHOD (RepeatedFieldIter, next)
 
 PHP_METHOD (RepeatedFieldIter, rewind)
 
 PHP_METHOD (RepeatedFieldIter, valid)
 
static zend_object * RepeatedField_clone_obj (PROTO_VAL *object)
 
static int RepeatedField_compare_objects (zval *rf1, zval *rf2)
 
static zend_object * RepeatedField_create (zend_class_entry *class_type)
 
static void RepeatedField_destructor (zend_object *obj)
 
void RepeatedField_GetPhpWrapper (zval *val, upb_array *arr, TypeInfo type, zval *arena)
 
static HashTable * RepeatedField_GetProperties (PROTO_VAL *object)
 
static zval * RepeatedField_GetPropertyPtrPtr (PROTO_VAL *object, PROTO_STR *member, int type, void **cache_slot)
 
upb_arrayRepeatedField_GetUpbArray (zval *val, TypeInfo type, upb_arena *arena)
 
zend_object * RepeatedFieldIter_create (zend_class_entry *class_type)
 
static void RepeatedFieldIter_dtor (zend_object *obj)
 
static void RepeatedFieldIter_make (zval *val, zval *repeated_field)
 

Variables

static zend_function_entry repeated_field_iter_methods []
 
static zend_object_handlers repeated_field_iter_object_handlers
 
static zend_function_entry repeated_field_methods []
 
zend_class_entry * RepeatedField_class_entry
 
static zend_object_handlers RepeatedField_object_handlers
 
zend_class_entry * RepeatedFieldIter_class_entry
 

Function Documentation

◆ Array_ModuleInit()

void Array_ModuleInit ( )

Array_ModuleInit()

Called when the C extension is loaded to register all types.

Definition at line 634 of file protobuf/php/ext/google/protobuf/array.c.

◆ ArrayEq()

bool ArrayEq ( const upb_array a1,
const upb_array a2,
TypeInfo  type 
)

Definition at line 217 of file protobuf/php/ext/google/protobuf/array.c.

◆ PHP_METHOD() [1/13]

PHP_METHOD ( RepeatedField  ,
__construct   
)

RepeatedField::__construct()

Constructs an instance of RepeatedField.

Parameters
longType of the stored element.
stringMessage/Enum class.

Definition at line 246 of file protobuf/php/ext/google/protobuf/array.c.

◆ PHP_METHOD() [2/13]

PHP_METHOD ( RepeatedField  ,
append   
)

RepeatedField::append()

Append element to the end of the repeated field.

Parameters
objectThe element to be added.

Definition at line 275 of file protobuf/php/ext/google/protobuf/array.c.

◆ PHP_METHOD() [3/13]

PHP_METHOD ( RepeatedField  ,
count   
)

RepeatedField::count()

Implements the Countable interface. Invoked when PHP code calls:

$len = count($arr); Return the number of stored elements. This will also be called for: count($arr)

Returns
long The number of stored elements.

Definition at line 428 of file protobuf/php/ext/google/protobuf/array.c.

◆ PHP_METHOD() [4/13]

PHP_METHOD ( RepeatedField  ,
getIterator   
)

RepeatedField::getIterator()

Implements the IteratorAggregate interface. Invoked when PHP code calls:

foreach ($arr) {}

Returns
object Beginning iterator.

Definition at line 447 of file protobuf/php/ext/google/protobuf/array.c.

◆ PHP_METHOD() [5/13]

PHP_METHOD ( RepeatedField  ,
offsetExists   
)

RepeatedField::offsetExists()

Implements the ArrayAccess interface. Invoked when PHP code calls:

isset($arr[$idx]); empty($arr[$idx]);

Parameters
longThe index to be checked.
Returns
bool True if the element at the given index exists.

Definition at line 300 of file protobuf/php/ext/google/protobuf/array.c.

◆ PHP_METHOD() [6/13]

PHP_METHOD ( RepeatedField  ,
offsetGet   
)

RepeatedField::offsetGet()

Implements the ArrayAccess interface. Invoked when PHP code calls:

$x = $arr[$idx];

Parameters
longThe index of the element to be fetched.
Returns
object The stored element at given index.
Exceptions
Invalidtype for index.
Non-existingindex.

Definition at line 323 of file protobuf/php/ext/google/protobuf/array.c.

◆ PHP_METHOD() [7/13]

PHP_METHOD ( RepeatedField  ,
offsetSet   
)

RepeatedField::offsetSet()

Implements the ArrayAccess interface. Invoked when PHP code calls:

$arr[$idx] = $x; $arr []= $x; // Append

Parameters
longThe index of the element to be assigned.
objectThe element to be assigned.
Exceptions
Invalidtype for index.
Non-existingindex.
Incorrecttype of the element.

Definition at line 357 of file protobuf/php/ext/google/protobuf/array.c.

◆ PHP_METHOD() [8/13]

PHP_METHOD ( RepeatedField  ,
offsetUnset   
)

RepeatedField::offsetUnset()

Implements the ArrayAccess interface. Invoked when PHP code calls:

unset($arr[$idx]);

Parameters
longThe index of the element to be removed.
Exceptions
Invalidtype for index.
Theelement to be removed is not at the end of the RepeatedField.

Definition at line 399 of file protobuf/php/ext/google/protobuf/array.c.

◆ PHP_METHOD() [9/13]

PHP_METHOD ( RepeatedFieldIter  ,
current   
)

RepeatedFieldIter::current()

Implements the Iterator interface. Returns the current value.

Definition at line 567 of file protobuf/php/ext/google/protobuf/array.c.

◆ PHP_METHOD() [10/13]

PHP_METHOD ( RepeatedFieldIter  ,
key   
)

RepeatedFieldIter::key()

Implements the Iterator interface. Returns the current key.

Definition at line 590 of file protobuf/php/ext/google/protobuf/array.c.

◆ PHP_METHOD() [11/13]

PHP_METHOD ( RepeatedFieldIter  ,
next   
)

RepeatedFieldIter::next()

Implements the Iterator interface. Advances to the next element.

Definition at line 600 of file protobuf/php/ext/google/protobuf/array.c.

◆ PHP_METHOD() [12/13]

PHP_METHOD ( RepeatedFieldIter  ,
rewind   
)

RepeatedFieldIter::rewind()

Implements the Iterator interface. Sets the iterator to the first element.

Definition at line 557 of file protobuf/php/ext/google/protobuf/array.c.

◆ PHP_METHOD() [13/13]

PHP_METHOD ( RepeatedFieldIter  ,
valid   
)

RepeatedFieldIter::valid()

Implements the Iterator interface. Returns true if this is a valid element.

Definition at line 610 of file protobuf/php/ext/google/protobuf/array.c.

◆ RepeatedField_clone_obj()

static zend_object* RepeatedField_clone_obj ( PROTO_VAL object)
static

RepeatedField_clone_obj()

Object handler for cloning an object in PHP. Called when PHP code does:

$rf2 = clone $rf1;

Definition at line 121 of file protobuf/php/ext/google/protobuf/array.c.

◆ RepeatedField_compare_objects()

static int RepeatedField_compare_objects ( zval *  rf1,
zval *  rf2 
)
static

RepeatedField_compare_objects()

Object handler for comparing two repeated field objects. Called whenever PHP code does:

$rf1 == $rf2

Definition at line 104 of file protobuf/php/ext/google/protobuf/array.c.

◆ RepeatedField_create()

static zend_object* RepeatedField_create ( zend_class_entry *  class_type)
static

RepeatedField_create()

PHP class entry function to allocate and initialize a new RepeatedField object.

Definition at line 72 of file protobuf/php/ext/google/protobuf/array.c.

◆ RepeatedField_destructor()

static void RepeatedField_destructor ( zend_object *  obj)
static

RepeatedField_dtor()

Object handler to destroy a RepeatedField. This releases all resources associated with the message. Note that it is possible to access a destroyed object from PHP in rare cases.

Definition at line 89 of file protobuf/php/ext/google/protobuf/array.c.

◆ RepeatedField_GetPhpWrapper()

void RepeatedField_GetPhpWrapper ( zval *  val,
upb_array arr,
TypeInfo  type,
zval *  arena 
)

Definition at line 152 of file protobuf/php/ext/google/protobuf/array.c.

◆ RepeatedField_GetProperties()

static HashTable* RepeatedField_GetProperties ( PROTO_VAL object)
static

Definition at line 138 of file protobuf/php/ext/google/protobuf/array.c.

◆ RepeatedField_GetPropertyPtrPtr()

static zval* RepeatedField_GetPropertyPtrPtr ( PROTO_VAL object,
PROTO_STR member,
int  type,
void **  cache_slot 
)
static

Definition at line 142 of file protobuf/php/ext/google/protobuf/array.c.

◆ RepeatedField_GetUpbArray()

upb_array* RepeatedField_GetUpbArray ( zval *  val,
TypeInfo  type,
upb_arena arena 
)

Definition at line 172 of file protobuf/php/ext/google/protobuf/array.c.

◆ RepeatedFieldIter_create()

zend_object* RepeatedFieldIter_create ( zend_class_entry *  class_type)

RepeatedFieldIter_create()

PHP class entry function to allocate and initialize a new RepeatedFieldIter object.

Definition at line 502 of file protobuf/php/ext/google/protobuf/array.c.

◆ RepeatedFieldIter_dtor()

static void RepeatedFieldIter_dtor ( zend_object *  obj)
static

RepeatedFieldIter_dtor()

Object handler to destroy a RepeatedFieldIter. This releases all resources associated with the message. Note that it is possible to access a destroyed object from PHP in rare cases.

Definition at line 519 of file protobuf/php/ext/google/protobuf/array.c.

◆ RepeatedFieldIter_make()

static void RepeatedFieldIter_make ( zval *  val,
zval *  repeated_field 
)
static

RepeatedFieldIter_make()

C function to create a RepeatedFieldIter.

Definition at line 530 of file protobuf/php/ext/google/protobuf/array.c.

Variable Documentation

◆ repeated_field_iter_methods

zend_function_entry repeated_field_iter_methods[]
static
Initial value:
= {
ZEND_FE_END
}

Definition at line 616 of file protobuf/php/ext/google/protobuf/array.c.

◆ repeated_field_iter_object_handlers

zend_object_handlers repeated_field_iter_object_handlers
static

Definition at line 494 of file protobuf/php/ext/google/protobuf/array.c.

◆ repeated_field_methods

zend_function_entry repeated_field_methods[]
static
Initial value:
= {
ZEND_FE_END
}

Definition at line 471 of file protobuf/php/ext/google/protobuf/array.c.

◆ RepeatedField_class_entry

zend_class_entry* RepeatedField_class_entry

Definition at line 61 of file protobuf/php/ext/google/protobuf/array.c.

◆ RepeatedField_object_handlers

zend_object_handlers RepeatedField_object_handlers
static

Definition at line 62 of file protobuf/php/ext/google/protobuf/array.c.

◆ RepeatedFieldIter_class_entry

zend_class_entry* RepeatedFieldIter_class_entry

Definition at line 493 of file protobuf/php/ext/google/protobuf/array.c.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:03