本文整理汇总了C++中AzStrPool类的典型用法代码示例。如果您正苦于以下问题:C++ AzStrPool类的具体用法?C++ AzStrPool怎么用?C++ AzStrPool使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AzStrPool类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getInts
static void getInts(const char *str, AzByte dlm, AzIntArr *ia) {
ia->reset();
AzStrPool sp;
getStrings(str, dlm, &sp);
int ix;
for (ix = 0; ix < sp.size(); ++ix) {
ia->put(atol(sp.c_str(ix)));
}
}
示例2: getFloats
static void getFloats(const char *str, AzByte dlm, AzDvect *v) {
AzIFarr ifa;
AzStrPool sp;
getStrings(str, dlm, &sp);
int ix;
for (ix = 0; ix < sp.size(); ++ix) {
ifa.put(-1, atof(sp.c_str(ix)));
}
v->reform(ifa.size());
for (ix = 0; ix < ifa.size(); ++ix) {
v->set(ix, ifa.get(ix));
}
}
示例3: vInt
inline void vInt(const char *kw, int *out_value) {
if (param == NULL) return;
const char *ptr = pointAfterKw(param, kw);
if (ptr == NULL) return;
*out_value = atol(ptr);
if (doCheck) sp_used_kw.put(kw);
}
示例4: vStr
inline void vStr(const char *kw, AzBytArr *s) {
if (param == NULL) return;
const char *bp = pointAfterKw(param, kw);
if (bp == NULL) return;
const char *ep = pointAt(bp, dlm);
s->reset();
s->concat(bp, Az64::ptr_diff(ep-bp, "AzParam::vStr"));
if (doCheck) sp_used_kw.put(kw);
}
示例5: vLoss
inline void vLoss(const char *kw, AzLossType *out_loss) {
if (param == NULL) return;
AzBytArr s;
vStr(kw, &s);
if (s.length() > 0) {
*out_loss = AzLoss::lossType(s.c_str());
}
if (doCheck) sp_used_kw.put(kw);
}
示例6: read
virtual void read(AzFile *file) {
AzpCNet3::read(file);
int my_version = AzTools::read_header(file, reserved_len);
iia_layer_conn.read(file);
ia_layer_order.read(file);
layer_info.read(file);
conn.read(file);
sp_conn.read(file);
}
示例7: write
virtual void write(AzFile *file) {
AzpCNet3::write(file);
AzTools::write_header(file, version, reserved_len);
iia_layer_conn.write(file);
ia_layer_order.writec(file); /* write2: const */
layer_info.write(file);
conn.write(file);
sp_conn.writec(file);
}
示例8: swOff
inline void swOff(bool *swch, const char *kw,
bool doCheckKw=true) {
if (param == NULL) return;
if (doCheckKw) {
if (strstr(kw, "Dont") != kw &&
(strstr(kw, "No") != kw && strstr(kw, "Normalize") == NULL)) {
throw new AzException("AzParam::swOff",
"Off-kw should start with \"dont\" or \"No\"", kw);
}
}
const char *ptr = pointAfterKw(param, kw);
if (ptr != NULL &&
(*ptr == '\0' || *ptr == dlm) ) {
*swch = false;
}
if (doCheck) sp_used_kw.put(kw);
}
示例9: channels
AzpData_img() : data_num(0), channels(-1), sz1(0), sz2(0), dummy_ydim(-1),
current_batch(0), total_data_num(-1), data_scale(-1),
min_tar(1e+10), max_tar(-1e+10) {
sp_x_ext.put(AzpData_Ext_xpmat, AzpData_Ext_x);
sp_y_ext.put(AzpData_Ext_ysmat, AzpData_Ext_y);
}