Loading...
Searching...
No Matches
VTKStreamer.cpp
1/*---------------------------------------------------------------------------*\
2 *
3 * bitpit
4 *
5 * Copyright (C) 2015-2021 OPTIMAD engineering Srl
6 *
7 * -------------------------------------------------------------------------
8 * License
9 * This file is part of bitpit.
10 *
11 * bitpit is free software: you can redistribute it and/or modify it
12 * under the terms of the GNU Lesser General Public License v3 (LGPL)
13 * as published by the Free Software Foundation.
14 *
15 * bitpit is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 * License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with bitpit. If not, see <http://www.gnu.org/licenses/>.
22 *
23\*---------------------------------------------------------------------------*/
24
25#include "VTK.hpp"
26
27namespace bitpit{
28
41
54void VTKBaseStreamer::flushData( std::fstream &str, const std::string &name, VTKFormat format){
55
56 BITPIT_UNUSED(str) ;
57 BITPIT_UNUSED(name) ;
58 BITPIT_UNUSED(format) ;
59
60}
61
71void VTKBaseStreamer::absorbData( std::fstream &str, const std::string &name, VTKFormat format, uint64_t entries, uint8_t components, VTKDataType datatype){
72
73 BITPIT_UNUSED(str) ;
74 BITPIT_UNUSED(name) ;
75 BITPIT_UNUSED(format) ;
76 BITPIT_UNUSED(entries) ;
77 BITPIT_UNUSED(components) ;
78 BITPIT_UNUSED(datatype) ;
79
80}
81
95
100
101 for (const auto &entry : other.m_field) {
102 m_field[entry.first] = std::unique_ptr<VTKBaseContainer>(entry.second->clone()) ;
103 }
104
105}
106
114
115 VTKNativeStreamer temporary(other);
116 std::swap(temporary, *this);
117
118 return *this;
119
120}
121
126void VTKNativeStreamer::removeData( const std::string &name){
127
128 auto fieldItr = m_field.find(name) ;
129
130 if( fieldItr != m_field.end()){
131 m_field.erase( fieldItr) ;
132 }
133
134}
135
140bool VTKNativeStreamer::hasData( const std::string &name ) const {
141
142 for ( const auto &fieldEntry : m_field ) {
143 if( fieldEntry.first == name){
144 return true;
145 }
146 }
147
148 return false;
149
150}
151
158void VTKNativeStreamer::flushData( std::fstream &str, const std::string &name, VTKFormat format){
159
160 auto fieldItr = m_field.find(name) ;
161
162 if( fieldItr != m_field.end()){
163 fieldItr->second->flushData(str,format) ;
164 }
165
166}
167
177void VTKNativeStreamer::absorbData( std::fstream &str, const std::string &name, VTKFormat format, uint64_t entries, uint8_t components, VTKDataType datatype){
178
179 BITPIT_UNUSED(datatype);
180
181 auto fieldItr = m_field.find(name) ;
182
183 if( fieldItr != m_field.end()){
184 fieldItr->second->absorbData( str, format, entries, components ) ;
185 }
186
187}
188
189}
virtual void flushData(std::fstream &, const std::string &, VTKFormat)
virtual void absorbData(std::fstream &, const std::string &, VTKFormat, uint64_t, uint8_t, VTKDataType)
In VTKNativeStreamer all instances of classes derived from VTKBaseConatiner are stored....
Definition VTK.hpp:226
void absorbData(std::fstream &, const std::string &, VTKFormat, uint64_t, uint8_t, VTKDataType) override
bool hasData(const std::string &) const
void flushData(std::fstream &, const std::string &, VTKFormat) override
VTKNativeStreamer & operator=(const VTKNativeStreamer &other)
void removeData(const std::string &)
VTKFormat
Definition VTK.hpp:92
VTKDataType
Definition VTK.hpp:74
#define BITPIT_UNUSED(variable)
Definition compiler.hpp:63
--- layout: doxygen_footer ---