Mantid
Loading...
Searching...
No Matches
IBoxControllerIO.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#include "MantidAPI/DllConfig.h"
10
11namespace Mantid {
12namespace API {
13
25class MANTID_API_DLL IBoxControllerIO : public Kernel::DiskBuffer {
26public:
34 virtual bool openFile(const std::string &fileName, const std::string &mode) = 0;
36 virtual bool isOpened() const = 0;
38 virtual const std::string &getFileName() const = 0;
40 virtual void copyFileTo(const std::string &destFilename) = 0;
41
43 virtual void saveBlock(const std::vector<float> & /* DataBlock */, const uint64_t /*blockPosition*/) const = 0;
45 virtual void saveBlock(const std::vector<double> & /* DataBlock */, const uint64_t /*blockPosition*/) const = 0;
47 virtual void loadBlock(std::vector<float> & /* Block */, const uint64_t /*blockPosition*/,
48 const size_t /*BlockSize*/) const = 0;
49 virtual void loadBlock(std::vector<double> & /* Block */, const uint64_t /*blockPosition*/,
50 const size_t /*BlockSize*/) const = 0;
51
53 virtual void flushData() const = 0;
55 virtual void closeFile() = 0;
56
58 virtual size_t getDataChunk() const = 0;
59
65 virtual void setDataType(const size_t blockSize, const std::string &typeName) = 0;
66 virtual void getDataType(size_t &blockSize, std::string &typeName) const = 0;
67};
68} // namespace API
69} // namespace Mantid
The header describes interface to IO Operations perfomed by the box controller May be replaced by a b...
virtual void loadBlock(std::vector< double > &, const uint64_t, const size_t) const =0
virtual const std::string & getFileName() const =0
virtual void copyFileTo(const std::string &destFilename)=0
Copy the file contents to a new location.
virtual void getDataType(size_t &blockSize, std::string &typeName) const =0
virtual void loadBlock(std::vector< float > &, const uint64_t, const size_t) const =0
load known size float data block from spefied file position
virtual bool openFile(const std::string &fileName, const std::string &mode)=0
open file for i/o operations
virtual size_t getDataChunk() const =0
the method which returns the size of data block used in IO operations
virtual void saveBlock(const std::vector< double > &, const uint64_t) const =0
Save a double data block in the specified file position.
virtual void closeFile()=0
Close the file.
virtual bool isOpened() const =0
virtual void setDataType(const size_t blockSize, const std::string &typeName)=0
As save/load operations use void data type, these function allow set up/get the type name provided fo...
virtual void saveBlock(const std::vector< float > &, const uint64_t) const =0
Save a float data block in the specified file position.
virtual void flushData() const =0
flush the IO buffers
Buffer objects that need to be written out to disk so as to optimize writing operations.
Definition DiskBuffer.h:42
Helper class which provides the Collimation Length for SANS instruments.