Skip to content

Commit d38bb00

Browse files
Merge pull request #259 from HyperloopUPV-H8/development
v2.3.0
2 parents 7bd5e73 + a1eac16 commit d38bb00

45 files changed

Lines changed: 1449 additions & 510 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cproject

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.1392326343" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g3" valueType="enumerated"/>
3636
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols.38266524" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
3737
<listOptionValue builtIn="false" value="DEBUG"/>
38-
<listOptionValue builtIn="false" value="NUCLEO"/>
38+
<listOptionValue builtIn="false" value="BOARD"/>
3939
</option>
4040
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.includepaths.1469936301" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
4141
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc}&quot;"/>
@@ -57,8 +57,8 @@
5757
<listOptionValue builtIn="false" value="DEBUG"/>
5858
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
5959
<listOptionValue builtIn="false" value="STM32H723xx"/>
60-
<listOptionValue builtIn="false" value="NUCLEO"/>
61-
<listOptionValue builtIn="false" value="HSE_VALUE=8000000UL"/>
60+
<listOptionValue builtIn="false" value="HSE_VALUE=25000000UL"/>
61+
<listOptionValue builtIn="false" value="BOARD"/>
6262
</option>
6363
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths.1706685625" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
6464
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32H7xx/Include"/>
@@ -76,16 +76,17 @@
7676
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/LWIP/Target}&quot;"/>
7777
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc/ST-LIB_HIGH}&quot;"/>
7878
</option>
79+
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.otherflags.1558820298" name="Other flags" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.otherflags" useByScannerDiscovery="true" valueType="stringList"/>
7980
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1475030527" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
8081
</tool>
8182
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.1661936536" name="MCU G++ Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler">
8283
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.1174736451" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.value.g3" valueType="enumerated"/>
83-
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.976783598" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level" useByScannerDiscovery="false"/>
84+
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.976783598" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.value.o0" valueType="enumerated"/>
8485
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols.1331033218" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
8586
<listOptionValue builtIn="false" value="DEBUG"/>
8687
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
8788
<listOptionValue builtIn="false" value="STM32H723xx"/>
88-
<listOptionValue builtIn="false" value="NUCLEO"/>
89+
<listOptionValue builtIn="false" value="BOARD"/>
8990
</option>
9091
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.includepaths.1243949257" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
9192
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc}&quot;"/>
@@ -117,6 +118,9 @@
117118
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc/ST-LIB_HIGH}&quot;"/>
118119
</option>
119120
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.languagestandard.1092333469" name="Language standard" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.languagestandard" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.languagestandard.value.gnupp20" valueType="enumerated"/>
121+
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.otherflags.145077032" name="Other flags" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.otherflags" useByScannerDiscovery="true" valueType="stringList">
122+
<listOptionValue builtIn="false" value="-Wvolatile"/>
123+
</option>
120124
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.input.cpp.2042651219" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.input.cpp"/>
121125
</tool>
122126
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.1252531761" name="MCU GCC Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker"/>
@@ -218,6 +222,12 @@
218222
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/LWIP/App}&quot;"/>
219223
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/LWIP/Target}&quot;"/>
220224
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc/ST-LIB_HIGH}&quot;"/>
225+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc/HALAL/Services/}&quot;"/>
226+
</option>
227+
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols.779603999" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols" valueType="definedSymbols">
228+
<listOptionValue builtIn="false" value="DEBUG"/>
229+
<listOptionValue builtIn="false" value="HSE_VALUE=25000000UL"/>
230+
<listOptionValue builtIn="false" value="BOARD"/>
221231
</option>
222232
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.1583550009" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
223233
</tool>
@@ -227,6 +237,8 @@
227237
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.134281155" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
228238
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
229239
<listOptionValue builtIn="false" value="STM32H723xx"/>
240+
<listOptionValue builtIn="false" value="HSE_VALUE=25000000UL"/>
241+
<listOptionValue builtIn="false" value="BOARD"/>
230242
</option>
231243
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths.1420442850" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
232244
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32H7xx/Include"/>
@@ -252,6 +264,8 @@
252264
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols.1423635322" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
253265
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
254266
<listOptionValue builtIn="false" value="STM32H723xx"/>
267+
<listOptionValue builtIn="false" value="HSE_VALUE=25000000UL"/>
268+
<listOptionValue builtIn="false" value="BOARD"/>
255269
</option>
256270
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.includepaths.724629025" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
257271
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc}&quot;"/>
@@ -352,5 +366,11 @@
352366
<scannerConfigBuildInfo instanceId="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.debug.1166693079;com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.debug.1166693079.;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.1661936536;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.input.cpp.2042651219">
353367
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
354368
</scannerConfigBuildInfo>
369+
<scannerConfigBuildInfo instanceId="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.1604434668;com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.1604434668.;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1237569348;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.640356923">
370+
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
371+
</scannerConfigBuildInfo>
372+
<scannerConfigBuildInfo instanceId="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.1604434668;com.st.stm32cube.ide.mcu.gnu.managedbuild.config.lib.release.1604434668.;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.1046330885;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.input.cpp.1603283963">
373+
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
374+
</scannerConfigBuildInfo>
355375
</storageModule>
356376
</cproject>

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
},
1919
"C_Cpp.default.cppStandard": "c++20",
2020
"C_Cpp.default.cStandard": "c17",
21+
"files.associations": {
22+
"bitset": "cpp",
23+
"cstdlib": "cpp",
24+
"mutex": "cpp"
25+
},
2126
"docwriter.style": "Doxygen",
2227
"docwriter.progress.trackFunctions": true,
2328
"docwriter.progress.trackMethods": true

