DNA Calib 1.1
Project brief
Concepts.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "trio/Defs.h"
6
7#include <cstddef>
8#include <cstdint>
9
10namespace trio {
11
12class Writable;
13
15 public:
25 virtual std::size_t read(char* destination, std::size_t size) = 0;
35 virtual std::size_t read(Writable* destination, std::size_t size) = 0;
36
37 protected:
38 virtual ~Readable();
39
40};
41
43 public:
53 virtual std::size_t write(const char* source, std::size_t size) = 0;
63 virtual std::size_t write(Readable* source, std::size_t size) = 0;
64
65 protected:
66 virtual ~Writable();
67
68};
69
71 public:
77 virtual std::uint64_t tell() = 0;
83 virtual void seek(std::uint64_t position) = 0;
84
85 protected:
86 virtual ~Seekable();
87
88};
89
91 public:
95 virtual void open() = 0;
96
97 protected:
98 virtual ~Openable();
99
100};
101
103 public:
107 virtual void close() = 0;
108
109 protected:
110 virtual ~Closeable();
111
112};
113
114class TRIOAPI Controllable : public Openable, public Closeable {
115 protected:
116 virtual ~Controllable();
117
118};
119
121 public:
127 virtual std::uint64_t size() = 0;
128
129 protected:
130 virtual ~Bounded();
131
132};
133
135 public:
139 virtual void flush() = 0;
140
141 protected:
142 virtual ~Buffered();
143
144};
145
147 public:
151 virtual void resize(std::uint64_t size) = 0;
152
153 protected:
154 virtual ~Resizable();
155
156};
157
158} // namespace trio
Definition: Concepts.h:120
virtual ~Bounded()
virtual std::uint64_t size()=0
Obtain size of stream in bytes.
Definition: Concepts.h:134
virtual void flush()=0
Flush the changes to filesystem.
virtual ~Buffered()
Definition: Concepts.h:102
virtual void close()=0
Close access to the stream.
virtual ~Closeable()
Definition: Concepts.h:114
virtual ~Controllable()
Definition: Concepts.h:90
virtual ~Openable()
virtual void open()=0
Open access to the stream.
Definition: Concepts.h:14
virtual std::size_t read(char *destination, std::size_t size)=0
Read bytes from stream into the given buffer.
virtual ~Readable()
virtual std::size_t read(Writable *destination, std::size_t size)=0
Read bytes from this stream into the given stream.
Definition: Concepts.h:146
virtual ~Resizable()
virtual void resize(std::uint64_t size)=0
Resize file to the requested size.
Definition: Concepts.h:70
virtual ~Seekable()
virtual void seek(std::uint64_t position)=0
Set the current position in the stream.
virtual std::uint64_t tell()=0
Get the current position in the stream.
Definition: Concepts.h:42
virtual std::size_t write(const char *source, std::size_t size)=0
Writes bytes from the given buffer to the stream.
virtual std::size_t write(Readable *source, std::size_t size)=0
Writes bytes from the given stream to this stream.
virtual ~Writable()
Definition: Concepts.h:10
#define TRIOAPI
Definition: trio/Defs.h:26