本文整理汇总了C++中NcAtt::values方法的典型用法代码示例。如果您正苦于以下问题:C++ NcAtt::values方法的具体用法?C++ NcAtt::values怎么用?C++ NcAtt::values使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NcAtt
的用法示例。
在下文中一共展示了NcAtt::values方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dumpgatts
void DumpableNcFile::dumpgatts( void )
{
NcAtt* ap;
for(int n = 0; ap = get_att(n); n++) {
cout << "\t\t" << ":" << ap->name() << " = " ;
NcValues* vals = ap->values();
cout << *vals << " ;" << endl ;
delete vals;
delete ap;
}
}
示例2: dumpatts
void dumpatts(NcVar& var)
{
NcToken vname = var.name();
NcAtt* ap;
for(int n = 0; ap = var.get_att(n); n++) {
cout << "\t\t" << vname << ":" << ap->name() << " = " ;
NcValues* vals = ap->values();
cout << *vals << " ;" << endl ;
delete ap;
delete vals;
}
}
示例3: CopyNcVarAttributes
void CopyNcVarAttributes(
NcVar * varIn,
NcVar * varOut
) {
for (int a = 0; a < varIn->num_atts(); a++) {
NcAtt * att = varIn->get_att(a);
long num_vals = att->num_vals();
NcValues * pValues = att->values();
if (att->type() == ncByte) {
varOut->add_att(att->name(), num_vals,
(const ncbyte*)(pValues->base()));
} else if (att->type() == ncChar) {
varOut->add_att(att->name(), num_vals,
(const char*)(pValues->base()));
} else if (att->type() == ncShort) {
varOut->add_att(att->name(), num_vals,
(const short*)(pValues->base()));
} else if (att->type() == ncInt) {
varOut->add_att(att->name(), num_vals,
(const int*)(pValues->base()));
} else if (att->type() == ncFloat) {
varOut->add_att(att->name(), num_vals,
(const float*)(pValues->base()));
} else if (att->type() == ncDouble) {
varOut->add_att(att->name(), num_vals,
(const double*)(pValues->base()));
} else {
_EXCEPTIONT("Invalid attribute type");
}
delete pValues;
}
}