Spinning Topp Logo BlackTopp Studios
inc
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Mezzanine::Input::SequenceContainer Class Reference

This class stores and provides utilities for sequenced inputs and their operations. More...

#include <sequencecontainer.h>

+ Collaboration diagram for Mezzanine::Input::SequenceContainer:

Public Types

typedef Trie< Input::MetaCode, Int32SequencedInputContainer
 Container type for recognized input sequences.
 
typedef SequencedInputContainer::iterator SequencedInputIterator
 Iterator type for recognized input sequences.
 

Public Member Functions

 SequenceContainer ()
 Class constructor.
 
 SequenceContainer (const UInt32 &Device)
 Controller constructor. More...
 
virtual ~SequenceContainer ()
 Class destructor.
 
void AddInputSequence (const MetaCodeContainer &Codes, const Int32 &SequenceID)
 Adds a custom sequence of inputs that this system will look for and generate MetaCode's for when they occur.

Exceptions
Ifthe vector of MetaCode's doesn't end with a null MetaCode, an exception will be thrown. An exception can also be thrown if the ID provided is the max value of an Int32.
More...
 
Int32 GetIDofInputSequence (const MetaCodeContainer &Codes)
 Gets the ID of the provided sequence of MetaCode's.

Exceptions
Ifthe vector of MetaCode's doesn't end with a null MetaCode, an exception will be thrown.
More...
 
UInt32 GetNumInputSequences () const
 Gets the number of input sequences stored in this sequence container. More...
 
Boole InputSequenceExists (const MetaCodeContainer &Codes)
 Checks to see if the provided sequence of MetaCode's is already being checked for.

Exceptions
Ifthe vector of MetaCode's doesn't end with a null MetaCode, an exception will be thrown.
More...
 
void RemoveAllInputSequences ()
 Removes all stored input sequences.
 
void RemoveInputSequence (const MetaCodeContainer &Codes)
 Removes the specified custom sequence of MetaCode's.

Exceptions
Ifthe vector of MetaCode's doesn't end with a null MetaCode, an exception will be thrown.
More...
 
void Update (const MetaCodeContainer &NormalCodes, MetaCodeContainer &SequenceCodes)
 Adds provided codes to the cache if necessary and checks for sequences that have been met. More...
 

Protected Member Functions

MetaCode ProcessSequence (MetaCodeIterator First, MetaCodeIterator OneAfterLast)
 Processes a sequence(as defined by an iterator range) to see if any action needs to be taken. More...
 
void VerifyInputID (const Int32 &ID) const
 Verify's a numer is valid to be used as an ID for an input sequence being inserted. More...
 
virtual void VerifyInputSequence (const MetaCodeContainer &Codes) const
 Verify's a sequence of MetaCode's is terminated with a null MetaCode. More...
 

Protected Attributes

MetaCodeContainer CurrSequenceCache
 Container storing the current input sequence. More...
 
const UInt32 DeviceIndex
 The index of the device to detect sequenced inputs for. More...
 
UInt16 MaxSequenceSize
 The maximum number of inputs to keep cached for detecting sequenced inputs. More...
 
SequencedInputContainer SequencedInputs
 Container storing all the recognized input sequences. More...
 
TimerSequenceTimer
 Timer used to help detect input sequences. More...
 

Detailed Description

This class stores and provides utilities for sequenced inputs and their operations.

Definition at line 54 of file sequencecontainer.h.

Constructor & Destructor Documentation

Mezzanine::Input::SequenceContainer::SequenceContainer ( const UInt32 Device)

Controller constructor.

Parameters
DeviceThe index of the controller device this container belongs to.

Definition at line 63 of file sequencecontainer.cpp.

Member Function Documentation

void Mezzanine::Input::SequenceContainer::AddInputSequence ( const MetaCodeContainer Codes,
const Int32 SequenceID 
)

Adds a custom sequence of inputs that this system will look for and generate MetaCode's for when they occur.

Exceptions
Ifthe vector of MetaCode's doesn't end with a null MetaCode, an exception will be thrown. An exception can also be thrown if the ID provided is the max value of an Int32.

Parameters
CodesA vector containing the sequence of MetaCode's to be added.
SequenceIDA unique UInt32 to be used as the identifier for this sequence when a MetaCode is generated.

