FLEXMethodBase.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // FLEXMethodBase.h
  3. // FLEX
  4. //
  5. // Derived from MirrorKit.
  6. // Created by Tanner on 7/5/15.
  7. // Copyright (c) 2015 Tanner Bennett. All rights reserved.
  8. //
  9. #import <Foundation/Foundation.h>
  10. /// A base class for methods which encompasses those that may not
  11. /// have been added to a class yet. Useful on it's own for adding
  12. /// methods to a class, or building a new class from the ground up.
  13. @interface FLEXMethodBase : NSObject {
  14. @protected
  15. SEL _selector;
  16. NSString *_name;
  17. NSString *_typeEncoding;
  18. IMP _implementation;
  19. NSString *_flex_description;
  20. }
  21. /// Constructs and returns an \c FLEXSimpleMethod instance with the given name, type encoding, and implementation.
  22. + (instancetype)buildMethodNamed:(NSString *)name withTypes:(NSString *)typeEncoding implementation:(IMP)implementation;
  23. /// The selector of the method.
  24. @property (nonatomic, readonly) SEL selector;
  25. /// The selector string of the method.
  26. @property (nonatomic, readonly) NSString *selectorString;
  27. /// Same as selectorString.
  28. @property (nonatomic, readonly) NSString *name;
  29. /// The type encoding of the method.
  30. @property (nonatomic, readonly) NSString *typeEncoding;
  31. /// The implementation of the method.
  32. @property (nonatomic, readonly) IMP implementation;
  33. /// For internal use
  34. @property (nonatomic) id tag;
  35. @end