CatapultServer  v0.5.0.1 (Elephant)
catapult::ionet::AppendContext Class Reference

Public Member Functions

 AppendContext (ByteBuffer &data, size_t size)
 Creates an append context for appending size data to data. More...
 
 AppendContext (AppendContext &&rhs)
 Move constructor. More...
 
 ~AppendContext ()
 Destructor. More...
 
boost::asio::mutable_buffers_1 buffer ()
 An asio buffer that can be written to in place. More...
 
void commit (size_t size)
 Commits the write to the underlying buffer. More...
 

Private Member Functions

void assertNotCommitted () const
 

Private Attributes

ByteBufferm_data
 
size_t m_appendSize
 
size_t m_originalSize
 
bool m_isCommitted
 

Detailed Description

Context for enabling in-place data writes into a buffer. If commit is not called, the write is abandoned.

Constructor & Destructor Documentation

◆ AppendContext() [1/2]

catapult::ionet::AppendContext::AppendContext ( ByteBuffer data,
size_t  size 
)

Creates an append context for appending size data to data.

◆ AppendContext() [2/2]

catapult::ionet::AppendContext::AppendContext ( AppendContext &&  rhs)

Move constructor.

◆ ~AppendContext()

catapult::ionet::AppendContext::~AppendContext ( )

Destructor.

Member Function Documentation

◆ assertNotCommitted()

void catapult::ionet::AppendContext::assertNotCommitted ( ) const
private
Here is the caller graph for this function:

◆ buffer()

boost::asio::mutable_buffers_1 catapult::ionet::AppendContext::buffer ( )

An asio buffer that can be written to in place.

Here is the call graph for this function:

◆ commit()

void catapult::ionet::AppendContext::commit ( size_t  size)

Commits the write to the underlying buffer.

Here is the call graph for this function:

Member Data Documentation

◆ m_appendSize

size_t catapult::ionet::AppendContext::m_appendSize
private

◆ m_data

ByteBuffer& catapult::ionet::AppendContext::m_data
private

◆ m_isCommitted

bool catapult::ionet::AppendContext::m_isCommitted
private

◆ m_originalSize

size_t catapult::ionet::AppendContext::m_originalSize
private

The documentation for this class was generated from the following files: