aboutsummaryrefslogtreecommitdiffstats
path: root/libccnx-common/ccnx/common/ccnx_ManifestHashGroup.h
blob: 092434b1365c0909a852d419392b046e8cbd0ce7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
/*
 * Copyright (c) 2017 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * @file ccnx_ManifestHashGroup.h
 * @brief A HashGroup in a FLIC manifest.
 *
 */
#ifndef libccnx_ccnx_ManifestHashGroup_h
#define libccnx_ccnx_ManifestHashGroup_h

#include <ccnx/common/ccnx_Name.h>
#include <ccnx/common/ccnx_ContentObject.h>

#include <parc/algol/parc_Buffer.h>
#include <parc/algol/parc_List.h>
#include <parc/algol/parc_Memory.h>
#include <parc/algol/parc_JSON.h>
#include <parc/algol/parc_Iterator.h>
#include <parc/algol/parc_LinkedList.h>

#include <parc/security/parc_Signature.h>

struct ccnx_manifest_hash_group;
/**
 * @typedef CCNxManifestHashGroup
 * @brief A FLIC HashGroup
 */
typedef struct ccnx_manifest_hash_group CCNxManifestHashGroup;

typedef enum {
    CCNxManifestHashGroupPointerType_Data,
    CCNxManifestHashGroupPointerType_Manifest
} CCNxManifestHashGroupPointerType;

/**
 * @typedef CCNxManifestHashGroupPointer
 * @brief A HashGroup pointer.
 */
struct ccnx_manifest_hash_group_pointer;
typedef struct ccnx_manifest_hash_group_pointer CCNxManifestHashGroupPointer;

/**
 * Retrieve the type of a `CCNxManifestHashGroupPointer`.
 *
 * @param [in] ptr A `CCNxManifestHashGroupPointer` instance.
 *
 * @retval The type of the `CCNxManifestHashGroupPointer` instance.
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroupPointer *pointer = ccnxManifestHashGroup_GetPointerAtIndex(group, 0);
 *     CCNxManifestHashGroupPointerType type = ccnxManifestHashGroupPointer_GetType(pointer);
 *     if (type == CCNxManifestHashGroupPointerType_Data) {
 *          // Data
 *     } else {
 *          // Manifest
 *     }
 * }
 * @endcode
 */
CCNxManifestHashGroupPointerType ccnxManifestHashGroupPointer_GetType(const CCNxManifestHashGroupPointer *ptr);

/**
 * Retrieve hash digest associated with the `CCNxManifestHashGroupPointer` value.
 *
 * @param [in] ptr A `CCNxManifestHashGroupPointer` instance.
 *
 * @retval The hash digest for a `CCNxManifestHashGroupPointer` in a `PARCBuffer`.
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroupPointer *pointer = ccnxManifestHashGroup_GetPointerAtIndex(group, 0);
 *     PARCBuffer *digest = ccnxManifestHashGroupPointer_GetDigest(pointer);
 *     // use the digest
 * }
 * @endcode
 */
const PARCBuffer *ccnxManifestHashGroupPointer_GetDigest(const CCNxManifestHashGroupPointer *ptr);

/**
 * Create a new and empty {@link CCNxManifestHashGroup} instance.
 *
 * @return A pointer to a {@link CCNxManifestHashGroup} instance, or NULL if an error or out of memory.
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *section = CCNxManifestHashGroup_Create();
 *
 *     ...
 *
 *     CCNxManifestHashGroup_Release(&section);
 * }
 * @endcode
 */
CCNxManifestHashGroup *ccnxManifestHashGroup_Create();

