-
Notifications
You must be signed in to change notification settings - Fork 130
/
BinaryStreamWriter.h
51 lines (41 loc) · 1.46 KB
/
BinaryStreamWriter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "dna/Defs.h"
#include "dna/StreamWriter.h"
#include "dna/types/Aliases.h"
namespace dna {
class DNAAPI BinaryStreamWriter : public StreamWriter {
public:
/**
@brief Factory method for creation of BinaryStreamWriter
@param stream
Stream into which the data is going to be written.
@param memRes
Memory resource to be used for allocations.
@note
If a memory resource is not given, a default allocation mechanism will be used.
@warning
User is responsible for releasing the returned pointer by calling destroy.
@see destroy
*/
static BinaryStreamWriter* create(BoundedIOStream* stream, MemoryResource* memRes = nullptr);
/**
@brief Method for freeing a BinaryStreamWriter instance.
@param instance
Instance of BinaryStreamWriter to be freed.
@see create
*/
static void destroy(BinaryStreamWriter* instance);
~BinaryStreamWriter() override;
};
} // namespace dna
namespace pma {
template<>
struct DefaultInstanceCreator<dna::BinaryStreamWriter> {
using type = pma::FactoryCreate<dna::BinaryStreamWriter>;
};
template<>
struct DefaultInstanceDestroyer<dna::BinaryStreamWriter> {
using type = pma::FactoryDestroy<dna::BinaryStreamWriter>;
};
} // namespace pma