本文整理汇总了C++中DataSourceRef::GetRecord方法的典型用法代码示例。如果您正苦于以下问题:C++ DataSourceRef::GetRecord方法的具体用法?C++ DataSourceRef::GetRecord怎么用?C++ DataSourceRef::GetRecord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataSourceRef
的用法示例。
在下文中一共展示了DataSourceRef::GetRecord方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessConfiguration
///////////////////////////////////////////////////////////////////////////////
// Process the configuration settings. This will set up the recordCopier.
// Note: Check HaveConfigurationError() for the result.
///////////////////////////////////////////////////////////////////////////////
void GeoLoadCombineAddressRange::ProcessConfiguration()
{
if (!configChanged) {
return;
}
::ProcessConfiguration();
// Output record starts out empty
outputRecord = new Record;
// Make a new record copier
recordCopier = new RecordCopier;
// Must have an output
DataSourceList outputs = GetOutputs();
if (outputs.size() == 0) {
ConfigError("Must have at least one output attached");
}
// Get references to all inputs.
DataSourceRef input = GetFirstInput();
if (input == 0) {
ConfigError("Must have at least one input attached");
return;
}
// Output is always copy of input record schema
outputRecord = new Record(*input->GetRecord());
// Copy entire record; this is only very slightly wasteful of CPU.
recordCopier->AddRecordTransfers(outputRecord);
// Configuration processing. Walk the DataItem hierarchy and
// transform that into the data-file, file format, and record layout.
DataItemRef tmp;
///////////////////////////////////////////////////////////////////////////////
// Specified fields
///////////////////////////////////////////////////////////////////////////////
postcodeFieldName = "";
tlidFieldName = "";
leftRightFieldName = "";
fraddrFieldName = "";
toaddrFieldName = "";
tmp = config["ZIP"];
if (tmp != 0) {
postcodeFieldName = TsString(*tmp);
}
if (outputRecord->GetField(postcodeFieldName) == 0) {
ConfigError("ZIP field '" + postcodeFieldName + "' does not exist on input record");
}
tmp = config["TLID"];
if (tmp != 0) {
tlidFieldName = TsString(*tmp);
}
if (outputRecord->GetField(tlidFieldName) == 0) {
ConfigError("TLID field '" + tlidFieldName + "' does not exist on input record");
}
tmp = config["LEFTRIGHT"];
if (tmp != 0) {
leftRightFieldName = TsString(*tmp);
}
if (outputRecord->GetField(leftRightFieldName) == 0) {
ConfigError("LEFTRIGHT field '" + leftRightFieldName + "' does not exist on input record");
}
tmp = config["FRADDR"];
if (tmp != 0) {
fraddrFieldName = TsString(*tmp);
}
if (outputRecord->GetField(fraddrFieldName) == 0) {
ConfigError("FRADDR field '" + fraddrFieldName + "' does not exist on input record");
}
tmp = config["TOADDR"];
if (tmp != 0) {
toaddrFieldName = TsString(*tmp);
}
if (outputRecord->GetField(toaddrFieldName) == 0) {
ConfigError("TOADDR field '" + toaddrFieldName + "' does not exist on input record");
}
}