-
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.
Merge pull request #1 from tmadden/context-prototyping
Add component collections.
- Loading branch information
Showing
25 changed files
with
1,427 additions
and
334 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
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,41 @@ | ||
#include <alia/component_collection.hpp> | ||
|
||
using namespace alia; | ||
|
||
struct foo_tag | ||
{ | ||
}; | ||
struct foo | ||
{ | ||
bool b = false; | ||
}; | ||
struct bar_tag | ||
{ | ||
}; | ||
struct bar | ||
{ | ||
int i = 0; | ||
}; | ||
|
||
using storage_type = generic_component_storage<any>; | ||
using cc_empty = empty_component_collection<storage_type>; | ||
|
||
void | ||
f() | ||
{ | ||
storage_type storage_empty; | ||
cc_empty mc_empty(&storage_empty); | ||
|
||
storage_type storage_b; | ||
auto mc_b = add_component<bar_tag>(&storage_b, mc_empty, bar()); | ||
|
||
storage_type storage_fb; | ||
auto mc_fb = add_component<foo_tag>(&storage_fb, mc_b, foo()); | ||
|
||
storage_type storage_f; | ||
auto mc_f = remove_component<bar_tag>(&storage_f, mc_fb); | ||
get_component<foo_tag>(mc_f); | ||
#ifdef ALIA_TEST_COMPILATION_FAILURE | ||
get_component<bar_tag>(mc_f); | ||
#endif | ||
} |
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,8 @@ | ||
:: Apply our .clang-format styling to all C++ source files. | ||
:: Note that this should be run from the root directory. | ||
@echo off | ||
setlocal enabledelayedexpansion | ||
for /F usebackq^ tokens^=*^ delims^=^ eol^= %%f in (`dir /s /b *.hpp *.cpp *.ipp`) do ( | ||
clang-format -style=file -i %%f | ||
) | ||
endlocal |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.