WSL/SLF GitLab Repository

IOPlugin.cc 1.76 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/***********************************************************************************/
/*  Copyright 2010 WSL Institute for Snow and Avalanche Research    SLF-DAVOS      */
/***********************************************************************************/
/* This file is part of MeteoIO.
    MeteoIO is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    MeteoIO is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with MeteoIO.  If not, see <http://www.gnu.org/licenses/>.
*/
#include <meteoio/IOPlugin.h>

namespace mio {

22
const std::string IOPlugin::header="<IOPlugin>              classname,    &class,      &creator_func</IOPlugin>";
23

24
25
26
27
28
29
30
IOPlugin& IOPlugin::operator=(const IOPlugin& source)
{
	//since this represents a plugin on a given machine/node, since the pointers point to entry points
	//in the compiled code, they should remain valid and therefore can be copied
	if(this != &source) {
		classname = source.classname;
		io = source.io;
31
		creator_func = source.creator_func;
32
33
34
35
	}
	return *this;
}

36
const std::string IOPlugin::toString() const {
37
	std::ostringstream os;
38
	const int pt_w=8;
39
40
41
42
	os << "<IOPlugin>" << std::setw(10) << classname;
	os << "," << std::showbase << std::setw(pt_w+2) << io;
	os << "," << std::showbase << std::setw(pt_w+2) << creator_func << "</IOPlugin>\n";
	return os.str();
43
44
45
}

} //end namespace