Proyectos de Subversion Iphone Microlearning

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
// Copyright 2020 Google LLC
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
//      http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
 
15
#import <Foundation/Foundation.h>
16
 
17
@class FPRClassInstrumentor;
18
 
19
NS_ASSUME_NONNULL_BEGIN
20
 
21
/** FPRInstrument instances can instrument many different classes, but should try to instrument
22
 *  only a single class in the general case. Due to class clusters, FPRInstruments need to be able
23
 *  to support logical groups of classes, even if the public API is a single class (e.g.
24
 *  NSDictionary or NSURLSession. FPRInstrument is expected to be subclassed by other classes that
25
 *  actually implement the instrument. Subclasses should provide their own implementations of
26
 *  registerInstrumentor
27
 */
28
NS_EXTENSION_UNAVAILABLE("Firebase Performance is not supported for extensions.")
29
@interface FPRInstrument : NSObject
30
 
31
/** The list of class instrumentors. count should == 1 in most cases, and be > 1 for class clusters.
32
 */
33
@property(nonatomic, readonly) NSArray<FPRClassInstrumentor *> *classInstrumentors;
34
 
35
/** A set of the instrumented classes. */
36
@property(nonatomic, readonly) NSSet<Class> *instrumentedClasses;
37
 
38
/**
39
 * Checks if the given object is instrumentable and returns YES if instrumentable. NO, otherwise.
40
 *
41
 * @param object Object that needs to be validated.
42
 * @return Yes if instrumentable, NO otherwise.
43
 */
44
- (BOOL)isObjectInstrumentable:(id)object;
45
 
46
/** Registers all instrumentors this instrument will utilize. Should be instrumented in a subclass.
47
 *
48
 *  @note This method is thread-safe.
49
 */
50
- (void)registerInstrumentors;
51
 
52
/** Deregisters the instrumentors by using API provided by FPRClassInstrumentor. Called by dealloc.
53
 *
54
 *  @note This method is thread-safe.
55
 */
56
- (void)deregisterInstrumentors;
57
 
58
@end
59
 
60
NS_ASSUME_NONNULL_END