MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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,
Int32
SequencedInputContainer
 
typedef
SequencedInputContainer::iterator 
SequencedInputIterator
 

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...
 
bool 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
 
const UInt32 DeviceIndex
 
UInt16 MaxSequenceSize
 
SequencedInputContainer SequencedInputs
 
StopWatchTimerSequenceTimer
 

Detailed Description

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

Definition at line 57 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 64 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 121 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 136 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 162 of file sequencecontainer.cpp.

bool 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 130 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 99 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 148 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 167 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 93 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 81 of file sequencecontainer.cpp.


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