本文整理汇总了C++中Extent::getTypePtr方法的典型用法代码示例。如果您正苦于以下问题:C++ Extent::getTypePtr方法的具体用法?C++ Extent::getTypePtr怎么用?C++ Extent::getTypePtr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Extent
的用法示例。
在下文中一共展示了Extent::getTypePtr方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: firstExtent
virtual void firstExtent(const Extent &e) {
series.setType(e.getTypePtr());
const ExtentType::Ptr extent_type(e.getTypePtr());
fields.reserve(extent_type->getNFields());
for (uint32_t i = 0; i < extent_type->getNFields(); ++i) {
string field_name(extent_type->getFieldName(i));
fields.push_back(GeneralField::make(series, field_name));
into.columns.push_back(TableColumn(field_name,
extent_type->getFieldTypeStr(field_name)));
}
into.__isset.columns = true;
}
示例2: firstExtent
virtual void firstExtent(const Extent &e) {
skip_after_count.resize(getMaxUnifiedId()+1);
skip_after_skip.resize(getMaxUnifiedId() +1);
const ExtentType::Ptr type = e.getTypePtr();
if (type->versionCompatible(0,0) || type->versionCompatible(1,0)) {
packet_at.setFieldName("packet-at");
is_request.setFieldName("is-request");
op_id.setFieldName("op-id");
nfs_version.setFieldName("nfs-version");
transaction_id.setFieldName("transaction-id");
payload_length.setFieldName("payload-length");
record_id.setFieldName("record-id");
} else if (type->versionCompatible(2,0)) {
packet_at.setFieldName("packet_at");
is_request.setFieldName("is_request");
op_id.setFieldName("op_id");
nfs_version.setFieldName("nfs_version");
transaction_id.setFieldName("transaction_id");
payload_length.setFieldName("payload_length");
record_id.setFieldName("record_id");
} else {
FATAL_ERROR(format("can only handle v[0,1,2].*; not %d.%d")
% type->majorVersion() % type->minorVersion());
}
}
示例3: firstExtent
void firstExtent(const Extent &b_e) {
ExtentSeries a_series;
a_series.setExtent(a_input.getSharedExtent());
b_series.setType(b_e.getTypePtr());
if (a_series.getSharedExtent() == NULL) {
requestError("a_table is empty?");
}
// Three possible sources for values in the output:
//
// 1) the a value fields, so from the hash-map
// 2a) the b fields, as one of the a eq fields.
// 2b) the b fields, as one of the b values or eq fields
//
// We do not try to optimize the extraction and just create a new general field for each
// extraction so if the hash-map has duplicate columns, there will be duplicate fields.
vector<GeneralField::Ptr> a_eq_fields;
HashUnique<string> known_a_eq_fields;
BOOST_FOREACH(const CMap::value_type &vt, eq_columns) {
SINVARIANT(a_series.getTypePtr()->getFieldType(vt.first)
== b_series.getTypePtr()->getFieldType(vt.second));
a_eq_fields.push_back(GeneralField::make(a_series, vt.first));
b_eq_fields.push_back(GeneralField::make(b_series, vt.second));
known_a_eq_fields.add(vt.first);
}
示例4: firstExtent
virtual void firstExtent(const Extent &e) {
const ExtentType::Ptr type = e.getTypePtr();
if (type->getName() == "Network trace: IP packets") {
packet_at.setFieldName("packet-at");
wire_len.setFieldName("wire-length");
} else if (type->getName() == "Trace::Network::IP" &&
type->versionCompatible(1,0)) {
packet_at.setFieldName("packet-at");
wire_len.setFieldName("wire-length");
} else if (type->getName() == "Trace::Network::IP" &&
type->versionCompatible(2,0)) {
packet_at.setFieldName("packet_at");
wire_len.setFieldName("wire_length");
} else {
FATAL_ERROR("?");
}
}
示例5: firstExtent
void firstExtent(const Extent &e) {
const ExtentType::Ptr type = e.getTypePtr();
if (type->versionCompatible(0,0) || type->versionCompatible(1,0)) {
reqtime.setFieldName("packet-at");
is_request.setFieldName("is-request");
transaction_id.setFieldName("transaction-id");
op_id.setFieldName("op-id");
} else if (type->versionCompatible(2,0)) {
reqtime.setFieldName("packet_at");
is_request.setFieldName("is_request");
transaction_id.setFieldName("transaction_id");
op_id.setFieldName("op_id");
} else {
FATAL_ERROR(format("can only handle v[0,1,2].*; not %d.%d")
% type->majorVersion() % type->minorVersion());
}
}
示例6: newExtentHook
void newExtentHook(const Extent &e) {
if (series.getTypePtr() != NULL) {
return; // already did this
}
const ExtentType::Ptr type = e.getTypePtr();
if (type->getName() == "NFS trace: read-write") {
SINVARIANT(type->getNamespace() == "" &&
type->majorVersion() == 0 &&
type->minorVersion() == 0);
is_read.setFieldName("is-read");
} else if (type->getName() == "Trace::NFS::read-write"
&& type->versionCompatible(1,0)) {
is_read.setFieldName("is-read");
} else if (type->getName() == "Trace::NFS::read-write"
&& type->versionCompatible(2,0)) {
is_read.setFieldName("is_read");
} else {
FATAL_ERROR("?");
}
}
示例7: printIndex
void printIndex(off64_t offset, Extent &extent) {
cout << offset << "\t" << extent.getTypePtr()->getName() << "\t" << extent.size() << "\n";
}