Index: src/libchcore/TSQLiteSerializerRowData.cpp =================================================================== diff -u -N -rd9527df01ee91b35d9a5fdccb80ded25a9c8265f -re98c03b108baad889dfd7c7fbb1a49f5ea5a55d8 --- src/libchcore/TSQLiteSerializerRowData.cpp (.../TSQLiteSerializerRowData.cpp) (revision d9527df01ee91b35d9a5fdccb80ded25a9c8265f) +++ src/libchcore/TSQLiteSerializerRowData.cpp (.../TSQLiteSerializerRowData.cpp) (revision e98c03b108baad889dfd7c7fbb1a49f5ea5a55d8) @@ -22,16 +22,16 @@ #include #include "TSerializerException.h" #include "ErrorCodes.h" -#include "SerializerTrace.h" #include "TPlainStringPool.h" namespace chcore { /////////////////////////////////////////////////////////////////////////// - TSQLiteSerializerRowData::TSQLiteSerializerRowData(object_id_t oidRowID, TSQLiteColumnsDefinition& rColumnDefinition, bool bAdded, unsigned long long* pPoolMemory, size_t stPoolMemorySizeInBytes, TPlainStringPool& poolStrings) : + TSQLiteSerializerRowData::TSQLiteSerializerRowData(object_id_t oidRowID, TSQLiteColumnsDefinition& rColumnDefinition, bool bAdded, unsigned long long* pPoolMemory, size_t stPoolMemorySizeInBytes, TPlainStringPool& poolStrings, const logger::TLogFileDataPtr& spLogFileData) : m_pPoolMemory(pPoolMemory), m_rColumns(rColumnDefinition), - m_poolStrings(poolStrings) + m_poolStrings(poolStrings), + m_spLog(logger::MakeLogger(spLogFileData, L"Serializer-RowData")) { if (!m_pPoolMemory) throw TSerializerException(eErr_InvalidArgument, _T("Null memory provided"), LOCATION); @@ -49,13 +49,6 @@ MarkAsAdded(); } - TSQLiteSerializerRowData::TSQLiteSerializerRowData(const TSQLiteSerializerRowData& rSrc) : - m_pPoolMemory(rSrc.m_pPoolMemory), - m_rColumns(rSrc.m_rColumns), - m_poolStrings(rSrc.m_poolStrings) - { - } - TSQLiteSerializerRowData::~TSQLiteSerializerRowData() { } @@ -387,6 +380,8 @@ void TSQLiteSerializerRowData::BindParams(sqlite::TSQLiteStatement &tStatement, int& iSQLiteColumnNumber, size_t stSkipColumn) { + LOG_DEBUG(m_spLog) << L"Binding parameters"; + size_t stCount = m_rColumns.GetCount(); for (size_t stColumn = 0; stColumn < stCount; ++stColumn) { @@ -400,71 +395,71 @@ case IColumnsDefinition::eType_bool: { bool bValue = GetDataForColumn(stColumn) != 0 ? true : false; - DBTRACE1_D(_T("- param(bool): %ld\n"), bValue ? 1l : 0l); + LOG_TRACE(m_spLog) << L"BindValue - column: " << stColumn << L", value(bool): " << (bValue ? 1l : 0l); tStatement.BindValue(iSQLiteColumnNumber++, bValue); break; } case IColumnsDefinition::eType_short: { short siValue = *(short*)(unsigned short*)&GetDataForColumn(stColumn); - DBTRACE1_D(_T("- param(short): %d\n"), siValue); + LOG_TRACE(m_spLog) << L"BindValue - column: " << stColumn << L", value(short): " << siValue; tStatement.BindValue(iSQLiteColumnNumber++, siValue); break; } case IColumnsDefinition::eType_ushort: { unsigned short usiValue = (unsigned short)GetDataForColumn(stColumn); - DBTRACE1_D(_T("- param(ushort): %u\n"), usiValue); + LOG_TRACE(m_spLog) << L"BindValue - column: " << stColumn << L", value(ushort): " << usiValue; tStatement.BindValue(iSQLiteColumnNumber++, usiValue); break; } case IColumnsDefinition::eType_int: { int iValue = *(int*)(unsigned int*)&GetDataForColumn(stColumn); - DBTRACE1_D(_T("- param(int): %ld\n"), iValue); + LOG_TRACE(m_spLog) << L"BindValue - column: " << stColumn << L", value(int): " << iValue; tStatement.BindValue(iSQLiteColumnNumber++, iValue); break; } case IColumnsDefinition::eType_uint: { unsigned int uiValue = (unsigned int)GetDataForColumn(stColumn); - DBTRACE1_D(_T("- param(uint): %lu\n"), uiValue); + LOG_TRACE(m_spLog) << L"BindValue - column: " << stColumn << L", value(uint): " << uiValue; tStatement.BindValue(iSQLiteColumnNumber++, uiValue); break; } case IColumnsDefinition::eType_long: { long lValue = *(long*)(unsigned long*)&GetDataForColumn(stColumn); - DBTRACE1_D(_T("- param(long): %ld\n"), lValue); + LOG_TRACE(m_spLog) << L"BindValue - column: " << stColumn << L", value(long): " << lValue; tStatement.BindValue(iSQLiteColumnNumber++, lValue); break; } case IColumnsDefinition::eType_ulong: { unsigned long ulValue = (unsigned long)GetDataForColumn(stColumn); - DBTRACE1_D(_T("- param(ulong): %lu\n"), ulValue); + LOG_TRACE(m_spLog) << L"BindValue - column: " << stColumn << L", value(ulong): " << ulValue; tStatement.BindValue(iSQLiteColumnNumber++, ulValue); break; } case IColumnsDefinition::eType_longlong: { long long llValue = *(long long*)(unsigned long long*)&GetDataForColumn(stColumn); - DBTRACE1_D(_T("- param(llong): %I64d\n"), llValue); + LOG_TRACE(m_spLog) << L"BindValue - column: " << stColumn << L", value(llong): " << llValue; tStatement.BindValue(iSQLiteColumnNumber++, llValue); break; } case IColumnsDefinition::eType_ulonglong: { unsigned long long ullValue = GetDataForColumn(stColumn); - DBTRACE1_D(_T("- param(ullong): %I64u\n"), ullValue); + LOG_TRACE(m_spLog) << L"BindValue - column: " << stColumn << L", value(ullong): " << ullValue; tStatement.BindValue(iSQLiteColumnNumber++, ullValue); break; } @@ -473,23 +468,23 @@ { // cppcheck-suppress invalidPointerCast double dValue = *(double*)(unsigned long long*)&GetDataForColumn(stColumn); - DBTRACE1_D(_T("- param(double): %f\n"), dValue); + LOG_TRACE(m_spLog) << L"BindValue - column: " << stColumn << L", value(double): " << dValue; tStatement.BindValue(iSQLiteColumnNumber++, dValue); break; } case IColumnsDefinition::eType_string: { const wchar_t* pszValue = (const wchar_t*)(unsigned long long*)GetDataForColumn(stColumn); - DBTRACE1_D(_T("- param(string): %s\n"), pszValue ? pszValue : _T("")); + LOG_TRACE(m_spLog) << L"BindValue - column: " << stColumn << L", value(string): " << (pszValue ? pszValue : _T("")); tStatement.BindValue(iSQLiteColumnNumber++, pszValue ? pszValue : _T("")); break; } case IColumnsDefinition::eType_path: { const wchar_t* pszValue = (const wchar_t*)(unsigned long long*)GetDataForColumn(stColumn); - DBTRACE1_D(_T("- param(path): %s\n"), pszValue ? pszValue : _T("")); + LOG_TRACE(m_spLog) << L"BindValue - column: " << stColumn << L", value(path): " << (pszValue ? pszValue : _T("")); tStatement.BindValue(iSQLiteColumnNumber++, pszValue ? PathFromString(pszValue) : TSmartPath()); break; } @@ -532,11 +527,4 @@ FreeColumnData(stColumn); } } - - TSQLiteSerializerRowData& TSQLiteSerializerRowData::operator=(const TSQLiteSerializerRowData& rSrc) - { - m_pPoolMemory = rSrc.m_pPoolMemory; - - return *this; - } }