3 #ifndef INCLUDE_NN_NLIB_MEMORYOUTPUTSTREAM_H_
4 #define INCLUDE_NN_NLIB_MEMORYOUTPUTSTREAM_H_
14 template <
class T,
size_t N>
16 : m_MemBuf(reinterpret_cast<unsigned char*>(&buf[0])),
18 m_MemSize(N *
sizeof(T)) {}
22 template <
class T,
size_t N>
24 this->Init(&buf[0], N *
sizeof(T));
28 virtual bool PushBuffer_(
const void* p,
size_t nBytes,
39 unsigned char* m_MemBuf;
47 #endif // INCLUDE_NN_NLIB_MEMORYOUTPUTSTREAM_H_
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
MemoryOutputStream() noexcept
Instantiates the object with default parameters (default constructor). You must call the Init functio...
MemoryOutputStream(T(&buf)[N]) noexcept
Constructs and initializes MemoryOutputStream.
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
#define NLIB_DISALLOW_COPY_AND_ASSIGN(TypeName)
Prohibits use of the copy constructor and assignment operator for the class specified by TypeName...
The class for creating an output stream that makes use of memory.
#define NLIB_OVERRIDE
Defines override if it is available for use. If not, holds an empty string.
void Init(T(&buf)[N]) noexcept
Initializes MemoryOuputStream and makes it available for use.
Defines the base class for output streams.
The base class for output streams. This class cannot be instantiated.