61 template<
class TIteratorType>
104 return reinterpret_cast<const value_type*
>(&mValue)[mByteIndex];
116 using value_type =
typename std::iterator_traits<TIteratorType>::value_type;
118 if ((++mByteIndex) == value_size) {
145 typename std::iterator_traits<TIteratorType>::value_type mValue;
162 : mrOStream(rOStream)
187 template <
typename TIteratorType,
188 std::enable_if_t<std::is_base_of_v<std::input_iterator_tag, typename std::iterator_traits<TIteratorType>::iterator_category>,
bool> =
true>
198 using value_type =
typename std::iterator_traits<TIteratorType>::value_type;
202 const IndexType raw_bytes =
N *
sizeof(value_type);
209 const IndexType initial_byte_triplet_offset = raw_bytes + mByteTripletIndex;
213 for (; mByteTripletIndex <
std::min(initial_byte_triplet_offset,
IndexType{3}); ++mByteTripletIndex) {
214 mByteTriplet[mByteTripletIndex] = *itr_byte_triplet++;
215 ++number_of_written_bytes;
220 if (mByteTripletIndex == 3) {
221 mByteTripletIndex = 0;
223 EncodeTriplet(mrOStream, mByteTriplet, 0);
226 const IndexType number_of_triplets = (raw_bytes - number_of_written_bytes) / 3;
229 EncodeTriplet(mrOStream, {*itr_byte_triplet++, *itr_byte_triplet++, *itr_byte_triplet++}, 0);
232 number_of_written_bytes += number_of_triplets * 3;
235 const IndexType remaining_bytes = raw_bytes - number_of_written_bytes;
236 for (; mByteTripletIndex < remaining_bytes; ++mByteTripletIndex) {
237 mByteTriplet[mByteTripletIndex] = *itr_byte_triplet++;
253 std::ostream& mrOStream;
267 std::array<char, 3> mByteTriplet;
275 constexpr
static char base64Map[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
291 static void EncodeTriplet(
292 std::ostream& rOutput,
293 const std::array<char, 3>& rBytes,
298 base64Map[(rBytes[0] & 0xfc) >> 2],
299 base64Map[((rBytes[0] & 0x03) << 4) + ((rBytes[1] & 0xf0) >> 4)],
300 base64Map[((rBytes[1] & 0x0f) << 2) + ((rBytes[2] & 0xc0) >> 6)],
301 base64Map[rBytes[2] & 0x3f],
'\0'};
303 std::fill(
tmp + 4 - Padding,
tmp + 4,
'=');
A forward iterator that iterates over bytes in a sequence.
Definition: base_64_encoded_output.h:63
value_type operator*() const
Dereference operator.
Definition: base_64_encoded_output.h:102
char & reference
Definition: base_64_encoded_output.h:70
ByteIterator operator++(int)
Post-increment operator.
Definition: base_64_encoded_output.h:131
char * pointer
Definition: base_64_encoded_output.h:69
ByteIterator(TIteratorType it)
Constructor.
Definition: base_64_encoded_output.h:85
std::forward_iterator_tag iterator_category
Definition: base_64_encoded_output.h:71
char value_type
Definition: base_64_encoded_output.h:68
ByteIterator & operator++()
Pre-increment operator.
Definition: base_64_encoded_output.h:114
std::ptrdiff_t difference_type
Definition: base_64_encoded_output.h:72
Encodes given iterator data to base 64 string representation.
Definition: base_64_encoded_output.h:42
std::size_t IndexType
The index type.
Definition: base_64_encoded_output.h:48
void WriteData(TIteratorType Begin, const IndexType N)
writes the iterator data to the given output stream
Definition: base_64_encoded_output.h:189
Base64EncodedOutput(std::ostream &rOStream)
Constructor.
Definition: base_64_encoded_output.h:161
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
static double min(double a, double b)
Definition: GeometryFunctions.h:71
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
tuple tmp
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:98
u
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:30
N
Definition: sensitivityMatrix.py:29
integer i
Definition: TensorModule.f:17