LAPTOP-SNT8I5JK\Boounion
2025-03-10 19261d011387ec57d646decc945aadaf8913eeab
SourceCode/Bond/Servo/CAttributeVector.cpp
对比新文件
@@ -0,0 +1,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];
   }
}