/**
 * Create a new {@link CCNxManifestHashGroup} instance from a
 *
 * @param [in] jsonRepresentation - A pointer to a {@link PARCJSON} object representing the `CCNxManifestHashGroup`.
 *
 * @return A pointer to a {@link CCNxManifestHashGroup} instance, or NULL if an error or out of memory.
 *
 * Example:
 * @code
 * {
 *     PARCJSON *jsonRep = ccnxTlvDictionary_GetJson(dict, CCNxCodecSchemaV1TlvDictionary_MessageFastArray_ManifestHashGroup);
 *     CCNxManifestHashGroup *section = CCNxManifestHashGroup_CreateFromJson(jsonRep);
 *
 *     ...
 *
 *     ccnxJson_Destroy(&jsonRep);
 *     CCNxManifestHashGroup_Release(&section);
 * }
 * @endcode
 */
CCNxManifestHashGroup *ccnxManifestHashGroup_CreateFromJson(const PARCJSON *jsonRepresentation);

/**
 * Increase the number of references to an instance of this object.
 *
 * Note that new instance is not created,
 * only that the given instance's reference count is incremented.
 * Discard the reference by invoking {@link CCNxManifestHashGroup_Release()}.
 *
 * @param [in] group A pointer to the {@link CCNxManifestHashGroup} to acquire.
 * @return The value of the input parameter @p group.
 *
 * Example:
 * @code
 * {
 *     CCNxManifest *manifest = CCNxManifestHashGroup_Acquire(instance);
 *
 *     CCNxManifestHashGroup_Release(&manifest);
 * }
 * @endcode
 *
 * @see `CCNxManifestHashGroup_Release`
 */
CCNxManifestHashGroup *ccnxManifestHashGroup_Acquire(const CCNxManifestHashGroup *group);

/**
 * Release a previously acquired reference to the specified instance,
 * decrementing the reference count for the instance.
 *
 * The pointer to the instance is set to NULL as a side-effect of this function.
 *
 * If the invocation causes the last reference to the instance to be released,
 * the instance is deallocated and the instance's implementation will perform
 * additional cleanup and release other privately held references.
 *
 * @param [in,out] sectionP A pointer to a pointer to the instance to release.
 *
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *manifest = CCNxManifestHashGroup_Acquire(instance);
 *
 *     CCNxManifestHashGroup_Release(&manifest);
 * }
 * @endcode
 */
void ccnxManifestHashGroup_Release(CCNxManifestHashGroup **sectionP);

/**
 * Check that the pointer to the {@link CCNxManifestHashGroup} is valid. It should be non-null,
 * and any referenced data should also be valid.
 *
 * @param [in] manifest A pointer to the {@link CCNxManifestHashGroup} to check.
 *
 *
 * Example:
 * @code
 * {
 *     CCNxManifest *manifest = CCNxManifestHashGroup_Acquire(instance);
 *
 *     CCNxManifestHashGroup_AssertValid(manifest);
 * }
 * @endcode
 */
void ccnxManifestHashGroup_AssertValid(const CCNxManifestHashGroup *manifest);

/**
 * Add a new pointer to the {@link CCNxManifestHashGroup} with the specified type and hash digest.
 *
 * @param [in] group - A {@link CCNxManifestHashGroup} instance.
 * @param [in] type - The {@link CCNxManifestHashGroupPointerType} type.
 * @param [in] buffer - The {@link PARCBuffer} containing the pointer digest.
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *group = CCNxManifestHashGroup_Create();
 *
 *     PARCBuffer *hashDigest = ...;
 *
 *     bool added = ccnxManifestHashGroup_AppendPointer(group, CCNxManifestHashGroupPointerType_Data, hashDigest);
 *     // added == true if the group was not full
 *
 *     CCNxManifestHashGroup_Release(&group);
 * }
 * @endcode
 */
bool ccnxManifestHashGroup_AppendPointer(CCNxManifestHashGroup *group, CCNxManifestHashGroupPointerType type, const PARCBuffer *buffer);