Definition at line 118 of file sequencecontainer.cpp.

Int32 Mezzanine::Input::SequenceContainer::GetIDofInputSequence ( const MetaCodeContainer Codes)

Gets the ID of the provided sequence of MetaCode's.

Exceptions
Ifthe vector of MetaCode's doesn't end with a null MetaCode, an exception will be thrown.

Parameters
CodesA vector containing the sequence of MetaCode's to get the ID for.
Returns
Returns the ID of the provided sequence, or the max value of an Int32 if the sequence does not exist.

Definition at line 133 of file sequencecontainer.cpp.

UInt32 Mezzanine::Input::SequenceContainer::GetNumInputSequences ( ) const

Gets the number of input sequences stored in this sequence container.

Returns
Returns a UInt32 containing the number of sequences stored.

Definition at line 159 of file sequencecontainer.cpp.

Boole Mezzanine::Input::SequenceContainer::InputSequenceExists ( const MetaCodeContainer Codes)

Checks to see if the provided sequence of MetaCode's is already being checked for.

Exceptions
Ifthe vector of MetaCode's doesn't end with a null MetaCode, an exception will be thrown.

Parameters
CodesA vector containing the sequence of MetaCode's to check for.
Returns
Returns true if the sequence already exists, false otherwise.

Definition at line 127 of file sequencecontainer.cpp.

MetaCode Mezzanine::Input::SequenceContainer::ProcessSequence ( MetaCodeIterator  First,
MetaCodeIterator  OneAfterLast 
)
protected

Processes a sequence(as defined by an iterator range) to see if any action needs to be taken.

Parameters
FirstAn iterator to the first metacode in the sequence.
OneAfterLastAn iterator to the space after the last metacode in the sequence.
Returns
Returns a new metacode for a completed sequence, or a "Null" metacode if no sequence was completed.

Definition at line 96 of file sequencecontainer.cpp.

void Mezzanine::Input::SequenceContainer::RemoveInputSequence ( const MetaCodeContainer Codes)

Removes the specified custom sequence of MetaCode's.

Exceptions
Ifthe vector of MetaCode's doesn't end with a null MetaCode, an exception will be thrown.

Parameters
CodesA vector containing the sequence of MetaCode's to be removed.

Definition at line 145 of file sequencecontainer.cpp.

void Mezzanine::Input::SequenceContainer::Update ( const MetaCodeContainer NormalCodes,
MetaCodeContainer SequenceCodes 
)

Adds provided codes to the cache if necessary and checks for sequences that have been met.

Parameters
NormalCodesA vector of the codes to add and/or check as a part of another sequence.
SequenceCodesA vector to which generated sequence codes will be added if they are generated.

Definition at line 164 of file sequencecontainer.cpp.

void Mezzanine::Input::SequenceContainer::VerifyInputID ( const Int32 ID) const
protected

Verify's a numer is valid to be used as an ID for an input sequence being inserted.

Parameters
IDThe identification number to verify.

Definition at line 90 of file sequencecontainer.cpp.

void Mezzanine::Input::SequenceContainer::VerifyInputSequence ( const MetaCodeContainer Codes) const
protectedvirtual

Verify's a sequence of MetaCode's is terminated with a null MetaCode.

Parameters
CodesThe vector of MetaCode's to verify.

Definition at line 79 of file sequencecontainer.cpp.

Member Data Documentation

MetaCodeContainer Mezzanine::Input::SequenceContainer::CurrSequenceCache
protected

Container storing the current input sequence.

Definition at line 67 of file sequencecontainer.h.

const UInt32 Mezzanine::Input::SequenceContainer::DeviceIndex
protected

The index of the device to detect sequenced inputs for.

Definition at line 73 of file sequencecontainer.h.

UInt16 Mezzanine::Input::SequenceContainer::MaxSequenceSize
protected

The maximum number of inputs to keep cached for detecting sequenced inputs.

Definition at line 76 of file sequencecontainer.h.

SequencedInputContainer Mezzanine::Input::SequenceContainer::SequencedInputs
protected

Container storing all the recognized input sequences.

Definition at line 64 of file sequencecontainer.h.

Timer* Mezzanine::Input::SequenceContainer::SequenceTimer
protected

Timer used to help detect input sequences.

Definition at line 70 of file sequencecontainer.h.


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