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#include "MantidKernel/System.h"
11
12namespace Mantid {
13namespace API {
14
26class MANTID_API_DLL IBoxControllerIO : public Kernel::DiskBuffer {
27public:
35 virtual bool openFile(const std::string &fileName, const std::string &mode) = 0;
37 virtual bool isOpened() const = 0;
39 virtual const std::string &getFileName() const = 0;
41 virtual void copyFileTo(const std::string &destFilename) = 0;
42
44 virtual void saveBlock(const std::vector<float> & /* DataBlock */, const uint64_t /*blockPosition*/) const = 0;
46 virtual void saveBlock(const std::vector<double> & /* DataBlock */, const uint64_t /*blockPosition*/) const = 0;
48 virtual void loadBlock(std::vector<float> & /* Block */, const uint64_t /*blockPosition*/,
49 const size_t /*BlockSize*/) const = 0;
50 virtual void loadBlock(std::vector<double> & /* Block */, const uint64_t /*blockPosition*/,
51 const size_t /*BlockSize*/) const = 0;
52
54 virtual void flushData() const = 0;
56 virtual void closeFile() = 0;
57
59 virtual size_t getDataChunk() const = 0;
60
66 virtual void setDataType(const size_t blockSize, const std::string &typeName) = 0;
67 virtual void getDataType(size_t &blockSize, std::string &typeName) const = 0;
68};
69} // namespace API
70} // 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.