CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
25 #include <boost/filesystem/path.hpp>
37 FileQueueWriter(
const std::string& directory,
const std::string& indexFilename);
41 void flush()
override;
58 FileQueueReader(
const std::string& directory,
const std::string& readerIndexFilename,
const std::string& writerIndexFilename);
69 void skip(uint32_t count);
uint64_t get() const
Gets the index value.
Definition: IndexFile.cpp:36
IndexFile m_writerIndexFile
Definition: FileQueue.h:77
Wrapper for low-level i/o operations on files.
Definition: RawFile.h:49
Open file for both reading and writing. Removes the file if it exists.
Index file containing a uint64_t value.
Definition: IndexFile.h:28
IndexFile m_readerIndexFile
Definition: FileQueue.h:76
constexpr void HexFormat(const ByteArray< N, TTag > &)
void write(const RawBuffer &buffer) override
Definition: FileQueue.cpp:63
Open file in read-only mode.
LockMode
Defines locking mode for the file.
Definition: RawFile.h:40
IndexFile m_indexFile
Definition: FileQueue.h:45
uint64_t m_indexValue
Definition: FileQueue.h:46
#define CATAPULT_THROW_RUNTIME_ERROR_1(MESSAGE, PARAM1)
Macro used to throw a catapult runtime error with a single parameter.
Definition: exceptions.h:171
boost::filesystem::path m_directory
Definition: FileQueue.h:44
File based queue reader where each message is represented by a file (with incrementing names) in a di...
Definition: FileQueue.h:51
Definition: FileQueue.h:31
void skip(uint32_t count)
Skips at most the next count messages.
Definition: FileQueue.cpp:121
boost::filesystem::path m_directory
Definition: FileQueue.h:75
std::unique_ptr< BufferedOutputFileStream > m_pOutputStream
Definition: FileQueue.h:47
bool exists() const
true if the index file exists.
Definition: IndexFile.cpp:32
bool process(const consumer< const std::string & > &processFilename)
Definition: FileQueue.cpp:126
bool tryReadNextMessage(const consumer< std::vector< uint8_t >> &consumer)
Tries to read the next message and forwards it to consumer if successful.
Definition: FileQueue.cpp:114
FileQueueReader(const std::string &directory)
Creates a file queue reader around directory.
Definition: FileQueue.cpp:95
Definition: AddressExtractionExtension.cpp:28
size_t pending() const
Gets the number of pending messages.
Definition: FileQueue.cpp:108
FileQueueWriter(const std::string &directory)
Creates a file queue writer around directory.
Definition: FileQueue.cpp:54
uint64_t increment()
Increments the index value by one and returns the new value.
Definition: IndexFile.cpp:47
std::function< void(TArgs...)> consumer
A consumer function.
Definition: functions.h:35
Writer interface.
Definition: Stream.h:41
BasicRawBuffer< const uint8_t > RawBuffer
A const binary buffer.
Definition: RawBuffer.h:62
void flush() override
Definition: FileQueue.cpp:73