summaryrefslogtreecommitdiff
path: root/AK/Forward.h
AgeCommit message (Collapse)Author
2021-11-17AK: Forward declare Error and ErrorOr in AK/Forward.hAndreas Kling
2021-08-19AK: Add GenericLexer to forwarding headerTimothy Flynn
2021-07-22AK: Add Utf16View for decoding UTF-16 stringsTimothy Flynn
Also includes a way to transcode from and to UTF-8 strings.
2021-07-11AK: Bring back FixedArray<T>Andreas Kling
Let's bring this class back, but without the confusing resize() API. A FixedArray<T> is simply a fixed-size array of T. The size is provided at run-time, unlike Array<T> where the size is provided at compile-time.
2021-06-29AK: Use OrderedHashMap in JsonObjectMax Wipfli
This changes JsonObject to use the new OrderedHashMap instead of an extra vector for tracking the insertion order. This also adds a default value for the KeyTraits template argument in OrderedHashMap. Furthermore, it fixes two cases where code iterating over a JsonObject relied on the value argument being copied before invoking the callback.
2021-06-16AK: Remove now unused InlineLinkedList classBrian Gianforcaro
All usages of AK::InlineLinkedList have been converted to AK::IntrusiveList. So it's time to retire our old friend. Note: The empty white space change in AK/CMakeLists.txt is to force CMake to re-glob the header files in the AK directory so incremental build will work when folks git pull this change locally. Otherwise they'll get errors, because CMake will attempt to install a file which no longer exists.
2021-06-15AK: Add Ordering support to HashTable and HashMapHediadyoin1
Adds a IsOrdered flag to Hashtable and HashMap, which allows iteration in insertion order
2021-06-08AK: Make Vector capable of holding reference typesAli Mohammad Pur
This commit makes it possible to instantiate `Vector<T&>` and use it to store references to `T` in a vector. All non-pointer observers are made to return the reference, and the pointer observers simply yield the underlying pointer. Note that the 'find_*' methods act on the values and not the pointers that are stored in the vector. This commit also makes errors in various vector methods much more readable by directly using requires-clauses on them. And finally, it should be noted that Vector cannot hold temporaries :^)
2021-05-16AK: Turn ByteBuffer into a value typeGunnar Beutner
Previously ByteBuffer would internally hold a RefPtr to the byte buffer and would behave like a reference type, i.e. copying a ByteBuffer would not create a duplicate byte buffer, but rather two objects which refer to the same internal buffer. This also changes ByteBuffer so that it has some internal capacity much like the Vector<T> type. Unlike Vector<T> however a byte buffer's data may be uninitialized. With this commit ByteBuffer makes use of the kmalloc_good_size() API to pick an optimal allocation size for its internal buffer.
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-03-13AK: Add OutputBitStream classIdan Horowitz
This will be used in the deflate compressor.
2021-03-12Everywhere: Remove klog(), dbg() and purge all LogStream usage :^)Andreas Kling
Good-bye LogStream. Long live AK::Format!
2021-03-02Kernel: Prevent using copy_from_user() for timespec/timevalBen Wiederhake
These structs can be inconsistent, for example if the amount of microseconds is negative or larger than 1'000'000. Therefore, they should not be copied as-is. Use copy_time_from_user instead.
2021-02-20AK: Make Nonnull*PtrVector use size_t for indexesAndreas Kling
This was weird. It turns out these class were using int indexes and sizes despite being derived from Vector which uses size_t. Make the universe right again by using size_t here as well.
2021-01-17Kernel+Userland: Remove shared buffers (shbufs)Andreas Kling
All users of this mechanism have been switched to anonymous files and passing file descriptors with sendfd()/recvfd(). Shbufs got us where we are today, but it's time we say good-bye to them and welcome a much more idiomatic replacement. :^)
2021-01-16AK: Add enabled template parameter to dbgln.asynts
2021-01-04AK: Add default memory order as template argument for Atomic<T>Tom
This is useful for collecting statistics, e.g. Atomic<unsigned, MemoryOrder::memory_order_relaxed> would allow using operators such as ++ to use relaxed semantics throughout without having to explicitly call fetch_add with the memory order.
2020-12-09AK: Fix unsigned integer underflow in DuplexMemoryStream::write.asynts
2020-12-08AK: Forward declare Nonnull{Own,Ref}PtrVectorAnotherTest
2020-11-11RefPtrTraits: struct/class mismatch in forward declarationLenny Maiorani
Problem: - Building with clang is broken because of the `struct` vs `class` mismatch between the definition and declaration. Solution: - Change `class` to `struct` in the forward declaration.
2020-11-10AK: Add RefPtrTraits to allow implementing custom null pointersTom
This adds the ability to implement custom null states that allow storing state in null pointers.
2020-11-08LibJS+AK: Move cross-platform stack bounds code from JS::Heap to AK::StackInfoLinus Groh
This will be useful for other things than the Heap, maybe even outside of LibJS.
2020-09-21AK: Remove BufferStream class.asynts
There are three classes avaliable that share the functionality of BufferStream: 1. InputMemoryStream is for reading from static buffers. Example: Bytes input = /* ... */; InputMemoryStream stream { input }; LittleEndian<u32> little_endian_value; input >> little_endian_value; u32 host_endian_value; input >> host_endian_value; SomeComplexStruct complex_struct; input >> Bytes { &complex_struct, sizeof(complex_struct) }; 2. OutputMemoryStream is for writing to static buffers. Example: Array<u8, 4096> buffer; OutputMemoryStream stream; stream << LittleEndian<u32> { 42 }; stream << ReadonlyBytes { &complex_struct, sizeof(complex_struct) }; foo(stream.bytes()); 3. DuplexMemoryStream for writing to dynamic buffers, can also be used as an intermediate buffer by reading from it directly. Example: DuplexMemoryStream stream; stream << NetworkOrdered<u32> { 13 }; stream << NetowkrOrdered<u64> { 22 }; NetworkOrdered<u32> value; stream >> value; ASSERT(value == 13); foo(stream.copy_into_contiguous_buffer()); Unlike BufferStream these streams do not use a fixed endianness (BufferStream used little endian) these have to be explicitly specified. There are helper types in <AK/Endian.h>.
2020-09-15AK: Re-add OutputMemoryStream for static buffers only.asynts
2020-09-15AK: Remove OutputMemoryStream for DuplexMemoryStream.asynts
OutputMemoryStream was originally a proxy for DuplexMemoryStream that did not expose any reading API. Now I need to add another class that is like OutputMemoryStream but only for static buffers. My first idea was to make OutputMemoryStream do that too, but I think it's much better to have a distinct class for that. I originally wanted to call that class FixedOutputMemoryStream but that name is really cumbersome and it's a bit unintuitive because InputMemoryStream is already reading from a fixed buffer. So let's just use DuplexMemoryStream instead of OutputMemoryStream for any dynamic stuff and create a new OutputMemoryStream for static buffers.
2020-09-12AK: Fix forward-declaration of ArrayBen Wiederhake
2020-09-08AK: Remove FixedArray class.asynts
2020-09-08AK: Add Array<T, Size> template.asynts
2020-09-08AK: Add generic SimpleIterator class to replace VectorIterator.asynts
2020-09-01AK: Add OutputMemoryStream class.asynts
2020-08-26AK: Add InputBitStream class.asynts
2020-08-26AK: Add CircularDuplexStream class.asynts
2020-08-20AK: Add DuplexMemoryStream class.asynts
This class is similar to BufferStream because it is possible to both read and write to it. However, it differs in the following ways: - DuplexMemoryStream keeps a history of 64KiB and discards the rest, BufferStream always keeps everything around. - DuplexMemoryStream tracks reading and writing seperately, the following is valid: DuplexMemoryStream stream; stream << 42; int value; stream >> value; For BufferStream it would read: BufferStream stream; stream << 42; int value; stream.seek(0); stream >> value; In the future I would like to replace all usages of BufferStream with InputMemoryStream, OutputMemoryStream (doesn't exist yet) and DuplexMemoryStream. For now I just add DuplexMemoryStream though.
2020-08-06AK: Add InputStream abstraction and InputMemoryStream implementation.asynts
2020-07-26AK: Implement Span which represents a contiguous sequence of objects.asynts
This makes it possible to pass one object rather than pointer and length individually.
2020-05-17AK: Add a very basic Utf32View classAndreas Kling
This allows you to wrap a { const u32* codepoints, size_t length } in a simple object.
2020-03-22AK: Add FlyString, a simple flyweight string classAndreas Kling
FlyString is a flyweight string class that wraps a RefPtr<StringImpl> known to be unique among the set of FlyStrings. The class is very unoptimized at the moment. When to use FlyString: - When you want O(1) string comparison - When you want to deduplicate a lot of identical strings When not to use FlyString: - For strings that don't need either of the above features - For strings that are likely to be unique
2020-02-25AK: Make Vector use size_t for its size and capacityAndreas Kling
2020-02-20AK: Use size_t for CircularQueue and CircularDequeAndreas Kling
2020-02-16AK: Add HashMap, HashTable and Traits to Forward.hAndreas Kling
2020-02-15AK: Add BufferStream to Forward.hAndreas Kling
2020-02-14AK: Add Utf8View to Forward.hAndreas Kling
2020-02-14AK: Add LogStream and DebugLogStream to Forward.hAndreas Kling
2020-02-14AK: Add SharedBuffer to Forward.hAndreas Kling
2020-02-14LibCore: Add a forward declaration headerAndreas Kling
This patch adds <LibCore/Forward.h> and uses it in various places to shrink the header dependency graph.
2020-02-14AK: Add a forward declaration headerAndreas Kling
You can now #include <AK/Forward.h> to get most of the AK types as forward declarations. Header dependency explosion is one of the main contributors to compile times at the moment, so this is a step towards smaller include graphs.