本文整理汇总了C++中DataSetHeader::GetNameValIterators方法的典型用法代码示例。如果您正苦于以下问题:C++ DataSetHeader::GetNameValIterators方法的具体用法?C++ DataSetHeader::GetNameValIterators怎么用?C++ DataSetHeader::GetNameValIterators使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataSetHeader
的用法示例。
在下文中一共展示了DataSetHeader::GetNameValIterators方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AssignmentTest
void DataSetHeaderTest::AssignmentTest()
{
header->SetName(L"pixel data");
header->AddUShortColumn(L"Intensity");
header->SetRowCnt(101);
ParameterNameValueType t1;
t1.SetName(L"Scanner");
t1.SetValueText(L"M10");
header->AddNameValParam(t1);
ParameterNameValueType t2;
t2.SetName(L"Pixel Size");
t2.SetValueText(L"0.051");
header->AddNameValParam(t2);
DataSetHeader assignee;
assignee = *header;
// Check that the assignment worked
CPPUNIT_ASSERT(assignee.GetName() == header->GetName());
CPPUNIT_ASSERT(assignee.GetColumnCnt() == header->GetColumnCnt());
CPPUNIT_ASSERT(assignee.GetNameValParamCnt() == header->GetNameValParamCnt());
CPPUNIT_ASSERT(assignee.GetRowCnt() == header->GetRowCnt());
CPPUNIT_ASSERT(assignee.GetColumnInfo(0) == header->GetColumnInfo(0));
ParameterNameValueTypeConstIt nvpAssigneeBegin, nvpAssigneeEnd;
assignee.GetNameValIterators(nvpAssigneeBegin, nvpAssigneeEnd);
ParameterNameValueTypeConstIt nvpHeaderBegin, nvpHeaderEnd;
assignee.GetNameValIterators(nvpHeaderBegin, nvpHeaderEnd);
CPPUNIT_ASSERT(*nvpAssigneeBegin == *nvpHeaderBegin);
++nvpAssigneeBegin;
++nvpHeaderBegin;
CPPUNIT_ASSERT(*nvpAssigneeBegin == *nvpHeaderBegin);
++nvpAssigneeBegin;
++nvpHeaderBegin;
CPPUNIT_ASSERT(nvpAssigneeBegin == nvpAssigneeEnd);
CPPUNIT_ASSERT(nvpHeaderBegin == nvpHeaderEnd);
// TBD: no test of row offset array.
}
示例2: WriteNameValParams
void DataSetHeaderWriter::WriteNameValParams(std::ofstream &os, DataSetHeader &dc)
{
ParameterNameValueTypeConstIt begin;
ParameterNameValueTypeConstIt end;
dc.GetNameValIterators(begin, end);
while(begin != end)
{
FileOutput::WriteString16(os, begin->GetName());
MIMEValue mv = begin->GetMIMEValue();
u_int32_t sz;
const void* ptr = mv.GetValue(sz);
FileOutput::WriteBlob(os, ptr, sz);
FileOutput::WriteString16(os, begin->GetMIMEType());
begin++;
}
}
示例3: testWrite
void CopyNumberResultWriterTest::testWrite()
{
CopyNumberResultWriter writer;
const char *fileNames[] = {"test1.cn", "test2.cn"};
list<ParameterNameValueType> algParams;
list<ParameterNameValueType> sumParams;
vector<ColumnInfo> cols;
writer.MaximumProbeSetNameLength(12);
writer.MaximumCytoRegionNameLength(12);
writer.MaximumGenotypeProbeSetNameLength(12);
writer.AlgName() = "MYALG";
writer.AlgVersion() = "1.0";
writer.NumberProbeSets() = 10;
writer.NumberCytoRegions() = 10;
writer.NumberGenotypeProbeSets() = 10;
writer.Columns() = cols;
writer.AlgParams() = algParams;
writer.SetChromosomeProbeSetIndexInformation(X_CHR, 0, writer.NumberProbeSets());
for (int i=0; i<2; i++)
{
FusionCELData cel;
cel.SetFileName("../data/small_cel_file");
cel.Read(false);
writer.SummaryParams() = sumParams;
writer.CreateResultFile(cel, fileNames[i]);
cel.Close();
ProbeSetMultiDataCopyNumberData entry;
char buf[64];
for (int j=0; j<writer.NumberProbeSets(); j++)
{
entry.chr = X_CHR;
entry.position = j+i;
snprintf(buf, 64, "%d", j+i);
entry.name = buf;
writer.WriteProbeSetResult(entry);
}
ProbeSetMultiDataCytoRegionData cy;
for (int j=0; j<writer.NumberCytoRegions(); j++)
{
cy.call = 1;
cy.confidenceScore = (float)(j+i);
snprintf(buf, 64, "%d", j+i);
cy.name = buf;
writer.WriteCytoRegionResult(cy);
}
ProbeSetMultiDataGenotypeData gt;
for (int j=0; j<writer.NumberGenotypeProbeSets(); j++)
{
gt.call = 1;
gt.confidence = (float)(j+i);
snprintf(buf, 64, "%d", j+i);
gt.name = buf;
writer.WriteGenotypeProbeSetResult(gt);
}
writer.CloseResultsFile();
}
for (int i=0; i<2; i++)
{
FusionCHPData *chp = FusionCHPDataReg::Read(fileNames[i]);
CPPUNIT_ASSERT(chp != NULL);
FusionCHPMultiDataData *genoChp = FusionCHPMultiDataData::FromBase(chp);
CPPUNIT_ASSERT(genoChp != NULL);
CPPUNIT_ASSERT(genoChp->GetAlgName() == L"MYALG");
CPPUNIT_ASSERT(genoChp->GetAlgVersion() == L"1.0");
CPPUNIT_ASSERT(genoChp->GetArrayType() == L"Hg-small");
CPPUNIT_ASSERT(genoChp->GetEntryCount(ExpressionMultiDataType) == 0);
CPPUNIT_ASSERT(genoChp->GetEntryCount(GenotypeMultiDataType) == 10);
CPPUNIT_ASSERT(genoChp->GetEntryCount(CopyNumberMultiDataType) == 10);
CPPUNIT_ASSERT(genoChp->GetEntryCount(CytoMultiDataType) == 10);
DataSetHeader *dsh = genoChp->GetDataSetHeader(CopyNumberMultiDataType);
CPPUNIT_ASSERT(dsh->GetNameValParamCnt() == 3);
ParameterNameValueTypeConstIt begin;
ParameterNameValueTypeConstIt end;
ParameterNameValueTypeConstIt it;
dsh->GetNameValIterators(begin, end);
it = begin;
CPPUNIT_ASSERT(it->GetValueInt32() == 0);
++it;
CPPUNIT_ASSERT(it->GetValueInt32() == 10);
++it;
CPPUNIT_ASSERT(it->GetValueAscii() == "X");
ProbeSetMultiDataCopyNumberData entry;
char buf[64];
for (int j=0; j<10; j++)
{
genoChp->GetCopyNumberEntry(CopyNumberMultiDataType, j, entry);
CPPUNIT_ASSERT(entry.chr == X_CHR);
CPPUNIT_ASSERT(entry.position == j+i);
snprintf(buf, 64, "%d", j+i);
CPPUNIT_ASSERT(entry.name.compare(buf) == 0);
}
//.........这里部分代码省略.........