IOBuffer.cpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /***************************************************************************
  2. *
  3. * Project _____ __ ____ _ _
  4. * ( _ ) /__\ (_ _)_| |_ _| |_
  5. * )(_)( /(__)\ )( (_ _)(_ _)
  6. * (_____)(__)(__)(__) |_| |_|
  7. *
  8. *
  9. * Copyright 2018-present, Leonid Stryzhevskyi <lganzzzo@gmail.com>
  10. *
  11. * Licensed under the Apache License, Version 2.0 (the "License");
  12. * you may not use this file except in compliance with the License.
  13. * You may obtain a copy of the License at
  14. *
  15. * http://www.apache.org/licenses/LICENSE-2.0
  16. *
  17. * Unless required by applicable law or agreed to in writing, software
  18. * distributed under the License is distributed on an "AS IS" BASIS,
  19. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  20. * See the License for the specific language governing permissions and
  21. * limitations under the License.
  22. *
  23. ***************************************************************************/
  24. #include "IOBuffer.hpp"
  25. namespace oatpp { namespace data { namespace buffer {
  26. const v_buff_size IOBuffer::BUFFER_SIZE = 4096;
  27. IOBuffer::IOBuffer()
  28. : m_entry(new v_char8[BUFFER_SIZE])
  29. {}
  30. std::shared_ptr<IOBuffer> IOBuffer::createShared(){
  31. return std::make_shared<IOBuffer>();
  32. }
  33. IOBuffer::~IOBuffer() {
  34. delete [] m_entry;
  35. }
  36. void* IOBuffer::getData(){
  37. return m_entry;
  38. }
  39. v_buff_size IOBuffer::getSize(){
  40. return BUFFER_SIZE;
  41. }
  42. }}}