Inc/C++Utilities/CppUtils.hpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <cstdarg>
3737
#include <stdarg.h>
3838

39+
3940
namespace chrono = std::chrono;
4041
namespace placeholders = std::placeholders;
4142

@@ -67,9 +68,4 @@ using std::unordered_map;
6768
using std::vector;
6869
using std::queue;
6970
using std::map;
70-
71-
template<class Type>
72-
concept Integral = is_integral<Type>::value;
73-
74-
template<class Type>
75-
concept NotIntegral = !is_integral<Type>::value;
71+
using std::stringstream;
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11

22
#pragma once
3-
namespace Board{
4-
enum ID{
5-
VCU,
6-
BLCU,
7-
TCU,
8-
LCU_MASTER,
9-
LCU_SLAVE,
10-
PCU,
11-
BMSA,
12-
OBCCU
13-
};
14-
}
3+
enum BoardID{
4+
VCU,
5+
BLCU_VEHICLE,
6+
BLCU_INFRASTRUCTURE,
7+
TCU,
8+
LCU_MASTER,
9+
LCU_SLAVE,
10+
PCU,
11+
BMSA,
12+
OBCCU,
13+
NOBOARD
14+
};
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#pragma once
2+
#include "C++Utilities/CppUtils.hpp"
3+
4+
template<class Type>
5+
concept Integral = is_integral<Type>::value;
6+
7+
template<class Type>
8+
concept NotIntegral = !is_integral<Type>::value;
9+
10+
template <class T>
11+
concept Callable = requires(T a)
12+
{
13+
{ a() };
14+
};
15+
16+
template <class T>
17+
concept NotCallable = !Callable<T>;
18+
19+
template <class... Types>
20+
struct has_callable;
21+
22+
template <class Type, class... Types>
23+
struct has_callable<Type,Types...>{
24+
static constexpr bool value = Callable<Type> || has_callable<Types...>::value;
25+
};
26+
27+
template <>
28+
struct has_callable<>{
29+
static constexpr bool value = false;
30+
};
31+
32+
template <class... Types>
33+
concept CallablePack = has_callable<Types...>::value;
34+
35+
template <class... Types>
36+
concept NotCallablePack = !CallablePack<Types...>;
37+
38+
template <class T>
39+
concept Container = requires(T a, const T b)
40+
{
41+
requires std::regular<T>;
42+
requires std::swappable<T>;
43+
requires std::same_as<typename T::reference, typename T::value_type &>;
44+
requires std::same_as<typename T::const_reference, const typename T::value_type &>;
45+
requires std::forward_iterator<typename T::iterator>;
46+
requires std::forward_iterator<typename T::const_iterator>;
47+
requires std::signed_integral<typename T::difference_type>;
48+
requires std::same_as<typename T::difference_type, typename std::iterator_traits<typename T::iterator>::difference_type>;
49+
requires std::same_as<typename T::difference_type, typename std::iterator_traits<typename T::const_iterator>::difference_type>;
50+
{ a.begin() } -> std::same_as<typename T::iterator>;
51+
{ a.end() } -> std::same_as<typename T::iterator>;
52+
{ b.begin() } -> std::same_as<typename T::const_iterator>;
53+
{ b.end() } -> std::same_as<typename T::const_iterator>;
54+
{ a.cbegin() } -> std::same_as<typename T::const_iterator>;
55+
{ a.cend() } -> std::same_as<typename T::const_iterator>;
56+
{ a.size() } -> std::same_as<typename T::size_type>;
57+
{ a.max_size() } -> std::same_as<typename T::size_type>;
58+
{ a.empty() } -> std::convertible_to<bool>;
59+
};
60+
61+
template <class T>
62+
concept NotContainer = !Container<T>;
63+
64+
template <class T, class... U>
65+
concept PackDerivesFrom = (std::derived_from<T, U> && ...);
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#pragma once
2+
3+
#include "C++Utilities/CppUtils.hpp"
4+
5+
template<class... Types> class stack_tuple;
6+
7+
template<>
8+
class stack_tuple<> {
9+
public:
10+
stack_tuple() = default;
11+
template<class FunctionType>
12+
void for_each(FunctionType function) {}
13+
};
14+
15+
template<class Type, class... Types>
16+
class stack_tuple<Type, Types...>: public stack_tuple<Types...> {
17+
public:
18+
Type value;
19+
stack_tuple() = default;
20+
stack_tuple(Type value, Types... values): stack_tuple<Types...>(values...), value(value) {}
21+
template<class FunctionType>
22+
void for_each(FunctionType function) {
23+
function(value);
24+
stack_tuple<Types...>::for_each(function);
25+
}
26+
};
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#pragma once
2+
#include "C++Utilities/CppUtils.hpp"
3+
4+
template<class... Types>
5+
struct TemplatePack{
6+
using Pack = Types...;
7+
};
8+
9+
template<class FilterType, class... ToFilter>
10+
struct TemplatePackFilter;
11+
12+
template<class FilterType, class First, class... ToFilter> requires requires { requires !is_same<FilterType, First>::value; }
13+
struct TemplatePackFilter<FilterType, First, ToFilter...>{
14+
using FilteredPack = typename TemplatePackFilter<FilterType, ToFilter...>::FilteredPack;
15+
};
16+
17+
template<class FilterType, class... ToFilter>
18+
struct TemplatePackFilter<FilterType, FilterType, ToFilter...>{
19+
using FilteredPack = TemplatePack<FilterType, typename TemplatePackFilter<FilterType, ToFilter...>::FilteredPack>::Pack;
20+
};
21+
22+
template<class FilterType>
23+
struct TemplatePackFilter<FilterType>{
24+
using FilteredPack = TemplatePack<>::Pack;
25+
};

