| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #pragma once
- #include <string>
- #include <baseContainer.h>
- namespace pika
- {
- struct ContainerInformation
- {
- ContainerInformation() {};
- ContainerInformation(
- size_t containerStructBaseSize,
- const char *containerName,
- const ContainerStaticInfo& containerStaticInfo):
- containerStructBaseSize(containerStructBaseSize), containerName(containerName),
- containerStaticInfo(containerStaticInfo)
- {
- };
- bool operator==(const ContainerInformation &other)
- {
- if (this == &other) { return true; }
- return
- this->containerStructBaseSize == other.containerStructBaseSize &&
- this->containerName == other.containerName &&
- this->containerStaticInfo == other.containerStaticInfo;
- }
- bool operator!=(const ContainerInformation &other)
- {
- return !(*this == other);
- }
- size_t containerStructBaseSize = 0; //static memory
- std::string containerName = "";
- ContainerStaticInfo containerStaticInfo = {};
- size_t calculateMemoryRequirements()
- {
- size_t size = 0;
- size += containerStructBaseSize;
- pika::align64(size);
- size += containerStaticInfo.defaultHeapMemorySize;
- for (auto i : containerStaticInfo.bonusAllocators)
- {
- pika::align64(size);
- size += i;
- }
- return size;
- }
- };
- }
|