本文整理汇总了C++中Arg::dim方法的典型用法代码示例。如果您正苦于以下问题:C++ Arg::dim方法的具体用法?C++ Arg::dim怎么用?C++ Arg::dim使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Arg
的用法示例。
在下文中一共展示了Arg::dim方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dispatch_createcomposite
/** Send a create composite task to a target worker
* @param wi a worker information that will execute this CreateComposite task
* @param name a name of Composite array that will be created
* @param name arg argument that contains information about splits that will build a composite array
* @param id an ID of this task (Generally 0)
* @param uid a real ID of this task
* @return NULL
*/
static void dispatch_createcomposite(WorkerInfo *wi,
const string &name,
const Arg &carg,
const std::vector<Arg>* task_args,
::uint64_t id,
::uint64_t uid,
::uint64_t parentid) {
CreateCompositeRequest req;
req.set_name(name);
for (int j = 0; j < carg.arrays_size(); j++) {
NewArg arg;
arg.set_varname(carg.name());
arg.set_arrayname(carg.arrays(j).name());
req.add_cargs()->CopyFrom(arg);
//req.add_arraynames(carg.arrays(j).name());
req.add_offsets()->CopyFrom(carg.offsets(j));
}
req.mutable_dims()->CopyFrom(carg.dim());
if(task_args !=NULL && DATASTORE == RINSTANCE) {
for (int i = 0; i < task_args->size(); i++) {
if ((*task_args)[i].arrays_size() == 1 || (*task_args)[i].is_list()) {
NewArg arg;
arg.set_varname((*task_args)[i].name());
if((*task_args)[i].is_list()){
for(int j = 0; j < (*task_args)[i].arrays_size(); j ++){
arg.add_list_arraynames((*task_args)[i].arrays(j).name());
}
arg.set_arrayname("list_type...");
}else{
arg.set_arrayname((*task_args)[i].arrays(0).name());
}
req.add_task_args()->CopyFrom(arg);
}
}
}
req.set_id(id);
req.set_uid(uid);
req.set_parenttaskid(parentid);
wi->CreateComposite(req);
LOG_INFO("CREATECOMPOSITE Create TaskID %6d - Sent to Worker %s", static_cast<int>(uid), wi->hostname().c_str());
}