foamGltfList.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) 2021 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::glTF::List
28
29Description
30 Container for glTF entities
31
32Note
33 Implements the glTF v2 specification
34
35SourceFiles
36 foamGltfList.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef foam_gltf_list_H
41#define foam_gltf_list_H
42
43#include "DynamicList.H"
44#include "Ostream.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50namespace glTF
51{
52 template<class Type> class List;
53}
54
55template<class Type>
57
58namespace glTF
59{
60
61/*---------------------------------------------------------------------------*\
62 Class glTF::List Declaration
63\*---------------------------------------------------------------------------*/
64
65template<class Type>
66class List
67{
68 // Private Data
69
70 //- Storage
72
73
74public:
75
76 // Constructors
77
78 //- Default construct
79 List() = default;
80
81
82 //- Destructor
83 ~List() = default;
84
85
86 // Public Member Functions
87
88 //- Helper to create a new Type on the list and set the ID
89 Type& create(const word& name);
90
91 //- Return const access to the underlying list
92 const DynamicList<Type>& data() const noexcept;
93
94 //- List contains no data
95 bool empty() const noexcept;
96
97 //- Return the list size
98 label size() const noexcept;
99
100 //- Write
101 void write(Ostream& os, const word& keyword, bool firstEntry = false);
102
103 //- Write
104 void write(Ostream& os) const;
105
106 Type& operator[](const label i);
107};
108
109
110// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111
112} // End namespace glTF
113} // End namespace Foam
114
115// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116
117#ifdef NoRepository
118 #include "foamGltfList.C"
119#endif
120
121// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122
123#endif
124
125// ************************************************************************* //
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:72
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Container for glTF entities.
Definition: foamGltfList.H:66
bool empty() const noexcept
List contains no data.
Definition: foamGltfList.C:51
~List()=default
Destructor.
label size() const noexcept
Return the list size.
Definition: foamGltfList.C:58
const DynamicList< Type > & data() const noexcept
Return const access to the underlying list.
Definition: foamGltfList.C:44
List()=default
Default construct.
Type & create(const word &name)
Helper to create a new Type on the list and set the ID.
Definition: foamGltfList.C:33
A class for handling words, derived from Foam::string.
Definition: word.H:68
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
const direction noexcept
Definition: Scalar.H:223
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
runTime write()