当前位置: 首页>>代码示例>>C++>>正文


C++ DataSet::Rows方法代码示例

本文整理汇总了C++中DataSet::Rows方法的典型用法代码示例。如果您正苦于以下问题:C++ DataSet::Rows方法的具体用法?C++ DataSet::Rows怎么用?C++ DataSet::Rows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataSet的用法示例。


在下文中一共展示了DataSet::Rows方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ColsFromDataSetWithZeroRows

void DataSetTest_GenericData::ColsFromDataSetWithZeroRows()
{
	GenericData gd;
	GenericFileReader reader;
	reader.SetFilename("../data/small_cel_file_with_dataset_of_zero_rows");
	reader.ReadHeader(gd);

	// Open a DataSet that has 0 rows.
	DataSet* ds = gd.DataSet(0,3);
	CPPUNIT_ASSERT(ds);
	CPPUNIT_ASSERT(ds->Cols() == 2);
	CPPUNIT_ASSERT(ds->Rows() == 0);

	ds->Delete();

	// Open another DataSet that has 0 rows.
	ds = gd.DataSet(0,4);
	CPPUNIT_ASSERT(ds);
	CPPUNIT_ASSERT(ds->Cols() == 2);
	CPPUNIT_ASSERT(ds->Rows() == 0);

	ds->Delete();
}
开发者ID:,项目名称:,代码行数:23,代码来源:

示例2: Read

/*
 * Read the file contents into the data object.
 */
void GridControlFileReader::Read(const std::string &fileName, GridControlData& data)
{
	// Clear the old data and read the file.
	data.Clear();
	GenericFileReader reader;
	GenericData gdata;
	reader.SetFilename(fileName);
	reader.ReadHeader(gdata);

	// Check the file identifier
	if (gdata.FileIdentifier() != GRD_FILE_TYPE_IDENTIFIER)
	{
		affymetrix_calvin_exceptions::InvalidFileTypeException e(L"Calvin",L"Default Description, Please Update!",affymetrix_calvin_utilities::DateTime::GetCurrentDateTime().ToString(),std::string(__FILE__),(u_int16_t)__LINE__,0);
		throw e;
	}

	// Get the header parameters.
	ParameterNameValueType param;
	gdata.Header().GetGenericDataHdr()->FindNameValParam(GRD_ROWS_PARAMETER_NAME, param);
	data.SetRows(param.GetValueInt32());
	gdata.Header().GetGenericDataHdr()->FindNameValParam(GRD_COLUMNS_PARAMETER_NAME, param);
	data.SetColumns(param.GetValueInt32());

	// Get the XY coordinates from the dataSets.
	FeatureCoordinate coord;
	u_int16_t x;
	u_int16_t y;
	int nRows;
	DataSet *dataSet;

	// First the B1 probes.
	dataSet = gdata.DataSet(GRD_FILE_COORDINATE_GROUP_NAME, GRD_FILE_B1_SET_NAME);
	if (dataSet->Open() == false)
	{
		affymetrix_calvin_exceptions::DataSetNotOpenException e(L"Calvin",L"Default Description, Please Update!",affymetrix_calvin_utilities::DateTime::GetCurrentDateTime().ToString(),std::string(__FILE__),(u_int16_t)__LINE__,0);
		throw e;
	}
	nRows = dataSet->Rows();
	data.ResizeB1(nRows);
	for (int iRow=0; iRow<nRows; iRow++)
	{
		dataSet->GetData(iRow, 0, x);
		dataSet->GetData(iRow, 1, y);
		coord.x = x;
		coord.y = y;
		data.SetB1(iRow, coord);
	}
	dataSet->Close();
	dataSet->Delete();

	// Next the B2 probes.
	dataSet = gdata.DataSet(GRD_FILE_COORDINATE_GROUP_NAME, GRD_FILE_B2_SET_NAME);
	if (dataSet->Open() == false)
	{
		affymetrix_calvin_exceptions::DataSetNotOpenException e(L"Calvin",L"Default Description, Please Update!",affymetrix_calvin_utilities::DateTime::GetCurrentDateTime().ToString(),std::string(__FILE__),(u_int16_t)__LINE__,0);
		throw e;
	}
	nRows = dataSet->Rows();
	data.ResizeB2(nRows);
	for (int iRow=0; iRow<nRows; iRow++)
	{
		dataSet->GetData(iRow, 0, x);
		dataSet->GetData(iRow, 1, y);
		coord.x = x;
		coord.y = y;
		data.SetB2(iRow, coord);
	}
	dataSet->Close();
	dataSet->Delete();

	// Last the NS probes.
	dataSet = gdata.DataSet(GRD_FILE_COORDINATE_GROUP_NAME, GRD_FILE_NS_SET_NAME);
	if (dataSet->Open() == false)
	{
		affymetrix_calvin_exceptions::DataSetNotOpenException e(L"Calvin",L"Default Description, Please Update!",affymetrix_calvin_utilities::DateTime::GetCurrentDateTime().ToString(),std::string(__FILE__),(u_int16_t)__LINE__,0);
		throw e;
	}
	nRows = dataSet->Rows();
	data.ResizeNS(nRows);
	for (int iRow=0; iRow<nRows; iRow++)
	{
		dataSet->GetData(iRow, 0, x);
		dataSet->GetData(iRow, 1, y);
		coord.x = x;
		coord.y = y;
		data.SetNS(iRow, coord);
	}
	dataSet->Close();
	dataSet->Delete();
}
开发者ID:HenrikBengtsson,项目名称:Affx-Fusion-SDK,代码行数:93,代码来源:GridControlFileReader.cpp


注:本文中的DataSet::Rows方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。