forked from EA31337/EA31337-classes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/dev-v2012-renames' into dev-v2012
* origin/dev-v2012-renames: Renames Collection to Storage/
- Loading branch information
Showing
11 changed files
with
118 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
name: Test Storage | ||
|
||
# yamllint disable-line rule:truthy | ||
on: | ||
pull_request: | ||
paths: | ||
- 'Storage/**' | ||
- '.github/workflows/test-storage.yml' | ||
push: | ||
paths: | ||
- 'Storage/**' | ||
- '.github/workflows/test-storage.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: 'Storage/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' | ||
|
||
Storage-Tests-MQL4: | ||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: Storage/tests | ||
needs: Compile | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
test: | ||
- Collection.test | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: files-ex4 | ||
- name: Run ${{ matrix.test }} | ||
uses: fx31337/mql-tester-action@master | ||
with: | ||
Script: ${{ matrix.test }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,7 +101,6 @@ jobs: | |
matrix: | ||
test: | ||
# - 3DTest | ||
- CollectionTest | ||
- ConfigTest | ||
- ConvertTest | ||
- DateTimeTest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Storage classes | ||
|
||
## `Collection` class | ||
|
||
This class is for storing various type of objects. Here is the example usage: | ||
|
||
// Define custom classes of Object type. | ||
class Stack : Object { | ||
public: | ||
virtual string GetName() = NULL; | ||
}; | ||
class Foo : Stack { | ||
public: | ||
string GetName() { return "Foo"; }; | ||
double Weight() { return 0; }; | ||
}; | ||
class Bar : Stack { | ||
public: | ||
string GetName() { return "Bar"; }; | ||
double Weight() { return 1; }; | ||
}; | ||
class Baz : Stack { | ||
public: | ||
string GetName() { return "Baz"; }; | ||
double Weight() { return 2; }; | ||
}; | ||
|
||
int OnInit() { | ||
// Define and add items. | ||
Collection *stack = new Collection(); | ||
stack.Add(new Foo); | ||
stack.Add(new Bar); | ||
stack.Add(new Baz); | ||
// Print the lowest and the highest items. | ||
Print("Lowest: ", ((Stack *)stack.GetLowest()).GetName()); | ||
Print("Highest: ", ((Stack *)stack.GetHighest()).GetName()); | ||
// Print all the items. | ||
for (uint i = 0; i < stack.GetSize(); i++) { | ||
Print(i, ": ", ((Stack *)stack.GetByIndex(i)).GetName()); | ||
} | ||
// Clean up. | ||
Object::Delete(stack); | ||
return (INIT_SUCCEEDED); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters