Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed to etl #34

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/sequencer/sequences/HangingSequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "HangingSequence.h"


bool HangingSequence::testCondition([[maybe_unused]] uint64_t startTime, [[maybe_unused]] uint64_t curTime) {
return false;
}
Expand Down
5 changes: 3 additions & 2 deletions src/sequencer/sequences/RelatTimedSequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

#include "sequencer/sequences/RelatTimedSequence.h"
#include <utility>
#include <etl/vector.h>

RelatTimedSequence::RelatTimedSequence(std::vector<std::pair<uint64_t, ECSState>> seq) :
RelatTimedSequence::RelatTimedSequence(etl::vector<std::pair<uint64_t, ECSState>, 30> seq) :
RelatTimedSequence(seq, 0) {}

//private constructor, the usage of moving from a vector reference is justified here since it is encapsulated
RelatTimedSequence::RelatTimedSequence(std::vector<std::pair<uint64_t, ECSState>>& seq, size_t index) :
RelatTimedSequence::RelatTimedSequence(etl::vector<std::pair<uint64_t, ECSState>, 30>& seq, size_t index) :
waitTime(seq.at(index).first), //use .at() instead of [] for bounds checking
storedState(std::move(seq.at(index).second))
{
Expand Down
4 changes: 2 additions & 2 deletions src/sequencer/sequences/RelatTimedSequence.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class RelatTimedSequence: public ISequence{
*
* @throws std::out_of_range if seq is empty
*/
explicit RelatTimedSequence(std::vector<std::pair<uint64_t, ECSState>> seq);
explicit RelatTimedSequence(etl::vector<std::pair<uint64_t, ECSState>, 30> seq);

/*
* deleting the copy/move constructors that way we don't accidently make new sequences
Expand All @@ -50,7 +50,7 @@ class RelatTimedSequence: public ISequence{

private:
//NOTE: keep this constructor as a separate private constructor, rather than have index with a default arg
RelatTimedSequence(std::vector<std::pair<uint64_t, ECSState>>& seq , size_t index);
RelatTimedSequence(etl::vector<std::pair<uint64_t, ECSState>, 30>& seq , size_t index);

uint64_t waitTime;
ECSState storedState;
Expand Down
Loading