Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
deathkiller committed Jan 2, 2025
1 parent 8de25b9 commit e0bf3f9
Show file tree
Hide file tree
Showing 17 changed files with 47 additions and 46 deletions.
1 change: 1 addition & 0 deletions Sources/Jazz2/Compatibility/EventConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace Jazz2::Compatibility
{
class JJ2Level;

/** @brief Converted extended event description */
struct ConversionResult {
EventType Type;
std::uint8_t Params[16];
Expand Down
2 changes: 2 additions & 0 deletions Sources/Jazz2/Compatibility/JJ2Level.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ namespace Jazz2::Compatibility
friend class JJ2Episode;

public:
/** @brief Episode name and level name */
struct LevelToken {
String Episode;
String Level;
};

/** @brief Extra tileset used in the level */
struct ExtraTilesetEntry {
String Name;
std::uint16_t Offset;
Expand Down
2 changes: 1 addition & 1 deletion Sources/Jazz2/Compatibility/JJ2Tileset.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ using namespace Death::Containers;

namespace Jazz2::Compatibility
{
/** @brief Parses original `.j2t` tileset files */
/** @brief Parses original `.j2t` tile set files */
class JJ2Tileset
{
public:
Expand Down
2 changes: 1 addition & 1 deletion Sources/Jazz2/Multiplayer/ServerDiscovery.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace Jazz2::Multiplayer
};

/**
@brief Allows to monitor publicly-listed running servers
@brief Allows to monitor publicly-listed running servers for server listing
@experimental
*/
Expand Down
2 changes: 1 addition & 1 deletion Sources/Jazz2/Scripting/ScriptLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace Jazz2::Scripting
};

/**
@brief Generic **AngelScript** script loader with @cpp #include @ce and @cpp #pragma @ce support
@brief Generic **AngelScript** script loader with `#include` and `#pragma` support
@experimental
*/
Expand Down
18 changes: 9 additions & 9 deletions Sources/Shared/Base/Memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ namespace Death {
initialization is performed separately from the allocation itself with either a
loop or a call to @ref std::memset().
- @ref allocateAligned(DefaultInitT, std::size_t) leaves trivial types
- @ref allocateAligned(Containers::DefaultInitT, std::size_t) leaves trivial types
uninitialized and calls the default constructor elsewhere. Because of the
differing behavior for trivial types it's better to explicitly use either
the @ref ValueInit or @ref NoInit variants instead.
- @ref allocateAligned(ValueInitT, std::size_t) is equivalent to the default
the @ref Containers::ValueInit or @ref Containers::NoInit variants instead.
- @ref allocateAligned(Containers::ValueInitT, std::size_t) is equivalent to the default
case, zero-initializing trivial types and calling the default constructor
elsewhere. Useful when you want to make the choice appear explicit.
- @ref allocateAligned(NoInitT, std::size_t) does not initialize anything.
- @ref allocateAligned(Containers::NoInitT, std::size_t) does not initialize anything.
Useful for trivial types when you'll be overwriting the contents anyway,
for non-trivial types this is the dangerous option and you need to call the
constructor on all elements manually using placement new,
Expand All @@ -72,10 +72,10 @@ namespace Death {
Compared to @ref allocateAligned(std::size_t), trivial types are not
initialized and default constructor is called otherwise. Because of the
differing behavior for trivial types it's better to explicitly use either the
@ref allocateAligned(ValueInitT, std::size_t) or the
@ref allocateAligned(NoInitT, std::size_t) variant instead.
@ref allocateAligned(Containers::ValueInitT, std::size_t) or the
@ref allocateAligned(Containers::NoInitT, std::size_t) variant instead.
Implemented via @ref allocateAligned(NoInitT, std::size_t) with a
Implemented via @ref allocateAligned(Containers::NoInitT, std::size_t) with a
loop calling the constructors on the returned allocation in case of non-trivial
types.
*/
Expand All @@ -85,7 +85,7 @@ namespace Death {
@brief Allocate aligned memory and value-initialize it
Same as @ref allocateAligned(std::size_t), just more explicit. Implemented via
@ref allocateAligned(NoInitT, std::size_t) with either a
@ref allocateAligned(Containers::NoInitT, std::size_t) with either a
@ref std::memset() or a loop calling the constructors on the returned
allocation.
*/
Expand All @@ -96,7 +96,7 @@ namespace Death {
Compared to @ref allocateAligned(std::size_t), the memory is left in an
unitialized state. For trivial types is equivalent to
@ref allocateAligned(DefaultInitT, std::size_t). For non-trivial
@ref allocateAligned(Containers::DefaultInitT, std::size_t). For non-trivial
types, destruction is always done using a custom deleter that explicitly calls
the destructor on *all elements* --- which means that for non-trivial types
you're expected to construct all elements using placement new (or for example
Expand Down
3 changes: 2 additions & 1 deletion Sources/Shared/Containers/ArrayView.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace Death { namespace Containers {
@subsection Containers-ArrayView-usage-access Data access
The class provides the usual C++ container interface --- @ref data(),
@ref size() and @ref isEmpty(); subscript access via @ref operator T*(), range
@ref size() and @ref empty(); subscript access via @ref operator T*(), range
access via @ref begin() / @ref end(), and their overloads and acess to the
@ref front() and @ref back() element, if the view is non-empty. The view itself
is immutable and thus all member functions are @cpp const @ce, but if the
Expand Down Expand Up @@ -731,6 +731,7 @@ namespace Death { namespace Containers {
typedef T Type;

enum : std::size_t {
/** @brief Array size */
Size = size_
};

Expand Down
1 change: 1 addition & 0 deletions Sources/Shared/Containers/GrowableArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ namespace Death { namespace Containers {
typedef T Type;

enum : std::size_t {
/** @copydoc ArrayMallocAllocator::AllocationOffset */
AllocationOffset = Implementation::AllocatorTraits<T>::Offset
};

Expand Down
2 changes: 0 additions & 2 deletions Sources/Shared/Containers/Reference.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ namespace Death { namespace Containers {

/**
* @brief Construction from r-value references is not allowed
*
* A @ref MoveReference can be created from r-value references instead.
*/
Reference(T&&) = delete;

Expand Down
1 change: 1 addition & 0 deletions Sources/Shared/Containers/StaticArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ namespace Death { namespace Containers {
typedef T Type;

enum : std::size_t {
/** @brief Array size */
Size = size_
};

Expand Down
14 changes: 7 additions & 7 deletions Sources/Shared/Containers/String.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ namespace Death { namespace Containers {
*
* If the view is @ref StringViewFlags::NullTerminated, returns a
* non-owning reference to it without any extra allocations or copies
* involved, propagating also @ref StringViewFlag::Global to
* involved, propagating also @ref StringViewFlags::Global to
* @ref viewFlags() if present. Otherwise creates a null-terminated
* owning copy using @ref String(StringView).
*
Expand All @@ -244,7 +244,7 @@ namespace Death { namespace Containers {
* If the view is both @ref StringViewFlags::NullTerminated and
* @ref StringViewFlags::Global, returns a non-owning reference to it
* without any extra allocations or copies involved, propagating also
* @ref StringViewFlag::Global to @ref viewFlags(). Otherwise creates
* @ref StringViewFlags::Global to @ref viewFlags(). Otherwise creates
* a null-terminated owning copy using @ref String(StringView).
*
* This function is primarily meant for efficiently storing
Expand Down Expand Up @@ -556,8 +556,8 @@ namespace Death { namespace Containers {
* @brief View flags
*
* A @ref BasicStringView "StringView" constructed from this instance
* will have these flags. @ref StringViewFlag::NullTerminated is
* present always, @ref StringViewFlag::Global if the string was
* will have these flags. @ref StringViewFlags::NullTerminated is
* present always, @ref StringViewFlags::Global if the string was
* originally created from a global null-terminated view with
* @ref nullTerminatedView() or @ref nullTerminatedGlobalView().
*/
Expand Down Expand Up @@ -657,7 +657,7 @@ namespace Death { namespace Containers {
* Equivalent to @ref BasicStringView::sliceSize(). Both arguments are
* expected to be in range. If `begin + size` points to (one item
* after) the end of the original (null-terminated) string, the result
* has @ref StringViewFlag::NullTerminated set.
* has @ref StringViewFlags::NullTerminated set.
* @m_keywords{substr()}
*/
#ifdef DOXYGEN_GENERATING_OUTPUT
Expand Down Expand Up @@ -792,7 +792,7 @@ namespace Death { namespace Containers {
* @brief Partition
*
* Equivalent to @ref BasicStringView::partition(StringView) const. The
* last returned value has always @ref StringViewFlag::NullTerminated
* last returned value has always @ref StringViewFlags::NullTerminated
* set.
*/
StaticArray<3, MutableStringView> partition(StringView separator);
Expand Down Expand Up @@ -1092,7 +1092,7 @@ namespace Death { namespace Containers {
StringView (which uses the top two bits for marking global and
null-terminated views), we can use the second highest bit of the
size to denote a small string. The highest bit, marked as G in the
below diagram, is used to preserve StringViewFlag::Global in case of
below diagram, is used to preserve StringViewFlags::Global in case of
a nullTerminatedGlobalView() and a subsequent conversion back to a
StringView. In case of a large string, there's size, data pointer
and deleter pointer, either 24 (or 12) bytes in total. In case of a
Expand Down
8 changes: 4 additions & 4 deletions Sources/Shared/Containers/StringView.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ namespace Death { namespace Containers {
/**
* @brief Construct from a @ref String
*
* The resulting view has @ref StringViewFlag::NullTerminated set
* always, and @ref StringViewFlag::Global if the string was originally
* The resulting view has @ref StringViewFlags::NullTerminated set
* always, and @ref StringViewFlags::Global if the string was originally
* created from a global null-terminated view with
* @ref String::nullTerminatedView() or @ref String::nullTerminatedGlobalView().
*/
Expand All @@ -254,8 +254,8 @@ namespace Death { namespace Containers {
* @brief Construct from a const @ref String
*
* Enabled only if the view is not mutable. The resulting view has
* @ref StringViewFlag::NullTerminated set always, and
* @ref StringViewFlag::Global if the string was created from a global
* @ref StringViewFlags::NullTerminated set always, and
* @ref StringViewFlags::Global if the string was created from a global
* null-terminated view with @ref String::nullTerminatedView() or
* @ref String::nullTerminatedGlobalView().
*/
Expand Down
5 changes: 1 addition & 4 deletions Sources/Shared/Cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -967,10 +967,7 @@ namespace Death { namespace Cpu {
/**
@brief Feature set
Provides storage and comparison as well as runtime detection of CPU instruction
set. Provides an interface similar to an @ref Containers::EnumSet, with values
being the @ref Sse2, @ref Sse3 etc. tags.
Provides storage and comparison as well as runtime detection of CPU instruction set.
See the @ref Cpu namespace for an overview and usage examples.
*/
class Features {
Expand Down
24 changes: 12 additions & 12 deletions Sources/Shared/IO/FileSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ namespace Death { namespace IO {

/** @brief Returns an absolute path from a relative one */
static Containers::String GetAbsolutePath(Containers::StringView path);
/** @brief Returns @cpp true @ce if the specified path is not empty and is absolute */
/** @brief Returns `true` if the specified path is not empty and is absolute */
static bool IsAbsolutePath(Containers::StringView path);

/** @brief Returns the path of executable */
Expand All @@ -203,33 +203,33 @@ namespace Death { namespace IO {
static Containers::String GetWindowsDirectory();
#endif

/** @brief Returns @cpp true @ce if the specified path is a directory */
/** @brief Returns `true` if the specified path is a directory */
static bool DirectoryExists(Containers::StringView path);
/** @brief Returns @cpp true @ce if the specified path is a file */
/** @brief Returns `true` if the specified path is a file */
static bool FileExists(Containers::StringView path);

/** @brief Returns @cpp true @ce if the file or directory exists */
/** @brief Returns `true` if the file or directory exists */
static bool Exists(Containers::StringView path);
/** @brief Returns @cpp true @ce if the file or directory is readable */
/** @brief Returns `true` if the file or directory is readable */
static bool IsReadable(Containers::StringView path);
/** @brief Returns @cpp true @ce if the file or directory is writeable */
/** @brief Returns `true` if the file or directory is writeable */
static bool IsWritable(Containers::StringView path);
/** @brief Returns @cpp true @ce if the file or directory is executable */
/** @brief Returns `true` if the file or directory is executable */
static bool IsExecutable(Containers::StringView path);

/** @brief Returns @cpp true @ce if the path is a file and is readable */
/** @brief Returns `true` if the path is a file and is readable */
static bool IsReadableFile(Containers::StringView path);
/** @brief Returns @cpp true @ce if the path is a file and is writeable */
/** @brief Returns `true` if the path is a file and is writeable */
static bool IsWritableFile(Containers::StringView path);

/** @brief Returns @cpp true @ce if the path is a symbolic link */
/** @brief Returns `true` if the path is a symbolic link */
static bool IsSymbolicLink(Containers::StringView path);

/** @brief Returns @cpp true @ce if the file or directory is hidden */
/** @brief Returns `true` if the file or directory is hidden */
static bool IsHidden(Containers::StringView path);
/** @brief Makes a @cpp true @ce or directory hidden or not */
static bool SetHidden(Containers::StringView path, bool hidden);
/** @brief Returns @cpp true @ce if the file or directory is read-only */
/** @brief Returns `true` if the file or directory is read-only */
static bool IsReadOnly(Containers::StringView path);
/** @brief Makes a file or directory read-only or not */
static bool SetReadOnly(Containers::StringView path, bool readonly);
Expand Down
2 changes: 1 addition & 1 deletion Sources/Shared/IO/Stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace Death { namespace IO {
virtual std::int64_t Write(const void* source, std::int64_t bytesToWrite) = 0;
/** @brief Clears all buffers for this stream and causes any buffered data to be written to the underlying device */
virtual bool Flush() = 0;
/** @brief Returns @cpp true @ce if the stream has been sucessfully opened */
/** @brief Returns `true` if the stream has been sucessfully opened */
virtual bool IsValid() = 0;

/** @brief Returns stream size in bytes */
Expand Down
4 changes: 2 additions & 2 deletions Sources/Shared/Threading/Event.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@ namespace Death { namespace Threading {
#endif
};

/** @brief Event object that will atomically revert to an unsignaled state anytime a @relativeref{Event<Type>,Wait()} call succeeds (i.e., returns @cpp true @ce). */
/** @brief Event object that will atomically revert to an unsignaled state anytime a @relativeref{Event<Type>,Wait()} call succeeds */
using AutoResetEvent = Event<EventType::AutoReset>;

/** @brief Event object that once signaled remains that way forever, unless @relativeref{Event<Type>,ResetEvent()} is called. */
/** @brief Event object that once signaled remains that way forever, unless @relativeref{Event<Type>,ResetEvent()} is called */
using ManualResetEvent = Event<EventType::ManualReset>;

}}
2 changes: 1 addition & 1 deletion Sources/nCine/Threading/Thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace nCine
void Set(std::int32_t cpuNum);
/** @brief Sets the specified CPU number to be excluded by the set */
void Clear(std::int32_t cpuNum);
/** @brief Returns @cpp true @ce if the specified CPU number belongs to the set */
/** @brief Returns `true` if the specified CPU number belongs to the set */
bool IsSet(std::int32_t cpuNum);

private:
Expand Down

0 comments on commit e0bf3f9

Please sign in to comment.