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-2021 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::pTraits
29
30Description
31 A traits class, which is primarily used 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 Foam_pTraits_H
40#define Foam_pTraits_H
41
42// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43
44namespace Foam
45{
46
47// Forward Declarations
48class Istream;
49
50/*---------------------------------------------------------------------------*\
51 Class pTraits Declaration
52\*---------------------------------------------------------------------------*/
53
54// The base implementation is a pass-through to the base class.
55// Accordingly it inherits all static methods (eg, typeName etc).
56template<class Base>
57class pTraits
58:
59 public Base
60{
61public:
62
63 // Constructors
64
65 //- Copy construct from base class
66 explicit pTraits(const Base& obj)
67 :
68 Base(obj)
69 {}
70
71 //- Construct from Istream
72 explicit pTraits(Istream& is)
73 :
74 Base(is)
75 {}
76};
77
78
79// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
80
81} // End namespace Foam
82
83// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84
85#endif
86
87// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
A traits class, which is primarily used for primitives.
Definition: pTraits.H:59
pTraits(const Base &obj)
Copy construct from base class.
Definition: pTraits.H:65
pTraits(Istream &is)
Construct from Istream.
Definition: pTraits.H:71
Namespace for OpenFOAM.