- 论坛徽章:
- 0
|
这个类中的BasicTaskScheduler()是不是构造函数啊,为什么它被creatNew()调用?
- class BasicTaskScheduler: public BasicTaskScheduler0 {
- public:
- static BasicTaskScheduler* createNew();
- virtual ~BasicTaskScheduler();
- protected:
- BasicTaskScheduler();
- // called only by "createNew()"
- protected:
- // Redefined virtual functions:
- virtual void SingleStep(unsigned maxDelayTime);
- virtual void setBackgroundHandling(int socketNum, int conditionSet, BackgroundHandlerProc* handlerProc, void* clientData);
- virtual void moveSocketHandling(int oldSocketNum, int newSocketNum);
- protected:
- // To implement background operations:
- int fMaxNumSockets;
- fd_set fReadSet;
- fd_set fWriteSet;
- fd_set fExceptionSet;
- };
复制代码- BasicTaskScheduler* BasicTaskScheduler::createNew() {
- return new BasicTaskScheduler();
- }
复制代码 return new BasicTaskScheduler()
new一个函数吗???看不懂啊。
|
|