Skip to content

Commit ffbf7da

Browse files
bzbarsky-applekiel-apple
authored andcommitted
Improve description for MTRDevice. (project-chip#34857)
* apply changes from PR project-chip#34797 to to concrete class * Improve description for MTRDevice. Includes various information that wasn't included before but probably should be. * Address review comments. --------- Co-authored-by: Kiel Oleson <kielo@apple.com>
1 parent e0f9bd4 commit ffbf7da

6 files changed

+495
-53
lines changed

src/darwin/Framework/CHIP/MTRAsyncWorkQueue.h

+3
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@ MTR_TESTABLE
228228
- (BOOL)hasDuplicateForTypeID:(NSUInteger)opaqueDuplicateTypeID
229229
workItemData:(id)opaqueWorkItemData;
230230

231+
// Returns current count of queued items.
232+
- (NSUInteger)itemCount;
233+
231234
/// Cancels and removes all work items.
232235
- (void)invalidate;
233236
@end

src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm

+6
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,12 @@ - (BOOL)hasDuplicateForTypeID:(NSUInteger)opaqueDuplicateTypeID workItemData:(id
433433
return NO;
434434
}
435435

436+
- (NSUInteger)itemCount
437+
{
438+
std::lock_guard lock(_lock);
439+
return _items.count;
440+
}
441+
436442
@end
437443

438444
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)