bloaty/third_party/protobuf/objectivec/GPBArray.h
Go to the documentation of this file.
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2015 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above
12 // copyright notice, this list of conditions and the following disclaimer
13 // in the documentation and/or other materials provided with the
14 // distribution.
15 // * Neither the name of Google Inc. nor the names of its
16 // contributors may be used to endorse or promote products derived from
17 // this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 #import <Foundation/Foundation.h>
32 
33 #import "GPBRuntimeTypes.h"
34 
35 NS_ASSUME_NONNULL_BEGIN
36 
37 //%PDDM-EXPAND DECLARE_ARRAYS()
38 // This block of code is generated, do not edit it directly.
39 
40 #pragma mark - Int32
41 
48 @interface GPBInt32Array : NSObject <NSCopying>
49 
51 @property(nonatomic, readonly) NSUInteger count;
52 
56 + (instancetype)array;
57 
65 + (instancetype)arrayWithValue:(int32_t)value;
66 
75 + (instancetype)arrayWithValueArray:(GPBInt32Array *)array;
76 
84 + (instancetype)arrayWithCapacity:(NSUInteger)count;
85 
89 - (instancetype)init NS_DESIGNATED_INITIALIZER;
90 
99 - (instancetype)initWithValues:(const int32_t [__nullable])values
100  count:(NSUInteger)count;
101 
109 - (instancetype)initWithValueArray:(GPBInt32Array *)array;
110 
118 - (instancetype)initWithCapacity:(NSUInteger)count;
119 
127 - (int32_t)valueAtIndex:(NSUInteger)index;
128 
137 - (void)enumerateValuesWithBlock:(void (NS_NOESCAPE ^)(int32_t value, NSUInteger idx, BOOL *stop))block;
138 
148 - (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
149  usingBlock:(void (NS_NOESCAPE ^)(int32_t value, NSUInteger idx, BOOL *stop))block;
150 
156 - (void)addValue:(int32_t)value;
157 
164 - (void)addValues:(const int32_t [__nullable])values count:(NSUInteger)count;
165 
171 - (void)addValuesFromArray:(GPBInt32Array *)array;
172 
179 - (void)insertValue:(int32_t)value atIndex:(NSUInteger)index;
180 
187 - (void)replaceValueAtIndex:(NSUInteger)index withValue:(int32_t)value;
188 
194 - (void)removeValueAtIndex:(NSUInteger)index;
195 
199 - (void)removeAll;
200 
207 - (void)exchangeValueAtIndex:(NSUInteger)idx1
208  withValueAtIndex:(NSUInteger)idx2;
209 
210 @end
211 
212 #pragma mark - UInt32
213 
220 @interface GPBUInt32Array : NSObject <NSCopying>
221 
223 @property(nonatomic, readonly) NSUInteger count;
224 
228 + (instancetype)array;
229 
237 + (instancetype)arrayWithValue:(uint32_t)value;
238 
247 + (instancetype)arrayWithValueArray:(GPBUInt32Array *)array;
248 
256 + (instancetype)arrayWithCapacity:(NSUInteger)count;
257 
261 - (instancetype)init NS_DESIGNATED_INITIALIZER;
262 
271 - (instancetype)initWithValues:(const uint32_t [__nullable])values
272  count:(NSUInteger)count;
273 
281 - (instancetype)initWithValueArray:(GPBUInt32Array *)array;
282 
290 - (instancetype)initWithCapacity:(NSUInteger)count;
291 
299 - (uint32_t)valueAtIndex:(NSUInteger)index;
300 
309 - (void)enumerateValuesWithBlock:(void (NS_NOESCAPE ^)(uint32_t value, NSUInteger idx, BOOL *stop))block;
310 
320 - (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
321  usingBlock:(void (NS_NOESCAPE ^)(uint32_t value, NSUInteger idx, BOOL *stop))block;
322 
328 - (void)addValue:(uint32_t)value;
329 
336 - (void)addValues:(const uint32_t [__nullable])values count:(NSUInteger)count;
337 
343 - (void)addValuesFromArray:(GPBUInt32Array *)array;
344 
351 - (void)insertValue:(uint32_t)value atIndex:(NSUInteger)index;
352 
359 - (void)replaceValueAtIndex:(NSUInteger)index withValue:(uint32_t)value;
360 
366 - (void)removeValueAtIndex:(NSUInteger)index;
367 
371 - (void)removeAll;
372 
379 - (void)exchangeValueAtIndex:(NSUInteger)idx1
380  withValueAtIndex:(NSUInteger)idx2;
381 
382 @end
383 
384 #pragma mark - Int64
385 
392 @interface GPBInt64Array : NSObject <NSCopying>
393 
395 @property(nonatomic, readonly) NSUInteger count;
396 
400 + (instancetype)array;
401 
409 + (instancetype)arrayWithValue:(int64_t)value;
410 
419 + (instancetype)arrayWithValueArray:(GPBInt64Array *)array;
420 
428 + (instancetype)arrayWithCapacity:(NSUInteger)count;
429 
433 - (instancetype)init NS_DESIGNATED_INITIALIZER;
434 
443 - (instancetype)initWithValues:(const int64_t [__nullable])values
444  count:(NSUInteger)count;
445 
453 - (instancetype)initWithValueArray:(GPBInt64Array *)array;
454 
462 - (instancetype)initWithCapacity:(NSUInteger)count;
463 
471 - (int64_t)valueAtIndex:(NSUInteger)index;
472 
481 - (void)enumerateValuesWithBlock:(void (NS_NOESCAPE ^)(int64_t value, NSUInteger idx, BOOL *stop))block;
482 
492 - (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
493  usingBlock:(void (NS_NOESCAPE ^)(int64_t value, NSUInteger idx, BOOL *stop))block;
494 
500 - (void)addValue:(int64_t)value;
501 
508 - (void)addValues:(const int64_t [__nullable])values count:(NSUInteger)count;
509 
515 - (void)addValuesFromArray:(GPBInt64Array *)array;
516 
523 - (void)insertValue:(int64_t)value atIndex:(NSUInteger)index;
524 
531 - (void)replaceValueAtIndex:(NSUInteger)index withValue:(int64_t)value;
532 
538 - (void)removeValueAtIndex:(NSUInteger)index;
539 
543 - (void)removeAll;
544 
551 - (void)exchangeValueAtIndex:(NSUInteger)idx1
552  withValueAtIndex:(NSUInteger)idx2;
553 
554 @end
555 
556 #pragma mark - UInt64
557 
564 @interface GPBUInt64Array : NSObject <NSCopying>
565 
567 @property(nonatomic, readonly) NSUInteger count;
568 
572 + (instancetype)array;
573 
581 + (instancetype)arrayWithValue:(uint64_t)value;
582 
591 + (instancetype)arrayWithValueArray:(GPBUInt64Array *)array;
592 
600 + (instancetype)arrayWithCapacity:(NSUInteger)count;
601 
605 - (instancetype)init NS_DESIGNATED_INITIALIZER;
606 
615 - (instancetype)initWithValues:(const uint64_t [__nullable])values
616  count:(NSUInteger)count;
617 
625 - (instancetype)initWithValueArray:(GPBUInt64Array *)array;
626 
634 - (instancetype)initWithCapacity:(NSUInteger)count;
635 
643 - (uint64_t)valueAtIndex:(NSUInteger)index;
644 
653 - (void)enumerateValuesWithBlock:(void (NS_NOESCAPE ^)(uint64_t value, NSUInteger idx, BOOL *stop))block;
654 
664 - (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
665  usingBlock:(void (NS_NOESCAPE ^)(uint64_t value, NSUInteger idx, BOOL *stop))block;
666 
672 - (void)addValue:(uint64_t)value;
673 
680 - (void)addValues:(const uint64_t [__nullable])values count:(NSUInteger)count;
681 
687 - (void)addValuesFromArray:(GPBUInt64Array *)array;
688 
695 - (void)insertValue:(uint64_t)value atIndex:(NSUInteger)index;
696 
703 - (void)replaceValueAtIndex:(NSUInteger)index withValue:(uint64_t)value;
704 
710 - (void)removeValueAtIndex:(NSUInteger)index;
711 
715 - (void)removeAll;
716 
723 - (void)exchangeValueAtIndex:(NSUInteger)idx1
724  withValueAtIndex:(NSUInteger)idx2;
725 
726 @end
727 
728 #pragma mark - Float
729 
736 @interface GPBFloatArray : NSObject <NSCopying>
737 
739 @property(nonatomic, readonly) NSUInteger count;
740 
744 + (instancetype)array;
745 
753 + (instancetype)arrayWithValue:(float)value;
754 
763 + (instancetype)arrayWithValueArray:(GPBFloatArray *)array;
764 
772 + (instancetype)arrayWithCapacity:(NSUInteger)count;
773 
777 - (instancetype)init NS_DESIGNATED_INITIALIZER;
778 
787 - (instancetype)initWithValues:(const float [__nullable])values
788  count:(NSUInteger)count;
789 
797 - (instancetype)initWithValueArray:(GPBFloatArray *)array;
798 
806 - (instancetype)initWithCapacity:(NSUInteger)count;
807 
815 - (float)valueAtIndex:(NSUInteger)index;
816 
825 - (void)enumerateValuesWithBlock:(void (NS_NOESCAPE ^)(float value, NSUInteger idx, BOOL *stop))block;
826 
836 - (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
837  usingBlock:(void (NS_NOESCAPE ^)(float value, NSUInteger idx, BOOL *stop))block;
838 
844 - (void)addValue:(float)value;
845 
852 - (void)addValues:(const float [__nullable])values count:(NSUInteger)count;
853 
859 - (void)addValuesFromArray:(GPBFloatArray *)array;
860 
867 - (void)insertValue:(float)value atIndex:(NSUInteger)index;
868 
875 - (void)replaceValueAtIndex:(NSUInteger)index withValue:(float)value;
876 
882 - (void)removeValueAtIndex:(NSUInteger)index;
883 
887 - (void)removeAll;
888 
895 - (void)exchangeValueAtIndex:(NSUInteger)idx1
896  withValueAtIndex:(NSUInteger)idx2;
897 
898 @end
899 
900 #pragma mark - Double
901 
908 @interface GPBDoubleArray : NSObject <NSCopying>
909 
911 @property(nonatomic, readonly) NSUInteger count;
912 
916 + (instancetype)array;
917 
925 + (instancetype)arrayWithValue:(double)value;
926 
935 + (instancetype)arrayWithValueArray:(GPBDoubleArray *)array;
936 
944 + (instancetype)arrayWithCapacity:(NSUInteger)count;
945 
949 - (instancetype)init NS_DESIGNATED_INITIALIZER;
950 
959 - (instancetype)initWithValues:(const double [__nullable])values
960  count:(NSUInteger)count;
961 
969 - (instancetype)initWithValueArray:(GPBDoubleArray *)array;
970 
978 - (instancetype)initWithCapacity:(NSUInteger)count;
979 
987 - (double)valueAtIndex:(NSUInteger)index;
988 
997 - (void)enumerateValuesWithBlock:(void (NS_NOESCAPE ^)(double value, NSUInteger idx, BOOL *stop))block;
998 
1008 - (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
1009  usingBlock:(void (NS_NOESCAPE ^)(double value, NSUInteger idx, BOOL *stop))block;
1010 
1016 - (void)addValue:(double)value;
1017 
1024 - (void)addValues:(const double [__nullable])values count:(NSUInteger)count;
1025 
1031 - (void)addValuesFromArray:(GPBDoubleArray *)array;
1032 
1039 - (void)insertValue:(double)value atIndex:(NSUInteger)index;
1040 
1047 - (void)replaceValueAtIndex:(NSUInteger)index withValue:(double)value;
1048 
1054 - (void)removeValueAtIndex:(NSUInteger)index;
1055 
1059 - (void)removeAll;
1060 
1067 - (void)exchangeValueAtIndex:(NSUInteger)idx1
1068  withValueAtIndex:(NSUInteger)idx2;
1069 
1070 @end
1071 
1072 #pragma mark - Bool
1073 
1080 @interface GPBBoolArray : NSObject <NSCopying>
1081 
1083 @property(nonatomic, readonly) NSUInteger count;
1084 
1088 + (instancetype)array;
1089 
1097 + (instancetype)arrayWithValue:(BOOL)value;
1098 
1107 + (instancetype)arrayWithValueArray:(GPBBoolArray *)array;
1108 
1116 + (instancetype)arrayWithCapacity:(NSUInteger)count;
1117 
1121 - (instancetype)init NS_DESIGNATED_INITIALIZER;
1122 
1131 - (instancetype)initWithValues:(const BOOL [__nullable])values
1132  count:(NSUInteger)count;
1133 
1141 - (instancetype)initWithValueArray:(GPBBoolArray *)array;
1142 
1150 - (instancetype)initWithCapacity:(NSUInteger)count;
1151 
1159 - (BOOL)valueAtIndex:(NSUInteger)index;
1160 
1169 - (void)enumerateValuesWithBlock:(void (NS_NOESCAPE ^)(BOOL value, NSUInteger idx, BOOL *stop))block;
1170 
1180 - (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
1181  usingBlock:(void (NS_NOESCAPE ^)(BOOL value, NSUInteger idx, BOOL *stop))block;
1182 
1188 - (void)addValue:(BOOL)value;
1189 
1196 - (void)addValues:(const BOOL [__nullable])values count:(NSUInteger)count;
1197 
1203 - (void)addValuesFromArray:(GPBBoolArray *)array;
1204 
1211 - (void)insertValue:(BOOL)value atIndex:(NSUInteger)index;
1212 
1219 - (void)replaceValueAtIndex:(NSUInteger)index withValue:(BOOL)value;
1220 
1226 - (void)removeValueAtIndex:(NSUInteger)index;
1227 
1231 - (void)removeAll;
1232 
1239 - (void)exchangeValueAtIndex:(NSUInteger)idx1
1240  withValueAtIndex:(NSUInteger)idx2;
1241 
1242 @end
1243 
1244 #pragma mark - Enum
1245 
1252 @interface GPBEnumArray : NSObject <NSCopying>
1253 
1255 @property(nonatomic, readonly) NSUInteger count;
1257 @property(nonatomic, readonly) GPBEnumValidationFunc validationFunc;
1258 
1262 + (instancetype)array;
1263 
1272 + (instancetype)arrayWithValidationFunction:(nullable GPBEnumValidationFunc)func;
1273 
1283 + (instancetype)arrayWithValidationFunction:(nullable GPBEnumValidationFunc)func
1284  rawValue:(int32_t)value;
1285 
1294 + (instancetype)arrayWithValueArray:(GPBEnumArray *)array;
1295 
1305 + (instancetype)arrayWithValidationFunction:(nullable GPBEnumValidationFunc)func
1306  capacity:(NSUInteger)count;
1307 
1315 - (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
1316  NS_DESIGNATED_INITIALIZER;
1317 
1327 - (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
1328  rawValues:(const int32_t [__nullable])values
1329  count:(NSUInteger)count;
1330 
1338 - (instancetype)initWithValueArray:(GPBEnumArray *)array;
1339 
1348 - (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
1349  capacity:(NSUInteger)count;
1350 
1351 // These will return kGPBUnrecognizedEnumeratorValue if the value at index is not a
1352 // valid enumerator as defined by validationFunc. If the actual value is
1353 // desired, use "raw" version of the method.
1354 
1362 - (int32_t)valueAtIndex:(NSUInteger)index;
1363 
1372 - (void)enumerateValuesWithBlock:(void (NS_NOESCAPE ^)(int32_t value, NSUInteger idx, BOOL *stop))block;
1373 
1383 - (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
1384  usingBlock:(void (NS_NOESCAPE ^)(int32_t value, NSUInteger idx, BOOL *stop))block;
1385 
1386 // These methods bypass the validationFunc to provide access to values that were not
1387 // known at the time the binary was compiled.
1388 
1396 - (int32_t)rawValueAtIndex:(NSUInteger)index;
1397 
1406 - (void)enumerateRawValuesWithBlock:(void (NS_NOESCAPE ^)(int32_t value, NSUInteger idx, BOOL *stop))block;
1407 
1417 - (void)enumerateRawValuesWithOptions:(NSEnumerationOptions)opts
1418  usingBlock:(void (NS_NOESCAPE ^)(int32_t value, NSUInteger idx, BOOL *stop))block;
1419 
1420 // If value is not a valid enumerator as defined by validationFunc, these
1421 // methods will assert in debug, and will log in release and assign the value
1422 // to the default value. Use the rawValue methods below to assign non enumerator
1423 // values.
1424 
1430 - (void)addValue:(int32_t)value;
1431 
1438 - (void)addValues:(const int32_t [__nullable])values count:(NSUInteger)count;
1439 
1440 
1447 - (void)insertValue:(int32_t)value atIndex:(NSUInteger)index;
1448 
1455 - (void)replaceValueAtIndex:(NSUInteger)index withValue:(int32_t)value;
1456 
1457 // These methods bypass the validationFunc to provide setting of values that were not
1458 // known at the time the binary was compiled.
1459 
1468 - (void)addRawValue:(int32_t)value;
1469 
1478 - (void)addRawValuesFromArray:(GPBEnumArray *)array;
1479 
1489 - (void)addRawValues:(const int32_t [__nullable])values count:(NSUInteger)count;
1490 
1500 - (void)insertRawValue:(int32_t)value atIndex:(NSUInteger)index;
1501 
1511 - (void)replaceValueAtIndex:(NSUInteger)index withRawValue:(int32_t)value;
1512 
1513 // No validation applies to these methods.
1514 
1520 - (void)removeValueAtIndex:(NSUInteger)index;
1521 
1525 - (void)removeAll;
1526 
1533 - (void)exchangeValueAtIndex:(NSUInteger)idx1
1534  withValueAtIndex:(NSUInteger)idx2;
1535 
1536 @end
1537 
1538 //%PDDM-EXPAND-END DECLARE_ARRAYS()
1539 
1540 NS_ASSUME_NONNULL_END
1541 
1542 //%PDDM-DEFINE DECLARE_ARRAYS()
1543 //%ARRAY_INTERFACE_SIMPLE(Int32, int32_t)
1544 //%ARRAY_INTERFACE_SIMPLE(UInt32, uint32_t)
1545 //%ARRAY_INTERFACE_SIMPLE(Int64, int64_t)
1546 //%ARRAY_INTERFACE_SIMPLE(UInt64, uint64_t)
1547 //%ARRAY_INTERFACE_SIMPLE(Float, float)
1548 //%ARRAY_INTERFACE_SIMPLE(Double, double)
1549 //%ARRAY_INTERFACE_SIMPLE(Bool, BOOL)
1550 //%ARRAY_INTERFACE_ENUM(Enum, int32_t)
1551 
1552 //
1553 // The common case (everything but Enum)
1554 //
1555 
1556 //%PDDM-DEFINE ARRAY_INTERFACE_SIMPLE(NAME, TYPE)
1557 //%#pragma mark - NAME
1558 //%
1559 //%/**
1560 //% * Class used for repeated fields of ##TYPE## values. This performs better than
1561 //% * boxing into NSNumbers in NSArrays.
1562 //% *
1563 //% * @note This class is not meant to be subclassed.
1564 //% **/
1565 //%@interface GPB##NAME##Array : NSObject <NSCopying>
1566 //%
1567 //%/** The number of elements contained in the array. */
1568 //%@property(nonatomic, readonly) NSUInteger count;
1569 //%
1570 //%/**
1571 //% * @return A newly instanced and empty GPB##NAME##Array.
1572 //% **/
1573 //%+ (instancetype)array;
1574 //%
1575 //%/**
1576 //% * Creates and initializes a GPB##NAME##Array with the single element given.
1577 //% *
1578 //% * @param value The value to be placed in the array.
1579 //% *
1580 //% * @return A newly instanced GPB##NAME##Array with value in it.
1581 //% **/
1582 //%+ (instancetype)arrayWithValue:(TYPE)value;
1583 //%
1584 //%/**
1585 //% * Creates and initializes a GPB##NAME##Array with the contents of the given
1586 //% * array.
1587 //% *
1588 //% * @param array Array with the contents to be put into the new array.
1589 //% *
1590 //% * @return A newly instanced GPB##NAME##Array with the contents of array.
1591 //% **/
1592 //%+ (instancetype)arrayWithValueArray:(GPB##NAME##Array *)array;
1593 //%
1594 //%/**
1595 //% * Creates and initializes a GPB##NAME##Array with the given capacity.
1596 //% *
1597 //% * @param count The capacity needed for the array.
1598 //% *
1599 //% * @return A newly instanced GPB##NAME##Array with a capacity of count.
1600 //% **/
1601 //%+ (instancetype)arrayWithCapacity:(NSUInteger)count;
1602 //%
1603 //%/**
1604 //% * @return A newly initialized and empty GPB##NAME##Array.
1605 //% **/
1606 //%- (instancetype)init NS_DESIGNATED_INITIALIZER;
1607 //%
1608 //%/**
1609 //% * Initializes the array, copying the given values.
1610 //% *
1611 //% * @param values An array with the values to put inside this array.
1612 //% * @param count The number of elements to copy into the array.
1613 //% *
1614 //% * @return A newly initialized GPB##NAME##Array with a copy of the values.
1615 //% **/
1616 //%- (instancetype)initWithValues:(const TYPE [__nullable])values
1617 //% count:(NSUInteger)count;
1618 //%
1619 //%/**
1620 //% * Initializes the array, copying the given values.
1621 //% *
1622 //% * @param array An array with the values to put inside this array.
1623 //% *
1624 //% * @return A newly initialized GPB##NAME##Array with a copy of the values.
1625 //% **/
1626 //%- (instancetype)initWithValueArray:(GPB##NAME##Array *)array;
1627 //%
1628 //%/**
1629 //% * Initializes the array with the given capacity.
1630 //% *
1631 //% * @param count The capacity needed for the array.
1632 //% *
1633 //% * @return A newly initialized GPB##NAME##Array with a capacity of count.
1634 //% **/
1635 //%- (instancetype)initWithCapacity:(NSUInteger)count;
1636 //%
1637 //%ARRAY_IMMUTABLE_INTERFACE(NAME, TYPE, Basic)
1638 //%
1639 //%ARRAY_MUTABLE_INTERFACE(NAME, TYPE, Basic)
1640 //%
1641 //%@end
1642 //%
1643 
1644 //
1645 // Macros specific to Enums (to tweak their interface).
1646 //
1647 
1648 //%PDDM-DEFINE ARRAY_INTERFACE_ENUM(NAME, TYPE)
1649 //%#pragma mark - NAME
1650 //%
1651 //%/**
1652 //% * This class is used for repeated fields of ##TYPE## values. This performs
1653 //% * better than boxing into NSNumbers in NSArrays.
1654 //% *
1655 //% * @note This class is not meant to be subclassed.
1656 //% **/
1657 //%@interface GPB##NAME##Array : NSObject <NSCopying>
1658 //%
1659 //%/** The number of elements contained in the array. */
1660 //%@property(nonatomic, readonly) NSUInteger count;
1661 //%/** The validation function to check if the enums are valid. */
1662 //%@property(nonatomic, readonly) GPBEnumValidationFunc validationFunc;
1663 //%
1664 //%/**
1665 //% * @return A newly instanced and empty GPB##NAME##Array.
1666 //% **/
1667 //%+ (instancetype)array;
1668 //%
1669 //%/**
1670 //% * Creates and initializes a GPB##NAME##Array with the enum validation function
1671 //% * given.
1672 //% *
1673 //% * @param func The enum validation function for the array.
1674 //% *
1675 //% * @return A newly instanced GPB##NAME##Array.
1676 //% **/
1677 //%+ (instancetype)arrayWithValidationFunction:(nullable GPBEnumValidationFunc)func;
1678 //%
1679 //%/**
1680 //% * Creates and initializes a GPB##NAME##Array with the enum validation function
1681 //% * given and the single raw value given.
1682 //% *
1683 //% * @param func The enum validation function for the array.
1684 //% * @param value The raw value to add to this array.
1685 //% *
1686 //% * @return A newly instanced GPB##NAME##Array.
1687 //% **/
1688 //%+ (instancetype)arrayWithValidationFunction:(nullable GPBEnumValidationFunc)func
1689 //% rawValue:(TYPE)value;
1690 //%
1691 //%/**
1692 //% * Creates and initializes a GPB##NAME##Array that adds the elements from the
1693 //% * given array.
1694 //% *
1695 //% * @param array Array containing the values to add to the new array.
1696 //% *
1697 //% * @return A newly instanced GPB##NAME##Array.
1698 //% **/
1699 //%+ (instancetype)arrayWithValueArray:(GPB##NAME##Array *)array;
1700 //%
1701 //%/**
1702 //% * Creates and initializes a GPB##NAME##Array with the given enum validation
1703 //% * function and with the givencapacity.
1704 //% *
1705 //% * @param func The enum validation function for the array.
1706 //% * @param count The capacity needed for the array.
1707 //% *
1708 //% * @return A newly instanced GPB##NAME##Array with a capacity of count.
1709 //% **/
1710 //%+ (instancetype)arrayWithValidationFunction:(nullable GPBEnumValidationFunc)func
1711 //% capacity:(NSUInteger)count;
1712 //%
1713 //%/**
1714 //% * Initializes the array with the given enum validation function.
1715 //% *
1716 //% * @param func The enum validation function for the array.
1717 //% *
1718 //% * @return A newly initialized GPB##NAME##Array with a copy of the values.
1719 //% **/
1720 //%- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
1721 //% NS_DESIGNATED_INITIALIZER;
1722 //%
1723 //%/**
1724 //% * Initializes the array, copying the given values.
1725 //% *
1726 //% * @param func The enum validation function for the array.
1727 //% * @param values An array with the values to put inside this array.
1728 //% * @param count The number of elements to copy into the array.
1729 //% *
1730 //% * @return A newly initialized GPB##NAME##Array with a copy of the values.
1731 //% **/
1732 //%- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
1733 //% rawValues:(const TYPE [__nullable])values
1734 //% count:(NSUInteger)count;
1735 //%
1736 //%/**
1737 //% * Initializes the array, copying the given values.
1738 //% *
1739 //% * @param array An array with the values to put inside this array.
1740 //% *
1741 //% * @return A newly initialized GPB##NAME##Array with a copy of the values.
1742 //% **/
1743 //%- (instancetype)initWithValueArray:(GPB##NAME##Array *)array;
1744 //%
1745 //%/**
1746 //% * Initializes the array with the given capacity.
1747 //% *
1748 //% * @param func The enum validation function for the array.
1749 //% * @param count The capacity needed for the array.
1750 //% *
1751 //% * @return A newly initialized GPB##NAME##Array with a capacity of count.
1752 //% **/
1753 //%- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
1754 //% capacity:(NSUInteger)count;
1755 //%
1756 //%// These will return kGPBUnrecognizedEnumeratorValue if the value at index is not a
1757 //%// valid enumerator as defined by validationFunc. If the actual value is
1758 //%// desired, use "raw" version of the method.
1759 //%
1760 //%ARRAY_IMMUTABLE_INTERFACE(NAME, TYPE, NAME)
1761 //%
1762 //%// These methods bypass the validationFunc to provide access to values that were not
1763 //%// known at the time the binary was compiled.
1764 //%
1765 //%/**
1766 //% * Gets the raw enum value at the given index.
1767 //% *
1768 //% * @param index The index of the raw enum value to get.
1769 //% *
1770 //% * @return The raw enum value at the given index.
1771 //% **/
1772 //%- (TYPE)rawValueAtIndex:(NSUInteger)index;
1773 //%
1774 //%/**
1775 //% * Enumerates the values on this array with the given block.
1776 //% *
1777 //% * @param block The block to enumerate with.
1778 //% * **value**: The current value being enumerated.
1779 //% * **idx**: The index of the current value.
1780 //% * **stop**: A pointer to a boolean that when set stops the enumeration.
1781 //% **/
1782 //%- (void)enumerateRawValuesWithBlock:(void (NS_NOESCAPE ^)(TYPE value, NSUInteger idx, BOOL *stop))block;
1783 //%
1784 //%/**
1785 //% * Enumerates the values on this array with the given block.
1786 //% *
1787 //% * @param opts Options to control the enumeration.
1788 //% * @param block The block to enumerate with.
1789 //% * **value**: The current value being enumerated.
1790 //% * **idx**: The index of the current value.
1791 //% * **stop**: A pointer to a boolean that when set stops the enumeration.
1792 //% **/
1793 //%- (void)enumerateRawValuesWithOptions:(NSEnumerationOptions)opts
1794 //% usingBlock:(void (NS_NOESCAPE ^)(TYPE value, NSUInteger idx, BOOL *stop))block;
1795 //%
1796 //%// If value is not a valid enumerator as defined by validationFunc, these
1797 //%// methods will assert in debug, and will log in release and assign the value
1798 //%// to the default value. Use the rawValue methods below to assign non enumerator
1799 //%// values.
1800 //%
1801 //%ARRAY_MUTABLE_INTERFACE(NAME, TYPE, NAME)
1802 //%
1803 //%@end
1804 //%
1805 
1806 //%PDDM-DEFINE ARRAY_IMMUTABLE_INTERFACE(NAME, TYPE, HELPER_NAME)
1807 //%/**
1808 //% * Gets the value at the given index.
1809 //% *
1810 //% * @param index The index of the value to get.
1811 //% *
1812 //% * @return The value at the given index.
1813 //% **/
1814 //%- (TYPE)valueAtIndex:(NSUInteger)index;
1815 //%
1816 //%/**
1817 //% * Enumerates the values on this array with the given block.
1818 //% *
1819 //% * @param block The block to enumerate with.
1820 //% * **value**: The current value being enumerated.
1821 //% * **idx**: The index of the current value.
1822 //% * **stop**: A pointer to a boolean that when set stops the enumeration.
1823 //% **/
1824 //%- (void)enumerateValuesWithBlock:(void (NS_NOESCAPE ^)(TYPE value, NSUInteger idx, BOOL *stop))block;
1825 //%
1826 //%/**
1827 //% * Enumerates the values on this array with the given block.
1828 //% *
1829 //% * @param opts Options to control the enumeration.
1830 //% * @param block The block to enumerate with.
1831 //% * **value**: The current value being enumerated.
1832 //% * **idx**: The index of the current value.
1833 //% * **stop**: A pointer to a boolean that when set stops the enumeration.
1834 //% **/
1835 //%- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
1836 //% usingBlock:(void (NS_NOESCAPE ^)(TYPE value, NSUInteger idx, BOOL *stop))block;
1837 
1838 //%PDDM-DEFINE ARRAY_MUTABLE_INTERFACE(NAME, TYPE, HELPER_NAME)
1839 //%/**
1840 //% * Adds a value to this array.
1841 //% *
1842 //% * @param value The value to add to this array.
1843 //% **/
1844 //%- (void)addValue:(TYPE)value;
1845 //%
1846 //%/**
1847 //% * Adds values to this array.
1848 //% *
1849 //% * @param values The values to add to this array.
1850 //% * @param count The number of elements to add.
1851 //% **/
1852 //%- (void)addValues:(const TYPE [__nullable])values count:(NSUInteger)count;
1853 //%
1854 //%ARRAY_EXTRA_MUTABLE_METHODS1_##HELPER_NAME(NAME, TYPE)
1855 //%/**
1856 //% * Inserts a value into the given position.
1857 //% *
1858 //% * @param value The value to add to this array.
1859 //% * @param index The index into which to insert the value.
1860 //% **/
1861 //%- (void)insertValue:(TYPE)value atIndex:(NSUInteger)index;
1862 //%
1863 //%/**
1864 //% * Replaces the value at the given index with the given value.
1865 //% *
1866 //% * @param index The index for which to replace the value.
1867 //% * @param value The value to replace with.
1868 //% **/
1869 //%- (void)replaceValueAtIndex:(NSUInteger)index withValue:(TYPE)value;
1870 //%ARRAY_EXTRA_MUTABLE_METHODS2_##HELPER_NAME(NAME, TYPE)
1871 //%/**
1872 //% * Removes the value at the given index.
1873 //% *
1874 //% * @param index The index of the value to remove.
1875 //% **/
1876 //%- (void)removeValueAtIndex:(NSUInteger)index;
1877 //%
1878 //%/**
1879 //% * Removes all the values from this array.
1880 //% **/
1881 //%- (void)removeAll;
1882 //%
1883 //%/**
1884 //% * Exchanges the values between the given indexes.
1885 //% *
1886 //% * @param idx1 The index of the first element to exchange.
1887 //% * @param idx2 The index of the second element to exchange.
1888 //% **/
1889 //%- (void)exchangeValueAtIndex:(NSUInteger)idx1
1890 //% withValueAtIndex:(NSUInteger)idx2;
1891 
1892 //
1893 // These are hooks invoked by the above to do insert as needed.
1894 //
1895 
1896 //%PDDM-DEFINE ARRAY_EXTRA_MUTABLE_METHODS1_Basic(NAME, TYPE)
1897 //%/**
1898 //% * Adds the values from the given array to this array.
1899 //% *
1900 //% * @param array The array containing the elements to add to this array.
1901 //% **/
1902 //%- (void)addValuesFromArray:(GPB##NAME##Array *)array;
1903 //%
1904 //%PDDM-DEFINE ARRAY_EXTRA_MUTABLE_METHODS2_Basic(NAME, TYPE)
1905 // Empty
1906 //%PDDM-DEFINE ARRAY_EXTRA_MUTABLE_METHODS1_Enum(NAME, TYPE)
1907 // Empty
1908 //%PDDM-DEFINE ARRAY_EXTRA_MUTABLE_METHODS2_Enum(NAME, TYPE)
1909 //%
1910 //%// These methods bypass the validationFunc to provide setting of values that were not
1911 //%// known at the time the binary was compiled.
1912 //%
1913 //%/**
1914 //% * Adds a raw enum value to this array.
1915 //% *
1916 //% * @note This method bypass the validationFunc to enable the setting of values that
1917 //% * were not known at the time the binary was compiled.
1918 //% *
1919 //% * @param value The raw enum value to add to the array.
1920 //% **/
1921 //%- (void)addRawValue:(TYPE)value;
1922 //%
1923 //%/**
1924 //% * Adds raw enum values to this array.
1925 //% *
1926 //% * @note This method bypass the validationFunc to enable the setting of values that
1927 //% * were not known at the time the binary was compiled.
1928 //% *
1929 //% * @param array Array containing the raw enum values to add to this array.
1930 //% **/
1931 //%- (void)addRawValuesFromArray:(GPB##NAME##Array *)array;
1932 //%
1933 //%/**
1934 //% * Adds raw enum values to this array.
1935 //% *
1936 //% * @note This method bypass the validationFunc to enable the setting of values that
1937 //% * were not known at the time the binary was compiled.
1938 //% *
1939 //% * @param values Array containing the raw enum values to add to this array.
1940 //% * @param count The number of raw values to add.
1941 //% **/
1942 //%- (void)addRawValues:(const TYPE [__nullable])values count:(NSUInteger)count;
1943 //%
1944 //%/**
1945 //% * Inserts a raw enum value at the given index.
1946 //% *
1947 //% * @note This method bypass the validationFunc to enable the setting of values that
1948 //% * were not known at the time the binary was compiled.
1949 //% *
1950 //% * @param value Raw enum value to add.
1951 //% * @param index The index into which to insert the value.
1952 //% **/
1953 //%- (void)insertRawValue:(TYPE)value atIndex:(NSUInteger)index;
1954 //%
1955 //%/**
1956 //% * Replaces the raw enum value at the given index with the given value.
1957 //% *
1958 //% * @note This method bypass the validationFunc to enable the setting of values that
1959 //% * were not known at the time the binary was compiled.
1960 //% *
1961 //% * @param index The index for which to replace the value.
1962 //% * @param value The raw enum value to replace with.
1963 //% **/
1964 //%- (void)replaceValueAtIndex:(NSUInteger)index withRawValue:(TYPE)value;
1965 //%
1966 //%// No validation applies to these methods.
1967 //%
GPBInt64Array
Definition: bloaty/third_party/protobuf/objectivec/GPBArray.h:392
GPBBoolArray
Definition: bloaty/third_party/protobuf/objectivec/GPBArray.h:1080
init
const char * init
Definition: upb/upb/bindings/lua/main.c:49
const
#define const
Definition: bloaty/third_party/zlib/zconf.h:230
cstest_report.opts
opts
Definition: cstest_report.py:81
BOOL
int BOOL
Definition: undname.c:46
block
Block * block
Definition: protobuf/src/google/protobuf/descriptor.cc:1041
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
array
Definition: undname.c:101
int64_t
signed __int64 int64_t
Definition: stdint-msvc2008.h:89
GPBEnumArray
Definition: bloaty/third_party/protobuf/objectivec/GPBArray.h:1252
-[GPBInt32Array removeAll]
void removeAll()
uint64_t
unsigned __int64 uint64_t
Definition: stdint-msvc2008.h:90
-[GPBInt32Array NS_DESIGNATED_INITIALIZER]
instancetype NS_DESIGNATED_INITIALIZER()
GPBFloatArray
Definition: bloaty/third_party/protobuf/objectivec/GPBArray.h:736
GPBUInt32Array
Definition: bloaty/third_party/protobuf/objectivec/GPBArray.h:220
GPBRuntimeTypes.h
+[GPBInt32Array array]
instancetype array()
setup.idx
idx
Definition: third_party/bloaty/third_party/capstone/bindings/python/setup.py:197
value
const char * value
Definition: hpack_parser_table.cc:165
GPBDoubleArray
Definition: bloaty/third_party/protobuf/objectivec/GPBArray.h:908
GPBInt32Array::count
NSUInteger count
Definition: bloaty/third_party/protobuf/objectivec/GPBArray.h:51
index
int index
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:1184
GPBEnumValidationFunc
BOOL(* GPBEnumValidationFunc)(int32_t)
Definition: bloaty/third_party/protobuf/objectivec/GPBRuntimeTypes.h:42
values
std::array< int64_t, Size > values
Definition: abseil-cpp/absl/container/btree_benchmark.cc:608
GPBUInt64Array
Definition: bloaty/third_party/protobuf/objectivec/GPBArray.h:564
stop
static const char stop[]
Definition: benchmark-async-pummel.c:35
GPBInt32Array
Definition: bloaty/third_party/protobuf/objectivec/GPBArray.h:48
int32_t
signed int int32_t
Definition: stdint-msvc2008.h:77


grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:43