aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/Common.h5
-rw-r--r--src/common/DataStores/DB2FileLoader.cpp26
-rw-r--r--src/common/Logging/Log.cpp6
-rw-r--r--src/common/Metric/Metric.cpp6
4 files changed, 19 insertions, 24 deletions
diff --git a/src/common/Common.h b/src/common/Common.h
index 7f76698c9c9..e97288996f8 100644
--- a/src/common/Common.h
+++ b/src/common/Common.h
@@ -125,9 +125,4 @@ struct TC_COMMON_API LocalizedString
#define MAX_QUERY_LEN 32*1024
-namespace Trinity
-{
- using std::make_unique;
-}
-
#endif
diff --git a/src/common/DataStores/DB2FileLoader.cpp b/src/common/DataStores/DB2FileLoader.cpp
index 824f3e47945..46c3f3d6b9c 100644
--- a/src/common/DataStores/DB2FileLoader.cpp
+++ b/src/common/DataStores/DB2FileLoader.cpp
@@ -348,7 +348,7 @@ bool DB2FileLoaderRegularImpl::LoadTableData(DB2FileSource* source, uint32 secti
{
if (!_data)
{
- _data = Trinity::make_unique<uint8[]>(_header->RecordSize * _header->RecordCount + _header->StringTableSize + 8);
+ _data = std::make_unique<uint8[]>(_header->RecordSize * _header->RecordCount + _header->StringTableSize + 8);
_stringTable = &_data[_header->RecordSize * _header->RecordCount];
}
@@ -1002,7 +1002,7 @@ DB2FileLoaderSparseImpl::DB2FileLoaderSparseImpl(char const* fileName, DB2FileLo
_source(source),
_totalRecordSize(0),
_maxRecordSize(0),
- _fieldAndArrayOffsets(loadInfo ? (Trinity::make_unique<std::size_t[]>(loadInfo->Meta->FieldCount + loadInfo->FieldCount - (!loadInfo->Meta->HasIndexFieldInData() ? 1 : 0))) : nullptr)
+ _fieldAndArrayOffsets(loadInfo ? (std::make_unique<std::size_t[]>(loadInfo->Meta->FieldCount + loadInfo->FieldCount - (!loadInfo->Meta->HasIndexFieldInData() ? 1 : 0))) : nullptr)
{
}
@@ -1057,7 +1057,7 @@ bool DB2FileLoaderSparseImpl::LoadCatalogData(DB2FileSource* source, uint32 sect
void DB2FileLoaderSparseImpl::SetAdditionalData(std::vector<uint32> /*idTable*/, std::vector<DB2RecordCopy> /*copyTable*/, std::vector<std::vector<DB2IndexData>> parentIndexes)
{
_parentIndexes = std::move(parentIndexes);
- _recordBuffer = Trinity::make_unique<uint8[]>(_maxRecordSize);
+ _recordBuffer = std::make_unique<uint8[]>(_maxRecordSize);
}
char* DB2FileLoaderSparseImpl::AutoProduceData(uint32& maxId, char**& indexTable, std::vector<char*>& stringPool)
@@ -1777,7 +1777,7 @@ bool DB2FileLoader::LoadHeaders(DB2FileSource* source, DB2FileLoadInfo const* lo
if (loadInfo && (_header.ParentLookupCount && loadInfo->Meta->ParentIndexField == -1))
return false;
- std::unique_ptr<DB2SectionHeader[]> sections = Trinity::make_unique<DB2SectionHeader[]>(_header.SectionCount);
+ std::unique_ptr<DB2SectionHeader[]> sections = std::make_unique<DB2SectionHeader[]>(_header.SectionCount);
if (_header.SectionCount && !source->Read(sections.get(), sizeof(DB2SectionHeader) * _header.SectionCount))
return false;
@@ -1808,7 +1808,7 @@ bool DB2FileLoader::LoadHeaders(DB2FileSource* source, DB2FileLoadInfo const* lo
return false;
}
- std::unique_ptr<DB2FieldEntry[]> fieldData = Trinity::make_unique<DB2FieldEntry[]>(_header.FieldCount);
+ std::unique_ptr<DB2FieldEntry[]> fieldData = std::make_unique<DB2FieldEntry[]>(_header.FieldCount);
if (!source->Read(fieldData.get(), sizeof(DB2FieldEntry) * _header.FieldCount))
return false;
@@ -1818,7 +1818,7 @@ bool DB2FileLoader::LoadHeaders(DB2FileSource* source, DB2FileLoadInfo const* lo
std::unique_ptr<std::unordered_map<uint32, uint32>[]> commonValues;
if (_header.ColumnMetaSize)
{
- columnMeta = Trinity::make_unique<DB2ColumnMeta[]>(_header.TotalFieldCount);
+ columnMeta = std::make_unique<DB2ColumnMeta[]>(_header.TotalFieldCount);
if (!source->Read(columnMeta.get(), _header.ColumnMetaSize))
return false;
@@ -1830,30 +1830,30 @@ bool DB2FileLoader::LoadHeaders(DB2FileSource* source, DB2FileLoadInfo const* lo
columnMeta[loadInfo->Meta->IndexField].CompressionType == DB2ColumnCompression::SignedImmediate);
}
- palletValues = Trinity::make_unique<std::unique_ptr<DB2PalletValue[]>[]>(_header.TotalFieldCount);
+ palletValues = std::make_unique<std::unique_ptr<DB2PalletValue[]>[]>(_header.TotalFieldCount);
for (uint32 i = 0; i < _header.TotalFieldCount; ++i)
{
if (columnMeta[i].CompressionType != DB2ColumnCompression::Pallet)
continue;
- palletValues[i] = Trinity::make_unique<DB2PalletValue[]>(columnMeta[i].AdditionalDataSize / sizeof(DB2PalletValue));
+ palletValues[i] = std::make_unique<DB2PalletValue[]>(columnMeta[i].AdditionalDataSize / sizeof(DB2PalletValue));
if (!source->Read(palletValues[i].get(), columnMeta[i].AdditionalDataSize))
return false;
}
- palletArrayValues = Trinity::make_unique<std::unique_ptr<DB2PalletValue[]>[]>(_header.TotalFieldCount);
+ palletArrayValues = std::make_unique<std::unique_ptr<DB2PalletValue[]>[]>(_header.TotalFieldCount);
for (uint32 i = 0; i < _header.TotalFieldCount; ++i)
{
if (columnMeta[i].CompressionType != DB2ColumnCompression::PalletArray)
continue;
- palletArrayValues[i] = Trinity::make_unique<DB2PalletValue[]>(columnMeta[i].AdditionalDataSize / sizeof(DB2PalletValue));
+ palletArrayValues[i] = std::make_unique<DB2PalletValue[]>(columnMeta[i].AdditionalDataSize / sizeof(DB2PalletValue));
if (!source->Read(palletArrayValues[i].get(), columnMeta[i].AdditionalDataSize))
return false;
}
- std::unique_ptr<std::unique_ptr<DB2CommonValue[]>[]> commonData = Trinity::make_unique<std::unique_ptr<DB2CommonValue[]>[]>(_header.TotalFieldCount);
- commonValues = Trinity::make_unique<std::unordered_map<uint32, uint32>[]>(_header.TotalFieldCount);
+ std::unique_ptr<std::unique_ptr<DB2CommonValue[]>[]> commonData = std::make_unique<std::unique_ptr<DB2CommonValue[]>[]>(_header.TotalFieldCount);
+ commonValues = std::make_unique<std::unordered_map<uint32, uint32>[]>(_header.TotalFieldCount);
for (uint32 i = 0; i < _header.TotalFieldCount; ++i)
{
if (columnMeta[i].CompressionType != DB2ColumnCompression::CommonData)
@@ -1862,7 +1862,7 @@ bool DB2FileLoader::LoadHeaders(DB2FileSource* source, DB2FileLoadInfo const* lo
if (!columnMeta[i].AdditionalDataSize)
continue;
- commonData[i] = Trinity::make_unique<DB2CommonValue[]>(columnMeta[i].AdditionalDataSize / sizeof(DB2CommonValue));
+ commonData[i] = std::make_unique<DB2CommonValue[]>(columnMeta[i].AdditionalDataSize / sizeof(DB2CommonValue));
if (!source->Read(commonData[i].get(), columnMeta[i].AdditionalDataSize))
return false;
diff --git a/src/common/Logging/Log.cpp b/src/common/Logging/Log.cpp
index 89a971d3ffb..3ec5aeb421a 100644
--- a/src/common/Logging/Log.cpp
+++ b/src/common/Logging/Log.cpp
@@ -152,7 +152,7 @@ void Log::CreateLoggerFromConfig(std::string const& appenderName)
if (level < lowestLogLevel)
lowestLogLevel = level;
- logger = Trinity::make_unique<Logger>(name, level);
+ logger = std::make_unique<Logger>(name, level);
//fprintf(stdout, "Log::CreateLoggerFromConfig: Created Logger %s, Level %u\n", name.c_str(), level);
std::istringstream ss(*iter);
@@ -215,12 +215,12 @@ void Log::RegisterAppender(uint8 index, AppenderCreatorFn appenderCreateFn)
void Log::outMessage(std::string const& filter, LogLevel const level, std::string&& message)
{
- write(Trinity::make_unique<LogMessage>(level, filter, std::move(message)));
+ write(std::make_unique<LogMessage>(level, filter, std::move(message)));
}
void Log::outCommand(std::string&& message, std::string&& param1)
{
- write(Trinity::make_unique<LogMessage>(LOG_LEVEL_INFO, "commands.gm", std::move(message), std::move(param1)));
+ write(std::make_unique<LogMessage>(LOG_LEVEL_INFO, "commands.gm", std::move(message), std::move(param1)));
}
void Log::write(std::unique_ptr<LogMessage>&& msg) const
diff --git a/src/common/Metric/Metric.cpp b/src/common/Metric/Metric.cpp
index d5a642536dc..285a836a44a 100644
--- a/src/common/Metric/Metric.cpp
+++ b/src/common/Metric/Metric.cpp
@@ -27,10 +27,10 @@
void Metric::Initialize(std::string const& realmName, Trinity::Asio::IoContext& ioContext, std::function<void()> overallStatusLogger)
{
- _dataStream = Trinity::make_unique<boost::asio::ip::tcp::iostream>();
+ _dataStream = std::make_unique<boost::asio::ip::tcp::iostream>();
_realmName = FormatInfluxDBTagValue(realmName);
- _batchTimer = Trinity::make_unique<Trinity::Asio::DeadlineTimer>(ioContext);
- _overallStatusTimer = Trinity::make_unique<Trinity::Asio::DeadlineTimer>(ioContext);
+ _batchTimer = std::make_unique<Trinity::Asio::DeadlineTimer>(ioContext);
+ _overallStatusTimer = std::make_unique<Trinity::Asio::DeadlineTimer>(ioContext);
_overallStatusLogger = overallStatusLogger;
LoadFromConfigs();
}