GULRuntimeClassSnapshot.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright 2018 Google LLC
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. @class GULRuntimeClassDiff;
  18. NS_ASSUME_NONNULL_BEGIN
  19. /** This class is able to capture the runtime state of a given class. */
  20. @interface GULRuntimeClassSnapshot : NSObject
  21. - (instancetype)init NS_UNAVAILABLE;
  22. /** Instantiates an instance of this class with the given class.
  23. *
  24. * @param aClass The class that will be snapshot.
  25. * @return An instance of this class.
  26. */
  27. - (instancetype)initWithClass:(Class)aClass NS_DESIGNATED_INITIALIZER;
  28. /** Captures the runtime state of this class. */
  29. - (void)capture;
  30. /** Calculates the diff between snapshots and returns a diff object populated with information.
  31. *
  32. * @param otherClassSnapshot The other snapshot to compare it to. It's assumed that the
  33. * otherClassSnapshot was created after the caller.
  34. * @return A diff object representing the diff between the two snapshots.
  35. */
  36. - (GULRuntimeClassDiff *)diff:(GULRuntimeClassSnapshot *)otherClassSnapshot;
  37. @end
  38. NS_ASSUME_NONNULL_END