Skip to content

Fix: Cleanups #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions code/Random/RandomGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ RandomGenerator::RandomGenerator( GeneratorType type ) noexcept :
::srand( static_cast<unsigned int>(time(nullptr)));
}

RandomGenerator::~RandomGenerator() {
// empty
}

int RandomGenerator::get( int lower, int upper ) {
int ret( 0 );
if ( GeneratorType::Standard == m_type ) {
Expand Down
2 changes: 1 addition & 1 deletion include/cppcore/Common/TBitField.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace cppcore {
/// @class TBitField
/// @ingroup CPPCore
///
/// @brief
/// @brief Container to handle specific bitfields.
//-------------------------------------------------------------------------------------------------
template <class T>
class TBitField {
Expand Down
34 changes: 19 additions & 15 deletions include/cppcore/Container/THashMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
namespace cppcore {

//-------------------------------------------------------------------------------------------------
/// @class THashMap
/// @ingroup CPPCore
/// @class THashMap
/// @ingroup CPPCore
///
/// @brief This class implements a hash map.
///
/// You can work with the hashmap in the following way:
///
/// @brief This class implements a hash map. You can access your data like:
/// @code
/// using TestHashMap = THashMap<int, String>:
/// TestHashMap hm;
Expand All @@ -44,6 +47,7 @@ namespace cppcore {
template <class T, class U, class TAlloc = TDefaultAllocator<T>>
class THashMap {
public:
/// The alias
using Hash = THash<T>;

/// @brief The initial hash size.
Expand All @@ -54,7 +58,7 @@ class THashMap {
public:
/// @brief The class constructor.
/// @param init [in] The initial size for the hash.
THashMap(size_t init = InitSize);
explicit THashMap(size_t init = InitSize);

/// @brief The class destructor.
~THashMap();
Expand All @@ -71,36 +75,36 @@ class THashMap {
/// @return true for empty, false for not empty.
bool isEmpty() const;

/// @brief Will init the hash-map.
/// @param init [in] The initial size for the hash.
/// @brief Will init the hash-map with the given size.
/// @param[in] init The initial size for the hash.
void init(size_t init);

/// @brief The hash-map will be cleared.
/// @brief The hash-map will be cleared.
void clear();

/// @brief A new key value pair will be entered.
/// @param key [in] The key.
/// @param value [in] The value to store.
/// @brief A new key value pair will be entered.
/// @param[in] key The key.
/// @param[in] value The value to store.
void insert(const T &key, const U &value);

/// @brief Will remove a given key-value pair form the hash-map.
/// @param key [in] The key to look for.
/// @param[in] key The key to look for.
/// @return true, if key-value pair was found and removed.
bool remove(const T &key);

/// @brief Looks for a given key and returns true, if a key-value pair is stored in the list.
/// @param key [in] The key to look for.
/// @param[in] key The key to look for.
/// @return true, if key-value pair was found.
bool hasKey(const T &key) const;

/// @brief Returns the assigned value for the given key.
/// @param key [in] The key to look for.
/// @param value [in] The value, unset when no key-value pair was found.
/// @param[in] key The key to look for.
/// @param[in] value The value, unset when no key-value pair was found.
/// @return true, if key-value pair was found, false if not.
bool getValue(const T &key, U &value) const;

/// @brief Returns the assigned value for the given key.
/// @param key [in] The key to look for.
/// @param[in] key The key to look for.
/// @return The value, will unset when no key-value pair was found.
U &operator[](const T &key) const;

Expand Down
14 changes: 7 additions & 7 deletions include/cppcore/Container/TQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
namespace cppcore {

//-------------------------------------------------------------------------------------------------
/// @class TQueue
/// @ingroup CPPCore
/// @class TQueue
/// @ingroup CPPCore
///
/// @brief This template class implements a simple queue ( works FIFO ).
/// @brief This template class implements a simple queue ( works FIFO ).
//-------------------------------------------------------------------------------------------------
template<class T, class TAlloc = TDefaultAllocator<T>>
class TQueue {
Expand All @@ -41,7 +41,7 @@ class TQueue {

/// @brief The class copy constructor.
/// @param rhs [in] The instance to copy from.
TQueue( const TQueue<T, TAlloc> &rhs );
TQueue(const TQueue<T, TAlloc> &rhs );

/// @brief The destructor.
~TQueue();
Expand Down Expand Up @@ -109,9 +109,9 @@ inline bool TQueue<T, TAlloc>::dequeue( T &item ) {
m_QueueData.removeFront();
if ( isEmpty() ) {
return false;
} else {
return true;
}
}

return true;
}

template<class T, class TAlloc>
Expand Down
23 changes: 12 additions & 11 deletions include/cppcore/Container/TStaticArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,41 +28,42 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
namespace cppcore {

//-------------------------------------------------------------------------------------------------
/// @class TArray
/// @ingroup CPPCore
/// @class TArray
/// @ingroup CPPCore
///
/// @brief This template class implements a simple array with dynamic boundaries.
///
/// @brief This template class implements a simple array with dynamic boundaries.
/// You can use it to add new items, remove them and iterate through them. The data items are
/// stores in an array.
//-------------------------------------------------------------------------------------------------
template <class T, size_t len>
class TStaticArray {
public:
/// @brief The default class constructor.
/// @brief The default class constructor.
TStaticArray();

/// @brief The class constructor with the initial value.
/// @param initValue [in] The initial value.
TStaticArray(T initValue);
/// @param[in] initValue The initial value.
explicit TStaticArray(T initValue);

/// @brief The copy constructor.
/// @brief The copy constructor.
/// @param rhs [in] The array to copy from.
TStaticArray(const TStaticArray<T, len> &rhs);

/// @brief The class destructor.
~TStaticArray() = default;

/// @brief Returns the number of items in the array.
/// @retun The size of the array.
/// @return The size of the array.
size_t size() const;

/// @brief Will set the item at the given index.
/// @param index [in] The requested index.
/// @param value [in] The new value.
/// @param[in] index The requested index.
/// @param[in] value The new value.
void set(size_t index, T value);

/// @brief Will set all values to the same value.
/// @param value. [in] The value to set.
/// @param[in] value The value to set.
void memset(T value);

/// @brief The index op.
Expand Down
2 changes: 1 addition & 1 deletion include/cppcore/Random/RandomGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class DLL_CPPCORE_EXPORT RandomGenerator {
RandomGenerator( GeneratorType type = GeneratorType::Standard ) noexcept;

/// @brief The class destructor.
~RandomGenerator();
~RandomGenerator() = default;

/// @brief Gets a new random number.
/// @param lower [in] The lower bound.
Expand Down
Loading