Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Toggle main menu visibility
Main Page
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
h
i
l
m
n
o
p
r
s
t
u
v
Functions
a
b
c
d
e
f
h
i
l
n
o
p
r
s
t
u
v
Variables
Typedefs
Enumerations
a
c
d
f
h
i
l
m
p
r
s
t
v
Enumerator
a
c
d
f
h
i
l
m
p
r
s
t
u
v
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
~
Variables
a
b
c
d
e
f
h
i
j
l
m
n
o
p
q
r
s
t
u
w
Typedefs
Enumerations
Enumerator
b
c
d
e
f
i
m
n
q
r
s
x
Files
File List
File Members
All
f
o
r
Functions
Variables
Macros
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
Loading...
Searching...
No Matches
aligned_storage.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2022 Roc Streaming authors
3
*
4
* This Source Code Form is subject to the terms of the Mozilla Public
5
* License, v. 2.0. If a copy of the MPL was not distributed with this
6
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
*/
8
9
//! @file roc_core/aligned_storage.h
10
//! @brief Aligned storage.
11
12
#ifndef ROC_CORE_ALIGNED_STORAGE_H_
13
#define ROC_CORE_ALIGNED_STORAGE_H_
14
15
#include "
roc_core/align_ops.h
"
16
#include "
roc_core/stddefs.h
"
17
18
namespace
roc
{
19
namespace
core {
20
21
//! Fixed-size maximum-aligned storage.
22
template
<
size_t
Size>
class
AlignedStorage
{
23
public
:
24
//! Get storage size.
25
static
size_t
size
() {
26
return
sizeof
(Memory);
27
}
25
static
size_t
size
() {
…
}
28
29
//! Get storage memory.
30
const
void
*
memory
()
const
{
31
return
memory_.payload;
32
}
30
const
void
*
memory
()
const
{
…
}
33
34
//! Get storage memory.
35
void
*
memory
() {
36
return
memory_.payload;
37
}
35
void
*
memory
() {
…
}
38
39
private
:
40
union
Memory {
41
AlignMax
alignment;
42
char
payload[
Size
!= 0 ?
Size
: 1];
43
};
44
45
Memory memory_;
46
};
22
template
<
size_t
Size>
class
AlignedStorage
{
…
};
47
48
}
// namespace core
49
}
// namespace roc
50
51
#endif
// ROC_CORE_ALIGNED_STORAGE_H_
align_ops.h
Alignment operations.
roc::core::AlignedStorage
Fixed-size maximum-aligned storage.
Definition
aligned_storage.h:22
roc::core::AlignedStorage::memory
const void * memory() const
Get storage memory.
Definition
aligned_storage.h:30
roc::core::AlignedStorage::memory
void * memory()
Get storage memory.
Definition
aligned_storage.h:35
roc::core::AlignedStorage::size
static size_t size()
Get storage size.
Definition
aligned_storage.h:25
roc::core::SharedPtr
Shared ownership intrusive pointer.
Definition
shared_ptr.h:32
roc
Root namespace.
stddefs.h
Commonly used types and functions.
roc::core::AlignMax
Maximum aligned data unit.
Definition
align_ops.h:21
roc_core
aligned_storage.h
Generated by
1.9.8