------------------------ ComponentPool::Append Add an component to the end of the buffer (without knowing its static type data)
| 55 | // Add an component to the end of the buffer (without knowing its static type data) |
| 56 | // |
| 57 | void ComponentPool::Append(void const* const componentData) |
| 58 | { |
| 59 | size_t const typeSize = ComponentRegistry::Instance().GetSize(m_ComponentType); |
| 60 | size_t const byteIdx = m_Buffer.size(); |
| 61 | |
| 62 | // add space in the buffer so we can create our new component |
| 63 | m_Buffer.resize(byteIdx + typeSize); |
| 64 | |
| 65 | // call the copy constructor on the component in our new memory location |
| 66 | ComponentRegistry::Instance().GetCopyAssign(m_ComponentType)(componentData, static_cast<void*>(&m_Buffer[byteIdx])); |
| 67 | } |
| 68 | |
| 69 | //------------------------ |
| 70 | // ComponentPool::Erase |
no test coverage detected