pTraits.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 OpenFOAM Foundation
9  Copyright (C) 2020 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::pTraits
29 
30 Description
31  Traits class for primitives.
32 
33  All primitives need a specialised version of this class. The
34  specialised version will normally also require a conversion
35  method.
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef pTraits_H
40 #define pTraits_H
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 // Forward Declarations
48 class Istream;
49 
50 /*---------------------------------------------------------------------------*\
51  Class pTraits Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<class PrimitiveType>
55 class pTraits
56 :
57  public PrimitiveType
58 {
59 public:
60 
61  // Constructors
62 
63  //- Copy construct from primitive
64  explicit pTraits(const PrimitiveType& p)
65  :
66  PrimitiveType(p)
67  {}
68 
69  //- Construct from Istream
70  explicit pTraits(Istream& is)
71  :
72  PrimitiveType(is)
73  {}
74 };
75 
76 
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78 
79 } // End namespace Foam
80 
81 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 
83 #endif
84 
85 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::pTraits::pTraits
pTraits(const PrimitiveType &p)
Copy construct from primitive.
Definition: pTraits.H:63
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::pTraits
Traits class for primitives.
Definition: pTraits.H:54
Foam::pTraits::pTraits
pTraits(Istream &is)
Construct from Istream.
Definition: pTraits.H:69