16 #ifndef INCLUDE_NN_NLIB_MEMORYOUTPUTSTREAM_H_ 17 #define INCLUDE_NN_NLIB_MEMORYOUTPUTSTREAM_H_ 27 template <
class T,
size_t N>
29 : mos_buf_(reinterpret_cast<unsigned char*>(&buf[0])),
31 mos_size_(N *
sizeof(T)) {}
35 template <
class T,
size_t N>
37 return this->Init(&buf[0], N *
sizeof(T));
41 virtual bool PushBuffer_(
const void* p,
size_t nbytes,
52 unsigned char* mos_buf_;
60 #endif // INCLUDE_NN_NLIB_MEMORYOUTPUTSTREAM_H_ #define NLIB_OVERRIDE
Defines override if it is available for use. If not, holds an empty string.
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_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.
const void * data() const noexcept
Gets a pointer to the start of the output data.
errno_t Init(T(&buf)[N]) noexcept
Initializes MemoryOuputStream and makes it available for use.
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
Defines the base class for output streams.
The base class for output streams. This class cannot be instantiated.