/**
 * Prepend a new pointer to the {@link CCNxManifestHashGroup} with the specified type and hash digest.
 *
 * @param [in] group - A {@link CCNxManifestHashGroup} instance.
 * @param [in] type - The {@link CCNxManifestHashGroupPointerType} type.
 * @param [in] buffer - The {@link PARCBuffer} containing the pointer digest.
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *group = CCNxManifestHashGroup_Create();
 *
 *     PARCBuffer *hashDigest = ...;
 *
 *     bool added = ccnxManifestHashGroup_PrependPointer(group, CCNxManifestHashGroupPointerType_Data, hashDigest);
 *     // added == true if the group was not full
 *
 *     CCNxManifestHashGroup_Release(&group);
 * }
 * @endcode
 */
bool ccnxManifestHashGroup_PrependPointer(CCNxManifestHashGroup *group, CCNxManifestHashGroupPointerType type, const PARCBuffer *buffer);

/**
 * Retrieve the {@link CCNxManifestHashGroupPointer} in the {@link CCNxManifestHashGroup} at
 * the specified index.
 *
 * @param [in] group - A {@link CCNxManifestHashGroup} instance.
 * @param [in] index - The index of the `CCNxManifestHashGroupPointer` to retrieve.
 *
 * @retval The `CCNxManifestHashGroupPointer` at the specified index.
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *group = CCNxManifestHashGroup_Create();
 *
 *     PARCBuffer *hashDigest = ...;
 *     ccnxManifestHashGroup_AppendPointer(group, CCNxManifestHashGroupPointerType_Data, hashDigest);
 *
 *     // ...
 *     CCNxManifestHashGroupPointer *pointer = ccnxManifestHashGroup_GetPointerAtIndex(group, 0);
 *     // use it as needed
 *
 *     CCNxManifestHashGroup_Release(&group);
 * }
 * @endcode
 */
CCNxManifestHashGroupPointer *ccnxManifestHashGroup_GetPointerAtIndex(const CCNxManifestHashGroup *group, size_t index);

/**
 * Determine if two {@link CCNxManifestHashGroup} instances are equal.
 *
 * The following equivalence relations on non-null {@link CCNxManifestHashGroup} instances are maintained:
 *   * It is reflexive: for any non-null reference value x, `CCNxManifestHashGroup_Equals(x, x)` must return true.
 *
 *   * It is symmetric: for any non-null reference values x and y, `CCNxManifestHashGroup_Equals(x, y)` must return true if and only if
 *        `CCNxManifestHashGroup_Equals(y x)` returns true.
 *
 *   * It is transitive: for any non-null reference values x, y, and z, if
 *        `CCNxManifestHashGroup_Equals(x, y)` returns true and
 *        `CCNxManifestHashGroup_Equals(y, z)` returns true,
 *        then  `CCNxManifestHashGroup_Equals(x, z)` must return true.
 *
 *   * It is consistent: for any non-null reference values x and y, multiple invocations of `CCNxManifestHashGroup_Equals(x, y)`
 *         consistently return true or consistently return false.
 *
 *   * For any non-null reference value x, `CCNxManifestHashGroup_Equals(x, NULL)` must return false.
 *
 *
 * @param [in] x A pointer to a {@link CCNxManifestHashGroup} instance.
 * @param [in] y A pointer to a {@link CCNxManifestHashGroup} instance.
 * @return `true` if the referenced {@link CCNxManifestHashGroup} instances are equal.
 *
 * Example:
 * @code
 * {
 *    CCNxManifestHashGroup *a = CCNxManifestHashGroup_Create(...);
 *    CCNxManifestHashGroup *b = CCNxManifestHashGroup_Create(...);
 *
 *    if (CCNxManifestHashGroup_Equals(a, b)) {
 *        // true
 *    } else {
 *        // false
 *    }
 * }
 * @endcode
 */
bool ccnxManifestHashGroup_Equals(const CCNxManifestHashGroup *x, const CCNxManifestHashGroup *y);

