FPRMemoryGaugeCollector.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. #import <Foundation/Foundation.h>
  15. #import "FirebasePerformance/Sources/Gauges/FPRGaugeCollector.h"
  16. #import "FirebasePerformance/Sources/Gauges/Memory/FPRMemoryGaugeData.h"
  17. NS_ASSUME_NONNULL_BEGIN
  18. @class FPRMemoryGaugeCollector;
  19. /** Delegate method for the memory Gauge collector to report back the memory gauge data. */
  20. NS_EXTENSION_UNAVAILABLE("Firebase Performance is not supported for extensions.")
  21. @protocol FPRMemoryGaugeCollectorDelegate
  22. /**
  23. * Reports the collected memory gauge data back to its delegate.
  24. *
  25. * @param collector memory gauge collector that collected the information.
  26. * @param gaugeData memory gauge data.
  27. */
  28. - (void)memoryGaugeCollector:(FPRMemoryGaugeCollector *)collector
  29. gaugeData:(FPRMemoryGaugeData *)gaugeData;
  30. @end
  31. NS_EXTENSION_UNAVAILABLE("Firebase Performance is not supported for extensions.")
  32. @interface FPRMemoryGaugeCollector : NSObject <FPRGaugeCollector>
  33. /** Reference to the delegate object. */
  34. @property(nonatomic, weak, readonly) id<FPRMemoryGaugeCollectorDelegate> delegate;
  35. /**
  36. * Initializes the memory collector object with the delegate object provided.
  37. *
  38. * @param delegate Delegate object to which the memory gauge data is provided.
  39. * @return Instance of the memory gauge collector.
  40. */
  41. - (instancetype)initWithDelegate:(id<FPRMemoryGaugeCollectorDelegate>)delegate
  42. NS_DESIGNATED_INITIALIZER;
  43. /**
  44. * Initializer for the memory Gauge collector. This is not available.
  45. */
  46. - (instancetype)init NS_UNAVAILABLE;
  47. @end
  48. NS_ASSUME_NONNULL_END