1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

clang format apply

This commit is contained in:
Leonid Fedorov
2022-01-21 16:43:49 +00:00
parent 6b6411229f
commit 04752ec546
1376 changed files with 393460 additions and 412662 deletions

View File

@ -16,10 +16,10 @@
MA 02110-1301, USA. */
/***********************************************************************
* $Id: row.cpp 9210 2013-01-21 14:10:42Z rdempsey $
*
*
***********************************************************************/
* $Id: row.cpp 9210 2013-01-21 14:10:42Z rdempsey $
*
*
***********************************************************************/
#include <limits>
#define DMLPKGROW_DLLEXPORT
@ -28,83 +28,78 @@
namespace dmlpackage
{
Row::Row()
: fRowID(std::numeric_limits<WriteEngine::RID>::max())
{}
Row::Row() : fRowID(std::numeric_limits<WriteEngine::RID>::max())
{
}
Row::~Row()
{
for ( unsigned int i = 0; i < fColumnList.size(); i++)
{
delete fColumnList[i];
}
for (unsigned int i = 0; i < fColumnList.size(); i++)
{
delete fColumnList[i];
}
fColumnList.clear();
fColumnList.clear();
}
Row::Row(const Row& row)
{
for (unsigned int i = 0; i < row.fColumnList.size(); i++)
{
const DMLColumn* aColumn = row.get_ColumnAt(i);
DMLColumn* newColumn = new DMLColumn(aColumn->get_Name(), aColumn->get_Data());
fColumnList.push_back(newColumn);
}
for (unsigned int i = 0; i < row.fColumnList.size(); i++)
{
const DMLColumn* aColumn = row.get_ColumnAt(i);
DMLColumn* newColumn = new DMLColumn(aColumn->get_Name(), aColumn->get_Data());
fColumnList.push_back(newColumn);
}
fRowID = row.fRowID;
fRowID = row.fRowID;
}
int Row::read(messageqcpp::ByteStream& bytestream)
{
int retval = 1;
messageqcpp::ByteStream::octbyte rowID;
bytestream >> rowID;
set_RowID(rowID);
messageqcpp::ByteStream::quadbyte col_count;
bytestream >> col_count;
int retval = 1;
messageqcpp::ByteStream::octbyte rowID;
bytestream >> rowID;
set_RowID(rowID);
messageqcpp::ByteStream::quadbyte col_count;
bytestream >> col_count;
for (unsigned int i = 0; i < col_count; i++)
{
DMLColumn* aColumn = new DMLColumn();
retval = aColumn->read(bytestream);
fColumnList.push_back(aColumn);
}
for (unsigned int i = 0; i < col_count; i++)
{
DMLColumn* aColumn = new DMLColumn();
retval = aColumn->read(bytestream);
fColumnList.push_back(aColumn);
}
return retval;
return retval;
}
int Row::write(messageqcpp::ByteStream& bytestream)
{
int retval = 1;
messageqcpp::ByteStream::octbyte rowID = fRowID;
bytestream << rowID;
ColumnList::iterator colListPtr;
colListPtr = fColumnList.begin();
messageqcpp::ByteStream::quadbyte col_count = fColumnList.size();
bytestream << col_count;
int retval = 1;
messageqcpp::ByteStream::octbyte rowID = fRowID;
bytestream << rowID;
ColumnList::iterator colListPtr;
colListPtr = fColumnList.begin();
messageqcpp::ByteStream::quadbyte col_count = fColumnList.size();
bytestream << col_count;
for (; colListPtr != fColumnList.end(); ++colListPtr)
{
retval = (*colListPtr)->write(bytestream);
}
for (; colListPtr != fColumnList.end(); ++colListPtr)
{
retval = (*colListPtr)->write(bytestream);
}
return retval;
return retval;
}
const DMLColumn* Row::get_ColumnAt( unsigned int index ) const
const DMLColumn* Row::get_ColumnAt(unsigned int index) const
{
const DMLColumn* columnPtr = 0;
const DMLColumn* columnPtr = 0;
if ( index < fColumnList.size() )
{
columnPtr = fColumnList[index];
}
if (index < fColumnList.size())
{
columnPtr = fColumnList[index];
}
return columnPtr;
return columnPtr;
}
} // namespace dmlpackage
} // namespace dmlpackage