Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ZSaberLv0 committed Jun 21, 2024
1 parent d5ca635 commit 091db8f
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
71 changes: 71 additions & 0 deletions ZF/ZFUtility/zfsrc/ZFUtility/ZFTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,31 @@ ZFOBJECT_ON_INIT_DEFINE_2(ZFTask
this->implStop(implStop);
}

void ZFTask::objectInfoT(ZF_IN_OUT zfstring &ret) {
ret += ZFTOKEN_ZFObjectInfoLeft;
if(this->started()) {
zfstringAppend(ret, "%s running"
, this->classData()->className()
);
}
else {
zfstringAppend(ret, "%s %s"
, this->classData()->className()
, this->resultType()
);
if(!this->errorHint().isEmpty()) {
ret += ":\"";
ret += this->errorHint();
ret += "\"";
}
if(this->result() != zfnull) {
ret += ", result: ";
this->result()->objectInfoT(ret);
}
}
ret += ZFTOKEN_ZFObjectInfoRight;
}

// ============================================================
ZFOBJECT_REGISTER(ZFTaskGroup)

Expand Down Expand Up @@ -148,6 +173,29 @@ void ZFTaskGroup::taskOnStop(void) {
zfsuper::taskOnStop();
}

void ZFTaskGroup::objectInfoT(ZF_IN_OUT zfstring &ret) {
ret += ZFTOKEN_ZFObjectInfoLeft;
if(this->started()) {
zfstringAppend(ret, "%s running"
, this->classData()->className()
);
}
else {
zfstringAppend(ret, "%s %s"
, this->classData()->className()
, this->resultType()
);
if(!this->errorHint().isEmpty()) {
ret += ":\"";
ret += this->errorHint();
ret += "\"";
}
ret += " ";
this->childArray()->objectInfoOfContentT(ret);
}
ret += ZFTOKEN_ZFObjectInfoRight;
}

// ============================================================
ZFOBJECT_REGISTER(ZFTaskQueue)

Expand Down Expand Up @@ -225,4 +273,27 @@ void ZFTaskQueue::taskOnStop(void) {
zfsuper::taskOnStop();
}

void ZFTaskQueue::objectInfoT(ZF_IN_OUT zfstring &ret) {
ret += ZFTOKEN_ZFObjectInfoLeft;
if(this->started()) {
zfstringAppend(ret, "%s running"
, this->classData()->className()
);
}
else {
zfstringAppend(ret, "%s %s"
, this->classData()->className()
, this->resultType()
);
if(!this->errorHint().isEmpty()) {
ret += ":\"";
ret += this->errorHint();
ret += "\"";
}
ret += " ";
this->childArray()->objectInfoOfContentT(ret);
}
ret += ZFTOKEN_ZFObjectInfoRight;
}

ZF_NAMESPACE_GLOBAL_END
6 changes: 6 additions & 0 deletions ZF/ZFUtility/zfsrc/ZFUtility/ZFTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ zfclass ZFLIB_ZFUtility ZFTask : zfextend ZFObject {
this->stop();
zfsuper::objectOnDeallocPrepare();
}
zfoverride
virtual void objectInfoT(ZF_IN_OUT zfstring &ret);

private:
zfbool _ZFP_started;
Expand Down Expand Up @@ -166,6 +168,8 @@ zfclass ZFLIB_ZFUtility ZFTaskGroup : zfextend ZFTask {
virtual void taskOnStart(void);
zfoverride
virtual void taskOnStop(void);
zfoverride
virtual void objectInfoT(ZF_IN_OUT zfstring &ret);
};

/**
Expand Down Expand Up @@ -204,6 +208,8 @@ zfclass ZFLIB_ZFUtility ZFTaskQueue : zfextend ZFTask {
virtual void taskOnStart(void);
zfoverride
virtual void taskOnStop(void);
zfoverride
virtual void objectInfoT(ZF_IN_OUT zfstring &ret);
};

ZF_NAMESPACE_GLOBAL_END
Expand Down

0 comments on commit 091db8f

Please sign in to comment.