Pushing work to remote
This commit is contained in:
@@ -21,8 +21,6 @@ endif()
|
||||
# The order matters here: we add LibExample first so that its library is
|
||||
# defined before the executables that need to link to it.
|
||||
|
||||
add_subdirectory(LibExample)
|
||||
add_subdirectory(Submissions)
|
||||
add_subdirectory(Portfolio)
|
||||
|
||||
# --- End of File ---
|
||||
@@ -1,32 +0,0 @@
|
||||
# --- Step 1: Create the Library ---
|
||||
|
||||
# Define a library target named "LibExample".
|
||||
# We use INTERFACE because it only contains .hpp files (header-only).
|
||||
# There are no .cpp files to compile here.
|
||||
# TODO: Change to STATIC if you add .cpp files later.
|
||||
add_library(LibExample INTERFACE)
|
||||
|
||||
# --- Step 2: Add Header Files to the Library ---
|
||||
|
||||
# This command explicitly lists the header files that belong to the library.
|
||||
# This helps Visual Studio display them nicely in the Solution Explorer.
|
||||
target_sources(LibExample
|
||||
PUBLIC
|
||||
list.hpp
|
||||
TSingleLinkedListTemplate.hpp
|
||||
TDoublyLinkedListTemplate.hpp
|
||||
TCircularDoublyLinkedListTemplate.hpp
|
||||
queue.hpp
|
||||
stack.hpp
|
||||
)
|
||||
|
||||
# --- Step 3: Make Headers "Findable" ---
|
||||
|
||||
# This is the most important command here.
|
||||
# It tells any other project that links to "LibExample" to add this
|
||||
# directory (CMAKE_CURRENT_SOURCE_DIR) to its list of include paths.
|
||||
# This is what allows you to write #include "list.hpp" in your main.cpp.
|
||||
# Note: CMAKE_CURRENT_SOURCE_DIR is a built-in variable that points to the directory
|
||||
target_include_directories(LibExample INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
#TODO: Change INTERFACE to PUBLIC if you add .cpp files later.
|
||||
|
||||
@@ -1,454 +0,0 @@
|
||||
// Implantation of the Circular Doubly Linked List
|
||||
|
||||
#ifndef TCIRCULARDOUBLYLINKEDLISTTEMPLATE_HPP
|
||||
#define TCIRCULARDOUBLYLINKEDLISTTEMPLATE_HPP
|
||||
#pragma once
|
||||
|
||||
#include "TDoublyLinkedListTemplate.hpp"
|
||||
|
||||
template <typename T>
|
||||
class TCircularDoublyLinkedList : public TDoublyLinkedList<T> {
|
||||
private:
|
||||
|
||||
// Helper to remove a node, updating both next and prev pointers
|
||||
void InternalRemoveNode(TNode<T>* aNodeToDelete);
|
||||
|
||||
protected:
|
||||
// --- New Member Variable ---
|
||||
TNode<T>* cursor; // Points to the "current" node in the list.
|
||||
|
||||
public:
|
||||
using TSingleLinkedList<T>::Append;
|
||||
using TSingleLinkedList<T>::Prepend;
|
||||
|
||||
// --- Constructor & Destructor ---
|
||||
TCircularDoublyLinkedList(bool aIsDataOwner);
|
||||
virtual ~TCircularDoublyLinkedList() override;
|
||||
|
||||
// --- New Cursor Management Methods ---
|
||||
void ResetCursor();
|
||||
T GetCursorData() const;
|
||||
void AdvanceCursor(int aSteps = 1);
|
||||
void RewindCursor(int aSteps = 1);
|
||||
int GetCursorIndex() const;
|
||||
|
||||
|
||||
// --- Overridden Virtual Methods ---
|
||||
// For maintaining the circular link
|
||||
void Append(const T&) override;
|
||||
void Prepend(const T&) override;
|
||||
void Remove(const T&) override;
|
||||
void RemoveAll(const T&) override;
|
||||
T RemoveLast() override;
|
||||
void Reverse() override;
|
||||
void ReverseSublist(int, int) override;
|
||||
void Merge(TSingleLinkedList<T>& otherList) override;
|
||||
|
||||
// For avoiding infinite loops
|
||||
bool Contains(const T&) const override;
|
||||
T Search(const T&, FCheckNode<T>) const override;
|
||||
void ForEach(FVisitNode<T>) const override;
|
||||
TNode<T>* GetMiddle() const override;
|
||||
};
|
||||
|
||||
// Constructor: Establishes the initial circular link where the head points to itself.
|
||||
template <typename T>
|
||||
TCircularDoublyLinkedList<T>::TCircularDoublyLinkedList(bool aIsDataOwner)
|
||||
: TDoublyLinkedList<T>(aIsDataOwner) {
|
||||
// An empty circular list's dummy head points to itself.
|
||||
this->head->SetNext(this->head);
|
||||
this->head->SetPrev(this->head);
|
||||
this->cursor = this->head; // Cursor also starts at the head.
|
||||
}
|
||||
|
||||
// Destructor: The parent destructors are virtual and will handle cleanup.
|
||||
template <typename T>
|
||||
TCircularDoublyLinkedList<T>::~TCircularDoublyLinkedList() {
|
||||
// Before the parent destructors run, we must break the circular link.
|
||||
// The parent's `nullptr`-terminated cleanup loop will now work correctly.
|
||||
if (!this->IsEmpty()) {
|
||||
// The tail is the node before the dummy head.
|
||||
// Set its 'next' pointer to null instead of back to the head.
|
||||
this->head->GetPrev()->SetNext(nullptr);
|
||||
}
|
||||
// Now, the chain is broken: head -> node1 -> ... -> tail -> nullptr
|
||||
// The TDoublyLinkedList and TSingleLinkedList destructors will be called
|
||||
// automatically after this, and they will now function correctly.
|
||||
}
|
||||
|
||||
// Moves the cursor to the first element in the list.
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::ResetCursor() {
|
||||
if (this->IsEmpty()) {
|
||||
this->cursor = this->head;
|
||||
}
|
||||
else {
|
||||
this->cursor = this->head->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the data at the cursor's current position.
|
||||
template <typename T>
|
||||
T TCircularDoublyLinkedList<T>::GetCursorData() const {
|
||||
// The cursor is only valid if it's not pointing to the dummy head.
|
||||
if (!this->IsEmpty() && this->cursor != this->head) {
|
||||
return this->cursor->GetData();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Moves the cursor forward, wrapping around if needed.
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::AdvanceCursor(int aSteps) {
|
||||
if (this->IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < aSteps; ++i) {
|
||||
this->cursor = this->cursor->GetNext();
|
||||
// If we move to the dummy head, we've wrapped around. Skip over it to the first element.
|
||||
if (this->cursor == this->head) {
|
||||
this->cursor = this->head->GetNext();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Moves the cursor backward, wrapping around if needed.
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::RewindCursor(int aSteps) {
|
||||
if (this->IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < aSteps; ++i) {
|
||||
this->cursor = this->cursor->GetPrev();
|
||||
// If we move to the dummy head, we've wrapped around. Skip over it to the last element.
|
||||
if (this->cursor == this->head) {
|
||||
this->cursor = this->head->GetPrev();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Gets the numerical index of the cursor's current position.
|
||||
template <typename T>
|
||||
int TCircularDoublyLinkedList<T>::GetCursorIndex() const {
|
||||
if (this->IsEmpty() || this->cursor == this->head) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
TNode<T>* current = this->head->GetNext();
|
||||
|
||||
// Traverse the list safely, knowing it will eventually loop back to the head.
|
||||
while (current != this->head) {
|
||||
if (current == this->cursor) {
|
||||
return index;
|
||||
}
|
||||
current = current->GetNext();
|
||||
index++;
|
||||
}
|
||||
|
||||
return -1; // Should not be reached if cursor is valid.
|
||||
}
|
||||
|
||||
// Appends a node to the end of the list (before the dummy head).
|
||||
// Use the InternAppend from TDoublyLinkedList for basic logic, then adjust prev pointers.
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::Append(const T& aData) {
|
||||
// 1. Let the base class do ALL the standard work.
|
||||
TDoublyLinkedList<T>::Append(aData);
|
||||
// 2. Now fix the circular links.
|
||||
if(!this->IsEmpty()) {
|
||||
this->head->SetPrev(this->tail); // Dummy head's prev points to new tail
|
||||
this->tail->SetNext(this->head); // New tail's next points to dummy head
|
||||
}
|
||||
}
|
||||
|
||||
// Prepends a node to the beginning of the list (after the dummy head).
|
||||
// Use the Prepend from TDoublyLinkedList, this will handle all the logic.
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::Prepend(const T& aData) {
|
||||
TDoublyLinkedList<T>::Prepend(aData);
|
||||
// No need to adjust circular links, as TDoublyLinkedList::Prepend already does it.
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::InternalRemoveNode(TNode<T>* aNodeToDelete) {
|
||||
if (aNodeToDelete == nullptr || aNodeToDelete == this->head) return; // Invalid input
|
||||
|
||||
// 1. Update cursor if it points to the node being deleted
|
||||
if (this->cursor == aNodeToDelete) {
|
||||
this->cursor = aNodeToDelete->GetNext();
|
||||
}
|
||||
|
||||
//2. Update tail if the last node is being removed
|
||||
if (aNodeToDelete == this->tail) {
|
||||
this->tail = aNodeToDelete->GetPrev();
|
||||
}
|
||||
|
||||
// 3. Relink neighbors (this maintains the circle automatically)
|
||||
TNode<T>* prevNode = aNodeToDelete->GetPrev();
|
||||
TNode<T>* nextNode = aNodeToDelete->GetNext();
|
||||
prevNode->SetNext(nextNode);
|
||||
nextNode->SetPrev(prevNode);
|
||||
|
||||
// 4. Delete data if owned, then delete the node
|
||||
if (this->isDataOwner) {
|
||||
delete aNodeToDelete->GetData();
|
||||
}
|
||||
delete aNodeToDelete;
|
||||
this->size--;
|
||||
|
||||
// 5. If the list is now empty, ensure tail and cursor point to the head.
|
||||
if (this->IsEmpty()) {
|
||||
this->tail = this->head;
|
||||
this->cursor = this->head;
|
||||
}
|
||||
}
|
||||
|
||||
// Removes the first node with the given value.
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::Remove(const T& aData) {
|
||||
if (this->IsEmpty()) return;
|
||||
|
||||
// Start searching from the first actual node
|
||||
TNode<T>* current = this->head->GetNext();
|
||||
// Traverse the entire circle once
|
||||
for (int i = 0; i < this->size; ++i) {
|
||||
if (current->GetData() == aData) {
|
||||
TNode<T>* prevNode = current->GetPrev();
|
||||
TNode<T>* nextNode = current->GetNext();
|
||||
|
||||
// Update tail if the last node is being removed
|
||||
if (current == this->tail) {
|
||||
this->tail = prevNode;
|
||||
}
|
||||
|
||||
// Relink neighbors (this maintains the circle automatically)
|
||||
prevNode->SetNext(nextNode);
|
||||
nextNode->SetPrev(prevNode);
|
||||
|
||||
if (this->isDataOwner) {
|
||||
delete current->GetData();
|
||||
}
|
||||
delete current;
|
||||
this->size--;
|
||||
return;
|
||||
}
|
||||
current = current->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
// Removes the last element from the list.
|
||||
template <typename T>
|
||||
T TCircularDoublyLinkedList<T>::RemoveLast() {
|
||||
if (this->IsEmpty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TNode<T>* nodeToRemove = this->tail;
|
||||
T dataToReturn = nodeToRemove->GetData();
|
||||
TNode<T>* newTail = nodeToRemove->GetPrev();
|
||||
|
||||
// Relink the new tail to the head to maintain the circle
|
||||
newTail->SetNext(this->head);
|
||||
this->head->SetPrev(newTail);
|
||||
|
||||
this->tail = newTail; // Update tail pointer
|
||||
|
||||
delete nodeToRemove;
|
||||
this->size--;
|
||||
|
||||
if (this->IsEmpty()) {
|
||||
this->tail = this->head; // Reset tail if list is now empty
|
||||
}
|
||||
|
||||
return dataToReturn;
|
||||
}
|
||||
|
||||
// Removes all occurrences of a given value using a safe, bounded loop.
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::RemoveAll(const T& aData) {
|
||||
if (this->IsEmpty()) return;
|
||||
|
||||
TNode<T>* current = this->head->GetNext();
|
||||
int initialSize = this->size; // Loop based on the original size
|
||||
|
||||
for (int i = 0; i < initialSize; ++i) {
|
||||
TNode<T>* nextNode = current->GetNext(); // Get next node before potential deletion
|
||||
|
||||
if (current->GetData() == aData) {
|
||||
TNode<T>* prevNode = current->GetPrev();
|
||||
|
||||
if (current == this->tail) {
|
||||
this->tail = prevNode;
|
||||
}
|
||||
|
||||
prevNode->SetNext(nextNode);
|
||||
nextNode->SetPrev(prevNode);
|
||||
|
||||
if (this->isDataOwner) {
|
||||
delete current->GetData();
|
||||
}
|
||||
delete current;
|
||||
this->size--;
|
||||
}
|
||||
current = nextNode;
|
||||
}
|
||||
if (this->IsEmpty()) {
|
||||
this->tail = this->head;
|
||||
}
|
||||
}
|
||||
|
||||
// Reverses the entire list by swapping the next/prev pointers of every node.
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::Reverse() {
|
||||
if (this->size <= 1) return; // Nothing to reverse
|
||||
|
||||
// 1. Keep track of original head and tail nodes.
|
||||
TNode<T>* newFirstNode = this->tail;
|
||||
|
||||
// 2. Iterate through all nodes, swapping next and prev pointers.
|
||||
TNode<T>* current = this->head;
|
||||
// We must loop size + 1 times to include the dummy head in the pointer swap.
|
||||
for (int i = 0; i < this->size + 1; ++i) {
|
||||
current->SwapNextPrev();
|
||||
// The *new* prev pointer is the *original* next pointer, so this moves us forward.
|
||||
current = current->GetPrev();
|
||||
}
|
||||
|
||||
// 3. Correct the head and tail pointers.
|
||||
this->tail = this->head->GetNext(); // The old head is the new tail.
|
||||
this->head->SetNext(newFirstNode); // The dummy head now points to the old tail.
|
||||
newFirstNode->SetPrev(this->head); // New first node's prev points to dummy head.
|
||||
}
|
||||
|
||||
// Reverses a portion of the list, ensuring circular links are maintained.
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::ReverseSublist(int start, int end) {
|
||||
if (start < 0 || end >= this->size || start >= end) {
|
||||
return;
|
||||
}
|
||||
|
||||
// --- 1. Find boundary nodes ---
|
||||
TNode<T>* startNode = this->head->GetNext();
|
||||
for (int i = 0; i < start; ++i) {
|
||||
startNode = startNode->GetNext();
|
||||
}
|
||||
|
||||
TNode<T>* endNode = startNode;
|
||||
for (int i = start; i < end; ++i) {
|
||||
endNode = endNode->GetNext();
|
||||
}
|
||||
|
||||
TNode<T>* startPrev = startNode->GetPrev();
|
||||
TNode<T>* endNext = endNode->GetNext();
|
||||
|
||||
// --- 2. Reverse pointers for all nodes within the sublist ---
|
||||
TNode<T>* current = startNode;
|
||||
for (int i = 0; i <= (end - start); ++i) {
|
||||
TNode<T>* temp = current->GetNext();
|
||||
current->SetNext(current->GetPrev());
|
||||
current->SetPrev(temp);
|
||||
current = temp;
|
||||
}
|
||||
|
||||
// --- 3. Re-stitch the sublist (no nullptr checks needed) ---
|
||||
startPrev->SetNext(endNode);
|
||||
endNode->SetPrev(startPrev);
|
||||
startNode->SetNext(endNext);
|
||||
endNext->SetPrev(startNode);
|
||||
|
||||
// Update tail pointer if it was part of the reversed segment
|
||||
if (this->head->GetPrev() == endNode) { // Original startNode is now at the end
|
||||
this->tail = startNode;
|
||||
}
|
||||
}
|
||||
|
||||
// Merges another sorted list, creating a single, sorted circular list.
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::Merge(TSingleLinkedList<T>& otherList) {
|
||||
// We can call the parent implementation to do the heavy lifting of merging.
|
||||
TDoublyLinkedList<T>::Merge(otherList);
|
||||
|
||||
// The parent merge results in a null-terminated list. We just need to fix the ends.
|
||||
if (!this->IsEmpty()) {
|
||||
TNode<T>* firstNode = this->head->GetNext();
|
||||
this->tail->SetNext(firstNode);
|
||||
firstNode->SetPrev(this->tail);
|
||||
}
|
||||
}
|
||||
|
||||
// Applies a function to each node using a safe loop for a circular list.
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::ForEach(FVisitNode<T> aVisitNode) const {
|
||||
if (aVisitNode == nullptr || this->IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
TNode<T>* current = this->head->GetNext();
|
||||
int index = 0;
|
||||
while (current != this->head) {
|
||||
aVisitNode(current->GetData(), index);
|
||||
current = current->GetNext();
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
// Checks if a value is in the list using a safe, non-infinite loop.
|
||||
template <typename T>
|
||||
bool TCircularDoublyLinkedList<T>::Contains(const T& aData) const {
|
||||
if (this->IsEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
TNode<T>* current = this->head->GetNext();
|
||||
while (current != this->head) {
|
||||
if (current->GetData() == aData) {
|
||||
return true;
|
||||
}
|
||||
current = current->GetNext();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Searches for a value using a safe, non-infinite loop.
|
||||
template <typename T>
|
||||
T TCircularDoublyLinkedList<T>::Search(const T& aData, FCheckNode<T> aCheckNode) const {
|
||||
if (this->IsEmpty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TNode<T>* current = this->head->GetNext();
|
||||
while (current != this->head) {
|
||||
if (aCheckNode != nullptr) {
|
||||
if (aCheckNode(current->GetData(), aData)) {
|
||||
return current->GetData();
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (current->GetData() == aData) {
|
||||
return current->GetData();
|
||||
}
|
||||
}
|
||||
current = current->GetNext();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Finds the middle node by traversing to the size/2 index.
|
||||
template <typename T>
|
||||
TNode<T>* TCircularDoublyLinkedList<T>::GetMiddle() const {
|
||||
if (this->IsEmpty()) return nullptr;
|
||||
|
||||
// The safest way for a list where we know the size.
|
||||
int middleIndex = this->size / 2;
|
||||
TNode<T>* current = this->head->GetNext();
|
||||
for (int i = 0; i < middleIndex; ++i) {
|
||||
current = current->GetNext();
|
||||
}
|
||||
return current;
|
||||
}
|
||||
|
||||
#endif // TCIRCULARDOUBLYLINKEDLISTTEMPLATE_HPP
|
||||
@@ -1,340 +0,0 @@
|
||||
// TDoublyLinkedList implements a doubly linked list data structure with basic functionalities.
|
||||
|
||||
#ifndef TDOUBLYLINKEDLISTTEMPLEATE_HPP
|
||||
#define TDOUBLYLINKEDLISTTEMPLEATE_HPP
|
||||
#pragma once
|
||||
#include "TSingleLinkedListTemplate.hpp"
|
||||
|
||||
// Doubly Linked List inheriting from TSingleLinkedList
|
||||
template <typename T>
|
||||
class TDoublyLinkedList : public TSingleLinkedList<T> {
|
||||
private:
|
||||
// Internal helper to remove a node, updating both next and prev pointers
|
||||
void InternalRemoveNode(TNode<T>* aNodeToDelete);
|
||||
|
||||
public:
|
||||
using TSingleLinkedList<T>::Append;
|
||||
using TSingleLinkedList<T>::Prepend;
|
||||
|
||||
// --- Constructor & Destructor ---
|
||||
// Constructor calls the base class's constructor to initialize common members.
|
||||
TDoublyLinkedList(bool aIsDataOwner);
|
||||
|
||||
// The destructor is also virtual, ensuring the correct cleanup chain.
|
||||
virtual ~TDoublyLinkedList() override;
|
||||
|
||||
|
||||
// --- Overridden Virtual Methods from TSingleLinkedList ---
|
||||
// These methods provide new implementations to manage the 'prev' pointer
|
||||
// and/or to improve performance.
|
||||
virtual void Append(const T&) override;
|
||||
virtual void Prepend(const T&) override;
|
||||
virtual T GetAtIndex(int) override;
|
||||
virtual void Remove(const T&) override;
|
||||
virtual void Reverse() override;
|
||||
virtual void Merge(TSingleLinkedList<T>&) override;
|
||||
virtual void RemoveAll(const T&) override;
|
||||
virtual void ReverseSublist(int, int) override;
|
||||
virtual T RemoveLast();
|
||||
|
||||
|
||||
// --- New Methods Unique to TDoublyLinkedList ---
|
||||
// These methods leverage the 'prev' pointer for capabilities that are
|
||||
// inefficient or impossible in a singly-linked list.
|
||||
|
||||
void InsertBefore(TNode<T>*, T&);
|
||||
void ForEachReverse(FVisitNode<T>) const;
|
||||
};
|
||||
|
||||
|
||||
template<typename T>
|
||||
inline void TDoublyLinkedList<T>::InternalRemoveNode(TNode<T>* aNodeToDelete)
|
||||
{
|
||||
if (aNodeToDelete == nullptr || aNodeToDelete == this->head) return;
|
||||
TNode<T>* prevNode = aNodeToDelete->GetPrev();
|
||||
TNode<T>* nextNode = aNodeToDelete->GetNext();
|
||||
if (prevNode != nullptr) {
|
||||
prevNode->SetNext(nextNode);
|
||||
}
|
||||
if (nextNode != nullptr) {
|
||||
nextNode->SetPrev(prevNode);
|
||||
}
|
||||
if (aNodeToDelete == this->tail) {
|
||||
this->tail = prevNode;
|
||||
}
|
||||
if (this->isDataOwner) {
|
||||
delete aNodeToDelete->GetData();
|
||||
}
|
||||
delete aNodeToDelete;
|
||||
this->size--;
|
||||
}
|
||||
|
||||
// Constructor: Calls the base class constructor to perform initialization.
|
||||
template <typename T>
|
||||
TDoublyLinkedList<T>::TDoublyLinkedList(bool aIsDataOwner)
|
||||
: TSingleLinkedList<T>(aIsDataOwner) {}
|
||||
|
||||
// Destructor: The base class destructor is virtual, so this is called automatically.
|
||||
// No new resources were allocated, so the body can be empty.
|
||||
template <typename T>
|
||||
TDoublyLinkedList<T>::~TDoublyLinkedList() {} // No additional cleanup needed, the base class handles it.
|
||||
|
||||
// Append: Overridden to correctly set the 'prev' pointer on the new node.
|
||||
template <typename T>
|
||||
void TDoublyLinkedList<T>::Append(const T& aData) {
|
||||
TNode<T>* oldTail = this->tail;
|
||||
TNode<T>* newNode = this->InternAppend(aData);
|
||||
newNode->SetPrev(oldTail); // Set the new node's prev to the old tail
|
||||
}
|
||||
|
||||
// Prepend: Overridden to correctly set 'prev' pointers on the new node and its old neighbor.
|
||||
template <typename T>
|
||||
void TDoublyLinkedList<T>::Prepend(const T& aData) {
|
||||
TNode<T>* newNode = this->InternPrepend(aData);
|
||||
newNode->SetPrev(this->head); // New node's prev points to dummy head
|
||||
if (newNode->GetNext() != nullptr) {
|
||||
newNode->GetNext()->SetPrev(newNode); // Old first node's prev points to new node
|
||||
}
|
||||
}
|
||||
|
||||
// GetAtIndex: Re-introduces the performance optimization to search from the tail.
|
||||
template <typename T>
|
||||
T TDoublyLinkedList<T>::GetAtIndex(int aIndex) {
|
||||
if (aIndex < 0 || aIndex >= this->size) {
|
||||
return nullptr; // Index out of bounds
|
||||
}
|
||||
|
||||
TNode<T>* current;
|
||||
// Check which end is closer and traverse from there.
|
||||
if (aIndex < this->size / 2) {
|
||||
current = this->head->GetNext();
|
||||
for (int i = 0; i < aIndex; i++) {
|
||||
current = current->GetNext();
|
||||
}
|
||||
}
|
||||
else {
|
||||
current = this->tail;
|
||||
for (int i = this->size - 1; i > aIndex; i--) {
|
||||
current = current->GetPrev();
|
||||
}
|
||||
}
|
||||
return current->GetData();
|
||||
}
|
||||
|
||||
// Remove: Removes all nodes matching the given value.
|
||||
template <typename T>
|
||||
void TDoublyLinkedList<T>::Remove(const T& aData) {
|
||||
TNode<T>* current = this->head->GetNext();
|
||||
while (current != nullptr) {
|
||||
if (current->GetData() == aData) {
|
||||
TNode<T>* nodeToRemove = current;
|
||||
current = current->GetNext(); // Move current forward before deletion
|
||||
InternalRemoveNode(nodeToRemove);
|
||||
}
|
||||
else {
|
||||
// No match, just advance current
|
||||
current = current->GetNext();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Reverse: Uses the much simpler algorithm of swapping prev/next pointers.
|
||||
template <typename T>
|
||||
void TDoublyLinkedList<T>::Reverse() {
|
||||
if (this->size <= 1) return;
|
||||
|
||||
// 1. Keep track of original head and tail nodes.
|
||||
TNode<T>* originalHeadNode = this->head->GetNext();
|
||||
TNode<T>* originalTailNode = this->tail;
|
||||
|
||||
// 2. Swap prev/next for every node.
|
||||
TNode<T>* current = originalHeadNode;
|
||||
while (current != nullptr) {
|
||||
current->SwapNextPrev();
|
||||
// The *new* prev pointer is the *original* next pointer, so this moves us forward.
|
||||
current = current->GetPrev();
|
||||
}
|
||||
|
||||
// 3. Correct the pointers for the new head and tail.
|
||||
this->tail = originalHeadNode; // The old head is the new tail.
|
||||
this->head->SetNext(originalTailNode); // The dummy head now points to the old tail.
|
||||
}
|
||||
|
||||
// RemoveLast: Removes the final element in O(1) time.
|
||||
// Note: This returns the data, so the caller is now responsible for it.
|
||||
// The data itself is not deleted, even if isDataOwner is true.
|
||||
template <typename T>
|
||||
T TDoublyLinkedList<T>::RemoveLast() {
|
||||
if (this->IsEmpty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TNode<T>* nodeToRemove = this->tail;
|
||||
T dataToReturn = nodeToRemove->GetData();
|
||||
|
||||
this->tail = this->tail->GetPrev();
|
||||
this->tail->SetNext(nullptr);
|
||||
|
||||
delete nodeToRemove;
|
||||
this->size--;
|
||||
|
||||
return dataToReturn;
|
||||
}
|
||||
|
||||
// InsertBefore: Inserts a new node before a specified node in O(1) time.
|
||||
template <typename T>
|
||||
void TDoublyLinkedList<T>::InsertBefore(TNode<T>* aNode, T& aData) {
|
||||
if (aNode == nullptr || aNode == this->head) {
|
||||
// Cannot insert before a null node or the dummy head
|
||||
return;
|
||||
}
|
||||
|
||||
// If inserting before the first element, Prepend is easier.
|
||||
if (aNode == this->head->GetNext()) {
|
||||
Prepend(aData);
|
||||
return;
|
||||
}
|
||||
|
||||
TNode<T>* newNode = new TNode<T>(aData);
|
||||
TNode<T>* prevNode = aNode->GetPrev();
|
||||
|
||||
// Link new node to its neighbors
|
||||
newNode->SetPrev(prevNode);
|
||||
newNode->SetNext(aNode);
|
||||
|
||||
// Update neighbors to point to the new node
|
||||
prevNode->SetNext(newNode);
|
||||
aNode->SetPrev(newNode);
|
||||
|
||||
this->size++;
|
||||
}
|
||||
|
||||
// ForEachReverse: Traverses the list backward from tail to head.
|
||||
template <typename T>
|
||||
void TDoublyLinkedList<T>::ForEachReverse(FVisitNode<T> aVisitNode) const {
|
||||
if (aVisitNode == nullptr) {
|
||||
return;
|
||||
}
|
||||
TNode<T>* current = this->tail;
|
||||
int index = this->size - 1;
|
||||
while (current != this->head) {
|
||||
aVisitNode(current->GetData(), index);
|
||||
current = current->GetPrev();
|
||||
index--;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void TDoublyLinkedList<T>::Merge(TSingleLinkedList<T>& otherList) {
|
||||
if (otherList.IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
int otherSize = otherList.GetSize();
|
||||
// Call the now-public StealNodes to legally take ownership of the nodes.
|
||||
TNode<T>* p2 = otherList.StealNodes();
|
||||
|
||||
if (this->IsEmpty()) {
|
||||
this->head->SetNext(p2);
|
||||
if (p2) p2->SetPrev(this->head);
|
||||
this->size = otherSize;
|
||||
// Find the new tail by traversing.
|
||||
TNode<T>* newTail = this->head;
|
||||
while (newTail->GetNext() != nullptr) {
|
||||
newTail = newTail->GetNext();
|
||||
}
|
||||
this->tail = newTail;
|
||||
return;
|
||||
}
|
||||
|
||||
TNode<T>* p1 = this->head->GetNext();
|
||||
TNode<T>* currentTail = this->head;
|
||||
|
||||
while (p1 != nullptr && p2 != nullptr) {
|
||||
if (p1->GetData() <= p2->GetData()) {
|
||||
currentTail->SetNext(p1);
|
||||
p1->SetPrev(currentTail);
|
||||
p1 = p1->GetNext();
|
||||
}
|
||||
else {
|
||||
currentTail->SetNext(p2);
|
||||
p2->SetPrev(currentTail);
|
||||
p2 = p2->GetNext();
|
||||
}
|
||||
currentTail = currentTail->GetNext();
|
||||
}
|
||||
|
||||
TNode<T>* remainder = (p1 != nullptr) ? p1 : p2;
|
||||
currentTail->SetNext(remainder);
|
||||
if (remainder != nullptr) {
|
||||
remainder->SetPrev(currentTail);
|
||||
}
|
||||
|
||||
this->size += otherSize;
|
||||
// After merging, find the new tail by traversing from where we left off.
|
||||
while (currentTail->GetNext() != nullptr) {
|
||||
currentTail = currentTail->GetNext();
|
||||
}
|
||||
this->tail = currentTail;
|
||||
}
|
||||
|
||||
// Remove: Removes all nodes matching the given value.
|
||||
template <typename T>
|
||||
void TDoublyLinkedList<T>::RemoveAll(const T& aValue) {
|
||||
TNode<T>* current = this->head->GetNext();
|
||||
while (current != nullptr) {
|
||||
if (current->GetData() == aValue) {
|
||||
TNode<T>* nodeToRemove = current;
|
||||
current = current->GetNext(); // Move current forward before deletion
|
||||
InternalRemoveNode(nodeToRemove);
|
||||
}
|
||||
else {
|
||||
// No match, just advance the pointer
|
||||
current = current->GetNext();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ReverseSublist: Reverses a portion of the list between two indices (inclusive).
|
||||
template <typename T>
|
||||
void TDoublyLinkedList<T>::ReverseSublist(int start, int end) {
|
||||
if (start < 0 || end >= this->size || start >= end) return;
|
||||
|
||||
// --- 1. Find boundary nodes ---
|
||||
TNode<T>* startNode = this->head->GetNext();
|
||||
TNode<T>* endNode = startNode;
|
||||
|
||||
for (int i = 0; i < start; ++i) {
|
||||
startNode = startNode->GetNext();
|
||||
}
|
||||
for (int i = start; i < end; ++i) {
|
||||
endNode = endNode->GetNext();
|
||||
}
|
||||
|
||||
TNode<T>* startPrev = startNode->GetPrev();
|
||||
TNode<T>* endNext = endNode->GetNext();
|
||||
|
||||
// --- 2. Reverse pointers for all nodes within the sublist ---
|
||||
TNode<T>* current = startNode;
|
||||
while (current != endNext) {
|
||||
TNode<T>* temp = current->GetNext();
|
||||
current->SetNext(current->GetPrev());
|
||||
current->SetPrev(temp);
|
||||
current = temp; // Move to the original next node
|
||||
}
|
||||
|
||||
// --- 3. Re-stitch the reversed sublist into the main list ---
|
||||
startPrev->SetNext(endNode);
|
||||
endNode->SetPrev(startPrev);
|
||||
|
||||
startNode->SetNext(endNext);
|
||||
if (endNext != nullptr) {
|
||||
endNext->SetPrev(startNode);
|
||||
}
|
||||
else {
|
||||
// If we reversed to the end, the original startNode is the new tail
|
||||
this->tail = startNode;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !TDOUBLYLINKEDLISTTEMPLEATE_HPP
|
||||
@@ -1,529 +0,0 @@
|
||||
#ifndef TSINGLELINKEDLIST_HPP
|
||||
#define TSINGLELINKEDLIST_HPP
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <type_traits> // Required for the Clone function, and prevent delete on non-pointer types
|
||||
#include "TDoublyLinkedListTemplate.hpp"
|
||||
#include "TCircularDoublyLinkedListTemplate.hpp"
|
||||
|
||||
template <typename T>
|
||||
class TDoublyLinkedList; // Forward declaration for friendship
|
||||
template <typename T>
|
||||
class TCircularDoublyLinkedList; // Forward declaration for friendship
|
||||
|
||||
// Callback type definitions
|
||||
template <typename T, typename TArgs>
|
||||
using FDataFactory = T(*)(TArgs); // <-- ADD THIS LINE
|
||||
|
||||
template <typename T>
|
||||
using FCheckNode = bool(*)(const T, const T);
|
||||
|
||||
template <typename T>
|
||||
using FVisitNode = void(*)(const T, int);
|
||||
|
||||
template <typename T>
|
||||
class TNode {
|
||||
private:
|
||||
T data; // Data of type T (e.g., TSong*)
|
||||
TNode* next; // Pointer to the next node
|
||||
TNode* prev; // Pointer to the previous node, prepared for future use
|
||||
|
||||
void SwapNextPrev(); // Swaps the next and prev pointers of this node
|
||||
public:
|
||||
// Constructor
|
||||
|
||||
TNode(const T& aData);
|
||||
|
||||
// Destructor
|
||||
~TNode();
|
||||
|
||||
// Getters
|
||||
T GetData() const { return data; }
|
||||
TNode* GetNext() const { return next; }
|
||||
TNode* GetPrev() const { return prev; }
|
||||
|
||||
// Setters
|
||||
void SetNext(TNode* aNextNode) { next = aNextNode; }
|
||||
void SetPrev(TNode* aPrevNode) { prev = aPrevNode; }
|
||||
|
||||
// Add friendships here if needed
|
||||
friend class TDoublyLinkedList<T>;
|
||||
friend class TCircularDoublyLinkedList<T>;
|
||||
};
|
||||
|
||||
// --- Method Implementations ---
|
||||
// Constructor: Initializes the node with data from the factory function
|
||||
template <typename T>
|
||||
TNode<T>::TNode(const T& aData) : data(aData), next(nullptr), prev(nullptr) {}
|
||||
|
||||
// Destructor: Deletes the data pointer
|
||||
template <typename T>
|
||||
TNode<T>::~TNode() {
|
||||
//Do not delete data, data may exist outside the list
|
||||
data = nullptr; // Set data to nullptr to avoid dangling pointer
|
||||
next = nullptr; // Set next to nullptr to avoid dangling pointer
|
||||
prev = nullptr; // Set prev to nullptr to avoid dangling pointer
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void TNode<T>::SwapNextPrev() {
|
||||
TNode* temp = next;
|
||||
next = prev;
|
||||
prev = temp;
|
||||
}
|
||||
|
||||
// --- End of TNode class ---
|
||||
|
||||
// Singly Linked List TSingleLinkedList using TNode<T> and dummy node
|
||||
template <typename T>
|
||||
class TSingleLinkedList {
|
||||
private:
|
||||
// Helper to reset the list to empty state
|
||||
void ResetList();
|
||||
|
||||
protected:
|
||||
TNode<T>* head; // Pointer to the dummy head node
|
||||
TNode<T>* tail; // Pointer to the tail node
|
||||
int size; // Current size of the list
|
||||
bool isDataOwner; // Indicates if the list owns the data
|
||||
|
||||
// Internal implementations can be non-virtual
|
||||
TNode<T>* InternAppend(const T&);
|
||||
TNode<T>* InternPrepend(const T&);
|
||||
|
||||
// Helper for RemoveAll to delete a node given its previous node
|
||||
void InternalRemoveNode(TNode<T>*, TNode<T>*);
|
||||
// Helper to get node at index (non-virtual, used internally)
|
||||
TNode<T>* GetNodeAtIndex(int aIndex) const;
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
TSingleLinkedList(bool);
|
||||
// Virtual Destructor
|
||||
virtual ~TSingleLinkedList();
|
||||
|
||||
// --- Core Operations (Virtual) ---
|
||||
virtual void Append(const T&);
|
||||
virtual void Prepend(const T&);
|
||||
virtual T GetAtIndex(int);
|
||||
virtual void Remove(const T&);
|
||||
virtual void Reverse();
|
||||
virtual void RemoveAll(const T&);
|
||||
virtual void ReverseSublist(int, int);
|
||||
virtual TNode<T>* GetMiddle() const;
|
||||
virtual void Merge(TSingleLinkedList<T>&);
|
||||
|
||||
// --- Traversal functions that MUST now be virtual ---
|
||||
virtual bool Contains(const T&) const;
|
||||
virtual T Search(const T&, FCheckNode<T> = nullptr) const;
|
||||
virtual void ForEach(FVisitNode<T>) const;
|
||||
|
||||
// --- Non-Virtual Methods ---
|
||||
template <typename TArgs>
|
||||
T Append(FDataFactory<T, TArgs>, TArgs);
|
||||
template <typename TArgs>
|
||||
T Prepend(FDataFactory<T, TArgs>, TArgs);
|
||||
int GetSize() const;
|
||||
bool IsEmpty() const;
|
||||
TSingleLinkedList<T> Clone() const;
|
||||
TNode<T>* StealNodes();
|
||||
};
|
||||
|
||||
// Constructor: Initializes the dummy head node and list state
|
||||
template <typename T>
|
||||
TSingleLinkedList<T>::TSingleLinkedList(bool aIsDataOwner)
|
||||
: head(new TNode<T>(nullptr)), tail(head), size(0), isDataOwner(aIsDataOwner) {
|
||||
// COMPILE-TIME SAFETY CHECK
|
||||
// If the user tries to create a list of non-pointer types with ownership,
|
||||
// stop compilation with a static_assert.
|
||||
static_assert(std::is_pointer<T>::value || !aIsDataOwner,
|
||||
"isDataOwner can only be true if T is a pointer type (e.g., std::string*).");
|
||||
}
|
||||
|
||||
// Virtual Destructor: Deletes all nodes and, if owner, the data
|
||||
template <typename T>
|
||||
TSingleLinkedList<T>::~TSingleLinkedList() {
|
||||
TNode<T>* current = head;
|
||||
while (current != nullptr) {
|
||||
TNode<T>* nextNode = current->GetNext();
|
||||
if (isDataOwner && current->GetData() != nullptr) {
|
||||
delete current->GetData(); // Delete data if the list owns it
|
||||
}
|
||||
delete current; // Free the node itself
|
||||
current = nextNode;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void TSingleLinkedList<T>::InternalRemoveNode(TNode<T>* aPrevNode, TNode<T>* aNodeToDelete) {
|
||||
if (aPrevNode == nullptr || aNodeToDelete == nullptr) return;
|
||||
aPrevNode->SetNext(aNodeToDelete->GetNext());
|
||||
if (aNodeToDelete == this->tail) {
|
||||
this->tail = aPrevNode;
|
||||
}
|
||||
if (this->isDataOwner) {
|
||||
delete aNodeToDelete->GetData();
|
||||
}
|
||||
delete aNodeToDelete;
|
||||
this->size--;
|
||||
}
|
||||
|
||||
|
||||
// StealNodes: Detaches and returns the list's nodes, leaving it empty
|
||||
// Uses ResetList to clear the list state
|
||||
template <typename T>
|
||||
TNode<T>* TSingleLinkedList<T>::StealNodes() {
|
||||
TNode<T>* stolenHead = head->GetNext(); // First actual node
|
||||
this->ResetList(); // Clear the list to empty state
|
||||
return stolenHead; // Return the detached nodes
|
||||
}
|
||||
|
||||
// InternAppend: Handles the logic of adding a node to the end
|
||||
template <typename T>
|
||||
TNode<T>* TSingleLinkedList<T>::InternAppend(const T& aData) {
|
||||
TNode<T>* newNode = new TNode<T>(aData);
|
||||
tail->SetNext(newNode); // Link the old tail to the new node
|
||||
tail = newNode; // Update the tail pointer
|
||||
size++;
|
||||
return newNode;
|
||||
}
|
||||
|
||||
// Public Append method
|
||||
template <typename T>
|
||||
void TSingleLinkedList<T>::Append(const T& aData) {
|
||||
InternAppend(aData);
|
||||
}
|
||||
|
||||
// InternPrepend: Handles the logic of adding a node to the beginning
|
||||
template <typename T>
|
||||
TNode<T>* TSingleLinkedList<T>::InternPrepend(const T& aData) {
|
||||
TNode<T>* newNode = new TNode<T>(aData);
|
||||
newNode->SetNext(head->GetNext());
|
||||
head->SetNext(newNode);
|
||||
if (tail == head) { // If the list was empty, new node is also the tail
|
||||
tail = newNode;
|
||||
}
|
||||
size++;
|
||||
return newNode;
|
||||
}
|
||||
|
||||
// Public Prepend method
|
||||
template <typename T>
|
||||
void TSingleLinkedList<T>::Prepend(const T& aData) {
|
||||
InternPrepend(aData);
|
||||
}
|
||||
|
||||
// Append(): Creates a new node with the given factory and returns the new node's data.
|
||||
template <typename T>
|
||||
template <typename TArgs>
|
||||
T TSingleLinkedList<T>::Append(FDataFactory<T, TArgs> aDataFactory, TArgs aArgs) {
|
||||
if (aDataFactory == nullptr) {
|
||||
return nullptr; // Return nullptr if no factory is provided
|
||||
}
|
||||
T newData = aDataFactory(aArgs);
|
||||
this->Append(newData); // Call the existing virtual Append(T) method
|
||||
return newData;
|
||||
}
|
||||
|
||||
// Prepend(): Creates a new node with the given factory and returns the new node's data.
|
||||
template <typename T>
|
||||
template <typename TArgs>
|
||||
T TSingleLinkedList<T>::Prepend(FDataFactory<T, TArgs> aDataFactory, TArgs aArgs) {
|
||||
if (aDataFactory == nullptr) {
|
||||
return nullptr; // Return nullptr if no factory is provided
|
||||
}
|
||||
T newData = aDataFactory(aArgs);
|
||||
this->Prepend(newData); // Call the existing virtual Prepend(T) method
|
||||
return newData;
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
TNode<T>* TSingleLinkedList<T>::GetNodeAtIndex(int aIndex) const {
|
||||
TNode<T>* current = head->GetNext(); // Start at the first actual node
|
||||
for (int i = 0; i < aIndex; ++i) {
|
||||
current = current->GetNext();
|
||||
}
|
||||
return current;
|
||||
}
|
||||
|
||||
// GetAtIndex: Returns the value at a specified index.
|
||||
// This version iterates from the beginning only, as it cannot go backward.
|
||||
template <typename T>
|
||||
T TSingleLinkedList<T>::GetAtIndex(int aIndex) {
|
||||
if (aIndex < 0 || aIndex >= size) {
|
||||
return nullptr; // Index out of bounds
|
||||
}
|
||||
return GetNodeAtIndex(aIndex)->GetData();
|
||||
}
|
||||
|
||||
// Remove: Removes the first node matching the given value.
|
||||
// Requires tracking the previous node to relink the list.
|
||||
template <typename T>
|
||||
void TSingleLinkedList<T>::Remove(const T& aData) {
|
||||
TNode<T>* prev = head;
|
||||
TNode<T>* current = head->GetNext();
|
||||
|
||||
while (current != nullptr) {
|
||||
if (current->GetData() == aData) {
|
||||
// Match found, remove the node
|
||||
InternalRemoveNode(prev, current);
|
||||
return; // Only remove the first occurrence
|
||||
}
|
||||
}
|
||||
prev = current;
|
||||
current = current->GetNext();
|
||||
}
|
||||
|
||||
// Reverse: Reverses the list using the classic iterative algorithm for singly-linked lists.
|
||||
template <typename T>
|
||||
void TSingleLinkedList<T>::Reverse() {
|
||||
if (size <= 1) {
|
||||
return; // Nothing to reverse
|
||||
}
|
||||
|
||||
// The original first node will become the new tail
|
||||
tail = head->GetNext();
|
||||
|
||||
TNode<T>* prevNode = nullptr;
|
||||
TNode<T>* currentNode = head->GetNext();
|
||||
TNode<T>* nextNode = nullptr;
|
||||
|
||||
while (currentNode != nullptr) {
|
||||
nextNode = currentNode->GetNext(); // Store next node
|
||||
currentNode->SetNext(prevNode); // Reverse the current node's pointer
|
||||
prevNode = currentNode; // Move pointers one position ahead
|
||||
currentNode = nextNode;
|
||||
}
|
||||
|
||||
// After the loop, prevNode is the new first node
|
||||
head->SetNext(prevNode);
|
||||
}
|
||||
|
||||
// Contains: Checks if the list contains the given value,
|
||||
// this is diffrent from Search as it only checks for existence
|
||||
// This using search with a nullptr as the check function
|
||||
template <typename T>
|
||||
bool TSingleLinkedList<T>::Contains(const T& aData) const {
|
||||
return Search(aData, nullptr) != nullptr;
|
||||
}
|
||||
|
||||
// Search: Finds a value using an optional custom comparison function
|
||||
template <typename T>
|
||||
T TSingleLinkedList<T>::Search(const T& aData, FCheckNode<T> aCheckNode) const {
|
||||
TNode<T>* current = head->GetNext();
|
||||
while (current != nullptr) {
|
||||
// Use the provided check function or default to direct comparison
|
||||
if (aCheckNode != nullptr) {
|
||||
if (aCheckNode(current->GetData(), aData)) {
|
||||
return current->GetData();
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (current->GetData() == aData) {
|
||||
return current->GetData();
|
||||
}
|
||||
}
|
||||
current = current->GetNext();
|
||||
}
|
||||
return nullptr; // Not found
|
||||
}
|
||||
|
||||
// ForEach: Applies a function to each node in the list
|
||||
template <typename T>
|
||||
void TSingleLinkedList<T>::ForEach(FVisitNode<T> aVisitNode) const {
|
||||
if (aVisitNode == nullptr) {
|
||||
return;
|
||||
}
|
||||
TNode<T>* current = head->GetNext();
|
||||
int index = 0;
|
||||
while (current != nullptr) {
|
||||
aVisitNode(current->GetData(), index);
|
||||
current = current->GetNext();
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
// GetSize: Returns the current number of elements in the list
|
||||
template <typename T>
|
||||
int TSingleLinkedList<T>::GetSize() const {
|
||||
return size;
|
||||
}
|
||||
|
||||
// IsEmpty: Checks if the list has any elements
|
||||
template <typename T>
|
||||
bool TSingleLinkedList<T>::IsEmpty() const {
|
||||
return size == 0;
|
||||
}
|
||||
|
||||
// RemoveAll: Removes all occurrences of a given value from the list.
|
||||
template <typename T>
|
||||
void TSingleLinkedList<T>::RemoveAll(const T& aData) {
|
||||
TNode<T>* prev = this->head;
|
||||
TNode<T>* current = this->head->GetNext();
|
||||
|
||||
while (current != nullptr) {
|
||||
if (current->GetData() == aData) {
|
||||
// Match found, remove the node
|
||||
TNode<T>* nodeToDelete = current;
|
||||
current = current->GetNext(); // Advance current before deletion
|
||||
InternalRemoveNode(prev, nodeToDelete);
|
||||
// prev remains the same, as we just removed current
|
||||
}
|
||||
else {
|
||||
// No match, advance both pointers
|
||||
prev = current;
|
||||
current = current->GetNext();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Clone: Creates a deep copy of the list.
|
||||
template <typename T>
|
||||
TSingleLinkedList<T> TSingleLinkedList<T>::Clone() const {
|
||||
// Create a new list with the same ownership policy.
|
||||
TSingleLinkedList<T> newList(this->isDataOwner);
|
||||
|
||||
TNode<T>* current = this->head->GetNext();
|
||||
while (current != nullptr) {
|
||||
T dataToCopy = current->GetData();
|
||||
|
||||
// This is the core of the deep copy logic.
|
||||
if (this->isDataOwner && std::is_pointer<T>::value && dataToCopy != nullptr) {
|
||||
// If the list owns its pointer data, we must create a NEW object.
|
||||
// This assumes the underlying type has a copy constructor.
|
||||
// `std::remove_pointer_t<T>` gets the type T points to (e.g., TSong from TSong*).
|
||||
newList.Append(new std::remove_pointer_t<T>(*dataToCopy));
|
||||
}
|
||||
else {
|
||||
// For value types (int, double) or non-owned pointers, just copy the value.
|
||||
newList.Append(dataToCopy);
|
||||
}
|
||||
current = current->GetNext();
|
||||
}
|
||||
return newList;
|
||||
}
|
||||
|
||||
// ReverseSublist: Reverses a portion of the list between two indices (inclusive).
|
||||
template <typename T>
|
||||
void TSingleLinkedList<T>::ReverseSublist(int aStart, int aEnd) {
|
||||
// Validate indices
|
||||
if (aStart < 0 || aEnd >= this->size || aStart >= aEnd) return;
|
||||
|
||||
|
||||
// --- 1. Traverse to the nodes that define the sublist boundaries ---
|
||||
// Use the helper to find the node *before* the sublist starts
|
||||
TNode<T>* startNodePrev = (aStart == 0) ? this->head : this->GetNodeAtIndex(aStart - 1); // Node before the start of the sublist
|
||||
TNode<T>* sublistHead = startNodePrev->GetNext(); // First node of the sublist
|
||||
|
||||
// --- 2. Perform standard reversal on the sublist part only ---
|
||||
TNode<T>* prevNode = nullptr;
|
||||
TNode<T>* currentNode = sublistHead;
|
||||
TNode<T>* nextNode = nullptr;
|
||||
for (int i = 0; i <= (aEnd - aStart); ++i) {
|
||||
nextNode = currentNode->GetNext();
|
||||
currentNode->SetNext(prevNode);
|
||||
prevNode = currentNode;
|
||||
currentNode = nextNode;
|
||||
}
|
||||
|
||||
// --- 3. Stitch the reversed sublist back into the main list ---
|
||||
// 'prevNode' is now the new head of the reversed sublist.
|
||||
// 'sublistHead' is now the tail of the reversed sublist.
|
||||
startNodePrev->SetNext(prevNode);
|
||||
sublistHead->SetNext(currentNode);
|
||||
|
||||
// Update the main tail pointer if the reversal included the original tail.
|
||||
if (aEnd == this->size - 1) {
|
||||
this->tail = sublistHead;
|
||||
}
|
||||
}
|
||||
|
||||
// GetMiddle: Finds the middle node of the list using the fast/slow pointer algorithm.
|
||||
template <typename T>
|
||||
TNode<T>* TSingleLinkedList<T>::GetMiddle() const {
|
||||
if (this->IsEmpty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TNode<T>* slow = this->head->GetNext();
|
||||
TNode<T>* fast = this->head->GetNext();
|
||||
|
||||
// The loop condition ensures 'fast' and 'fast->GetNext()' are valid.
|
||||
// When 'fast' reaches the end, 'slow' will be at the midpoint.
|
||||
while (fast != nullptr && fast->GetNext() != nullptr) {
|
||||
slow = slow->GetNext();
|
||||
fast = fast->GetNext()->GetNext();
|
||||
}
|
||||
|
||||
return slow;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void TSingleLinkedList<T>::ResetList() {
|
||||
// Clear the list to an empty state
|
||||
this->head->SetNext(nullptr);
|
||||
this->tail = this->head;
|
||||
this->size = 0;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void TSingleLinkedList<T>::Merge(TSingleLinkedList<T>& aOtherList) {
|
||||
// If the other list is empty, there's nothing to do.
|
||||
if (aOtherList.IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If this list is empty, take ownership of the other list's nodes.
|
||||
if (this->IsEmpty()) {
|
||||
this->head->SetNext(aOtherList.head->GetNext());
|
||||
this->tail = aOtherList.tail;
|
||||
this->size = aOtherList.size;
|
||||
|
||||
// Clear the other list
|
||||
aOtherList.head->SetNext(nullptr);
|
||||
aOtherList.tail = aOtherList.head;
|
||||
aOtherList.size = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
// Pointers to the current nodes in each list
|
||||
TNode<T>* p1 = this->head->GetNext();
|
||||
TNode<T>* p2 = aOtherList.head->GetNext();
|
||||
|
||||
// Use the dummy head of `this` list to start building the merged result.
|
||||
TNode<T>* tail = this->head;
|
||||
|
||||
// --- Main Loop: Traverse both lists and pick the smaller node ---
|
||||
while (p1 != nullptr && p2 != nullptr) {
|
||||
if (p1->GetData() <= p2->GetData()) {
|
||||
tail->SetNext(p1);
|
||||
p1 = p1->GetNext();
|
||||
}
|
||||
else {
|
||||
tail->SetNext(p2);
|
||||
p2 = p2->GetNext();
|
||||
}
|
||||
tail = tail->GetNext();
|
||||
}
|
||||
|
||||
// --- Append the Remainder ---
|
||||
tail->SetNext(p1 != nullptr ? p1 : p2);
|
||||
|
||||
// --- Update the Tail Pointer ---
|
||||
while (tail->GetNext() != nullptr) {
|
||||
tail = tail->GetNext();
|
||||
}
|
||||
this->tail = tail;
|
||||
|
||||
// --- Update Size ---
|
||||
this->size += aOtherList.size;
|
||||
|
||||
// --- Clear the Other List ---
|
||||
aOtherList.ResetList();
|
||||
}
|
||||
|
||||
// --- End of TSingleLinkedList class ---
|
||||
|
||||
#endif // !TSINGLELINKEDLIST_HPP
|
||||
@@ -1,309 +0,0 @@
|
||||
#pragma once
|
||||
#include <stdexcept> // For std::runtime_error
|
||||
#include <string> // For std::to_string
|
||||
|
||||
// Linked List using TNode<T> class with constructor and destructor
|
||||
template <typename T>
|
||||
class TNode {
|
||||
private:
|
||||
T data; // Data of type T (e.g., TSong*)
|
||||
TNode* next; // Pointer to the next node
|
||||
TNode* prev; // Pointer to the previous node
|
||||
public:
|
||||
// Constructor
|
||||
|
||||
TNode(T aData);
|
||||
|
||||
// Destructor
|
||||
~TNode();
|
||||
|
||||
// Getters
|
||||
T GetData() const { return data; }
|
||||
TNode* GetNext() const { return next; }
|
||||
TNode* GetPrev() const { return prev; }
|
||||
|
||||
// Setters
|
||||
void SetNext(TNode* aNextNode) { next = aNextNode; }
|
||||
void SetPrev(TNode* aPrevNode) { prev = aPrevNode; }
|
||||
};
|
||||
|
||||
// --- Method Implementations ---
|
||||
// Constructor: Initializes the node with data from the factory function
|
||||
template <typename T>
|
||||
TNode<T>::TNode(T aData) : data(aData), next(nullptr), prev(nullptr) {}
|
||||
|
||||
// Destructor: Deletes the data pointer
|
||||
template <typename T>
|
||||
TNode<T>::~TNode() {
|
||||
//Do not delete data, data may exist outside the list
|
||||
data = nullptr; // Set data to nullptr to avoid dangling pointer
|
||||
next = nullptr; // Set next to nullptr to avoid dangling pointer
|
||||
prev = nullptr; // Set prev to nullptr to avoid dangling pointer
|
||||
}
|
||||
|
||||
// --- End of TNode class ---
|
||||
|
||||
// Type defined function for data factory
|
||||
template <typename T, typename TArgs>
|
||||
using FDataFactory = T(*)(TArgs);
|
||||
|
||||
// Type defined functions for TLinkedList
|
||||
template <typename T>
|
||||
using FCheckNode = bool(*)(const T, const T);
|
||||
|
||||
template <typename T>
|
||||
using FVisitNode = void(*)(const T, int);
|
||||
|
||||
// Linked List TLinkedList using TNode<T> and dummy node
|
||||
template <typename T>
|
||||
class TLinkedList {
|
||||
private:
|
||||
TNode<T>* head; // Pointer to the dummy head node
|
||||
TNode<T>* tail; // Pointer to the tail node
|
||||
int size; // Current size of the list
|
||||
bool isDataOwner; // Indicates if the list owns the data and should delete it
|
||||
|
||||
void InternAppend(T);
|
||||
void InternPrepend(T);
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
TLinkedList(bool);
|
||||
// Destructor
|
||||
~TLinkedList();
|
||||
|
||||
// Core Linked List Operations
|
||||
template <typename TArgs>
|
||||
T Append(FDataFactory<T, TArgs>, TArgs);
|
||||
void Append(T);
|
||||
|
||||
template <typename TArgs>
|
||||
T Prepend(FDataFactory<T, TArgs>, TArgs);
|
||||
void Prepend(T aValue);
|
||||
|
||||
T GetAtIndex(int aIndex);
|
||||
void Remove(const T aValue);
|
||||
|
||||
// Finding and Checking Operations
|
||||
bool Contains(const T aValue) const;
|
||||
T Search(const T aValue, FCheckNode<T> checkNode = nullptr) const;
|
||||
|
||||
// Loop Operations
|
||||
void ForEach(FVisitNode<T> aVisitNode) const;
|
||||
|
||||
// Helper Functions
|
||||
int GetSize() const;
|
||||
bool IsEmpty() const;
|
||||
void Reverse();
|
||||
};
|
||||
|
||||
// --- Method Implementations ---
|
||||
// Constructor: Initializes the dummy head node and tail
|
||||
template <typename T>
|
||||
TLinkedList<T>::TLinkedList(bool aIsDataOwner) : size(0) {
|
||||
isDataOwner = aIsDataOwner;
|
||||
head = new TNode<T>(nullptr); // Create a dummy head node
|
||||
tail = head; // Initially, tail is the same as head
|
||||
}
|
||||
|
||||
// Destructor: Deletes all nodes in the list
|
||||
template <typename T>
|
||||
TLinkedList<T>::~TLinkedList() {
|
||||
TNode<T>* current = head;
|
||||
while (current != nullptr) {
|
||||
TNode<T>* nextNode = current->GetNext();
|
||||
if (isDataOwner && current->GetData() != nullptr) {
|
||||
delete current->GetData(); // Delete the data if the list owns it
|
||||
}
|
||||
delete current; // Free the current node
|
||||
current = nextNode; // Move to the next node
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void TLinkedList<T>::InternAppend(T aData) {
|
||||
TNode<T>* newNode = new TNode<T>(aData);
|
||||
newNode->SetPrev(tail); // Set the prev pointer of the new node
|
||||
tail->SetNext(newNode); // Update the next pointer of the current tail
|
||||
tail = newNode; // Update the tail to the new node
|
||||
size++;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void TLinkedList<T>::InternPrepend(T aData) {
|
||||
TNode<T>* newNode = new TNode<T>(aData);
|
||||
newNode->SetNext(head->GetNext());
|
||||
if (head->GetNext() != nullptr) {
|
||||
head->GetNext()->SetPrev(newNode); // Update the prev pointer of the first node
|
||||
}
|
||||
head->SetNext(newNode);
|
||||
newNode->SetPrev(head); // Set the prev pointer of the new node
|
||||
if (tail == head) {
|
||||
tail = newNode;
|
||||
}
|
||||
size++;
|
||||
}
|
||||
|
||||
|
||||
// Append(): Adds a new node with the given factory and returns the new node's data
|
||||
template <typename T>
|
||||
template <typename TArgs>
|
||||
T TLinkedList<T>::Append(FDataFactory<T, TArgs> aDataFactory, TArgs aArgs) {
|
||||
if(aDataFactory == nullptr) {
|
||||
return nullptr; // Return nullptr if no factory is provided
|
||||
}
|
||||
T newData = aDataFactory(aArgs);
|
||||
InternAppend(newData);
|
||||
return newData;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void TLinkedList<T>::Append(T aValue) {
|
||||
InternAppend(aValue);
|
||||
}
|
||||
|
||||
// Prepend(): Adds a new node with the given factory to the beginning of the list
|
||||
template <typename T>
|
||||
template <typename TArgs>
|
||||
T TLinkedList<T>::Prepend(FDataFactory<T, TArgs> aDataFactory, TArgs aArgs) {
|
||||
if (aDataFactory == nullptr) {
|
||||
return nullptr; // Return nullptr if no factory is provided
|
||||
}
|
||||
T newData = aDataFactory(aArgs);
|
||||
InternPrepend(newData);
|
||||
return newData;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void TLinkedList<T>::Prepend(T aValue) {
|
||||
InternPrepend(aValue);
|
||||
}
|
||||
|
||||
// GetAtIndex(): Returns the value at the specified index
|
||||
template <typename T>
|
||||
T TLinkedList<T>::GetAtIndex(int aIndex) {
|
||||
if (aIndex < 0 || aIndex >= size) {
|
||||
return nullptr; // Return nullptr if index is out of bounds
|
||||
}
|
||||
TNode<T>* current;
|
||||
if (aIndex < size / 2) {
|
||||
current = head->GetNext();
|
||||
for (int i = 0; i < aIndex; i++) {
|
||||
current = current->GetNext();
|
||||
}
|
||||
}
|
||||
else {
|
||||
current = tail;
|
||||
for (int i = size - 1; i > aIndex; i--) {
|
||||
current = current->GetPrev();
|
||||
}
|
||||
}
|
||||
return current->GetData(); // Return the data directly
|
||||
}
|
||||
|
||||
// Remove(): Removes the first node with the given value
|
||||
template <typename T>
|
||||
void TLinkedList<T>::Remove(const T aValue) {
|
||||
TNode<T>* current = head->GetNext();
|
||||
while (current != nullptr) {
|
||||
if (current->GetData() == aValue) {
|
||||
TNode<T>* nodeToDelete = current;
|
||||
if (current->GetPrev() != nullptr) {
|
||||
current->GetPrev()->SetNext(current->GetNext());
|
||||
}
|
||||
if (current->GetNext() != nullptr) {
|
||||
current->GetNext()->SetPrev(current->GetPrev());
|
||||
}
|
||||
if (nodeToDelete == tail) {
|
||||
tail = current->GetPrev();
|
||||
}
|
||||
|
||||
if (isDataOwner && nodeToDelete->GetData() != nullptr) {
|
||||
delete nodeToDelete->GetData(); // Delete the data if the list owns it
|
||||
}
|
||||
delete nodeToDelete;
|
||||
size--;
|
||||
return;
|
||||
}
|
||||
current = current->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
// Contains(): Checks if the list contains the given value
|
||||
template <typename T>
|
||||
bool TLinkedList<T>::Contains(const T aValue) const {
|
||||
TNode<T>* current = head->GetNext();
|
||||
while (current != nullptr) {
|
||||
if (current->GetData() == aValue) {
|
||||
return true;
|
||||
}
|
||||
current = current->GetNext();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Search(): Searches for a node with the given value using an optional check function
|
||||
template <typename T>
|
||||
T TLinkedList<T>::Search(const T aValue, FCheckNode<T> checkNode) const {
|
||||
TNode<T>* current = head->GetNext();
|
||||
while (current != nullptr) {
|
||||
if (checkNode == nullptr) {
|
||||
if (current->GetData() == aValue) {
|
||||
return current->GetData();
|
||||
}
|
||||
} else {
|
||||
if (checkNode(current->GetData(), aValue)) {
|
||||
return current->GetData();
|
||||
}
|
||||
}
|
||||
current = current->GetNext();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ForEach(): Applies a function to each node in the list
|
||||
template <typename T>
|
||||
void TLinkedList<T>::ForEach(FVisitNode<T> aVisitNode) const {
|
||||
if (aVisitNode == nullptr) {
|
||||
return; // Return if no visit function is provided
|
||||
}
|
||||
TNode<T>* current = head->GetNext();
|
||||
int index = 0;
|
||||
while (current != nullptr) {
|
||||
aVisitNode(static_cast<const T>(current->GetData()), index); // Cast to const T
|
||||
current = current->GetNext();
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
// Reverse(): Reverses the order of the nodes in the list
|
||||
template <typename T>
|
||||
void TLinkedList<T>::Reverse() {
|
||||
TNode<T>* current = head->GetNext();
|
||||
TNode<T>* temp = nullptr; // Temporary pointer for swapping
|
||||
|
||||
// Handle an empty or single-node list
|
||||
if (current == nullptr || current->GetNext() == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Iterate and swap next and prev pointers
|
||||
while (current != nullptr) {
|
||||
temp = current->GetPrev(); // Store prev pointer
|
||||
current->SetPrev(current->GetNext()); // Set prev to next
|
||||
current->SetNext(temp); // Set next to temp (which holds original prev)
|
||||
current = current->GetPrev(); // Move to the original next node
|
||||
}
|
||||
|
||||
// Update head and tail
|
||||
TNode<T>* newHeadNext = tail; // The original tail becomes the new head->next
|
||||
tail = head->GetNext(); // The original first node is now the tail
|
||||
tail->SetNext(nullptr); // Ensure the new tail has no next pointer
|
||||
head->SetNext(newHeadNext); // Set the head's next to the new first node
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
int TLinkedList<T>::GetSize() const {
|
||||
return size;
|
||||
}
|
||||
// --- End of TLinkedList class ---
|
||||
@@ -1,73 +0,0 @@
|
||||
#pragma once
|
||||
#include <stdexcept> // For std::runtime_error
|
||||
|
||||
template <typename T, int MAX_SIZE>
|
||||
class TQueue {
|
||||
private:
|
||||
T data[MAX_SIZE]; // A static array of T with MAX_SIZE elements
|
||||
int frontIndex; // The index of the front element
|
||||
int rearIndex; // The index of the rear element
|
||||
int count; // Current number of elements in the queue
|
||||
public:
|
||||
// Constructor
|
||||
TQueue();
|
||||
// No destructor is needed since we aren't using 'new'
|
||||
// --- Core Queue Operations ---
|
||||
void Enqueue(const T& aElement);
|
||||
T Dequeue();
|
||||
T GetFront() const;
|
||||
// --- Helper Functions ---
|
||||
int size() const;
|
||||
bool IsEmpty() const;
|
||||
bool IsFull() const;
|
||||
};
|
||||
// --- Method Implementations ---
|
||||
// Constructor: Initializes the front and rear indices
|
||||
template <typename T, int MAX_SIZE>
|
||||
TQueue<T, MAX_SIZE>::TQueue() : frontIndex(0), rearIndex(-1), count(0) {
|
||||
// No memory allocation is needed
|
||||
}
|
||||
// enqueue(): Adds an element to the rear of the queue
|
||||
template <typename T, int MAX_SIZE>
|
||||
void TQueue<T, MAX_SIZE>::Enqueue(const T& aElement) {
|
||||
if (IsFull()) {
|
||||
throw std::runtime_error("Queue overflow: cannot enqueue to a full queue.");
|
||||
}
|
||||
rearIndex = (rearIndex + 1) % MAX_SIZE; // Circular increment
|
||||
data[rearIndex] = aElement;
|
||||
count++;
|
||||
}
|
||||
// dequeue(): Removes and returns the front element
|
||||
template <typename T, int MAX_SIZE>
|
||||
T TQueue<T, MAX_SIZE>::Dequeue() {
|
||||
if (IsEmpty()) {
|
||||
throw std::runtime_error("Queue underflow: cannot dequeue from an empty queue.");
|
||||
}
|
||||
T frontElement = data[frontIndex];
|
||||
frontIndex = (frontIndex + 1) % MAX_SIZE; // Circular increment
|
||||
count--;
|
||||
return frontElement;
|
||||
}
|
||||
// getFront(): Returns the front element without removing it
|
||||
template <typename T, int MAX_SIZE>
|
||||
T TQueue<T, MAX_SIZE>::GetFront() const {
|
||||
if (IsEmpty()) {
|
||||
throw std::runtime_error("Queue is empty: cannot get front.");
|
||||
}
|
||||
return data[frontIndex];
|
||||
}
|
||||
// size(): Returns the current number of elements
|
||||
template <typename T, int MAX_SIZE>
|
||||
int TQueue<T, MAX_SIZE>::size() const {
|
||||
return count;
|
||||
}
|
||||
// isEmpty(): Checks if the queue is empty
|
||||
template <typename T, int MAX_SIZE>
|
||||
bool TQueue<T, MAX_SIZE>::IsEmpty() const {
|
||||
return count == 0;
|
||||
}
|
||||
// isFull(): Checks if the queue is full
|
||||
template <typename T, int MAX_SIZE>
|
||||
bool TQueue<T, MAX_SIZE>::IsFull() const {
|
||||
return count == MAX_SIZE;
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
#pragma once
|
||||
#include <stdexcept> // For std::runtime_error
|
||||
|
||||
// The template now takes a type 'T' and an integer 'MAX_SIZE'
|
||||
template <typename T, int MAX_SIZE>
|
||||
class TStack {
|
||||
private:
|
||||
T data[MAX_SIZE]; // A static array of T with MAX_SIZE elements
|
||||
int topIndex; // The index of the top element (-1 if empty)
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
TStack();
|
||||
|
||||
// No destructor is needed since we aren't using 'new'
|
||||
|
||||
// --- Core Stack Operations ---
|
||||
void Push(const T& aElement);
|
||||
T Pop();
|
||||
T Peek() const;
|
||||
|
||||
// --- Helper Functions ---
|
||||
int GetSize() const;
|
||||
bool IsEmpty() const;
|
||||
bool IsFull() const;
|
||||
};
|
||||
|
||||
// --- Method Implementations ---
|
||||
|
||||
// Constructor: Just initializes the top index
|
||||
template <typename T, int MAX_SIZE>
|
||||
TStack<T, MAX_SIZE>::TStack() : topIndex(-1) {
|
||||
// No memory allocation is needed
|
||||
}
|
||||
|
||||
// push(): Adds an element to the top
|
||||
template <typename T, int MAX_SIZE>
|
||||
void TStack<T, MAX_SIZE>::Push(const T& aElement) {
|
||||
if (IsFull()) {
|
||||
throw std::runtime_error("Stack overflow: cannot push to a full stack.");
|
||||
}
|
||||
data[++topIndex] = aElement;
|
||||
}
|
||||
|
||||
// pop(): Removes and returns the top element
|
||||
template <typename T, int MAX_SIZE>
|
||||
T TStack<T, MAX_SIZE>::Pop() {
|
||||
if (IsEmpty()) {
|
||||
throw std::runtime_error("Stack underflow: cannot pop from an empty stack.");
|
||||
}
|
||||
return data[topIndex--];
|
||||
}
|
||||
|
||||
// peek(): Returns the top element without removing it
|
||||
template <typename T, int MAX_SIZE>
|
||||
T TStack<T, MAX_SIZE>::Peek() const {
|
||||
if (IsEmpty()) {
|
||||
throw std::runtime_error("Stack is empty: cannot peek.");
|
||||
}
|
||||
return data[topIndex];
|
||||
}
|
||||
|
||||
// size(): Returns the current number of elements
|
||||
template <typename T, int MAX_SIZE>
|
||||
int TStack<T, MAX_SIZE>::GetSize() const {
|
||||
return topIndex + 1;
|
||||
}
|
||||
|
||||
// isEmpty(): Checks if the stack is empty
|
||||
template <typename T, int MAX_SIZE>
|
||||
bool TStack<T, MAX_SIZE>::IsEmpty() const {
|
||||
return topIndex == -1;
|
||||
}
|
||||
|
||||
// isFull(): Checks if the stack is full
|
||||
template <typename T, int MAX_SIZE>
|
||||
bool TStack<T, MAX_SIZE>::IsFull() const {
|
||||
return topIndex == MAX_SIZE - 1;
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "option1.h"
|
||||
#include <limits>
|
||||
|
||||
#include "SharedLib.h"
|
||||
|
||||
// Entry point for Category 3, Option 1.
|
||||
// Demonstrates:
|
||||
// 1) Building a BST of 200 employees from DATA/random_names.txt
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
# This block defines the parameters the script can accept from the command line.
|
||||
param (
|
||||
# The full path to the build directory where the .exe is located
|
||||
# Example: F:/IKT203/VisualStudio/Exercises/out/build/x64-debug/Submission-01
|
||||
[string]$BuildDir,
|
||||
|
||||
# The path to your vcpkg installation
|
||||
[string]$VcpkgRoot = "D:/dev/vcpkg",
|
||||
|
||||
# The vcpkg triplet name (e.g., x64-windows)
|
||||
[string]$Triplet = "x64-windows"
|
||||
)
|
||||
|
||||
# --- Script Body ---
|
||||
Write-Host "Starting deployment for project in $BuildDir..." -ForegroundColor Green
|
||||
|
||||
# Define the source paths using the parameters.
|
||||
# Path to the main Qt DLLs (e.g., .../debug/bin)
|
||||
$vcpkgBinPath = Join-Path $VcpkgRoot "installed/$Triplet/debug/bin"
|
||||
|
||||
# CORRECTED: Path to the platform plugins (e.g., .../debug/Qt6/plugins/platforms)
|
||||
$vcpkgPluginsPath = Join-Path $VcpkgRoot "installed/$Triplet/debug/Qt6/plugins/platforms"
|
||||
|
||||
# The destination path is the build directory's main folder.
|
||||
$destinationPath = $BuildDir
|
||||
|
||||
# Check if the destination directory exists.
|
||||
if (-not (Test-Path $destinationPath)) {
|
||||
Write-Host "Error: Build directory not found at $destinationPath" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
# --- Copy Main DLLs ---
|
||||
# List the essential DLLs your project needs.
|
||||
$qtDlls = @(
|
||||
"Qt6Cored.dll",
|
||||
"Qt6Guid.dll",
|
||||
"Qt6Widgetsd.dll"
|
||||
)
|
||||
|
||||
Write-Host "Copying main Qt DLLs to $destinationPath"
|
||||
foreach ($dll in $qtDlls) {
|
||||
$sourceDll = Join-Path $vcpkgBinPath $dll
|
||||
Copy-Item -Path $sourceDll -Destination $destinationPath -Force
|
||||
}
|
||||
|
||||
# --- Copy Platform Plugin ---
|
||||
# Create the "platforms" subdirectory if it doesn't exist.
|
||||
$pluginDestPath = Join-Path $destinationPath "platforms"
|
||||
if (-not (Test-Path $pluginDestPath)) {
|
||||
New-Item -ItemType Directory -Path $pluginDestPath
|
||||
}
|
||||
|
||||
Write-Host "Copying platform plugin to $pluginDestPath"
|
||||
$sourcePlugin = Join-Path $vcpkgPluginsPath "qwindowsd.dll"
|
||||
Copy-Item -Path $sourcePlugin -Destination $pluginDestPath -Force
|
||||
|
||||
Write-Host "Deployment complete!" -ForegroundColor Green
|
||||
8
TheAlgorithmicOrganizer/.idea/.gitignore
generated
vendored
Normal file
8
TheAlgorithmicOrganizer/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
2
TheAlgorithmicOrganizer/.idea/TheAlgoeithmicOrganizer.iml
generated
Normal file
2
TheAlgorithmicOrganizer/.idea/TheAlgoeithmicOrganizer.iml
generated
Normal file
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module classpath="CMake" type="CPP_MODULE" version="4" />
|
||||
343
TheAlgorithmicOrganizer/.idea/editor.xml
generated
Normal file
343
TheAlgorithmicOrganizer/.idea/editor.xml
generated
Normal file
@@ -0,0 +1,343 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="BackendCodeEditorSettings">
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CDeclarationWithImplicitIntType/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConstevalIfIsAlwaysConstant/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractClassWithoutSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractVirtualFunctionCallInCtor/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAccessSpecifierWithNoDeclarations/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAwaiterTypeIsNotClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBooleanIncrementExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatBadCode/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatLegacyCode/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatMixedArgs/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooFewArgs/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCompileTimeConstantCanBeReplacedWithBooleanConstant/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConceptNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConditionalExpressionCanBeSimplified/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstValueFunctionReturnType/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCoroutineCallResolveError/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAArrayIndexOutOfBounds/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantConditions/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantFunctionResult/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantParameter/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFADeletedPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAEndlessLoop/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInfiniteRecursion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInvalidatedMemory/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesScope/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALoopConditionNotUpdated/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAMemoryLeak/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANotInitializedField/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANullDereference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFATimeOver/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableCode/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableFunctionCall/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreadVariable/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnusedValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesLocal/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesUncapturedLocal/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationSpecifierWithoutDeclarators/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorDisambiguatedAsFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorUsedBeforeInitialization/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultCaseNotHandledInSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultInitializationWithNoUserConstructor/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultIsUsedAsIdentifier/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultedSpecialMemberFunctionIsImplicitlyDeleted/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeletingVoidPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTemplateWithoutTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTypeWithoutTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedEntity/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedOverridenMethod/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedRegisterStorageClassSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDereferenceOperatorLimitExceeded/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDiscardedPostfixOperatorResult/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenSyntaxError/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUndocumentedParameter/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUnresolvedReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEmptyDeclaration/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersOrder/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersPlacement/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceDoStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceForStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceFunctionDeclarationStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceIfStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceNestedNamespacesStyle/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingDestructorStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingFunctionStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceTypeAliasCodeStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceWhileStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityAssignedButNoRead/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityUsedOnlyInUnevaluatedContext/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnumeratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEqualOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEvaluationFailure/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExplicitSpecializationInNonNamespaceScope/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExpressionWithoutSideEffects/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalFunctionInFinalClass/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalNonOverridingVirtualFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForLoopCanBeReplacedWithWhile/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForwardEnumDeclarationWithoutUnderlyingType/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionDoesntReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionResultShouldBeUsed/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionalStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHeaderHasBeenAlreadyIncluded/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHiddenFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHidingFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIdenticalOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIfCanBeReplacedByConstexprIf/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppImplicitDefaultConstructorNotAvailable/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompatiblePointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompleteSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInconsistentNaming/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIntegralToPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInvalidLineContinuation/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppJoinDeclarationAndAssignment/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLambdaCaptureNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableWithNonTrivialDtorIsNeverUsed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLongFloat/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeConst/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeStatic/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberInitializersOrder/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMismatchedClassTags/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingIncludeGuard/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingKeywordThrow/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppModulePartitionWithSeveralPartitionUnits/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtAddressOfClassRValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtBindingRValueToLvalueReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtCopyElisionInCopyInitDeclarator/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtDoubleUserConversionInCopyInit/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtNotInitializedStaticConstLocalVar/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtReinterpretCastFromNullptr/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterLiteral/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterWideLiteral/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMustBePublicVirtualToImplementInterface/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMutableSpecifierOnReferenceMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNoDiscardExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNodiscardFunctionWithoutReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExceptionSafeResourceAcquisition/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConversionOperator/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConvertingConstructor/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineFunctionDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineVariableDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNotAllPathsReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppObjectMemberMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppOutParameterMustBeWritten/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConstPtrOrRef/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNamesMismatch/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPassValueParameterByConstReference/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerConversionDropsQualifiers/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerToIntegralConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPolymorphicClassWithNonVirtualPublicDestructor/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyErroneousEmptyStatements/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUnintendedObjectSlicing/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderIsNotIncluded/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderNotFound/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfBadFormat/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfExtraArg/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfMissedArg/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfRiskyFormat/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrivateSpecialMemberFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRangeBasedForIncompatibleReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedefinitionOfDefaultArgumentInOverrideFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBooleanExpressionArgument/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantCastExpression/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantComplexityInComparison/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConditionalExpression/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConstSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantControlFlowJump/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantDereferencingAndTakingAddress/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElaboratedTypeSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeyword/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeywordInsideCompoundStatement/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyDeclaration/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyStatement/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantExportKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantFwdClassOrEnumSpecifier/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantInlineSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantLambdaParameterList/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantMemberInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantNamespaceDefinition/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantParentheses/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifierADL/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnMemberAllocationFunction/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnThreadLocalLocalVariable/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateArguments/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantVoidArgumentList/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantZeroInitializerInAggregateInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReinterpretCastFromVoidPtr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRemoveRedundantBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceMemsetWithZeroInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceTieWithStructuredBinding/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReturnNoValueInNonVoidFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSmartPointerVsMakeFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSomeObjectMembersMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSpecialFunctionWithoutNoexceptSpecification/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticAssertFailure/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticDataMemberInUnnamedStruct/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticSpecifierOnAnonymousNamespaceMember/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStringLiteralToCharPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTabsAreDisallowed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateArgumentsCanBeDeduced/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterShadowing/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppThrowExpressionCanBeReplacedWithRethrow/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScope/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScopeInitStatement/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTypeAliasNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedDependentBaseClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedNonStaticDataMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnionMemberOfReferenceType/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaEndRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnamedNamespaceInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnecessaryWhitespace/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnsignedZeroComparison/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnusedIncludeDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAlgorithmWithCount/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAssociativeContains/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAuto/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAutoForNumeric/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseElementsView/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseEraseAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseFamiliarTemplateSyntaxForGenericLambdas/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseRangeAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStdSize/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStructuredBinding/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseTypeTraitAlias/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUserDefinedLiteralSuffixDoesNotStartWithUnderscore/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUsingResultOfAssignmentAsCondition/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVariableCanBeMadeConstexpr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionCallInsideCtor/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionInFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVolatileParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWarningDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongIncludesOrder/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongSlashesInIncludeDirective/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroConstantCanBeReplacedWithNullptr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroValuedExpressionUsedAsNullPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IdentifierTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IfStdIsConstantEvaluatedCanBeReplaced/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StdIsConstantEvaluatedWillAlwaysEvaluateToConstant/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppClangFormat/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_ARGUMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_BINARY_EXPRESSIONS_CHAIN/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_CALLS_CHAIN/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXPRESSION/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXTENDS_LIST/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_FOR_STMT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_PARAMETER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_ARGUMENT/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_PARAMETER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTIPLE_DECLARATION/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_TERNARY/@EntryValue" value="ALIGN_ALL" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_CLASS_DEFINITION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_DECLARATIONS/@EntryValue" value="0" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DECLARATION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DEFINITION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BREAK_TEMPLATE_DECLARATION/@EntryValue" value="LINE_BREAK" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CASE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CONTINUOUS_LINE_INDENT/@EntryValue" value="Double" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/FREE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_ACCESS_SPECIFIERS_FROM_CLASS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CASE_FROM_SWITCH/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CLASS_MEMBERS_FROM_ACCESS_SPECIFIERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_COMMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_SIZE/@EntryValue" value="4" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_STYLE/@EntryValue" value="Space" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INITIALIZER_BRACES/@EntryValue" value="END_OF_LINE_NO_SPACE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INT_ALIGN_EQ/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_CODE/@EntryValue" value="2" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue" value="2" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_USER_LINEBREAKS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINE_BREAK_AFTER_COLON_IN_MEMBER_INITIALIZER_LISTS/@EntryValue" value="ON_SINGLE_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/MEMBER_INITIALIZER_LIST_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_INDENTATION/@EntryValue" value="All" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/OTHER_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_CATCH_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_ELSE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_NAMESPACE_DEFINITIONS_ON_SAME_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_WHILE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SIMPLE_BLOCK_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_SEMICOLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_METHOD/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_NESTED_DECLARATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_METHOD/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_UNARY_OPERATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_COLON/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_SEMICOLON/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_METHOD/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_METHOD/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BETWEEN_CLOSING_ANGLE_BRACKETS_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_ARRAY_ACCESS_BRACKETS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_DECLARATION_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_BLOCKS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_METHOD_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPECIAL_ELSE_IF_TREATMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TAB_WIDTH/@EntryValue" value="4" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TYPE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_BINARY_OPSIGN/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_ARGUMENTS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_RPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_RPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_TERNARY_OPSIGNS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_PARAMETERS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
|
||||
<option name="/Default/CodeStyle/EditorConfig/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
|
||||
</component>
|
||||
</project>
|
||||
12
TheAlgorithmicOrganizer/.idea/material_theme_project_new.xml
generated
Normal file
12
TheAlgorithmicOrganizer/.idea/material_theme_project_new.xml
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MaterialThemeProjectNewConfig">
|
||||
<option name="metadata">
|
||||
<MTProjectMetadataState>
|
||||
<option name="migrated" value="true" />
|
||||
<option name="pristineConfig" value="false" />
|
||||
<option name="userId" value="54f3be3a:19a5567208e:-7ffe" />
|
||||
</MTProjectMetadataState>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
7
TheAlgorithmicOrganizer/.idea/misc.xml
generated
Normal file
7
TheAlgorithmicOrganizer/.idea/misc.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CMakePythonSetting">
|
||||
<option name="pythonIntegrationState" value="YES" />
|
||||
</component>
|
||||
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
|
||||
</project>
|
||||
8
TheAlgorithmicOrganizer/.idea/modules.xml
generated
Normal file
8
TheAlgorithmicOrganizer/.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/TheAlgoeithmicOrganizer.iml" filepath="$PROJECT_DIR$/.idea/TheAlgoeithmicOrganizer.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
6
TheAlgorithmicOrganizer/.idea/vcs.xml
generated
Normal file
6
TheAlgorithmicOrganizer/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
Reference in New Issue
Block a user