forked from core-plot/core-plot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCPTFunctionDataSource.h
More file actions
38 lines (28 loc) · 1.17 KB
/
CPTFunctionDataSource.h
File metadata and controls
38 lines (28 loc) · 1.17 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
#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) CPTDataSourceFunction dataSourceFunction;
@property (nonatomic, readonly) CPTDataSourceBlock dataSourceBlock;
@property (nonatomic, readonly, cpt_weak_property) __cpt_weak CPTPlot *dataPlot;
@property (nonatomic, readwrite) CGFloat resolution;
@property (nonatomic, readwrite, strong) CPTPlotRange *dataRange;
/// @name Factory Methods
/// @{
+(instancetype)dataSourceForPlot:(CPTPlot *)plot withFunction:(CPTDataSourceFunction)function;
+(instancetype)dataSourceForPlot:(CPTPlot *)plot withBlock:(CPTDataSourceBlock)block;
/// @}
/// @name Initialization
/// @{
-(instancetype)initForPlot:(CPTPlot *)plot withFunction:(CPTDataSourceFunction)function;
-(instancetype)initForPlot:(CPTPlot *)plot withBlock:(CPTDataSourceBlock)block;
/// @}
@end