import_lib sample
tinyxml2::DynArray
is only used within import_lib sample.
Symbol previews are coming soon...
Symbols
loading...
Files
loading (1/4)...
Summary
Syntax
Examples
References
Call Tree
Data Use
Class Tree
Override Tree
Implementations
Instances
Lifecycle
SourceVu
ESP-IDF Framework and Examples
import_lib sample
tinyxml2::DynArray
tinyxml2::DynArray
Syntax
Show:
Summary
Declaration
from
tinyxml2.h:206
class
DynArray
{
public
:
DynArray
(
)
:
_mem
(
_pool
)
,
_allocated
(
INITIAL_SIZE
)
,
_size
(
0
)
{
}
~
DynArray
(
)
{
if
(
_mem
!=
_pool
)
{
delete
[
]
_mem
;
}
}
void
Clear
(
)
{
_size
=
0
;
}
void
Push
(
T
t
)
{
TIXMLASSERT
(
_size
<
INT_MAX
)
;
EnsureCapacity
(
_size
+
1
)
;
_mem
[
_size
]
=
t
;
++
_size
;
}
T
*
PushArr
(
int
count
)
{
TIXMLASSERT
(
count
>=
0
)
;
TIXMLASSERT
(
_size
<=
INT_MAX
-
count
)
;
EnsureCapacity
(
_size
+
count
)
;
T
*
ret
=
&
_mem
[
_size
]
;
_size
+=
count
;
return
ret
;
}
T
Pop
(
)
{
TIXMLASSERT
(
_size
>
0
)
;
--
_size
;
return
_mem
[
_size
]
;
}
void
PopArr
(
int
count
)
{
TIXMLASSERT
(
_size
>=
count
)
;
_size
-=
count
;
}
bool
Empty
(
)
const
{
return
_size
==
0
;
}
T
&
operator
[
]
(
int
i
)
{
TIXMLASSERT
(
i
>=
0
&&
i
<
_size
)
;
return
_mem
[
i
]
;
}
const
T
&
operator
[
]
(
int
i
)
const
{
TIXMLASSERT
(
i
>=
0
&&
i
<
_size
)
;
return
_mem
[
i
]
;
}
const
T
&
PeekTop
(
)
const
{
TIXMLASSERT
(
_size
>
0
)
;
return
_mem
[
_size
-
1
]
;
}
int
Size
(
)
const
{
TIXMLASSERT
(
_size
>=
0
)
;
return
_size
;
}
int
Capacity
(
)
const
{
TIXMLASSERT
(
_allocated
>=
INITIAL_SIZE
)
;
return
_allocated
;
}
void
SwapRemove
(
int
i
)
{
TIXMLASSERT
(
i
>=
0
&&
i
<
_size
)
;
TIXMLASSERT
(
_size
>
0
)
;
_mem
[
i
]
=
_mem
[
_size
-
1
]
;
--
_size
;
}
const
T
*
Mem
(
)
const
{
TIXMLASSERT
(
_mem
)
;
return
_mem
;
}
T
*
Mem
(
)
{
TIXMLASSERT
(
_mem
)
;
return
_mem
;
}
private
:
DynArray
(
const
DynArray
&
)
;
void
operator
=
(
const
DynArray
&
)
;
void
EnsureCapacity
(
int
cap
)
{
TIXMLASSERT
(
cap
>
0
)
;
if
(
cap
>
_allocated
)
{
TIXMLASSERT
(
cap
<=
INT_MAX
/
2
)
;
const
int
newAllocated
=
cap
*
2
;
T
*
newMem
=
new
T
[
newAllocated
]
;
TIXMLASSERT
(
newAllocated
>=
_size
)
;
memcpy
(
newMem
,
_mem
,
sizeof
(
T
)
*
_size
)
;
if
(
_mem
!=
_pool
)
{
delete
[
]
_mem
;
}
_mem
=
newMem
;
_allocated
=
newAllocated
;
}
}
T
*
_mem
;
T
_pool
[
INITIAL_SIZE
]
;
int
_allocated
;
int
_size
;
}
;
Examples
References
from
examples
Code
Location
Scope
Referrer
class
DynArray
tinyxml2.h:206
DynArray
(
const
DynArray
&
)
;
// not supported
tinyxml2.h:300
tinyxml2::DynArray::DynArray()
void
operator
=
(
const
DynArray
&
)
;
// not supported
tinyxml2.h:301
tinyxml2::DynArray::operator=()
tinyxml2::DynArray::operator=()::#0
DynArray
<
Block
*
,
10
>
_blockPtrs
;
tinyxml2.h:451
DynArray
<
XMLNode
*
,
10
>
_unlinked
;
tinyxml2.h:1949
tinyxml2::XMLDocument
tinyxml2::XMLDocument::_unlinked
DynArray
<
const
char
*
,
10
>
_stack
;
tinyxml2.h:2342
tinyxml2::XMLPrinter
tinyxml2::XMLPrinter::_stack
DynArray
<
char
,
20
>
_buffer
;
tinyxml2.h:2366
tinyxml2::XMLPrinter
tinyxml2::XMLPrinter::_buffer
Call Tree
from
examples
All items filtered out
All items filtered out
Data Use
from
examples
All items filtered out
All items filtered out
Class Tree
from
examples
All items filtered out
All items filtered out
Override Tree
from
examples
All items filtered out
All items filtered out
Implementations
from
examples
All items filtered out
All items filtered out
Instances
from
examples
Instance
Scope
Location
Project
tinyxml2::DynArray::operator=()::#0
tinyxml2::DynArray::operator=()
tinyxml2.h:301
tinyxml2::XMLDocument::_unlinked
tinyxml2::XMLDocument
tinyxml2.h:1949
tinyxml2::XMLPrinter::_stack
tinyxml2::XMLPrinter
tinyxml2.h:2342
tinyxml2::XMLPrinter::_buffer
tinyxml2::XMLPrinter
tinyxml2.h:2366
Lifecycle
from
examples
All items filtered out
All items filtered out