+/*\r
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>\r
+*\r
+* This file is part of CasparCG (www.casparcg.com).\r
+*\r
+* CasparCG is free software: you can redistribute it and/or modify\r
+* it under the terms of the GNU General Public License as published by\r
+* the Free Software Foundation, either version 3 of the License, or\r
+* (at your option) any later version.\r
+*\r
+* CasparCG is distributed in the hope that it will be useful,\r
+* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+* GNU General Public License for more details.\r
+*\r
+* You should have received a copy of the GNU General Public License\r
+* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
+*\r
+* Author: Robert Nagy, ronag89@gmail.com\r
+*/\r
+\r
+#include "../stdafx.h"\r
+\r
+#include "array.h"\r
+\r
+namespace caspar { namespace core {\r
+ \r
+const_array::const_array(const const_array& other)\r
+ : ptr_(other.ptr_)\r
+ , size_(other.size_)\r
+ , storage_(other.storage_)\r
+{\r
+}\r
+\r
+const_array::const_array(const_array&& other)\r
+ : ptr_(other.ptr_)\r
+ , size_(other.size_)\r
+ , storage_(std::move(other.storage_))\r
+{\r
+}\r
+\r
+const_array& const_array::operator=(const_array other)\r
+{\r
+ other.swap(*this);\r
+ return *this;\r
+}\r
+\r
+void const_array::swap(const_array& other)\r
+{\r
+ std::swap(ptr_, other.ptr_);\r
+ std::swap(size_, other.size_);\r
+ std::swap(storage_, other.storage_);\r
+}\r
+ \r
+const std::uint8_t* const_array::begin() const {return ptr_;} \r
+const std::uint8_t* const_array::data() const {return ptr_;}\r
+const std::uint8_t* const_array::end() const {return ptr_ + size_;}\r
+std::size_t const_array::size() const {return size_;}\r
+bool const_array::empty() const {return size() == 0;}\r
+\r
+mutable_array::mutable_array(mutable_array&& other)\r
+ : ptr_(other.ptr_)\r
+ , size_(other.size_)\r
+ , storage_(std::move(other.storage_))\r
+{\r
+}\r
+ \r
+mutable_array& mutable_array::operator=(mutable_array&& other)\r
+{\r
+ ptr_ = other.ptr_;\r
+ size_ = other.size_;\r
+ storage_ = std::move(other.storage_);\r
+ return *this;\r
+}\r
+ \r
+std::uint8_t* mutable_array::begin() {return ptr_;} \r
+std::uint8_t* mutable_array::data() {return ptr_;}\r
+std::uint8_t* mutable_array::end() {return ptr_ + size_;} \r
+const std::uint8_t* mutable_array::begin() const {return ptr_;} \r
+const std::uint8_t* mutable_array::data() const {return ptr_;}\r
+const std::uint8_t* mutable_array::end() const {return ptr_ + size_;}\r
+std::size_t mutable_array::size() const {return size_;}\r
+bool mutable_array::empty() const {return size() == 0;}\r
+const boost::any& mutable_array::storage() const {return *storage_;}\r
+\r
+}}
\ No newline at end of file