/// <summary> /// 创建基础时间流 /// </summary> /// <param name="timeUpdate"></param> /// <param name="tfIndex">数组前两个线程是给框架使用,0负责数据部分 1负责文件部分</param> internal static BaseTimeFlow CreateTimeFlow(ITimeUpdate timeUpdate, int tfIndex = -1) { if (tfIndex == -1) { return(new BaseTimeFlow(timeUpdate)); } else { return(new BaseTimeFlow(timeUpdate, tfIndex)); } }
/// <summary> /// 创建一个同步时间流 /// </summary> /// <param name="timeUpdate"></param> /// <returns></returns> public static TimeFlow CreateSync(ITimeUpdate timeUpdate) { return(new TimeFlow(timeUpdate, 2)); }
/// <summary> /// 构造函数 内部使用 /// </summary> /// <param name="timeUpdate"></param> /// <param name="tfIndex">数组前两个线程是给框架使用,0负责数据部分 1负责文件部分</param> private TimeFlow(ITimeUpdate timeUpdate, int tfIndex) : base(timeUpdate, tfIndex) { }
/// <summary> /// 构造函数 多线程处理逻辑 /// </summary> private TimeFlow(ITimeUpdate timeUpdate) : base(timeUpdate) { }
/// <summary> /// 构造函数 内部使用 /// </summary> /// <param name="timeUpdate"></param> /// <param name="tfIndex">数组前两个线程是给框架使用,0负责数据部分 1负责文件部分</param> protected BaseTimeFlow(ITimeUpdate timeUpdate, int tfIndex) { reference = new WeakReference <ITimeUpdate>(timeUpdate); TimeFlowManager.Instance.PushTimeFlow(this, tfIndex); }