You've already forked mariadb-columnstore-engine
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:
@ -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
|
||||
|
Reference in New Issue
Block a user