PLCnext API Documentation 25.0.2.69
Public Types | Public Member Functions | List of all members
Arp::Io::Commons::IoBuffer Class Reference

This class is used to get access to buffer memory More...

#include <IoBuffer.hpp>

Public Types

using Ptr = std::shared_ptr< IoBuffer >
 
using IGdsBuffer = Arp::Plc::Commons::Internal::Gds::Buffer::IGdsBuffer
 
using IGdsBufferPtr = std::shared_ptr< IGdsBuffer >
 

Public Member Functions

 IoBuffer (const IoBuffer &arg)=delete
 
 IoBuffer (IoBuffer &&arg) noexcept
 Default move constructor.
 
IoBufferoperator= (const IoBuffer &arg)=delete
 
IoBufferoperator= (IoBuffer &&arg) noexcept
 Default move-assignment operator.
 
 ~IoBuffer (void)
 Default destructor.
 
 IoBuffer (IGdsBufferPtr gdsBufferPtr)
 Constructs an IoBuffer instance. More...
 
size_t GetSize (void) const
 Returns the buffer data size. More...
 
Endianness GetEndianness () const
 Returns the buffer endianness. More...
 
void SetDataValid (bool isValid=true)
 Sets data valid flag. More...
 
bool BeginRead (byte *&currentReadData)
 Locks the buffer for reading and returns address of the current read buffer data segment. More...
 
void EndRead (void)
 Releases the buffer for reading.
 
void BeginWrite (byte *&currentWriteData)
 Locks the buffer for writing and returns current write buffer data segment. More...
 
void EndWrite (bool isValid=true)
 Releases the buffer for writing and sets a data valid flag. More...
 
Impl & GetImpl (void)
 For internal use only.
 
const Impl & GetImpl (void) const
 

Detailed Description

This class is used to get access to buffer memory

Objects of this class should only be created by the DataManager provided by IoComponentBase.

Constructor & Destructor Documentation

◆ IoBuffer()

Arp::Io::Commons::IoBuffer::IoBuffer ( IGdsBufferPtr  gdsBufferPtr)
explicit

Constructs an IoBuffer instance.

Parameters
gdsBufferPtrThe pointer to the IGdsBufferPtr. Throws if nullptr is used.
Exceptions
ArgumentNullExceptionIf gdsBufferPtr is nullptr.

Member Function Documentation

◆ BeginRead()

bool Arp::Io::Commons::IoBuffer::BeginRead ( byte *&  currentReadData)

Locks the buffer for reading and returns address of the current read buffer data segment.

Parameters
currentReadDataReturns the address of the current read buffer data segment
Returns
true if the buffer data is valid, otherwise false.

◆ BeginWrite()

void Arp::Io::Commons::IoBuffer::BeginWrite ( byte *&  currentWriteData)

Locks the buffer for writing and returns current write buffer data segment.

Parameters
currentWriteDataReturns the address of the current write buffer data segment.

◆ EndWrite()

void Arp::Io::Commons::IoBuffer::EndWrite ( bool  isValid = true)

Releases the buffer for writing and sets a data valid flag.

Parameters
isValidSets the data valid flag of the current buffer object.

◆ GetEndianness()

Endianness Arp::Io::Commons::IoBuffer::GetEndianness ( void  ) const

Returns the buffer endianness.

Returns
The buffer Endianness.

◆ GetSize()

size_t Arp::Io::Commons::IoBuffer::GetSize ( void  ) const

Returns the buffer data size.

Returns
The buffer data size.

◆ SetDataValid()

void Arp::Io::Commons::IoBuffer::SetDataValid ( bool  isValid = true)

Sets data valid flag.

Parameters
isValidSets status of data valid fag.

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