LAPTOP-SNT8I5JK\Boounion
2025-07-14 375342c11638685d6b7fecc2a979825c56d770f9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include "stdafx.h"
#include "CReport.h"
 
 
namespace SERVO {
    CReport::CReport()
    {
 
    }
 
    CReport::~CReport()
    {
 
    }
 
    unsigned int CReport::getReportId()
    {
        return m_nReportId;
    }
 
    BOOL CReport::addVariable(CVariable* pVariable)
    {
        ASSERT(pVariable);
        if (getVariable(pVariable->getVarialbleId()) != nullptr) {
            return FALSE;
        }
 
        m_variabels.push_back(pVariable);
        return TRUE;
    }
 
    BOOL CReport::deleteVarialble(unsigned int nVarialbleId)
    {
        BOOL bDelete = FALSE;
        for (auto iter = m_variabels.begin(); iter != m_variabels.end(); ++iter) {
            if (nVarialbleId == (*iter)->getVarialbleId()) {
                m_variabels.erase(iter);
                bDelete = TRUE;
                break;
            }
        }
 
        return bDelete;
    }
 
    CVariable* CReport::getVariable(unsigned int nVarialbleId)
    {
        for (auto item : m_variabels) {
            if (nVarialbleId == item->getVarialbleId()) {
                return item;
            }
        }
 
        return nullptr;
    }
}