Inc/HALAL/Models/Packets/Order.hpp

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,35 @@
77
#pragma once
88

99
#include "Packet.hpp"
10+
#include "OrderProtocol.hpp"
1011

1112
class Order : public Packet{
1213
public:
1314
virtual void set_callback(void(*callback)(void)) = 0;
1415
virtual void process() = 0;
16+
virtual void parse(OrderProtocol* socket, void* data) = 0;
17+
void parse(void* data) override {
18+
parse(nullptr, data);
19+
}
1520
static void process_by_id(uint16_t id) {
1621
if (orders.find(id) != orders.end()) orders[id]->process();
1722
}
18-
static void process_data(void* data) {
23+
static void process_data(OrderProtocol* socket, void* data) {
1924
uint16_t id = Packet::get_id(data);
2025
if (orders.contains(id)) {
21-
orders[id]->parse(data);
26+
orders[id]->parse(socket, data);
2227
orders[id]->process();
2328
}
2429
}
2530
protected:
2631
static map<uint16_t,Order*> orders;
2732
};
2833

29-
template<size_t BufferLength,class... Types>
34+
template<size_t BufferLength,class... Types> requires NotCallablePack<Types*...>
3035
class StackOrder : public StackPacket<BufferLength,Types...>, public Order{
3136
public:
3237
StackOrder(uint16_t id,void(*callback)(void), Types*... values) : StackPacket<BufferLength,Types...>(id,values...), callback(callback) {orders[id] = this;}
33-
StackOrder(uint16_t id, Types*... values) : StackPacket<BufferLength,Types...>(id,values...) {orders[id] = this;}
38+
// StackOrder(uint16_t id, Types*... values) : StackPacket<BufferLength,Types...>(id,values...) {orders[id] = this;}
3439
void(*callback)(void) = nullptr;
3540
void set_callback(void(*callback)(void)) override {
3641
this->callback = callback;
@@ -44,6 +49,9 @@ class StackOrder : public StackPacket<BufferLength,Types...>, public Order{
4449
void parse(void* data) override {
4550
StackPacket<BufferLength,Types...>::parse(data);
4651
}
52+
void parse(OrderProtocol* socket, void* data){
53+
parse(data);
54+
}
4755
size_t get_size() override {
4856
return StackPacket<BufferLength,Types...>::get_size();
4957
}
@@ -53,11 +61,11 @@ class StackOrder : public StackPacket<BufferLength,Types...>, public Order{
5361
};
5462

5563
#if __cpp_deduction_guides >= 201606
56-
template<class... Types>
64+
template<class... Types> requires NotCallablePack<Types*...>
5765
StackOrder(uint16_t id,void(*callback)(void), Types*... values)->StackOrder<(!has_container<Types...>::value)*total_sizeof<Types...>::value, Types...>;
5866

59-
template<class... Types>
60-
StackOrder(uint16_t id, Types*... values)->StackOrder<(!has_container<Types...>::value)*total_sizeof<Types...>::value, Types...>;
67+
//template<class... Types> requires NotCallablePack<Types*...>
68+
//StackOrder(uint16_t id, Types*... values)->StackOrder<(!has_container<Types...>::value)*total_sizeof<Types...>::value, Types...>;
6169
#endif
6270

6371
class HeapOrder : public HeapPacket, public Order{
@@ -81,6 +89,9 @@ class HeapOrder : public HeapPacket, public Order{
8189
void parse(void* data) override {
8290
HeapPacket::parse(data);
8391
}
92+
void parse(OrderProtocol* socket, void* data){
93+
parse(data);
94+
}
8495
size_t get_size() override {
8596
return HeapPacket::get_size();
8697
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#pragma once
2+
#include "Packets/Packet.hpp"
3+
4+
class Order;
5+
6+
class OrderProtocol{
7+
public:
8+
virtual bool send_order(Order& order) = 0;
9+
static vector<OrderProtocol*> sockets;
10+
};

0 commit comments

Comments
 (0)