cpp-mate  0.7
Helpful library for C++.
CppMate::BinaryData::Wrapper Class Reference

Represents implementation of BinaryData interface for exisitng data. More...

#include <BinaryData.hpp>

Inheritance diagram for CppMate::BinaryData::Wrapper:
Collaboration diagram for CppMate::BinaryData::Wrapper:

Public Member Functions

 Wrapper (const uint8_t *data, uint64_t size, bool validate=true)
 Constructor. More...
 
 Wrapper (const std::vector< uint8_t > &buffer)
 Constructor. More...
 
const uint8_t * getData () const override
 Returns address of data. More...
 
uint64_t getSize () const override
 Returns size of data in bytes. More...
 
- Public Member Functions inherited from CppMate::BinaryData
virtual ~BinaryData ()=default
 
bool hasData () const
 Returns status of a data presence. More...
 
bool operator== (const BinaryData &other) const
 operator == More...
 
bool operator!= (const BinaryData &other) const
 operator != More...
 

Detailed Description

Represents implementation of BinaryData interface for exisitng data.

Note
The source data should exist because wrapper doesn't own it.

Constructor & Destructor Documentation

◆ Wrapper() [1/2]

CppMate::BinaryData::Wrapper::Wrapper ( const uint8_t *  data,
uint64_t  size,
bool  validate = true 
)
inline

Constructor.

Parameters
datathe pointer to start of the data.
sizethe size of the data.
validateindicates that source data should be validated.
Exceptions
std::invalid_argument

◆ Wrapper() [2/2]

CppMate::BinaryData::Wrapper::Wrapper ( const std::vector< uint8_t > &  buffer)
inline

Constructor.

Parameters
bufferthe source buffer.

Member Function Documentation

◆ getData()

const uint8_t* CppMate::BinaryData::Wrapper::getData ( ) const
inlineoverridevirtual

Returns address of data.

Returns
address of data.

Implements CppMate::BinaryData.

◆ getSize()

uint64_t CppMate::BinaryData::Wrapper::getSize ( ) const
inlineoverridevirtual

Returns size of data in bytes.

Returns
size of data.

Implements CppMate::BinaryData.


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