Doxygen Samurai Engine
0.0.1
Doxygen Samurai Engine Documentation
Loading...
Searching...
No Matches
containerInformation.h
Go to the documentation of this file.
1
#pragma once
2
#include <string>
3
#include <
baseContainer.h
>
4
5
namespace
samurai
6
{
7
8
struct
ContainerInformation
9
{
10
ContainerInformation
() {};
11
ContainerInformation
(
12
size_t
containerStructBaseSize
,
13
const
char
*
containerName
,
14
const
ContainerStaticInfo
&
containerStaticInfo
):
15
containerStructBaseSize
(
containerStructBaseSize
),
containerName
(
containerName
),
16
containerStaticInfo
(
containerStaticInfo
)
17
{
18
useDefaultAllocator
=
containerStaticInfo
.
useDefaultAllocator
;
19
};
20
21
bool
operator==
(
const
ContainerInformation
&other)
22
{
23
if
(
this
== &other) {
return
true
; }
24
25
return
26
this->
containerStructBaseSize
== other.
containerStructBaseSize
&&
27
this->
containerName
== other.
containerName
&&
28
this->
containerStaticInfo
== other.
containerStaticInfo
&&
29
this->
useDefaultAllocator
== other.
useDefaultAllocator
;
30
31
}
32
33
bool
operator!=
(
const
ContainerInformation
&other)
34
{
35
return
!(*
this
== other);
36
}
37
38
size_t
containerStructBaseSize
= 0;
//static memory
39
std::string
containerName
=
""
;
40
ContainerStaticInfo
containerStaticInfo
= {};
41
bool
useDefaultAllocator
= 0;
42
43
size_t
calculateMemoryRequirements
()
44
{
45
if
(
useDefaultAllocator
) {
return
0; }
46
47
size_t
size = 0;
48
49
size +=
containerStructBaseSize
;
50
samurai::align64
(size);
51
52
size +=
containerStaticInfo
.
defaultHeapMemorySize
;
53
54
for
(
auto
i :
containerStaticInfo
.
bonusAllocators
)
55
{
56
samurai::align64
(size);
57
size += i;
58
}
59
60
return
size;
61
}
62
};
63
64
}
baseContainer.h
samurai
Definition
assetManagerWindow.cpp:10
samurai::align64
void align64(size_t &val)
Definition
Sizes.h:14
ContainerStaticInfo
Definition
baseContainer.h:108
ContainerStaticInfo::defaultHeapMemorySize
size_t defaultHeapMemorySize
Definition
baseContainer.h:111
ContainerStaticInfo::bonusAllocators
samurai::StaticVector< size_t, MaxAllocatorsCount > bonusAllocators
Definition
baseContainer.h:119
ContainerStaticInfo::useDefaultAllocator
bool useDefaultAllocator
Definition
baseContainer.h:116
samurai::ContainerInformation
Definition
containerInformation.h:9
samurai::ContainerInformation::containerName
std::string containerName
Definition
containerInformation.h:39
samurai::ContainerInformation::ContainerInformation
ContainerInformation()
Definition
containerInformation.h:10
samurai::ContainerInformation::calculateMemoryRequirements
size_t calculateMemoryRequirements()
Definition
containerInformation.h:43
samurai::ContainerInformation::operator!=
bool operator!=(const ContainerInformation &other)
Definition
containerInformation.h:33
samurai::ContainerInformation::containerStaticInfo
ContainerStaticInfo containerStaticInfo
Definition
containerInformation.h:40
samurai::ContainerInformation::ContainerInformation
ContainerInformation(size_t containerStructBaseSize, const char *containerName, const ContainerStaticInfo &containerStaticInfo)
Definition
containerInformation.h:11
samurai::ContainerInformation::useDefaultAllocator
bool useDefaultAllocator
Definition
containerInformation.h:41
samurai::ContainerInformation::operator==
bool operator==(const ContainerInformation &other)
Definition
containerInformation.h:21
samurai::ContainerInformation::containerStructBaseSize
size_t containerStructBaseSize
Definition
containerInformation.h:38
shared
containerInformation.h
Generated by
1.10.0