/**
 * Create a null-terminated string representation of the given {@link CCNxManifestHashGroup}.
 *
 * The returned value must be freed by the caller using {@link parcMemory_Deallocate()}.
 *
 * @param [in] group A pointer to a {@link CCNxManifestHashGroup} instance.
 *
 * @return A pointer to null-terminated string of characters repesenting the @p section that must be
 *         freed by the caller by `parcMemory_Deallocate()`.
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *group = CCNxManifestHashGroup_Create();
 *
 *     char *sectionDescription = CCNxManifestHashGroup_ToString(group);
 *     printf("Manifest: %s\n", sectionDescription);
 *
 *     CCNxManifestHashGroup_Release(&group);
 * }
 * @endcode
 */
char *ccnxManifestHashGroup_ToString(const CCNxManifestHashGroup *group);

/**
 * Create a `CCNxJson` representation of the given {@link CCNxManifestHashGroup}.
 *
 * The returned value must be freed by the caller using {@link ccnxJson_Destroy()}.
 *
 * @param [in] section A pointer to a {@link CCNxManifestHashGroup} instance.
 *
 * @return A pointer to the JSON representation of the @p section that must be freed by the caller by `ccnxJson_Destroy()`.
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *group = CCNxManifestHashGroup_Create();
 *
 *     PARCJSON *jsonForm = CCNxManifestHashGroup_ToJson(group);
 *     printf("Manifest: %s\n", ccnxJson_ToString(jsonForm));
 *
 *     CCNxManifestHashGroup_Release(&group);
 * }
 * @endcode
 */
PARCJSON *ccnxManifestHashGroup_ToJson(const CCNxManifestHashGroup *section);

/**
 * Set the {@link CCNxName} locator for this {@link CCNxManifestHashGroup}.
 *
 * @param [in] group A {@link CCNxManifestHashGroup} instance.
 * @param [in] locator A {@link CCNxName} instance.
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *group = ...
 *     CCNxName *name = ccnxName_CreateFromURI("lci:/some/place");
 *
 *     ccnxManifestHashGroup_setLocator(group, name);
 * }
 * @endcode
 */
void ccnxManifestHashGroup_SetLocator(CCNxManifestHashGroup *group, const CCNxName *locator);

/**
 * Retrieve the {@link CCNxName} locator for this {@link CCNxManifestHashGroup}.
 *
 * @param [in] CCNxManifestHashGroup A {@link CCNxManifestHashGroup} instance.
 *
 * @return non-NULL The {@link CCNxName} locator for this {@link CCNxManifestHashGroup}.
 * @return NULL There is no locator.
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *group = ...
 *
 *     CCNxName *locator = ccnxManifestHashGroup_GetLocator(group);
 *     printf("Manifest Locator: %s\n", ccnxName_ToString(locator));
 *
 *     CCNxManifestHashGroup_Release(&group);
 * }
 * @endcode
 */
const CCNxName *ccnxManifestHashGroup_GetLocator(const CCNxManifestHashGroup *group);

/**
 * Retrieve the number of pointers in this {@link CCNxManifestHashGroup}.
 *
 * @param [in] group A {@link CCNxManifestHashGroup} instance.
 *
 * @retval The number of pointers in the {@link CCNxManifestHashGroup} instance.
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *group = ...
 *
 *     size_t numPointers = ccnxManifestHashGroup_GetNumberOfPointers(group);
 *     for (size_t i = 0; i < numPointers; i++) {
 *          // get i-th pointer and do something with it
 *     }
 *
 *     CCNxManifestHashGroup_Release(&group);
 * }
 * @endcode
 */
size_t ccnxManifestHashGroup_GetNumberOfPointers(const CCNxManifestHashGroup *group);

