Skip to content

Commit

Permalink
Moves Serializer files to Serializer/
Browse files Browse the repository at this point in the history
Serializer: Renames .mqh to .h
  • Loading branch information
kenorb committed Aug 19, 2022
1 parent 8b9072d commit 943f662
Show file tree
Hide file tree
Showing 73 changed files with 245 additions and 186 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/test-serializer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
name: Test Serializer

# yamllint disable-line rule:truthy
on:
pull_request:
paths:
- 'Serializer/**'
- '.github/workflows/test-serializer.yml'
push:
paths:
- 'Serializer/**'
- '.github/workflows/test-serializer.yml'

jobs:

Compile:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Compile
uses: fx31337/mql-compile-action@master
with:
init-platform: true
path: 'serializer/tests'
verbose: true
- name: Print compiled files
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname'
shell: powershell
- name: Upload artifacts (MQL4)
uses: actions/upload-artifact@v2
with:
name: files-ex4
path: '**/*.ex4'
- name: Upload artifacts (MQL5)
uses: actions/upload-artifact@v2
with:
name: files-ex5
path: '**/*.ex5'

Serializer-Tests-MQL4:
defaults:
run:
shell: bash
working-directory: serializer/tests
needs: Compile
runs-on: ubuntu-latest
strategy:
matrix:
test:
- Serializer.test
steps:
- uses: actions/download-artifact@v2
with:
name: files-ex4
- name: Run ${{ matrix.test }}
uses: fx31337/mql-tester-action@master
with:
BtDays: 4-8
BtMonths: 1
BtYears: 2021
MtVersion: 4.0.0.1359
RunOnError: show_logs 200
TestExpert: ${{ matrix.test }}
timeout-minutes: 10
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ jobs:
- OrderQuery
- ProfilerTest
- RefsTest
- SerializerTest
- TerminalTest
- TimerTest
- ValueStorageTest
Expand Down
4 changes: 2 additions & 2 deletions 3D/Chart3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#include "../Indicators/Indi_MA.mqh"
#include "../Instances.h"
#include "../Refs.mqh"
#include "../SerializerConverter.mqh"
#include "../SerializerJson.mqh"
#include "../Serializer/SerializerConverter.h"
#include "../Serializer/SerializerJson.h"
#include "Chart3DCandles.h"
#include "Chart3DType.h"
#include "Cube.h"
Expand Down
2 changes: 1 addition & 1 deletion Account/Account.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

// Includes.
#include "../BufferStruct.mqh"
#include "../Serializer.mqh"
#include "../Serializer/Serializer.h"
#include "AccountBase.h"

/**
Expand Down
2 changes: 1 addition & 1 deletion Account/Account.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
class Serializer;

// Includes.
#include "../Serializer.mqh"
#include "../Serializer/Serializer.h"
#include "../Terminal.define.h"

// Struct for account entries.
Expand Down
1 change: 0 additions & 1 deletion Account/AccountBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#define ACCOUNTBASE_H

// Includes.
//#include "../Serializer.mqh"
#include "../Refs.mqh"
#include "AccountBase.struct.h"

Expand Down
2 changes: 1 addition & 1 deletion Account/AccountBase.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
class Serializer;

// Includes.
#include "../Serializer.mqh"
#include "../Serializer/Serializer.h"
#include "../Terminal.define.h"

// Struct for account entries.
Expand Down
2 changes: 1 addition & 1 deletion Account/AccountForex.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#define ACCOUNTFOREX_H

// Includes.
#include "../Serializer.mqh"
#include "../Serializer/Serializer.h"
#include "Account.h"
#include "AccountForex.struct.h"

Expand Down
2 changes: 1 addition & 1 deletion Account/AccountForex.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
class Serializer;

// Includes.
#include "../Serializer.mqh"
#include "../Serializer/Serializer.h"
#include "../Terminal.define.h"

// Struct for account entries.
Expand Down
2 changes: 1 addition & 1 deletion Account/AccountMt.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class AccountMt;
#include "../Indicator/Indicator.struct.h"
#include "../Order.struct.h"
#include "../Orders.mqh"
#include "../Serializer.mqh"
#include "../Serializer/Serializer.h"
#include "../SymbolInfo.mqh"
#include "../Trade.struct.h"
#include "Account.define.h"
Expand Down
11 changes: 5 additions & 6 deletions Bar.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,16 @@ class Serializer;
// Includes.
#include "Bar.enum.h"
#include "Chart.enum.h"
#include "ISerializable.h"
#include "Serializer.enum.h"
#include "SerializerNode.enum.h"
#include "Serializer/Serializable.h"
#include "Serializer/Serializer.enum.h"
#include "Serializer/SerializerNode.enum.h"
#include "Std.h"
#include "Serializer/Serializer.h"

/* Struct for storing OHLC values. */
struct BarOHLC
#ifndef __MQL__
: public ISerializable
: public Serializable
#endif
{
datetime time;
Expand Down Expand Up @@ -230,8 +231,6 @@ struct BarOHLC
string ToCSV() { return StringFormat("%d,%g,%g,%g,%g", time, open, high, low, close); }
};

