KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
Classes | List of all members
Kratos::Base64EncodedOutput Class Reference

Encodes given iterator data to base 64 string representation. More...

#include <base_64_encoded_output.h>

Collaboration diagram for Kratos::Base64EncodedOutput:

Classes

class  ByteIterator
 A forward iterator that iterates over bytes in a sequence. More...
 

Public Types

Type definitions
using IndexType = std::size_t
 The index type. More...
 

Public Member Functions

Life cycle

}

 Base64EncodedOutput (std::ostream &rOStream)
 Constructor. More...
 
 ~Base64EncodedOutput ()
 Destructor. More...
 
Public operations
template<typename TIteratorType , std::enable_if_t< std::is_base_of_v< std::input_iterator_tag, typename std::iterator_traits< TIteratorType >::iterator_category >, bool > = true>
void WriteData (TIteratorType Begin, const IndexType N)
 writes the iterator data to the given output stream More...
 

Detailed Description

Encodes given iterator data to base 64 string representation.

Encode incoming data to base 64 string representation.

Input data is read from chunks of consecutive iterators. Non-consecutive iterators can be processed by repeatedly calling Base64EncodedOutput::WriteOutputData.

Note
The destructor of the instance will write the remaining bytes of the data container with padding. Hence, scoping of the encoder should be done to properly finish writing of the data stream

Member Typedef Documentation

◆ IndexType

The index type.

Constructor & Destructor Documentation

◆ Base64EncodedOutput()

Kratos::Base64EncodedOutput::Base64EncodedOutput ( std::ostream &  rOStream)
inline

Constructor.

This constructor initializes a Base64EncodedOutput object with the specified output stream. The encoded data will be written to the provided output stream during encoding operations.

Parameters
rOStreamThe output stream where the encoded data will be written.

◆ ~Base64EncodedOutput()

Kratos::Base64EncodedOutput::~Base64EncodedOutput ( )

Destructor.

This destructor finalizes the encoding process by handling any remaining bytes and padding at the end of the data. It ensures that the encoded data is correctly written to the output stream before the object is destroyed.

Member Function Documentation

◆ WriteData()

template<typename TIteratorType , std::enable_if_t< std::is_base_of_v< std::input_iterator_tag, typename std::iterator_traits< TIteratorType >::iterator_category >, bool > = true>
void Kratos::Base64EncodedOutput::WriteData ( TIteratorType  Begin,
const IndexType  N 
)
inline

writes the iterator data to the given output stream

This method continues writing the data given by the Begin iterator to the speified rOutput stream in the base64 format.

Template Parameters
TIteratorTypeType of the iterator. Should satisfy requirements for std::input_iterator.
Parameters
BeginBegining of the iterator.
NNumber of data items in the data collection represented by the Begin iterator.

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