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

Go to the source code of this file.

Classes

struct  MapField
 
struct  MapFieldIter
 

Functions

static TypeInfo KeyType (MapField_Type type)
 
static void map_field_iter_dtor (zend_object *obj)
 
static HashTable * Map_GetProperties (PROTO_VAL *object)
 
static zval * Map_GetPropertyPtrPtr (PROTO_VAL *object, PROTO_STR *member, int type, void **cache_slot)
 
void Map_ModuleInit ()
 
bool MapEq (const upb_map *m1, const upb_map *m2, MapField_Type type)
 
static zend_object * MapField_clone_obj (PROTO_VAL *object)
 
static int MapField_compare_objects (zval *map1, zval *map2)
 
static zend_object * MapField_create (zend_class_entry *class_type)
 
static void MapField_destructor (zend_object *obj)
 
void MapField_GetPhpWrapper (zval *val, upb_map *map, MapField_Type type, zval *arena)
 
upb_mapMapField_GetUpbMap (zval *val, MapField_Type type, upb_arena *arena)
 
zend_object * MapFieldIter_create (zend_class_entry *class_type)
 
static void MapFieldIter_make (zval *val, zval *map_field)
 
static bool MapType_Eq (MapField_Type a, MapField_Type b)
 
MapField_Type MapType_Get (const upb_fielddef *f)
 
 PHP_METHOD (MapField, __construct)
 
 PHP_METHOD (MapField, count)
 
 PHP_METHOD (MapField, getIterator)
 
 PHP_METHOD (MapField, offsetExists)
 
 PHP_METHOD (MapField, offsetGet)
 
 PHP_METHOD (MapField, offsetSet)
 
 PHP_METHOD (MapField, offsetUnset)
 
 PHP_METHOD (MapFieldIter, current)
 
 PHP_METHOD (MapFieldIter, key)
 
 PHP_METHOD (MapFieldIter, next)
 
 PHP_METHOD (MapFieldIter, rewind)
 
 PHP_METHOD (MapFieldIter, valid)
 

Variables

static zend_function_entry map_field_iter_methods []
 
zend_class_entry * MapField_class_entry
 
static zend_function_entry MapField_methods []
 
static zend_object_handlers MapField_object_handlers
 
zend_class_entry * MapFieldIter_class_entry
 
static zend_object_handlers MapFieldIter_object_handlers
 

Function Documentation

◆ KeyType()

static TypeInfo KeyType ( MapField_Type  type)
static

Definition at line 64 of file protobuf/php/ext/google/protobuf/map.c.

◆ map_field_iter_dtor()

static void map_field_iter_dtor ( zend_object *  obj)
static

MapFieldIter_dtor()

Object handler to destroy a MapFieldIter. 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 512 of file protobuf/php/ext/google/protobuf/map.c.

◆ Map_GetProperties()

static HashTable* Map_GetProperties ( PROTO_VAL object)
static

Definition at line 159 of file protobuf/php/ext/google/protobuf/map.c.

◆ Map_GetPropertyPtrPtr()

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

Definition at line 154 of file protobuf/php/ext/google/protobuf/map.c.

◆ Map_ModuleInit()

void Map_ModuleInit ( )

Map_ModuleInit()

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

Definition at line 631 of file protobuf/php/ext/google/protobuf/map.c.

◆ MapEq()

bool MapEq ( const upb_map m1,
const upb_map m2,
MapField_Type  type 
)

Definition at line 236 of file protobuf/php/ext/google/protobuf/map.c.

◆ MapField_clone_obj()

static zend_object* MapField_clone_obj ( PROTO_VAL object)
static

MapField_clone_obj()

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

$map2 = clone $map1;

Definition at line 136 of file protobuf/php/ext/google/protobuf/map.c.

◆ MapField_compare_objects()

static int MapField_compare_objects ( zval *  map1,
zval *  map2 
)
static

MapField_compare_objects()

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

$map1 == $map2

Definition at line 119 of file protobuf/php/ext/google/protobuf/map.c.

◆ MapField_create()

static zend_object* MapField_create ( zend_class_entry *  class_type)
static

MapField_create()

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

Definition at line 87 of file protobuf/php/ext/google/protobuf/map.c.

◆ MapField_destructor()

static void MapField_destructor ( zend_object *  obj)
static

MapField_dtor()

Object handler to destroy a MapField. 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 104 of file protobuf/php/ext/google/protobuf/map.c.

◆ MapField_GetPhpWrapper()

void MapField_GetPhpWrapper ( zval *  val,
upb_map map,
MapField_Type  type,
zval *  arena 
)

Definition at line 167 of file protobuf/php/ext/google/protobuf/map.c.

◆ MapField_GetUpbMap()

upb_map* MapField_GetUpbMap ( zval *  val,
MapField_Type  type,
upb_arena arena 
)

Definition at line 187 of file protobuf/php/ext/google/protobuf/map.c.

◆ MapFieldIter_create()

zend_object* MapFieldIter_create ( zend_class_entry *  class_type)

MapFieldIter_create()

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

