mirror of
https://gitee.com/fasiondog/hikyuu.git
synced 2024-12-04 04:48:17 +08:00
Performance add exist
This commit is contained in:
parent
985934d58e
commit
3992e59b8d
@ -72,6 +72,17 @@ Performance::Performance() {
|
||||
|
||||
Performance::~Performance() {}
|
||||
|
||||
bool Performance::exist(const string& key) {
|
||||
bool ret = false;
|
||||
for (const auto& item : ms_keys) {
|
||||
if (item == key) {
|
||||
ret = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Performance& Performance::operator=(const Performance& other) {
|
||||
HKU_IF_RETURN(this == &other, *this);
|
||||
m_result = other.m_result;
|
||||
|
@ -29,6 +29,9 @@ public:
|
||||
Performance& operator=(const Performance& other);
|
||||
Performance& operator=(Performance&& other);
|
||||
|
||||
/** 是否为合法的统计项 */
|
||||
static bool exist(const string& key);
|
||||
|
||||
/** 复位,清除已计算的结果 */
|
||||
void reset();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user