#include "Serializer.mqh"

/* Method to serialize BarOHLC structure. */
SerializerNodeType BarOHLC::Serialize(Serializer &s) {
// s.Pass(THIS_REF, "time", TimeToString(time));
Expand Down
2 changes: 1 addition & 1 deletion BufferStruct.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// Includes.
#include "DictBase.mqh"
#include "DictStruct.mqh"
#include "Serializer.mqh"
#include "Serializer/Serializer.h"

/**
* Implements BufferStruct's Overflow Listener.
Expand Down
11 changes: 5 additions & 6 deletions Candle.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,17 @@ class Serializer;
// Includes.
#include "Bar.enum.h"
#include "Chart.enum.h"
#include "ISerializable.h"
#include "Serializer.enum.h"
#include "SerializerNode.enum.h"
#include "Serializer/Serializable.h"
#include "Serializer/Serializer.enum.h"
#include "Serializer/SerializerNode.enum.h"
#include "Std.h"
#include "Serializer/Serializer.h"

/* Structure for storing OHLC values. */
template <typename T>
struct CandleOHLC
#ifndef __MQL__
: public ISerializable
: public Serializable
#endif
{
T open, high, low, close;
Expand Down Expand Up @@ -276,8 +277,6 @@ struct CandleTOHLC : CandleOHLC<T> {
string ToCSV() { return StringFormat("%d,%g,%g,%g,%g", time, open, high, low, close); }
};

#include "Serializer.mqh"

/* Method to serialize CandleEntry structure. */
template <typename T>
SerializerNodeType CandleOHLC::Serialize(Serializer &s) {
Expand Down
2 changes: 1 addition & 1 deletion Chart.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include "Chart.struct.serialize.h"
#include "Convert.mqh"
#include "Market.mqh"
#include "Serializer.mqh"
#include "Serializer/Serializer.h"
#include "Task/TaskCondition.enum.h"

// Forward class declaration.
Expand Down
4 changes: 2 additions & 2 deletions Chart.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ struct ChartTf;
#include "Chart.enum.h"
#include "Chart.struct.static.h"
#include "Chart.struct.tf.h"
#include "Serializer.mqh"
#include "SerializerNode.enum.h"
#include "Serializer/Serializer.h"
#include "Serializer/SerializerNode.enum.h"
#include "Terminal.define.h"

/* Defines struct to store bar entries. */
Expand Down
4 changes: 2 additions & 2 deletions Chart.struct.serialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
class Serializer;

// Includes.
#include "Serializer.mqh"
#include "SerializerNode.enum.h"
#include "Serializer/Serializer.h"
#include "Serializer/SerializerNode.enum.h"

/* Method to serialize ChartEntry structure. */
SerializerNodeType ChartEntry::Serialize(Serializer& _s) {
Expand Down
5 changes: 2 additions & 3 deletions Chart.struct.tf.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ class Serializer;

// Includes.
#include "Chart.enum.h"
#include "SerializerNode.enum.h"
#include "Serializer/SerializerNode.enum.h"
#include "Terminal.define.h"
#include "Serializer/Serializer.h"

/* Defines struct for chart timeframe. */
struct ChartTf {
Expand Down Expand Up @@ -351,8 +352,6 @@ struct ChartTf {
SerializerNodeType Serialize(Serializer& s);
};

#include "Serializer.mqh"

/* Method to serialize ChartTf structure. */
SerializerNodeType ChartTf::Serialize(Serializer& s) {
s.PassEnum(THIS_REF, "tf", tf);
Expand Down
2 changes: 1 addition & 1 deletion Config.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "DictStruct.mqh"
#include "File.mqh"
#include "Object.mqh"
#include "Serializer.mqh"
#include "Serializer/Serializer.h"

enum CONFIG_FORMAT { CONFIG_FORMAT_JSON, CONFIG_FORMAT_JSON_NO_WHITESPACES, CONFIG_FORMAT_INI };

Expand Down
7 changes: 3 additions & 4 deletions Data.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ struct MqlRates;
// Includes.
#include "Data.enum.h"
#include "DateTime.mqh"
#include "Serializer.enum.h"
#include "SerializerNode.enum.h"
#include "Serializer/Serializer.enum.h"
#include "Serializer/SerializerNode.enum.h"
#include "Std.h"
#include "Serializer/Serializer.h"

#ifndef __MQL__
/**
Expand Down Expand Up @@ -330,8 +331,6 @@ struct DataParamEntry : public MqlParam {
SerializerNodeType Serialize(Serializer &s);
};

#include "Serializer.mqh"

/* Method to serialize DataParamEntry struct. */
SerializerNodeType DataParamEntry::Serialize(Serializer &s) {
s.PassEnum(THIS_REF, "type", type, SERIALIZER_FIELD_FLAG_HIDDEN);
Expand Down
4 changes: 2 additions & 2 deletions Dict.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#include "Convert.mqh"
#include "DictBase.mqh"
#include "Matrix.mqh"
#include "Serializer.mqh"
#include "SerializerNodeIterator.mqh"
#include "Serializer/Serializer.h"
#include "Serializer/SerializerNodeIterator.h"

template <typename K, typename V>
class DictIterator : public DictIteratorBase<K, V> {
Expand Down
2 changes: 1 addition & 1 deletion DictIteratorBase.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class DictBase;

#include "DictBase.mqh"
#include "DictSlotsRef.h"
#include "SerializerConversions.h"
#include "Serializer/SerializerConversions.h"

template <typename K, typename V>
class DictIteratorBase {
Expand Down
4 changes: 2 additions & 2 deletions DictObject.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

#include "Convert.mqh"
#include "DictBase.mqh"
#include "Serializer.mqh"
#include "SerializerNodeIterator.mqh"
#include "Serializer/Serializer.h"
#include "Serializer/SerializerNodeIterator.h"

template <typename K, typename V>
class DictObjectIterator : public DictIteratorBase<K, V> {
Expand Down
4 changes: 2 additions & 2 deletions DictStruct.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

#include "DictBase.mqh"
#include "DictIteratorBase.mqh"
#include "Serializer.mqh"
#include "SerializerNodeIterator.mqh"
#include "Serializer/Serializer.h"
#include "Serializer/SerializerNodeIterator.h"

// DictIterator could be used as DictStruct iterator.
#define DictStructIterator DictIteratorBase
Expand Down
8 changes: 4 additions & 4 deletions EA.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
#include "Market.mqh"
#include "Platform.h"
#include "Refs.struct.h"
#include "SerializerConverter.mqh"
#include "SerializerCsv.mqh"
#include "SerializerJson.mqh"
#include "SerializerSqlite.mqh"
#include "Serializer/SerializerConverter.h"
#include "Serializer/SerializerCsv.h"
#include "Serializer/SerializerJson.h"
#include "Serializer/SerializerSqlite.h"
#include "Strategy.mqh"
#include "SummaryReport.mqh"
#include "Task/TaskManager.h"
Expand Down
6 changes: 3 additions & 3 deletions Indicator/Indicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ struct IndicatorParams;
#include "../Math.h"
#include "../Object.mqh"
#include "../Refs.mqh"
#include "../Serializer.mqh"
#include "../SerializerCsv.mqh"
#include "../SerializerJson.mqh"
#include "../Serializer/Serializer.h"
#include "../Serializer/SerializerCsv.h"
#include "../Serializer/SerializerJson.h"
#include "../Storage/ValueStorage.h"
#include "../Storage/ValueStorage.indicator.h"
#include "../Storage/ValueStorage.native.h"
Expand Down
2 changes: 1 addition & 1 deletion Indicator/Indicator.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct ChartParams;
#include "../Chart.struct.tf.h"
#include "../Data.struct.h"
#include "../DateTime.struct.h"
#include "../SerializerNode.enum.h"
#include "../Serializer/SerializerNode.enum.h"
#include "Indicator.enum.h"
#include "IndicatorData.struct.cache.h"
//#include "Indicator.struct.serialize.h"
Expand Down
4 changes: 2 additions & 2 deletions Indicator/Indicator.struct.serialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
* Includes Indicator's struct serializers.
*/

#include "../Serializer.mqh"
#include "../SerializerNode.enum.h"
#include "../Serializer/Serializer.h"
#include "../Serializer/SerializerNode.enum.h"
#include "Indicator.struct.h"

/* Method to serialize IndicatorParams structure. */
Expand Down
Loading

0 comments on commit 943f662

Please sign in to comment.