BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
libraries
fc
src
static_variant.cpp
Go to the documentation of this file.
1
#include <
fc/static_variant.hpp
>
2
3
4
namespace
fc
{
namespace
impl {
5
6
dynamic_storage::dynamic_storage
() : storage(nullptr) {};
7
8
dynamic_storage::~dynamic_storage
()
9
{
10
release
();
11
}
12
13
void
*
dynamic_storage::data
()
const
14
{
15
FC_ASSERT
( storage !=
nullptr
);
16
return
(
void
*)storage;
17
}
18
19
void
dynamic_storage::alloc
(
size_t
size )
20
{
21
release
();
22
storage =
new
char
[size];
23
}
24
25
void
dynamic_storage::release
()
26
{
27
delete
[] storage;
28
storage =
nullptr
;
29
}
30
31
}}
fc
Definition:
api.hpp:15
static_variant.hpp
fc::impl::dynamic_storage::release
void release()
Definition:
static_variant.cpp:25
fc::impl::dynamic_storage::dynamic_storage
dynamic_storage()
Definition:
static_variant.cpp:6
fc::impl::dynamic_storage::~dynamic_storage
~dynamic_storage()
Definition:
static_variant.cpp:8
FC_ASSERT
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
Definition:
exception.hpp:345
fc::impl::dynamic_storage::data
void * data() const
Definition:
static_variant.cpp:13
fc::impl::dynamic_storage::alloc
void alloc(size_t size)
Definition:
static_variant.cpp:19
Generated on Fri Dec 15 2023 06:12:43 for BitShares-Core by
1.8.17