Ignition Transport

API Reference

11.0.0

The QueryOptions interface is used by Log::QueryMessages() to determine which messages are retrieved from the log file. More...

#include <QueryOptions.hh>

Public Member Functions

virtual ~QueryOptions ()=default
 Virtual destructor. More...
 
virtual std::vector< SqlStatementGenerateStatements (const Descriptor &_descriptor) const =0
 Generate one or more SQL query statements to be used by the log file to produce a Batch of messages. More...
 

Static Public Member Functions

static SqlStatement StandardMessageQueryClose ()
 Get a standard ending to a SQL statement that will instruct the queries to be ordered by the time the messages were received by the logger. It will also end the statement with a semicolon. More...
 
static SqlStatement StandardMessageQueryPreamble ()
 Get a standard SQL statement preamble, from the SELECT keyword up to (but not including) the WHERE keyword. This preamble will make sure that the statement is formatted in a way that MsgIter will have the information it needs. More...
 

Detailed Description

The QueryOptions interface is used by Log::QueryMessages() to determine which messages are retrieved from the log file.

Constructor & Destructor Documentation

◆ ~QueryOptions()

virtual ~QueryOptions ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ GenerateStatements()

virtual std::vector<SqlStatement> GenerateStatements ( const Descriptor _descriptor) const
pure virtual

Generate one or more SQL query statements to be used by the log file to produce a Batch of messages.

Parameters
[in]_descriptorA Descriptor to help form the SQL statements
Returns
One or more SQL statements.

Implemented in AllTopics, TopicPattern, and TopicList.

◆ StandardMessageQueryClose()

static SqlStatement StandardMessageQueryClose ( )
static

Get a standard ending to a SQL statement that will instruct the queries to be ordered by the time the messages were received by the logger. It will also end the statement with a semicolon.

Returns
{" ORDER BY messages.time_recv;"}

◆ StandardMessageQueryPreamble()

static SqlStatement StandardMessageQueryPreamble ( )
static

Get a standard SQL statement preamble, from the SELECT keyword up to (but not including) the WHERE keyword. This preamble will make sure that the statement is formatted in a way that MsgIter will have the information it needs.

Using this statement without modification will query all messages in the log, with no specified order (or fail to compile in the SQL interpreter if you neglect to add a semicolon to the end). Append the output of StandardMessageQueryClose() to ensure that the query output will be ordered by the time each message was received, and that the statement closes with a semicolon.

Returns
The initial clause of a standard QueryOptions SQL statement.

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