/**
 * Determine if more pointers can be added to a {@link CCNxManifestHashGroup} instance.
 *
 * @param [in] group A {@link CCNxManifestHashGroup} instance.
 *
 * @return true More space is available
 * @return false The manifest is full.
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *group = ...
 *
 *     size_t numPointers= ccnxManifestHashGroup_GetNumberOfPointers(group);
 *     for (size_t i = 0; i < numPointers; i++) {
 *          // get i-th pointer and do something with it
 *     }
 *
 *     CCNxManifestHashGroup_Release(&group);
 * }
 * @endcode
 */
bool ccnxManifestHashGroup_IsFull(const CCNxManifestHashGroup *group);

/**
 * Retrieve a {@link PARCIterator} to walk over each of the {@link CCNxManifestHashGroupPointer}
 * instances in the {@link CCNxManifestHashGroup}.
 *
 * @param [in] group A {@link CCNxManifestHashGroup} instance.
 *
 * @retval A {@link PARCIterator} instance.
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *group = ...
 *     PARCIterator *itr = ccnxManifestHashGroup_Iterator(group);
 *     while (parcIterator_HasNext(itr)) {
 *          CCNxManifestHashGroupPointer *ptr = (CCNxManifestHashGroupPointer *) parcIterator_Next(itr);
 *          // use the pointer
 *     }
 * }
 * @endcode
 */
PARCIterator *ccnxManifestHashGroup_Iterator(const CCNxManifestHashGroup *group);

/**
 * Retrieve the block size of this {@link CCNxManifestHashGroup}.
 *
 * @param [in] group A {@link CCNxManifestHashGroup} instance.
 *
 * @retval The block size of the {@link CCNxManifestHashGroup} instance.
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *group = ...
 *
 *     size_t blockSize = ccnxManifestHashGroup_GetBlockSize(group);
 *     // use it
 * }
 * @endcode
 */
size_t ccnxManifestHashGroup_GetBlockSize(const CCNxManifestHashGroup *group);

/**
 * Set the block size of this {@link CCNxManifestHashGroup}.
 *
 * @param [in] group A {@link CCNxManifestHashGroup} instance.
 * @param [in] blockSize The block size.
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *group = ...
 *     size_t blockSize =
 *
 *     ccnxManifestHashGroup_SetBlockSize(group, blockSize);
 * }
 * @endcode
 */
void ccnxManifestHashGroup_SetBlockSize(CCNxManifestHashGroup *group, size_t blockSize);

/**
 * Retrieve the data size of this {@link CCNxManifestHashGroup}.
 *
 * @param [in] group A {@link CCNxManifestHashGroup} instance.
 *
 * @retval The data size of the {@link CCNxManifestHashGroup} instance.
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *group = ...
 *
 *     size_t dataSize = ccnxManifestHashGroup_GetDataSize(group);
 *     // use it
 * }
 * @endcode
 */
size_t ccnxManifestHashGroup_GetDataSize(const CCNxManifestHashGroup *group);

/**
 * Set the data size of this {@link CCNxManifestHashGroup}.
 *
 * @param [in] group A {@link CCNxManifestHashGroup} instance.
 * @param [in] dataSize The data size
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *group = ...
 *     size_t dataSize =
 *
 *     ccnxManifestHashGroup_SetDataSize(group, dataSize);
 * }
 * @endcode
 */
void ccnxManifestHashGroup_SetDataSize(CCNxManifestHashGroup *group, size_t dataSize);

/**
 * Retrieve the entry size of this {@link CCNxManifestHashGroup}.
 *
 * @param [in] group A {@link CCNxManifestHashGroup} instance.
 *
 * @retval The entry size of the {@link CCNxManifestHashGroup} instance.
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *group = ...
 *
 *     size_t entrySize = ccnxManifestHashGroup_GetEntrySize(group);
 *     // use it
 * }
 * @endcode
 */
size_t ccnxManifestHashGroup_GetEntrySize(const CCNxManifestHashGroup *group);

/**
 * Set the entry size of this {@link CCNxManifestHashGroup}.
 *
 * @param [in] group A {@link CCNxManifestHashGroup} instance.
 * @param [in] entrySize The entry size.
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *group = ...
 *     size_t entrySize =
 *
 *     ccnxManifestHashGroup_SetEntrySize(group, entrySize);
 * }
 * @endcode
 */
void ccnxManifestHashGroup_SetEntrySize(CCNxManifestHashGroup *group, size_t entrySize);

/**
 * Retrieve the tree height of this {@link CCNxManifestHashGroup}.
 *
 * @param [in] group A {@link CCNxManifestHashGroup} instance.
 *
 * @retval The tree height of the {@link CCNxManifestHashGroup} instance.
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *group = ...
 *
 *     size_t treeHeight = ccnxManifestHashGroup_GetTreeHeight(group);
 *     // use it
 * }
 * @endcode
 */
size_t ccnxManifestHashGroup_GetTreeHeight(const CCNxManifestHashGroup *group);

/**
 * Set the tree height of this {@link CCNxManifestHashGroup}.
 *
 * @param [in] group A {@link CCNxManifestHashGroup} instance.
 * @param [in] treeHeight The tree height of the {@link CCNxManifestHashGroup} instance.
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *group = ...
 *     size_t treeHeight = ...
 *     ccnxManifestHashGroup_SetTreeHeight(group, treeHeight);
 * }
 * @endcode
 */
void ccnxManifestHashGroup_SetTreeHeight(CCNxManifestHashGroup *group, size_t treeHeight);

/**
 * Retrieve the overall data digest of this {@link CCNxManifestHashGroup}.
 *
 * @param [in] group A {@link CCNxManifestHashGroup} instance.
 *
 * @retval The overall data digest of the {@link CCNxManifestHashGroup} instance.
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *group = ...
 *
 *     const PARCBuffer *digest = ccnxManifestHashGroup_GetOverallDataDigest(group);
 *     // use it
 * }
 * @endcode
 */
const PARCBuffer *ccnxManifestHashGroup_GetOverallDataDigest(const CCNxManifestHashGroup *group);

/**
 * Set the overall data digest of this {@link CCNxManifestHashGroup}.
 *
 * @param [in] group A {@link CCNxManifestHashGroup} instance.
 * @param [in] digest The overall data digest of the {@link CCNxManifestHashGroup} instance.
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *group = ...
 *     const PARCBuffer *digest = ...
 *
 *     ccnxManifestHashGroup_SetOverallDataDigest(group, digest);
 * }
 * @endcode
 */
void ccnxManifestHashGroup_SetOverallDataDigest(CCNxManifestHashGroup *group, const PARCBuffer *digest);

/**
 * Determine if this `CCNxManifestHashGroup` is carrying any metadata.
 *
 * @param [in] group A {@link CCNxManifestHashGroup} instance.
 *
 * @retval true If the `CCNxManifestHashGroup` has metadata.
 * @retval false Otherwise
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *group = ...
 *
 *     bool hasMetadata = ccnxManifestHashGroup_HasMetadata(group);
 * }
 * @endcode
 */
bool ccnxManifestHashGroup_HasMetadata(const CCNxManifestHashGroup *group);

/**
 * Create a list of `CCNxInterest` instances that can be created from this single
 * `CCNxManifestHashGroup` instance.
 *
 * @param [in] group A pointer to an instance of `CCNxManifestHashGroup`.
 * @param [in] name A `CCNxName` locator for the interests in this list.
 *
 * @return A `PARCLinkedList` containing the set of all Interests that can be
 *         constructed from this HashGroup.
 *
 * Example:
 * @code
 * {
 *     CCNxManifestHashGroup *group = ...;
 *
 *     PARCLinkedList *interests = ccnxManifestHashGroup_CreateInterestList(group);
 * }
 * @endcode
 */
PARCLinkedList *ccnxManifestHashGroup_CreateInterestList(const CCNxManifestHashGroup *group, const CCNxName *locator);
#endif // libccnx_ccnx_ManifestHashGroup_h