CatapultServer  v0.5.0.1 (Elephant)
catapult::io::FileQueueReader Class Referencefinal

File based queue reader where each message is represented by a file (with incrementing names) in a directory. More...

Collaboration diagram for catapult::io::FileQueueReader:

Public Member Functions

 FileQueueReader (const std::string &directory)
 Creates a file queue reader around directory. More...
 
 FileQueueReader (const std::string &directory, const std::string &readerIndexFilename, const std::string &writerIndexFilename)
 
size_t pending () const
 Gets the number of pending messages. More...
 
bool tryReadNextMessage (const consumer< std::vector< uint8_t >> &consumer)
 Tries to read the next message and forwards it to consumer if successful. More...
 
void skip (uint32_t count)
 Skips at most the next count messages. More...
 

Private Member Functions

bool process (const consumer< const std::string & > &processFilename)
 

Private Attributes

boost::filesystem::path m_directory
 
IndexFile m_readerIndexFile
 
IndexFile m_writerIndexFile
 

Detailed Description

File based queue reader where each message is represented by a file (with incrementing names) in a directory.

Constructor & Destructor Documentation

◆ FileQueueReader() [1/2]

catapult::io::FileQueueReader::FileQueueReader ( const std::string &  directory)
explicit

Creates a file queue reader around directory.

◆ FileQueueReader() [2/2]

catapult::io::FileQueueReader::FileQueueReader ( const std::string &  directory,
const std::string &  readerIndexFilename,
const std::string &  writerIndexFilename 
)

Creates a file queue reader around directory containing (reader and writer) index files (readerIndexFilename, writerIndexFilename).

Member Function Documentation

◆ pending()

size_t catapult::io::FileQueueReader::pending ( ) const

Gets the number of pending messages.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ process()

bool catapult::io::FileQueueReader::process ( const consumer< const std::string & > &  processFilename)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ skip()

void catapult::io::FileQueueReader::skip ( uint32_t  count)

Skips at most the next count messages.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tryReadNextMessage()

bool catapult::io::FileQueueReader::tryReadNextMessage ( const consumer< std::vector< uint8_t >> &  consumer)

Tries to read the next message and forwards it to consumer if successful.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_directory

boost::filesystem::path catapult::io::FileQueueReader::m_directory
private

◆ m_readerIndexFile

IndexFile catapult::io::FileQueueReader::m_readerIndexFile
private

◆ m_writerIndexFile

IndexFile catapult::io::FileQueueReader::m_writerIndexFile
private

The documentation for this class was generated from the following files: