1 /* 2 * Distributed under the OSI-approved Apache License, Version 2.0. See 3 * accompanying file Copyright.txt for details. 4 * 5 * BufferSTL.h 6 * 7 * Created on: Sep 26, 2017 8 * Author: William F Godoy godoywf@ornl.gov 9 */ 10 11 #ifndef ADIOS2_TOOLKIT_FORMAT_BUFFER_HEAP_BUFFERSTL_H_ 12 #define ADIOS2_TOOLKIT_FORMAT_BUFFER_HEAP_BUFFERSTL_H_ 13 14 #include "adios2/toolkit/format/buffer/Buffer.h" 15 16 #include "adios2/common/ADIOSMacros.h" 17 18 namespace adios2 19 { 20 namespace format 21 { 22 23 class BufferSTL : public Buffer 24 { 25 public: 26 std::vector<char> m_Buffer; 27 28 BufferSTL(); 29 ~BufferSTL() = default; 30 31 char *Data() noexcept final; 32 const char *Data() const noexcept final; 33 34 void Resize(const size_t size, const std::string hint) final; 35 36 void Reset(const bool resetAbsolutePosition, 37 const bool zeroInitialize) final; 38 39 size_t GetAvailableSize() const final; 40 41 template <class T> 42 size_t Align() const noexcept; 43 44 void Delete(); 45 46 size_t DebugGetSize() const; 47 }; 48 49 #define declare_template_instantiation(T) \ 50 extern template size_t BufferSTL::Align<T>() const noexcept; 51 52 ADIOS2_FOREACH_PRIMITIVE_STDTYPE_1ARG(declare_template_instantiation) 53 #undef declare_template_instantiation 54 55 } // end namespace format 56 } // end namespace adios2 57 58 #endif /* ADIOS2_TOOLKIT_FORMAT_BUFFER_HEAP_BUFFERSTL_H_ */ 59