mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
Using FixedCapacityContainer for rxDbitList (#22)
* fixed capacity container * changed shm date
This commit is contained in:

committed by
Dhanya Thattil

parent
bf0847e967
commit
877bdb8979
@ -20,6 +20,8 @@ template <typename T, size_t Capacity> class FixedCapacityContainer {
|
||||
bool operator==(const std::vector<T> &other) const noexcept;
|
||||
bool operator!=(const std::vector<T> &other) const noexcept;
|
||||
|
||||
operator std::vector<T>(){return std::vector<T>(begin(), end());}
|
||||
|
||||
template <size_t OtherCapacity>
|
||||
bool operator==(const FixedCapacityContainer<T, OtherCapacity> &other) const
|
||||
noexcept;
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "ansi.h"
|
||||
|
||||
#define BIT32_MASK 0xFFFFFFFF
|
||||
#define MAX_RX_DBIT 64
|
||||
|
||||
/** default ports */
|
||||
#define DEFAULT_PORTNO 1952
|
||||
|
@ -215,3 +215,16 @@ SCENARIO("Assigning containers to each other", "[support]") {
|
||||
}
|
||||
}
|
||||
|
||||
SCENARIO("Converting to vector", "[support]"){
|
||||
GIVEN("a FixedCapacityContainer"){
|
||||
FixedCapacityContainer<int, 5> a{1,2,3};
|
||||
WHEN("Converted into a vector"){
|
||||
std::vector<int> b(a);
|
||||
THEN("Data and size matches"){
|
||||
REQUIRE(a == b);
|
||||
REQUIRE(a.size() == b.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user