Mantid
Loading...
Searching...
No Matches
SaveTBL.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
12#include "MantidAPI/Algorithm.h"
14#include "MantidDataHandling/DllConfig.h"
15
16namespace Mantid {
17namespace DataHandling {
24class MANTID_DATAHANDLING_DLL SaveTBL final : public API::Algorithm {
25public:
27 SaveTBL();
29 const std::string name() const override { return "SaveTBL"; }
31 const std::string summary() const override {
32 return "Saves a table workspace to a reflectometry tbl format ascii file.";
33 }
34
36 int version() const override { return 1; }
37 const std::vector<std::string> seeAlso() const override { return {"LoadTBL"}; }
39 const std::string category() const override { return "DataHandling\\Text"; }
40
41private:
43 void init() override;
45 void exec() override;
47 template <class T> void writeVal(const T &val, std::ofstream &file, bool endsep = true, bool endline = false);
48 void writeColumnNames(std::ofstream &file, std::vector<std::string> const &columnHeadings);
50 const char m_sep;
51 // populates the map and vector containing grouping information
52 void findGroups(const API::ITableWorkspace_sptr &ws);
54 std::map<int, std::vector<size_t>> m_stichgroups;
55 std::vector<size_t> m_nogroup;
56};
57} // namespace DataHandling
58} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
Saves a table workspace to a reflectometry tbl format ascii file.
Definition: SaveTBL.h:24
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
Definition: SaveTBL.h:37
const std::string summary() const override
Summary of algorithms purpose.
Definition: SaveTBL.h:31
const char m_sep
the separator
Definition: SaveTBL.h:50
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
Definition: SaveTBL.h:39
std::map< int, std::vector< size_t > > m_stichgroups
Map the separator options to their string equivalents.
Definition: SaveTBL.h:54
std::vector< size_t > m_nogroup
Definition: SaveTBL.h:55
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
Definition: SaveTBL.h:29
int version() const override
Algorithm's version for identification overriding a virtual method.
Definition: SaveTBL.h:36
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace
Helper class which provides the Collimation Length for SANS instruments.