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 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::instant
29 
30 Description
31  An instant of time. Contains the time value and name.
32 
33 SourceFiles
34  instant.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef instant_H
39 #define instant_H
40 
41 #include "word.H"
42 #include "Instant.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class instant Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class instant
54 :
55  public Instant<word>
56 {
57 public:
58 
59  // Static Data Members
60 
61  static const char* const typeName;
62 
63 
64  // Constructors
65 
66  //- Copy and move construct from components
68 
69  //- Construct null, with time-value = 0.
70  instant() = default;
71 
72  //- Copy construct
73  instant(const instant&) = default;
74 
75  //- Move construct
76  instant(instant&&) = default;
77 
78  //- Construct from timeValue, auto generating the name
79  explicit instant(scalar timeValue);
80 
81  //- Construct from timeName, parsing timeName for a value
82  explicit instant(const word& timeName);
83 
84  //- Construct from timeName, parsing timeName for a value
85  explicit instant(word&& timeName);
86 
87 
88  // Operators
89 
90  //- Copy assignment
91  instant& operator=(const instant&) = default;
92 
93  //- Move assignment
94  instant& operator=(instant&&) = default;
95 
96 };
97 
98 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
99 
100 } // End namespace Foam
101 
102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103 
104 #endif
105 
106 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Instant.H
Foam::instant::instant
instant()=default
Construct null, with time-value = 0.
timeName
word timeName
Definition: getTimeIndex.H:3
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::instant
An instant of time. Contains the time value and name.
Definition: instant.H:52
word.H
Foam::Instant
A tuple of value and key. The value often corresponds to a time value, thus the naming of the class....
Definition: Instant.H:53
Foam::instant::typeName
static const char *const typeName
Definition: instant.H:60
Foam::instant::operator=
instant & operator=(const instant &)=default
Copy assignment.