LAPTOP-SNT8I5JK\Boounion
2025-05-09 29623a829f040af2cd27fd6c477d54294063a0ea
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
#include "stdafx.h"
#include "CAttributeVector.h"
 
 
namespace SERVO {
    CAttributeVector::CAttributeVector()
    {
 
    }
 
    CAttributeVector::~CAttributeVector()
    {
        for (auto item : m_attributes) {
            delete item;
        }
        m_attributes.clear();
    }
 
    void CAttributeVector::addAttribute(CAttribute* pAttribute)
    {
        m_attributes.push_back(pAttribute);
    }
 
    unsigned int CAttributeVector::size()
    {
        return m_attributes.size();
    }
 
    void CAttributeVector::clear()
    {
        for (auto item : m_attributes) {
            delete item;
        }
        m_attributes.clear();
    }
 
    bool CAttributeVector::empty()
    {
        return m_attributes.empty();
    }
 
    CAttribute* CAttributeVector::getAttribute(unsigned int index)
    {
        ASSERT(index < m_attributes.size());
        return m_attributes[index];
    }
}