QuantumLibrary
Bloomberg::quantum::SequencerConfiguration< SequenceKey, Hash, KeyEqual, Allocator > Class Template Reference

Implementation of a configuration class for Sequencer. More...

#include <quantum_sequencer_configuration.h>

Public Types

using ExceptionCallback = std::function< void(std::exception_ptr exception, void *opaque)>
 Callback for unhandled exceptions in tasks posted to Sequencer. More...
 

Public Member Functions

void setControlQueueId (int controlQueueId)
 Sets the id of the control queue. More...
 
int getControlQueueId () const
 Gets the id of the control queue. More...
 
void setBucketCount (size_t bucketCount)
 Sets the minimal number of buckets to be used for the context hash map. More...
 
size_t getBucketCount () const
 gets the minimal number of buckets to be used for the context hash map More...
 
void setHash (const Hash &hash)
 Sets the hash function to be used for the context hash map. More...
 
const Hash & getHash () const
 Gets the hash function to be used for the context hash map. More...
 
void setKeyEqual (const KeyEqual &keyEqual)
 Sets the comparison function to be used for all SequenceKey comparisons for the context hash map. More...
 
const KeyEqual & getKeyEqual () const
 Gets the comparison function to be used for all SequenceKey comparisons for the context hash map. More...
 
void setAllocator (const Allocator &allocator)
 Sets the allocator for all SequenceKey comparisons for the context hash map. More...
 
const AllocatorgetAllocator () const
 Gets the allocator for all SequenceKey comparisons for the context hash map. More...
 
void setExceptionCallback (const ExceptionCallback &exceptionCallback)
 Sets the exception callback for Scheduler. More...
 
const ExceptionCallbackgetExceptionCallback () const
 Gets the exception callback for Scheduler. More...
 

Detailed Description

template<class SequenceKey, class Hash = std::hash<SequenceKey>, class KeyEqual = std::equal_to<SequenceKey>, class Allocator = std::allocator<std::pair<const SequenceKey, SequenceKeyData>>>
class Bloomberg::quantum::SequencerConfiguration< SequenceKey, Hash, KeyEqual, Allocator >

Implementation of a configuration class for Sequencer.

Template Parameters
SequenceKeyType of the key based that sequenced tasks are associated with in Sequencer
HashHash-function used for storing instances of SequenceKey in hash maps in Sequencer
KeyEqualThe equal-function used for storing instances of SequenceKey in hash maps in Sequencer
AllocatorThe allocator used for storing instances of SequenceKey in hash maps in Sequencer

Member Typedef Documentation

◆ ExceptionCallback

template<class SequenceKey, class Hash = std::hash<SequenceKey>, class KeyEqual = std::equal_to<SequenceKey>, class Allocator = std::allocator<std::pair<const SequenceKey, SequenceKeyData>>>
using Bloomberg::quantum::SequencerConfiguration< SequenceKey, Hash, KeyEqual, Allocator >::ExceptionCallback = std::function<void(std::exception_ptr exception, void* opaque)>

Callback for unhandled exceptions in tasks posted to Sequencer.

Parameters
exceptionpointer to the thrown exception
opaqueopaque data passed when posting a task

Member Function Documentation

◆ getAllocator()

template<class SequenceKey , class Hash , class KeyEqual , class Allocator >
const Allocator & Bloomberg::quantum::SequencerConfiguration< SequenceKey, Hash, KeyEqual, Allocator >::getAllocator ( ) const

Gets the allocator for all SequenceKey comparisons for the context hash map.

Returns
the allocator

◆ getBucketCount()

template<class SequenceKey , class Hash , class KeyEqual , class Allocator >
size_t Bloomberg::quantum::SequencerConfiguration< SequenceKey, Hash, KeyEqual, Allocator >::getBucketCount ( ) const

gets the minimal number of buckets to be used for the context hash map

Returns
the bucket number

◆ getControlQueueId()

template<class SequenceKey , class Hash , class KeyEqual , class Allocator >
int Bloomberg::quantum::SequencerConfiguration< SequenceKey, Hash, KeyEqual, Allocator >::getControlQueueId ( ) const

Gets the id of the control queue.

Returns
the queue id

◆ getExceptionCallback()

template<class SequenceKey , class Hash , class KeyEqual , class Allocator >
const SequencerConfiguration< SequenceKey, Hash, KeyEqual, Allocator >::ExceptionCallback & Bloomberg::quantum::SequencerConfiguration< SequenceKey, Hash, KeyEqual, Allocator >::getExceptionCallback ( ) const

Gets the exception callback for Scheduler.

Returns
the current callback

◆ getHash()

template<class SequenceKey , class Hash , class KeyEqual , class Allocator >
const Hash & Bloomberg::quantum::SequencerConfiguration< SequenceKey, Hash, KeyEqual, Allocator >::getHash ( ) const

Gets the hash function to be used for the context hash map.

Returns
the hash function

◆ getKeyEqual()

template<class SequenceKey , class Hash , class KeyEqual , class Allocator >
const KeyEqual & Bloomberg::quantum::SequencerConfiguration< SequenceKey, Hash, KeyEqual, Allocator >::getKeyEqual ( ) const

Gets the comparison function to be used for all SequenceKey comparisons for the context hash map.

Returns
the comparison function

◆ setAllocator()

template<class SequenceKey , class Hash , class KeyEqual , class Allocator >
void Bloomberg::quantum::SequencerConfiguration< SequenceKey, Hash, KeyEqual, Allocator >::setAllocator ( const Allocator allocator)

Sets the allocator for all SequenceKey comparisons for the context hash map.

Parameters
allocatorthe allocator

◆ setBucketCount()

template<class SequenceKey , class Hash , class KeyEqual , class Allocator >
void Bloomberg::quantum::SequencerConfiguration< SequenceKey, Hash, KeyEqual, Allocator >::setBucketCount ( size_t  bucketCount)

Sets the minimal number of buckets to be used for the context hash map.

Parameters
bucketCountthe bucket number

◆ setControlQueueId()

template<class SequenceKey , class Hash , class KeyEqual , class Allocator >
void Bloomberg::quantum::SequencerConfiguration< SequenceKey, Hash, KeyEqual, Allocator >::setControlQueueId ( int  controlQueueId)

Sets the id of the control queue.

Parameters
controlQueueIdthe queue id
Remarks
Sequencer typically processes tasks with the lower latency when the control queue is dedicated for the sequencer contol tasks only, and no other tasks are enqueued into it.

◆ setExceptionCallback()

template<class SequenceKey , class Hash , class KeyEqual , class Allocator >
void Bloomberg::quantum::SequencerConfiguration< SequenceKey, Hash, KeyEqual, Allocator >::setExceptionCallback ( const ExceptionCallback exceptionCallback)

Sets the exception callback for Scheduler.

Parameters
exceptionCallbackthe callback to set

◆ setHash()

template<class SequenceKey , class Hash , class KeyEqual , class Allocator >
void Bloomberg::quantum::SequencerConfiguration< SequenceKey, Hash, KeyEqual, Allocator >::setHash ( const Hash &  hash)

Sets the hash function to be used for the context hash map.

Parameters
hashthe hash function

◆ setKeyEqual()

template<class SequenceKey , class Hash , class KeyEqual , class Allocator >
void Bloomberg::quantum::SequencerConfiguration< SequenceKey, Hash, KeyEqual, Allocator >::setKeyEqual ( const KeyEqual &  keyEqual)

Sets the comparison function to be used for all SequenceKey comparisons for the context hash map.

Parameters
keyEqualthe comparison function