Definition at line 495 of file protobuf/php/ext/google/protobuf/map.c.

◆ MapFieldIter_make()

static void MapFieldIter_make ( zval *  val,
zval *  map_field 
)
static

MapFieldIter_make()

Function to create a MapFieldIter directly from C.

Definition at line 523 of file protobuf/php/ext/google/protobuf/map.c.

◆ MapType_Eq()

static bool MapType_Eq ( MapField_Type  a,
MapField_Type  b 
)
static

Definition at line 60 of file protobuf/php/ext/google/protobuf/map.c.

◆ MapType_Get()

MapField_Type MapType_Get ( const upb_fielddef f)

Definition at line 69 of file protobuf/php/ext/google/protobuf/map.c.

◆ PHP_METHOD() [1/12]

PHP_METHOD ( MapField  ,
__construct   
)

MapField::__construct()

Constructs an instance of MapField.

Parameters
longKey type.
longValue type.
stringMessage/Enum class (message/enum value types only).

Definition at line 266 of file protobuf/php/ext/google/protobuf/map.c.

◆ PHP_METHOD() [2/12]

PHP_METHOD ( MapField  ,
count   
)

MapField::count()

Implements the Countable interface. Invoked when PHP code calls:

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

Returns
long The number of stored elements.

Definition at line 425 of file protobuf/php/ext/google/protobuf/map.c.

◆ PHP_METHOD() [3/12]

PHP_METHOD ( MapField  ,
getIterator   
)

MapField::getIterator()

Implements the IteratorAggregate interface. Invoked when PHP code calls:

foreach ($arr) {}

Returns
object Beginning iterator.

Definition at line 444 of file protobuf/php/ext/google/protobuf/map.c.

◆ PHP_METHOD() [4/12]

PHP_METHOD ( MapField  ,
offsetExists   
)

MapField::offsetExists()

Implements the ArrayAccess interface. Invoked when PHP code calls:

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

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

Definition at line 318 of file protobuf/php/ext/google/protobuf/map.c.

◆ PHP_METHOD() [5/12]

PHP_METHOD ( MapField  ,
offsetGet   
)

MapField::offsetGet()

Implements the ArrayAccess interface. Invoked when PHP code calls:

$x = $map[$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 343 of file protobuf/php/ext/google/protobuf/map.c.

◆ PHP_METHOD() [6/12]

PHP_METHOD ( MapField  ,
offsetSet   
)

MapField::offsetSet()

Implements the ArrayAccess interface. Invoked when PHP code calls:

$map[$idx] = $x;

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 376 of file protobuf/php/ext/google/protobuf/map.c.

◆ PHP_METHOD() [7/12]

PHP_METHOD ( MapField  ,
offsetUnset   
)

MapField::offsetUnset()

Implements the ArrayAccess interface. Invoked when PHP code calls:

unset($map[$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 MapField.

Definition at line 402 of file protobuf/php/ext/google/protobuf/map.c.

◆ PHP_METHOD() [8/12]

PHP_METHOD ( MapFieldIter  ,
current   
)

MapFieldIter::current()

Implements the Iterator interface. Returns the current value.

Definition at line 566 of file protobuf/php/ext/google/protobuf/map.c.

◆ PHP_METHOD() [9/12]

PHP_METHOD ( MapFieldIter  ,
key   
)

MapFieldIter::key()

Implements the Iterator interface. Returns the current key.

Definition at line 580 of file protobuf/php/ext/google/protobuf/map.c.

◆ PHP_METHOD() [10/12]

PHP_METHOD ( MapFieldIter  ,
next   
)

MapFieldIter::next()

Implements the Iterator interface. Advances to the next element.

Definition at line 594 of file protobuf/php/ext/google/protobuf/map.c.

◆ PHP_METHOD() [11/12]

PHP_METHOD ( MapFieldIter  ,
rewind   
)

MapFieldIter::rewind()

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

Definition at line 554 of file protobuf/php/ext/google/protobuf/map.c.

◆ PHP_METHOD() [12/12]

PHP_METHOD ( MapFieldIter  ,
valid   
)

MapFieldIter::valid()

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

Definition at line 605 of file protobuf/php/ext/google/protobuf/map.c.

Variable Documentation

◆ map_field_iter_methods

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

Definition at line 612 of file protobuf/php/ext/google/protobuf/map.c.

◆ MapField_class_entry

zend_class_entry* MapField_class_entry

Definition at line 57 of file protobuf/php/ext/google/protobuf/map.c.

◆ MapField_methods

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

Definition at line 465 of file protobuf/php/ext/google/protobuf/map.c.

◆ MapField_object_handlers

zend_object_handlers MapField_object_handlers
static

Definition at line 58 of file protobuf/php/ext/google/protobuf/map.c.

◆ MapFieldIter_class_entry

zend_class_entry* MapFieldIter_class_entry

Definition at line 486 of file protobuf/php/ext/google/protobuf/map.c.

◆ MapFieldIter_object_handlers

zend_object_handlers MapFieldIter_object_handlers
static

Definition at line 487 of file protobuf/php/ext/google/protobuf/map.c.



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