Commit Graph

285 Commits

Author SHA1 Message Date
Deukhoofd 5fcebd4d4d
Implements faster hash mechanic for StringView. 2020-10-09 13:23:32 +02:00
Deukhoofd 51c7ba1c50
Use a precompiled header for many std includes. 2020-09-25 11:06:55 +02:00
Deukhoofd 74d7e23056
Style fixes. 2020-09-24 21:02:22 +02:00
Deukhoofd 2e93cd65c5
Remove constevals for now, until mingw32-w64 supports it on the build server. 2020-09-24 20:54:11 +02:00
Deukhoofd f20b55b0d5
Lots more documentation. 2020-09-24 20:40:21 +02:00
Deukhoofd 31b63d56db
Lots of documentation. 2020-09-22 19:32:40 +02:00
Deukhoofd 3f4b026071
Header cleanup. 2020-09-21 14:01:19 +02:00
Deukhoofd fedb27790e
Fixed checks for less than 0 on List indexing, as it was always false. 2020-08-20 13:27:39 +02:00
Deukhoofd 675407d7f5
Fixed Windows issues. 2020-08-20 13:21:39 +02:00
Deukhoofd 8fecd2079a
Remove Windows signal handling for now, as it's causing issues. 2020-08-20 13:19:11 +02:00
Deukhoofd a91a57aa0a
Style fix 2020-08-18 19:18:38 +02:00
Deukhoofd 5eb95805f6
Further Windows fixes. 2020-08-18 19:15:00 +02:00
Deukhoofd 16b083d927
Tweaks to make Windows happy again hopefully 2020-08-18 18:50:03 +02:00
Deukhoofd c2655568d7
Fixes for Windows. 2020-08-18 18:44:06 +02:00
Deukhoofd cfcdbfe984
Support for custom signal callbacks. 2020-08-18 18:41:18 +02:00
Deukhoofd d59c13a34d
Allow disabling pretty traces and remove dependency on libdw. 2020-08-17 20:08:23 +02:00
Deukhoofd a665ad3eaf
Set up macros for easier exception throwing. 2020-08-17 12:02:42 +02:00
Deukhoofd a64c2aaca8
Trim whitespace of snippets in stack traces. 2020-08-16 19:45:19 +02:00
Deukhoofd 98ff6b3b69
Improves exception stack traces by including inlined functions, and displaying snippets of code. 2020-08-16 19:15:45 +02:00
Deukhoofd 5c9e58d032
Style fixes. 2020-08-16 17:34:58 +02:00
Deukhoofd 73e67b8c5d
Fixed define flag. 2020-08-16 17:31:11 +02:00
Deukhoofd c58bc6f785
Hide some functions that aren't used by Windows from the Windows build. 2020-08-16 17:27:09 +02:00
Deukhoofd 620248f329
Include debug symbols in Release build, rework exception stack trace. 2020-08-16 16:59:13 +02:00
Deukhoofd 5a14c712d2
Style fix 2020-08-16 10:43:54 +02:00
Deukhoofd 20a7dc55a0
Return a value when stacktrace is empty. 2020-08-16 10:41:10 +02:00
Deukhoofd 9726920b7f
Fixes for Windows. 2020-08-15 16:14:33 +02:00
Deukhoofd 7de12d53b5
Implements noexcept copy constructor for Exception. 2020-08-15 16:14:06 +02:00
Deukhoofd f158dbf8a2
Throw all exceptions with Arbutils exception. 2020-08-15 14:50:17 +02:00
Deukhoofd 168c45cb3b
Further fixes for Exception class on Windows. 2020-08-15 14:25:27 +02:00
Deukhoofd c7d18db8b7
Completely not include the stacktrace on Windows. 2020-08-15 14:22:32 +02:00
Deukhoofd e778b61839
Don't use stacktrace on Windows. 2020-08-15 14:19:36 +02:00
Deukhoofd 1dee4cd4a8
Better handling for Exception stack trace testing. 2020-08-15 13:59:10 +02:00
Deukhoofd 5ac7654be1
Add option to get depth of stack trace. 2020-08-15 13:48:34 +02:00
Deukhoofd f29e111b78
Support new exception type with stack trace. 2020-08-15 13:31:16 +02:00
Deukhoofd fb6b04bf03
Style Fix 2020-08-10 17:22:47 +02:00
Deukhoofd 6e7a28d754
Support for swapping in a UniquePtrList. 2020-08-10 17:20:37 +02:00
Deukhoofd 08952c86d0
Support for passing parameters to list to construct item in list. 2020-08-09 10:47:41 +02:00
Deukhoofd 74ebb40afc
Fixes build. 2020-08-08 12:20:20 +02:00
Deukhoofd 0d9ea1d3a3
Changes empty static StringView, as it caused conflicts with older Empty bool checker. 2020-08-08 12:10:25 +02:00
Deukhoofd f330e8a9e0
Fixes naming. 2020-08-08 11:41:21 +02:00
Deukhoofd d8c3fe1436
Add support for simple empty StringView. 2020-08-08 11:26:46 +02:00
Deukhoofd 5fda89bc72
Add support for setting and taking ownership on a pointer in UniquePtrList. 2020-07-25 14:28:00 +02:00
Deukhoofd 4f5ae70634
Cleanup for the cmake file. 2020-07-17 12:15:32 +02:00
Deukhoofd eb3e174877
Reset to before c++20 features that required clang. 2020-07-12 15:06:20 +02:00
Deukhoofd 84052a2d94
Make StringViewLiteral use ConstEval 2020-07-10 11:07:34 +02:00
Deukhoofd 950464ae79
Implements piping StringView into streams. 2020-07-08 13:28:43 +02:00
Deukhoofd 97b15650f1
Intialize StringView fields to default values/ 2020-07-04 15:33:59 +02:00
Deukhoofd 25772e7d5a
Remove constexpr from non-constexpr function. 2020-07-04 15:04:31 +02:00
Deukhoofd d3aacee0ef
Replace StringView with shared_ptr. 2020-07-04 14:59:56 +02:00
Deukhoofd 5994299baa
Further tweaks to StringViews. 2020-06-27 15:15:13 +02:00
Deukhoofd 9f5b8e9c83
Removed std::string_view ctor on StringView. 2020-06-27 14:24:43 +02:00
Deukhoofd 083c00f85e
Changes for how Literal changes to normal StringView. 2020-06-27 14:16:15 +02:00
Deukhoofd 773e765c83
Slight rework of StringView. 2020-06-27 14:02:35 +02:00
Deukhoofd 030f82d34f
Reset pointer on charholder to prevent multiple deletions. 2020-06-27 13:59:01 +02:00
Deukhoofd 49b5e2cfe9
Fixes Windows build. 2020-06-27 13:35:29 +02:00
Deukhoofd f64224131b
Tweaks for StringView to make the backing value the owner of the string. 2020-06-27 13:27:17 +02:00
Deukhoofd 544c541bc3
Remove dereference operator as it just causes issues. 2020-06-26 17:49:42 +02:00
Deukhoofd 7da8a46c45
Hopefully fixes issues with incomplete types in BorrowedPtrs. 2020-06-26 17:42:43 +02:00
Deukhoofd d3c9998afa
Fixes for dereference operator. 2020-06-26 17:31:52 +02:00
Deukhoofd c08224ed26
Style fixes. 2020-06-26 17:18:50 +02:00
Deukhoofd 7fe8c80141
Fixed issue where the dereferencing function broke compilation on some compilers. 2020-06-26 17:17:06 +02:00
Deukhoofd 72aad2a5e3
Fixed dereference operators being noexcept. 2020-06-26 16:31:33 +02:00
Deukhoofd 4ffe9f10a3
Style fixes. 2020-06-26 16:27:17 +02:00
Deukhoofd e52b824a51
Mark StringView and StringViewLiteral as final. 2020-06-26 16:25:07 +02:00
Deukhoofd 57f2d15723
Revert "Add virtual destructor to BasicStringView."
This reverts commit 94fec63c
2020-06-26 16:20:46 +02:00
Deukhoofd 94fec63c1b
Add virtual destructor to BasicStringView. 2020-06-26 16:17:19 +02:00
Deukhoofd 088f66c385
Style fixes. 2020-06-26 15:58:42 +02:00
Deukhoofd abca51d331
Large rework of the project, specifically the String classes. 2020-06-26 15:56:00 +02:00
Deukhoofd 8eba3b28ff
Add dereference operator for BorrowedPtr. 2020-06-26 13:13:46 +02:00
Deukhoofd d547046752
Assert BorrowedPtr is not null when trying to dereference it. 2020-06-26 13:12:58 +02:00
Deukhoofd f59ec6c957
Follow code style with noexcept, add Const() function to BorrowedPtr to return a const pointer of itself. 2020-06-20 17:45:41 +02:00
Deukhoofd 893aa969d5
Make BorrowedPtr hashable. 2020-06-02 16:03:47 +02:00
Deukhoofd 4323e59ed4
Further fixes for Remove function on UniquePtrList 2020-06-02 14:40:59 +02:00
Deukhoofd 44fc403fb6
Fixes for Remove function on UniquePtrList 2020-06-02 14:28:09 +02:00
Deukhoofd 5196bed8aa
Implement Remove function for UniquePtrList. 2020-06-02 13:57:40 +02:00
Deukhoofd ad2d3be7e4
Add iterator for const version of UniquePtrList. 2020-05-31 18:50:22 +02:00
Deukhoofd a3a0859b94
Style fixes. 2020-05-31 17:16:20 +02:00
Deukhoofd 8ecf765ead
Make retrieve operation a const. 2020-05-31 17:06:04 +02:00
Deukhoofd 262156fbd2
Allow initialization of UniquePtrList from vector of pointers. 2020-05-31 16:58:45 +02:00
Deukhoofd bfe1fcc805
Style fixes. 2020-05-31 16:40:33 +02:00
Deukhoofd b7f1812153
Helper collection class that functions as list of unique pointers. 2020-05-31 16:37:49 +02:00
Deukhoofd 0b740ee24d
Fixed cast functions on BorrowedPtr being invalid. 2020-05-26 19:40:08 +02:00
Deukhoofd 90bda57d79
Renamed borrowed ptr to be in line with other types. 2020-05-26 17:39:27 +02:00
Deukhoofd c8ca951dd8
Reduce namespace length further 2020-05-26 17:36:39 +02:00
Deukhoofd 3dc96de34b
Change namespace name so it's a lot less verbose. 2020-05-26 17:21:08 +02:00
Deukhoofd 2ae108517d
Support for easy type casting from borrowed_ptr. 2020-05-26 17:18:12 +02:00
Deukhoofd f1ebfd78f6
Mark several more borrowed_ptr functions as const. 2020-05-26 14:01:52 +02:00
Deukhoofd a84c7ae45c
Implements assignment, some tweaks for borrowed_ptr. 2020-05-26 13:44:06 +02:00
Deukhoofd 817b4c55d8
Fixes for style in Random class. 2020-05-26 13:33:43 +02:00
Deukhoofd 373988c8b0
Removed overloaded equality members. 2020-05-26 13:31:56 +02:00
Deukhoofd 779ddd49e3
Replace old memory management tests with simple borrowed_ptr.cpp. 2020-05-26 13:22:18 +02:00
Deukhoofd 28f427fa36
Switches Random handling to PCG family, specifically for better cross platform predictability. 2020-05-22 12:37:25 +02:00
Deukhoofd f99243481e
Better support for linking C libraries statically. 2020-05-03 12:27:22 +02:00
Deukhoofd fe2bec18f5
Style fixes. 2020-05-02 15:55:55 +02:00
Deukhoofd 84b08f66e5
Fixes for ConstString 2020-05-02 15:30:25 +02:00
Deukhoofd 2e227a2688
Style fixes. 2020-04-28 16:55:00 +02:00
Deukhoofd 50f430b7be
Use map::at() function for Dictionary::Get, as it already throws an exception if it doesn't exist. 2020-04-25 15:53:17 +02:00
Deukhoofd fea040252d
Fixed type issue in List. 2020-04-24 19:13:55 +02:00
Deukhoofd 846a9380a7
Make List constructor with capacity reserve the space, instead of creating the vector with a set size. 2020-04-24 18:48:23 +02:00
Deukhoofd 409b52bbf7
Support for reserving space in List. 2020-04-24 18:47:17 +02:00
Deukhoofd fbf2e42b8f
Performance improvements for collections. 2020-04-24 17:47:49 +02:00
Deukhoofd 24aff14745
Fixed const issue. 2020-04-22 22:54:57 +02:00
Deukhoofd 535b68bb8c
Return GetRandomEngine not by const, so we can actually use it 2020-04-22 22:50:36 +02:00
Deukhoofd 1b623c2b76
Support for getting the random engine from Random class. 2020-04-22 22:44:26 +02:00
Deukhoofd 0777561a21
Removed unsensible explicit in list constructor 2020-04-22 13:26:39 +02:00
Deukhoofd e34f60a8ac
Return previous value from Set function. 2020-04-22 13:22:20 +02:00
Deukhoofd 8306c14163
Add Set function to List. 2020-04-22 13:21:06 +02:00
Deukhoofd 195043d4c5
Implements easier assertions for iterators 2020-04-22 12:44:50 +02:00
Deukhoofd 43e612122c
Further fixes for NO_ASSERT builds. 2020-04-22 12:17:47 +02:00
Deukhoofd 479a240c6f
Don't throw compilation error when NO_ASSERT is used. 2020-04-22 12:02:00 +02:00
Deukhoofd 91b9854932
Further tweaks to ConstString. 2020-04-21 17:06:49 +02:00
Deukhoofd 5e3b067452
Make Dictionary function parameters all passed by reference 2020-04-21 13:59:01 +02:00
Deukhoofd 96995d071f
Handler for when a ConstString is assigned to an already equal ConstString. 2020-04-21 13:56:06 +02:00
Deukhoofd 9bd30cb9c4
Rework of empty string handler on ConstString. 2020-04-21 10:20:37 +02:00
Deukhoofd c033060c16
Handle ConstString empty pointer better. 2020-04-20 19:49:39 +02:00
Deukhoofd 79384efb85
Tweaks and fixes for ConstString. 2020-04-20 19:38:45 +02:00
Deukhoofd 7d98d5b467
Assert that max is higher than min on random. 2020-04-19 18:45:59 +02:00
Deukhoofd 63da7ffda0
Fix start value not working on Enum. 2020-04-18 15:12:34 +02:00
Deukhoofd bc64e35c8a
Implements Enum with specific start value. 2020-04-18 14:57:23 +02:00
Deukhoofd e850f728bc
Add constexpr to GetValue on ConstString holder. 2020-04-16 11:16:55 +02:00
Deukhoofd de702b5569
Cleanup of ConstString. 2020-04-16 11:01:46 +02:00
Deukhoofd d6b7344dde
Limit amount of copies of ConstString by implementing reference counter. 2020-04-13 13:59:43 +02:00
Deukhoofd d64964b7cb
Include cmath in Enum for log10 use. 2020-04-10 20:02:41 +02:00
Deukhoofd f89fb303b5
Fixed memory issues with new Enum ToString handling. 2020-04-10 19:57:12 +02:00
Deukhoofd 9244249a64
Better handling of out of bound enum values in ToString. 2020-04-10 19:51:35 +02:00
Deukhoofd 60802341b0
Fixed assignment memory issue. 2020-04-10 14:38:01 +02:00
Deukhoofd fe01886114
Separate ConstString into normal and literal variant. 2020-04-09 18:01:38 +02:00
Deukhoofd 6b4d18f434
Resolve issue where ConstString can lose internal string representation due to not owning it.
This sadly meant most constexpr constructors had to be removed, as it needs to copy the string.
2020-04-07 18:54:23 +02:00
Deukhoofd 460f9308a0
Fixed issue with Valgrind. 2020-04-04 18:01:35 +02:00
Deukhoofd 6f60cd7c96
Rework of Random class. Now ensures better randomness, is more performant, and has function for retrieving seed. 2020-04-04 17:48:05 +02:00
Deukhoofd 4f563e6e67
Allow functions for GetNonNull and GetOptional to work when const. 2020-03-30 19:06:08 +02:00
Deukhoofd 4c1ca2e822
Allow transferring borrowedPtr into NonNull variant and vice versa. 2020-03-30 18:52:08 +02:00
Deukhoofd f8b4d79e28
Allow access of raw template type when const. 2020-03-30 18:29:49 +02:00
Deukhoofd 86c7aba0ea
Fixed OwnPtr not returning right version on BorrowNonNull. 2020-03-30 18:20:02 +02:00
Deukhoofd 16b082f00d
Allow borrowing as nonnull or optional pointers. 2020-03-30 17:58:11 +02:00
Deukhoofd 9e2805f684
Allow implicit converting of raw pointers to OwnPtrs. 2020-03-30 17:45:31 +02:00
Deukhoofd 96b2bd61ab
Default the BorrowedPtr and OwnPtr to nullptr. 2020-03-30 17:41:08 +02:00
Deukhoofd 6c5fe1bf93
Allow blank constructors for pointer types. 2020-03-30 17:28:21 +02:00
Deukhoofd d46b0d798a
Added const variants of Borrow. 2020-03-29 19:14:30 +02:00
Deukhoofd ae73e60f94
Allow assignment operator for OwnPtr. 2020-03-29 19:01:28 +02:00
Deukhoofd 72b545f5e3
Add functionality for Collections to get underlying items. 2020-03-29 18:49:10 +02:00
Deukhoofd 74ac2dbbc3
More functionality for memory classes. 2020-03-29 18:09:55 +02:00
Deukhoofd 872c275bc7
Support for pointer holder outline. 2020-03-28 21:08:55 +01:00
Deukhoofd bfedd15560
Add new line at end of macro file for Windows build. 2020-03-26 21:59:20 +01:00
Deukhoofd eb84eb0588
Macro support for unpacking weak pointers. 2020-03-26 21:55:00 +01:00
Deukhoofd 7524c2d61c
Added IndexOf support for List. 2020-03-24 22:56:40 +01:00
Deukhoofd 0b6220b2bf
Add Remove function to List, to remove items at a given index. 2020-03-22 19:08:38 +01:00
Deukhoofd 97bd13a1cb
Fixed not being able to assign to bool list. 2020-03-22 18:44:50 +01:00
Deukhoofd cc86041b06
Switch At functions around. 2020-03-22 18:34:05 +01:00
Deukhoofd 196bf5e1da
Assert index is not negative for List. 2020-03-22 18:21:29 +01:00