instant.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2017 OpenFOAM Foundation
9 Copyright (C) 2018-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::instant
29
30Description
31 An instant of time. Contains the time value and name.
32 Uses Foam::Time when formatting the name.
33
34SourceFiles
35 instants.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef Foam_instant_H
40#define Foam_instant_H
41
42#include "Instant.H"
43#include "word.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class instant Declaration
52\*---------------------------------------------------------------------------*/
54class instant
55:
56 public Instant<word>
57{
58public:
59
60 // Static Data Members
61
62 //- The type name (eg, for pTraits)
63 static const char* const typeName;
64
65
66 // Generated Methods
67
68 //- Default construct, with value = 0 and empty name
69 instant() = default;
70
71 //- Copy construct
72 instant(const instant&) = default;
73
74 //- Move construct
75 instant(instant&&) = default;
76
77 //- Copy assignment
78 instant& operator=(const instant&) = default;
79
80 //- Move assignment
81 instant& operator=(instant&&) = default;
82
83
84 // Constructors
85
86 //- Inherit all constructors (eg, copy/move construct from components)
88
89 //- Construct from timeValue, auto generating the name
90 explicit instant(scalar timeValue);
91
92 //- Copy construct from timeName, parsing timeName for a value
93 explicit instant(const word& timeName);
94
95 //- Move construct from timeName, parsing timeName for a value
96 explicit instant(word&& timeName);
97};
98
99
100// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
101
102} // End namespace Foam
103
104// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105
106#endif
107
108// ************************************************************************* //
A tuple of scalar value and key. The value often corresponds to a time value, thus the naming of the ...
Definition: Instant.H:52
Instant()
Default construct, with value = 0 and empty name.
Definition: Instant.H:94
An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name.
Definition: instant.H:56
instant()=default
Default construct, with value = 0 and empty name.
instant & operator=(const instant &)=default
Copy assignment.
instant & operator=(instant &&)=default
Move assignment.
instant(instant &&)=default
Move construct.
instant(const instant &)=default
Copy construct.
static const char *const typeName
The type name (eg, for pTraits)
Definition: instant.H:62
A class for handling words, derived from Foam::string.
Definition: word.H:68
word timeName
Definition: getTimeIndex.H:3
Namespace for OpenFOAM.