FPRMemoryGaugeCollector.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. @protocol FPRMemoryGaugeCollectorDelegate
  21. /**
  22. * Reports the collected memory gauge data back to its delegate.
  23. *
  24. * @param collector memory gauge collector that collected the information.
  25. * @param gaugeData memory gauge data.
  26. */
  27. - (void)memoryGaugeCollector:(FPRMemoryGaugeCollector *)collector
  28. gaugeData:(FPRMemoryGaugeData *)gaugeData;
  29. @end
  30. @interface FPRMemoryGaugeCollector : NSObject <FPRGaugeCollector>
  31. /** Reference to the delegate object. */
  32. @property(nonatomic, weak, readonly) id<FPRMemoryGaugeCollectorDelegate> delegate;
  33. /**
  34. * Initializes the memory collector object with the delegate object provided.
  35. *
  36. * @param delegate Delegate object to which the memory gauge data is provided.
  37. * @return Instance of the memory gauge collector.
  38. */
  39. - (instancetype)initWithDelegate:(id<FPRMemoryGaugeCollectorDelegate>)delegate
  40. NS_DESIGNATED_INITIALIZER;
  41. /**
  42. * Initializer for the memory Gauge collector. This is not available.
  43. */
  44. - (instancetype)init NS_UNAVAILABLE;
  45. @end
  46. NS_ASSUME_NONNULL_END