https://mooseframework.inl.gov
include
restart
InputStream.h
Go to the documentation of this file.
1
//* This file is part of the MOOSE framework
2
//* https://mooseframework.inl.gov
3
//*
4
//* All rights reserved, see COPYRIGHT for full restrictions
5
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6
//*
7
//* Licensed under LGPL 2.1, please see LICENSE for details
8
//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10
#pragma once
11
12
#include <memory>
13
#include <istream>
14
#include <vector>
15
#include <filesystem>
16
#include <optional>
17
22
class
InputStream
23
{
24
public
:
25
virtual
~InputStream
();
26
33
virtual
std::shared_ptr<std::istream>
get
()
const
= 0;
34
42
bool
inUse
()
const
;
43
47
virtual
std::optional<std::filesystem::path>
getFilename
()
const
;
48
49
protected
:
56
void
addSharedStream
(
const
std::weak_ptr<std::istream> stream)
const
;
57
58
private
:
60
mutable
std::vector<std::weak_ptr<std::istream>>
_shared_streams
;
61
};
InputStream::addSharedStream
void addSharedStream(const std::weak_ptr< std::istream > stream) const
Internal method to be called by derived classes to add a shared stream to _shared_streams (so that it...
Definition:
InputStream.C:21
InputStream
Helper class that hands out input streams to an underlying, managed stream of arbitrary type...
Definition:
InputStream.h:22
InputStream::_shared_streams
std::vector< std::weak_ptr< std::istream > > _shared_streams
The streams that have been handed out by get()
Definition:
InputStream.h:60
InputStream::~InputStream
virtual ~InputStream()
Definition:
InputStream.C:14
InputStream::inUse
bool inUse() const
Whether or not anything is still using this stream.
Definition:
InputStream.C:35
InputStream::getFilename
virtual std::optional< std::filesystem::path > getFilename() const
Gets the underlying filename, if any.
Definition:
InputStream.C:44
Generated on Fri Jul 18 2025 11:41:23 for https://mooseframework.inl.gov by
1.8.14