FARGOS/VISTA Object Management Environment Core  ..
FARGOS/VISTA Object Management Environment Core Table of Contents

Input block record for use with OrderedMultipleInputFilter. More...

#include <OrderedInput.hpp>

Public Types

typedef ssize_t BlockSize_t
 

Public Member Functions

 OrderedInputBlock (uint64_t key, unsigned char *block, BlockSize_t len, OrderedInputSource *source, bool makeCopy=true)
 Create a input block, potentially copying the source data. More...
 
void reuseBlock (uint64_t key, unsigned char *block, BlockSize_t len, OrderedInputSource *source, bool makeCopy=true) OME_ALWAYS_INLINE OME_ALWAYS_OPTIMIZE("-O3")
 Reinitialize an existing block. This routine is nearly identical to the OrderedInputBlock constructor, but is called when reusing an existing record. More...
 
 ~OrderedInputBlock ()
 
uint64_t getSortKey () const OME_ALWAYS_INLINE
 Get sort key for block. More...
 
bool operator< (const OrderedInputBlock &arg) const OME_ALWAYS_INLINE OME_ALWAYS_OPTIMIZE("-O3")
 Less-than comparison between OrderedInputBlock objects. More...
 

Static Public Member Functions

static CONSTEXPR uint64_t getMaximumPossibleSortKey () OME_ALWAYS_INLINE OME_CONST_FUNCTION
 Return maximum possible value for a sort key. More...
 

Public Attributes

uint64_t sortKey
 sort key for priority queue, typically represents nanoseconds More...
 
class OrderedInputSource * inputFile
 source/owner of storage block More...
 
unsigned char * blockStart
 base of storage block More...
 
BlockSize_t usedLen
 actively used amount within storage block More...
 
BlockSize_t blockLen
 size of storage block More...
 
bool ownBlock
 Boolean flag indicating ownership. More...
 

Protected Types

enum  { BLOCK_REUSE_PADDING =128 }
 

Detailed Description

Input block record for use with OrderedMultipleInputFilter.

The OrderedInputBlock structure is the fundamental record delivery mechanism used by OrderedMultipleInputFilter objects.

Member Typedef Documentation

◆ BlockSize_t

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
BLOCK_REUSE_PADDING 

Constructor & Destructor Documentation

◆ OrderedInputBlock()

OrderedInputBlock::OrderedInputBlock ( uint64_t  key,
unsigned char *  block,
BlockSize_t  len,
OrderedInputSource *  source,
bool  makeCopy = true 
)
inline

Create a input block, potentially copying the source data.

Parameters
keyspecifies the value of the used to order the input.
blockpoints to the data for the block
lenspecifies the length of the data
sourcepoints to the input source from which the data was obtained
makeCopyis a Boolean that indicates if a copy of the data should be made. If true, the source data can be altered or deleted immediately, however, effort must be expended to duplicate the content.

References blockLen, blockStart, inputFile, OME_PREFETCH, ownBlock, sortKey, and usedLen.

◆ ~OrderedInputBlock()

OrderedInputBlock::~OrderedInputBlock ( )
inline

References blockStart, and ownBlock.

Member Function Documentation

◆ getMaximumPossibleSortKey()

static CONSTEXPR uint64_t OrderedInputBlock::getMaximumPossibleSortKey ( )
inlinestatic

Return maximum possible value for a sort key.

Note
This is a static routine, so the value returned is not specific to a particular OrderedInputSource.

◆ getSortKey()

uint64_t OrderedInputBlock::getSortKey ( ) const
inline

Get sort key for block.

References sortKey.

◆ operator<()

bool OrderedInputBlock::operator< ( const OrderedInputBlock arg) const
inline

Less-than comparison between OrderedInputBlock objects.

Parameters
argis a reference to the other peer object to be compared.
Warning
The unexpected is done for this specialized class by having less-than act like greater-than so that the priority queue returns elements in the desired order.
Note
This routine is virtual to allow it to be overridden. This may be rare, but it does allow the logic to work with a subclass. Due to the rarity of this functionality being exploited and the multiple uses per input block, this benefits greatly from devirtualization, so marking application classes as final is helpful.
See also
FORCE_ORDERED_INPUT_BLOCK_AS_FINAL for a define to remove all virtualization for performance.

References inputFile, and sortKey.

◆ reuseBlock()

void OrderedInputBlock::reuseBlock ( uint64_t  key,
unsigned char *  block,
BlockSize_t  len,
OrderedInputSource *  source,
bool  makeCopy = true 
)
inline

Reinitialize an existing block. This routine is nearly identical to the OrderedInputBlock constructor, but is called when reusing an existing record.

Parameters
keyspecifies the value of the used to order the input.
blockpoints to the data for the block
lenspecifies the length of the data
sourcepoints to the input source from which the data was obtained
makeCopyis a Boolean that indicates if a copy of the data should be made. If true, the source data can be altered or deleted immediately, however, effort must be expended to duplicate the content.

References blockLen, blockStart, CACHE_LINE_LENGTH, inputFile, OME_EXPECT_FALSE, OME_EXPECT_TRUE, OME_PREFETCH, ownBlock, sortKey, and usedLen.

Member Data Documentation

◆ blockLen

BlockSize_t OrderedInputBlock::blockLen

size of storage block

Referenced by OrderedInputBlock(), and reuseBlock().

◆ blockStart

unsigned char* OrderedInputBlock::blockStart

base of storage block

Referenced by OrderedInputBlock(), reuseBlock(), and ~OrderedInputBlock().

◆ inputFile

◆ ownBlock

bool OrderedInputBlock::ownBlock

Boolean flag indicating ownership.

Referenced by OrderedInputBlock(), reuseBlock(), and ~OrderedInputBlock().

◆ sortKey

uint64_t OrderedInputBlock::sortKey

sort key for priority queue, typically represents nanoseconds

Referenced by getSortKey(), operator<(), OrderedInputBlock(), OrderedMultipleInputFilter::processQueue(), and reuseBlock().

◆ usedLen

BlockSize_t OrderedInputBlock::usedLen

actively used amount within storage block

Referenced by OrderedInputSourceProxyWithReordering::getNextInputBlock(), OrderedInputBlock(), and reuseBlock().


The documentation for this class was generated from the following file:
Generated: Tue Jul 28 2020 16:03:27
Support Information