2 * Copyright (C) 2012-2021 Euclid Science Ground Segment
4 * This library is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License as published by the Free
6 * Software Foundation; either version 3.0 of the License, or (at your option)
9 * This library is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this library; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19#ifndef FILEACCESSOR_IMPL
20#error "This file should not be included directly! Use FileAccessor.h instead"
26template <typename TFD>
27FileAccessor<TFD>::FileAccessor(TFD&& fd, ReleaseDescriptorCallback release_callback)
28 : m_fd(std::move(fd)), m_release_callback(release_callback) {}
30template <typename TFD>
31FileReadAccessor<TFD>::FileReadAccessor(TFD&& fd, ReleaseDescriptorCallback release_callback, SharedLock lock)
32 : FileAccessor<TFD>(std::move(fd), release_callback), m_shared_lock(std::move(lock)) {}
34template <typename TFD>
35FileReadAccessor<TFD>::~FileReadAccessor() {
36 FileAccessor<TFD>::m_release_callback(std::move(FileAccessor<TFD>::m_fd));
39template <typename TFD>
40bool FileReadAccessor<TFD>::isReadOnly() const {
44template <typename TFD>
45FileWriteAccessor<TFD>::FileWriteAccessor(TFD&& fd, ReleaseDescriptorCallback release_callback, UniqueLock lock)
46 : FileAccessor<TFD>(std::move(fd), release_callback), m_unique_lock(std::move(lock)) {}
48template <typename TFD>
49FileWriteAccessor<TFD>::~FileWriteAccessor<TFD>() {
50 FileAccessor<TFD>::m_release_callback(std::move(FileAccessor<TFD>::m_fd));
53template <typename TFD>
54bool FileWriteAccessor<TFD>::isReadOnly() const {
58} // namespace FilePool