Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/CBasic/CStatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class CSTATUS {
this->error_info_ = errorInfo;
}

explicit CSTATUS(const int& errorCode, const std::string& errorInfo) {
explicit CSTATUS(const int errorCode, const std::string& errorInfo) {
this->error_code_ = errorCode;
this->error_info_ = errorInfo;
}
Expand Down Expand Up @@ -145,7 +145,7 @@ class CSTATUS {
* @param info
* @return
*/
CSTATUS* setInfo(const int& code, const std::string& info) {
CSTATUS* setInfo(const int code, const std::string& info) {
error_code_ = code;
error_info_ = (STATUS_OK == error_code_) ? CGRAPH_EMPTY : info;
return this;
Expand Down
12 changes: 6 additions & 6 deletions src/GraphCtrl/GraphElement/GElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ CBool GElement::isMacro() const {
}


CStatus GElement::crashed(const CException& ex) {
CStatus GElement::crashed(const CException& ex) const {
(void)(this);
return CStatus(internal::STATUS_CRASH, ex.what());
}
Expand All @@ -352,7 +352,7 @@ CIndex GElement::getThreadIndex() {
CGRAPH_THROW_EXCEPTION_BY_CONDITION((nullptr == thread_pool_), \
this->getName() + " getThreadIndex with no thread pool") // 理论不可能出现的情况

auto tid = (CSize)std::hash<std::thread::id>{}(std::this_thread::get_id());
const auto tid = (CSize)std::hash<std::thread::id>{}(std::this_thread::get_id());
return thread_pool_->getThreadIndex(tid);
}

Expand Down Expand Up @@ -452,12 +452,12 @@ CVoid GElement::checkSuspend() {

CBool GElement::isGGroup() const {
// 按位与 GROUP有值,表示是 GROUP的逻辑
return (long(element_type_) & long(GElementType::GROUP)) > 0;
return (static_cast<long>(element_type_) & static_cast<long>(GElementType::GROUP)) > 0;
}


CBool GElement::isGAdaptor() const {
return (long(element_type_) & long(GElementType::ADAPTER)) > 0;
return (static_cast<long>(element_type_) & static_cast<long>(GElementType::ADAPTER)) > 0;
}


Expand Down Expand Up @@ -540,7 +540,7 @@ CStatus GElement::asyncRun() {
return run();
}, CGRAPH_POOL_TASK_STRATEGY);

auto futStatus = async_result_.wait_for(std::chrono::milliseconds(timeout_));
const auto& futStatus = async_result_.wait_for(std::chrono::milliseconds(timeout_));
if (std::future_status::ready == futStatus) {
status = getAsyncResult();
} else {
Expand Down Expand Up @@ -642,7 +642,7 @@ std::string GElement::__str_4py() {
// python 中 print 展示的格式
std::string info = "<name=" + this->getName() +
", session=" + this->getSession() + ", loop=" + std::to_string(this->getLoop());
auto relation = this->getRelation();
const auto& relation = this->getRelation();
if (relation.belong_) {
info += ", belong=" + relation.belong_->getName();
}
Expand Down
2 changes: 1 addition & 1 deletion src/GraphCtrl/GraphElement/GElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class GElement : public GElementObject,
* @param ex
* @return
*/
CStatus crashed(const CException& ex);
CStatus crashed(const CException& ex) const;

/**
* 获取当前element内部参数
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ CVoid GDynamicEngine::parallelRunOne(GElementPtr element) {
}
}

const auto& finishedSize = parallel_run_num_.fetch_add(1, std::memory_order_release) + 1;
const auto finishedSize = parallel_run_num_.fetch_add(1, std::memory_order_release) + 1;
if (finishedSize >= total_end_size_ || cur_status_.isErr()) {
CGRAPH_UNIQUE_LOCK lock(locker_.mtx_);
locker_.cv_.notify_one();
Expand Down
5 changes: 3 additions & 2 deletions src/GraphCtrl/GraphPipeline/GPipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ class GPipeline : public GPipelineObject,
* @tparam Args
* @param elementRef
* @param depends
* @param args
* @return
*/
template<typename TNode, typename ...Args,
Expand All @@ -174,7 +175,7 @@ class GPipeline : public GPipelineObject,

/**
* 注册一个 node
* @tparam T
* @tparam TNode
* @param depends
* @param name
* @param loop
Expand Down Expand Up @@ -300,7 +301,7 @@ class GPipeline : public GPipelineObject,

/**
* 添加模板类型守护
* @tparam TAspect
* @tparam TDaemon
* @tparam Args
* @param ms
* @param args
Expand Down
Loading