-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
92 changed files
with
2,978 additions
and
2,690 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 |
---|---|---|
|
@@ -12,6 +12,8 @@ DartConfiguration.tcl | |
Testing | ||
|
||
build/ | ||
.build/ | ||
.cache/ | ||
|
||
*.swp | ||
*.png | ||
|
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 |
---|---|---|
@@ -1,36 +1,36 @@ | ||
/* Copyright 2019 Michael Sippel | ||
/* Copyright 2019-2024 Michael Sippel, Tapish Narwal | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
#include <redGrapes/redGrapes.hpp> | ||
#include <redGrapes/resource/fieldresource.hpp> | ||
#include <redGrapes/resource/ioresource.hpp> | ||
#include <redGrapes/resource/resource_user.hpp> | ||
|
||
#include <iostream> | ||
|
||
int main(int, char*[]) | ||
{ | ||
redGrapes::init(1); | ||
redGrapes::FieldResource<std::vector<int>> a; | ||
redGrapes::IOResource<int> b; | ||
redGrapes::IOResource<int> c; | ||
auto rg = redGrapes::init(1); | ||
using TTask = decltype(rg)::RGTask; | ||
|
||
auto a = rg.createFieldResource<std::vector<int>>(); | ||
auto b = rg.createIOResource<int>(); | ||
auto c = rg.createIOResource<int>(); | ||
|
||
redGrapes::ResourceUser user1( | ||
redGrapes::ResourceUser<TTask> user1( | ||
{a.read(), // complete resource | ||
a.write().area({0}, {10}), // write only indices 0 to 10 | ||
b.write()}); | ||
|
||
redGrapes::ResourceUser user2({b.read()}); | ||
redGrapes::ResourceUser<TTask> user2({b.read()}); | ||
|
||
redGrapes::ResourceUser user3({b.read(), c.write()}); | ||
redGrapes::ResourceUser<TTask> user3({b.read(), c.write()}); | ||
|
||
std::cout << "is_serial(user1,user1) = " << redGrapes::ResourceUser::is_serial(user1, user1) << std::endl; | ||
std::cout << "is_serial(user1,user2) = " << redGrapes::ResourceUser::is_serial(user1, user2) << std::endl; | ||
std::cout << "is_serial(user1,user3) = " << redGrapes::ResourceUser::is_serial(user1, user3) << std::endl; | ||
std::cout << "is_serial(user2,user3) = " << redGrapes::ResourceUser::is_serial(user2, user3) << std::endl; | ||
std::cout << "is_serial(user1,user1) = " << redGrapes::ResourceUser<TTask>::is_serial(user1, user1) << std::endl; | ||
std::cout << "is_serial(user1,user2) = " << redGrapes::ResourceUser<TTask>::is_serial(user1, user2) << std::endl; | ||
std::cout << "is_serial(user1,user3) = " << redGrapes::ResourceUser<TTask>::is_serial(user1, user3) << std::endl; | ||
std::cout << "is_serial(user2,user3) = " << redGrapes::ResourceUser<TTask>::is_serial(user2, user3) << std::endl; | ||
|
||
redGrapes::finalize(); | ||
return 0; | ||
} |
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
Oops, something went wrong.