-
Notifications
You must be signed in to change notification settings - Fork 598
Expand file tree
/
Copy pathCPTFunctionDataSource.h
More file actions
42 lines (28 loc) · 1.44 KB
/
CPTFunctionDataSource.h
File metadata and controls
42 lines (28 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#import "CPTPlot.h"
@class CPTPlotRange;
/// @file
/**
* @brief A function called to generate plot data in a CPTFunctionDataSource datasource.
**/
typedef double (*CPTDataSourceFunction)(double);
/**
* @brief An Objective-C block called to generate plot data in a CPTFunctionDataSource datasource.
**/
typedef double (^CPTDataSourceBlock)(double);
@interface CPTFunctionDataSource : NSObject<CPTPlotDataSource>
@property (nonatomic, readonly, nullable) CPTDataSourceFunction dataSourceFunction;
@property (nonatomic, readonly, nullable) CPTDataSourceBlock dataSourceBlock;
@property (nonatomic, readonly, nonnull) CPTPlot *dataPlot;
@property (nonatomic, readwrite) CGFloat resolution;
@property (nonatomic, readwrite, strong, nullable) CPTPlotRange *dataRange;
/// @name Factory Methods
/// @{
+(nonnull instancetype)dataSourceForPlot:(nonnull CPTPlot *)plot withFunction:(nonnull CPTDataSourceFunction) function NS_SWIFT_NAME(init(for:withFunction:));
+(nonnull instancetype)dataSourceForPlot:(nonnull CPTPlot *)plot withBlock:(nonnull CPTDataSourceBlock) block NS_SWIFT_NAME(init(for:withBlock:));
/// @}
/// @name Initialization
/// @{
-(nonnull instancetype)initForPlot:(nonnull CPTPlot *)plot withFunction:(nonnull CPTDataSourceFunction) function NS_SWIFT_NAME(init(forPlot:withFunction:));
-(nonnull instancetype)initForPlot:(nonnull CPTPlot *)plot withBlock:(nonnull CPTDataSourceBlock) block NS_SWIFT_NAME(init(forPlot:withBlock:));
/// @}
@end