First commit for ICMP capabilities, added CPU::GetCacheLineSize(), and removed BaseObj from containers.
This commit is contained in:
@@ -25,7 +25,7 @@ namespace ehs
|
||||
/// @tparam T The character's data type to use.
|
||||
/// @tparam N The number data type to use.
|
||||
template<typename T = Char_8, typename N = UInt_64>
|
||||
class Str : public BaseObj
|
||||
class Str
|
||||
{
|
||||
private:
|
||||
N size;
|
||||
@@ -33,7 +33,7 @@ namespace ehs
|
||||
|
||||
public:
|
||||
/// Frees any data created on the heap.
|
||||
~Str() override
|
||||
~Str()
|
||||
{
|
||||
delete[] data;
|
||||
}
|
||||
@@ -42,7 +42,6 @@ namespace ehs
|
||||
Str()
|
||||
: size(0), data(nullptr)
|
||||
{
|
||||
AddType("Str");
|
||||
}
|
||||
|
||||
/// Initializes members with given C-style string.
|
||||
@@ -56,8 +55,6 @@ namespace ehs
|
||||
Util::Copy(data, str, Size(true));
|
||||
|
||||
data[this->size] = 0;
|
||||
|
||||
AddType("Str");
|
||||
}
|
||||
|
||||
/// Initializes members with given C-style string.
|
||||
@@ -70,8 +67,6 @@ namespace ehs
|
||||
Util::Copy(data, str, Size(true));
|
||||
|
||||
data[size] = 0;
|
||||
|
||||
AddType("Str");
|
||||
}
|
||||
|
||||
/// Initializes string with the given size.
|
||||
@@ -80,13 +75,11 @@ namespace ehs
|
||||
: size(size), data(new T[size + 1])
|
||||
{
|
||||
data[size] = 0;
|
||||
|
||||
AddType("Str");
|
||||
}
|
||||
|
||||
/// A move constructor.
|
||||
Str(Str&& str) noexcept
|
||||
: BaseObj((BaseObj&&)str), size(str.size), data(str.data)
|
||||
: size(str.size), data(str.data)
|
||||
{
|
||||
str.size = 0;
|
||||
str.data = nullptr;
|
||||
@@ -95,7 +88,7 @@ namespace ehs
|
||||
/// Copies all members from the given string object.
|
||||
/// @param [in] str The string object to copy from.
|
||||
Str(const Str& str)
|
||||
: BaseObj(str), size(str.size), data(new T[size + 1])
|
||||
: size(str.size), data(new T[size + 1])
|
||||
{
|
||||
Util::Copy(data, str.data, Size(true));
|
||||
|
||||
@@ -107,8 +100,6 @@ namespace ehs
|
||||
if (this == &str)
|
||||
return *this;
|
||||
|
||||
BaseObj::operator=((BaseObj&&)str);
|
||||
|
||||
size = str.size;
|
||||
delete[] data;
|
||||
data = str.data;
|
||||
@@ -127,8 +118,6 @@ namespace ehs
|
||||
if (&str == this)
|
||||
return *this;
|
||||
|
||||
BaseObj::operator=(str);
|
||||
|
||||
size = str.size;
|
||||
|
||||
delete[] data;
|
||||
|
Reference in New Issue
Block a user