00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "lsm_convert.hpp"
00020 #include "libstoragemgmt/libstoragemgmt_accessgroups.h"
00021 #include "libstoragemgmt/libstoragemgmt_blockrange.h"
00022 #include "libstoragemgmt/libstoragemgmt_nfsexport.h"
00023
00024 bool is_expected_object(Value & obj, std::string class_name)
00025 {
00026 if (obj.valueType() == Value::object_t) {
00027 std::map < std::string, Value > i = obj.asObject();
00028 std::map < std::string, Value >::iterator iter = i.find("class");
00029 if (iter != i.end() && iter->second.asString() == class_name) {
00030 return true;
00031 }
00032 }
00033 return false;
00034 }
00035
00036 lsm_volume *value_to_volume(Value & vol)
00037 {
00038 lsm_volume *rc = NULL;
00039
00040 if (is_expected_object(vol, CLASS_NAME_VOLUME)) {
00041 std::map < std::string, Value > v = vol.asObject();
00042
00043 rc = lsm_volume_record_alloc(v["id"].asString().c_str(),
00044 v["name"].asString().c_str(),
00045 v["vpd83"].asString().c_str(),
00046 v["block_size"].asUint64_t(),
00047 v["num_of_blocks"].asUint64_t(),
00048 v["admin_state"].asUint32_t(),
00049 v["system_id"].asString().c_str(),
00050 v["pool_id"].asString().c_str(),
00051 v["plugin_data"].asC_str());
00052 } else {
00053 throw ValueException("value_to_volume: Not correct type");
00054 }
00055
00056 return rc;
00057 }
00058
00059 Value volume_to_value(lsm_volume * vol)
00060 {
00061 if (LSM_IS_VOL(vol)) {
00062 std::map < std::string, Value > v;
00063 v["class"] = Value(CLASS_NAME_VOLUME);
00064 v["id"] = Value(vol->id);
00065 v["name"] = Value(vol->name);
00066 v["vpd83"] = Value(vol->vpd83);
00067 v["block_size"] = Value(vol->block_size);
00068 v["num_of_blocks"] = Value(vol->number_of_blocks);
00069 v["admin_state"] = Value(vol->admin_state);
00070 v["system_id"] = Value(vol->system_id);
00071 v["pool_id"] = Value(vol->pool_id);
00072 v["plugin_data"] = Value(vol->plugin_data);
00073 return Value(v);
00074 }
00075 return Value();
00076 }
00077
00078 int value_array_to_volumes(Value & volume_values, lsm_volume ** volumes[],
00079 uint32_t * count)
00080 {
00081 int rc = LSM_ERR_OK;
00082 try {
00083 *count = 0;
00084
00085 if (Value::array_t == volume_values.valueType()) {
00086 std::vector < Value > vol = volume_values.asArray();
00087
00088 *count = vol.size();
00089
00090 if (vol.size()) {
00091 *volumes = lsm_volume_record_array_alloc(vol.size());
00092
00093 if (*volumes) {
00094 for (size_t i = 0; i < vol.size(); ++i) {
00095 (*volumes)[i] = value_to_volume(vol[i]);
00096 if (!((*volumes)[i])) {
00097 rc = LSM_ERR_NO_MEMORY;
00098 goto error;
00099 }
00100 }
00101 } else {
00102 rc = LSM_ERR_NO_MEMORY;
00103 }
00104 }
00105 }
00106 }
00107 catch(const ValueException & ve) {
00108 rc = LSM_ERR_LIB_BUG;
00109 goto error;
00110 }
00111
00112 out:
00113 return rc;
00114
00115 error:
00116 if (*volumes && *count) {
00117 lsm_volume_record_array_free(*volumes, *count);
00118 *volumes = NULL;
00119 *count = 0;
00120 }
00121 goto out;
00122 }
00123
00124 lsm_disk *value_to_disk(Value & disk)
00125 {
00126 lsm_disk *rc = NULL;
00127 if (is_expected_object(disk, CLASS_NAME_DISK)) {
00128 std::map < std::string, Value > d = disk.asObject();
00129
00130 rc = lsm_disk_record_alloc(d["id"].asString().c_str(),
00131 d["name"].asString().c_str(),
00132 (lsm_disk_type) d["disk_type"].asInt32_t(),
00133 d["block_size"].asUint64_t(),
00134 d["num_of_blocks"].asUint64_t(),
00135 d["status"].asUint64_t(),
00136 d["system_id"].asString().c_str()
00137 );
00138 } else {
00139 throw ValueException("value_to_disk: Not correct type");
00140 }
00141 return rc;
00142 }
00143
00144
00145 Value disk_to_value(lsm_disk * disk)
00146 {
00147 if (LSM_IS_DISK(disk)) {
00148 std::map < std::string, Value > d;
00149 d["class"] = Value(CLASS_NAME_DISK);
00150 d["id"] = Value(disk->id);
00151 d["name"] = Value(disk->name);
00152 d["disk_type"] = Value(disk->disk_type);
00153 d["block_size"] = Value(disk->block_size);
00154 d["num_of_blocks"] = Value(disk->block_count);
00155 d["status"] = Value(disk->disk_status);
00156 d["system_id"] = Value(disk->system_id);
00157
00158 return Value(d);
00159 }
00160 return Value();
00161 }
00162
00163 int value_array_to_disks(Value & disk_values, lsm_disk ** disks[],
00164 uint32_t * count)
00165 {
00166 int rc = LSM_ERR_OK;
00167 try {
00168 *count = 0;
00169
00170 if (Value::array_t == disk_values.valueType()) {
00171 std::vector < Value > d = disk_values.asArray();
00172
00173 *count = d.size();
00174
00175 if (d.size()) {
00176 *disks = lsm_disk_record_array_alloc(d.size());
00177
00178 if (*disks) {
00179 for (size_t i = 0; i < d.size(); ++i) {
00180 (*disks)[i] = value_to_disk(d[i]);
00181 if (!((*disks)[i])) {
00182 rc = LSM_ERR_NO_MEMORY;
00183 goto error;
00184 }
00185 }
00186 } else {
00187 rc = LSM_ERR_NO_MEMORY;
00188 }
00189 }
00190 }
00191 }
00192 catch(const ValueException & ve) {
00193 rc = LSM_ERR_LIB_BUG;
00194 goto error;
00195 }
00196
00197 out:
00198 return rc;
00199
00200 error:
00201 if (*disks && *count) {
00202 lsm_disk_record_array_free(*disks, *count);
00203 *disks = NULL;
00204 *count = 0;
00205 }
00206 goto out;
00207 }
00208
00209 lsm_pool *value_to_pool(Value & pool)
00210 {
00211 lsm_pool *rc = NULL;
00212
00213 if (is_expected_object(pool, CLASS_NAME_POOL)) {
00214 std::map < std::string, Value > i = pool.asObject();
00215
00216 rc = lsm_pool_record_alloc(i["id"].asString().c_str(),
00217 i["name"].asString().c_str(),
00218 i["element_type"].asUint64_t(),
00219 i["unsupported_actions"].asUint64_t(),
00220 i["total_space"].asUint64_t(),
00221 i["free_space"].asUint64_t(),
00222 i["status"].asUint64_t(),
00223 i["status_info"].asString().c_str(),
00224 i["system_id"].asString().c_str(),
00225 i["plugin_data"].asC_str());
00226 } else {
00227 throw ValueException("value_to_pool: Not correct type");
00228 }
00229 return rc;
00230 }
00231
00232 Value pool_to_value(lsm_pool * pool)
00233 {
00234 if (LSM_IS_POOL(pool)) {
00235 std::map < std::string, Value > p;
00236 p["class"] = Value(CLASS_NAME_POOL);
00237 p["id"] = Value(pool->id);
00238 p["name"] = Value(pool->name);
00239 p["element_type"] = Value(pool->element_type);
00240 p["unsupported_actions"] = Value(pool->unsupported_actions);
00241 p["total_space"] = Value(pool->total_space);
00242 p["free_space"] = Value(pool->free_space);
00243 p["status"] = Value(pool->status);
00244 p["status_info"] = Value(pool->status_info);
00245 p["system_id"] = Value(pool->system_id);
00246 p["plugin_data"] = Value(pool->plugin_data);
00247 return Value(p);
00248 }
00249 return Value();
00250 }
00251
00252 lsm_system *value_to_system(Value & system)
00253 {
00254 lsm_system *rc = NULL;
00255 if (is_expected_object(system, CLASS_NAME_SYSTEM)) {
00256 std::map < std::string, Value > i = system.asObject();
00257
00258 rc = lsm_system_record_alloc(i["id"].asString().c_str(),
00259 i["name"].asString().c_str(),
00260 i["status"].asUint32_t(),
00261 i["status_info"].asString().c_str(),
00262 i["plugin_data"].asC_str());
00263 } else {
00264 throw ValueException("value_to_system: Not correct type");
00265 }
00266 return rc;
00267 }
00268
00269 Value system_to_value(lsm_system * system)
00270 {
00271 if (LSM_IS_SYSTEM(system)) {
00272 std::map < std::string, Value > s;
00273 s["class"] = Value(CLASS_NAME_SYSTEM);
00274 s["id"] = Value(system->id);
00275 s["name"] = Value(system->name);
00276 s["status"] = Value(system->status);
00277 s["status_info"] = Value(system->status_info);
00278 s["plugin_data"] = Value(system->plugin_data);
00279 return Value(s);
00280 }
00281 return Value();
00282 }
00283
00284 lsm_string_list *value_to_string_list(Value & v)
00285 {
00286 lsm_string_list *il = NULL;
00287
00288 if (Value::array_t == v.valueType()) {
00289 std::vector < Value > vl = v.asArray();
00290 uint32_t size = vl.size();
00291 il = lsm_string_list_alloc(size);
00292
00293 if (il) {
00294 for (uint32_t i = 0; i < size; ++i) {
00295 if (LSM_ERR_OK !=
00296 lsm_string_list_elem_set(il, i, vl[i].asC_str())) {
00297 lsm_string_list_free(il);
00298 il = NULL;
00299 break;
00300 }
00301 }
00302 }
00303 } else {
00304 throw ValueException("value_to_string_list: Not correct type");
00305 }
00306 return il;
00307 }
00308
00309 Value string_list_to_value(lsm_string_list * sl)
00310 {
00311 std::vector < Value > rc;
00312 if (LSM_IS_STRING_LIST(sl)) {
00313 uint32_t size = lsm_string_list_size(sl);
00314 rc.reserve(size);
00315
00316 for (uint32_t i = 0; i < size; ++i) {
00317 rc.push_back(Value(lsm_string_list_elem_get(sl, i)));
00318 }
00319 }
00320 return Value(rc);
00321 }
00322
00323 lsm_access_group *value_to_access_group(Value & group)
00324 {
00325 lsm_string_list *il = NULL;
00326 lsm_access_group *ag = NULL;
00327
00328 if (is_expected_object(group, CLASS_NAME_ACCESS_GROUP)) {
00329 std::map < std::string, Value > vAg = group.asObject();
00330 il = value_to_string_list(vAg["init_ids"]);
00331
00332 if (il) {
00333 ag = lsm_access_group_record_alloc(vAg["id"].asString().c_str(),
00334 vAg["name"].asString().c_str(),
00335 il, (lsm_access_group_init_type)
00336 vAg["init_type"].asInt32_t(),
00337 vAg["system_id"].
00338 asString().c_str(),
00339 vAg["plugin_data"].asC_str());
00340 }
00341
00342 lsm_string_list_free(il);
00343 } else {
00344 throw ValueException("value_to_access_group: Not correct type");
00345 }
00346 return ag;
00347 }
00348
00349 Value access_group_to_value(lsm_access_group * group)
00350 {
00351 if (LSM_IS_ACCESS_GROUP(group)) {
00352 std::map < std::string, Value > ag;
00353 ag["class"] = Value(CLASS_NAME_ACCESS_GROUP);
00354 ag["id"] = Value(group->id);
00355 ag["name"] = Value(group->name);
00356 ag["init_ids"] = Value(string_list_to_value(group->initiators));
00357 ag["init_type"] = Value(group->init_type);
00358 ag["system_id"] = Value(group->system_id);
00359 ag["plugin_data"] = Value(group->plugin_data);
00360 return Value(ag);
00361 }
00362 return Value();
00363 }
00364
00365 int value_array_to_access_groups(Value & group,
00366 lsm_access_group ** ag_list[],
00367 uint32_t * count)
00368 {
00369 int rc = LSM_ERR_OK;
00370
00371 try {
00372 std::vector < Value > ag = group.asArray();
00373 *count = ag.size();
00374
00375 if (*count) {
00376 *ag_list = lsm_access_group_record_array_alloc(*count);
00377 if (*ag_list) {
00378 uint32_t i;
00379 for (i = 0; i < *count; ++i) {
00380 (*ag_list)[i] = value_to_access_group(ag[i]);
00381 if (!((*ag_list)[i])) {
00382 rc = LSM_ERR_NO_MEMORY;
00383 goto error;
00384 }
00385 }
00386 } else {
00387 rc = LSM_ERR_NO_MEMORY;
00388 }
00389 }
00390 }
00391 catch(const ValueException & ve) {
00392 rc = LSM_ERR_LIB_BUG;
00393 goto error;
00394 }
00395
00396 out:
00397 return rc;
00398
00399 error:
00400 if (*ag_list && *count) {
00401 lsm_access_group_record_array_free(*ag_list, *count);
00402 *ag_list = NULL;
00403 *count = 0;
00404 }
00405 goto out;
00406 }
00407
00408 Value access_group_list_to_value(lsm_access_group ** group, uint32_t count)
00409 {
00410 std::vector < Value > rc;
00411
00412 if (group && count) {
00413 uint32_t i;
00414 rc.reserve(count);
00415 for (i = 0; i < count; ++i) {
00416 rc.push_back(access_group_to_value(group[i]));
00417 }
00418 }
00419 return Value(rc);
00420 }
00421
00422 lsm_block_range *value_to_block_range(Value & br)
00423 {
00424 lsm_block_range *rc = NULL;
00425 if (is_expected_object(br, CLASS_NAME_BLOCK_RANGE)) {
00426 std::map < std::string, Value > range = br.asObject();
00427
00428 rc = lsm_block_range_record_alloc(range["src_block"].asUint64_t(),
00429 range["dest_block"].asUint64_t(),
00430 range["block_count"].asUint64_t());
00431 } else {
00432 throw ValueException("value_to_block_range: Not correct type");
00433 }
00434 return rc;
00435 }
00436
00437 Value block_range_to_value(lsm_block_range * br)
00438 {
00439 if (LSM_IS_BLOCK_RANGE(br)) {
00440 std::map < std::string, Value > r;
00441 r["class"] = Value(CLASS_NAME_BLOCK_RANGE);
00442 r["src_block"] = Value(br->source_start);
00443 r["dest_block"] = Value(br->dest_start);
00444 r["block_count"] = Value(br->block_count);
00445 return Value(r);
00446 }
00447 return Value();
00448 }
00449
00450 lsm_block_range **value_to_block_range_list(Value & brl, uint32_t * count)
00451 {
00452 lsm_block_range **rc = NULL;
00453 std::vector < Value > r = brl.asArray();
00454 *count = r.size();
00455 if (*count) {
00456 rc = lsm_block_range_record_array_alloc(*count);
00457 if (rc) {
00458 for (uint32_t i = 0; i < *count; ++i) {
00459 rc[i] = value_to_block_range(r[i]);
00460 if (!rc[i]) {
00461 lsm_block_range_record_array_free(rc, i);
00462 rc = NULL;
00463 break;
00464 }
00465 }
00466 }
00467 }
00468 return rc;
00469 }
00470
00471 Value block_range_list_to_value(lsm_block_range ** brl, uint32_t count)
00472 {
00473 std::vector < Value > r;
00474 if (brl && count) {
00475 uint32_t i = 0;
00476 r.reserve(count);
00477 for (i = 0; i < count; ++i) {
00478 r.push_back(block_range_to_value(brl[i]));
00479 }
00480 }
00481 return Value(r);
00482 }
00483
00484 lsm_fs *value_to_fs(Value & fs)
00485 {
00486 lsm_fs *rc = NULL;
00487 if (is_expected_object(fs, CLASS_NAME_FILE_SYSTEM)) {
00488 std::map < std::string, Value > f = fs.asObject();
00489
00490 rc = lsm_fs_record_alloc(f["id"].asString().c_str(),
00491 f["name"].asString().c_str(),
00492 f["total_space"].asUint64_t(),
00493 f["free_space"].asUint64_t(),
00494 f["pool_id"].asString().c_str(),
00495 f["system_id"].asString().c_str(),
00496 f["plugin_data"].asC_str());
00497 } else {
00498 throw ValueException("value_to_fs: Not correct type");
00499 }
00500 return rc;
00501 }
00502
00503 Value fs_to_value(lsm_fs * fs)
00504 {
00505 if (LSM_IS_FS(fs)) {
00506 std::map < std::string, Value > f;
00507 f["class"] = Value(CLASS_NAME_FILE_SYSTEM);
00508 f["id"] = Value(fs->id);
00509 f["name"] = Value(fs->name);
00510 f["total_space"] = Value(fs->total_space);
00511 f["free_space"] = Value(fs->free_space);
00512 f["pool_id"] = Value(fs->pool_id);
00513 f["system_id"] = Value(fs->system_id);
00514 f["plugin_data"] = Value(fs->plugin_data);
00515 return Value(f);
00516 }
00517 return Value();
00518 }
00519
00520
00521 lsm_fs_ss *value_to_ss(Value & ss)
00522 {
00523 lsm_fs_ss *rc = NULL;
00524 if (is_expected_object(ss, CLASS_NAME_FS_SNAPSHOT)) {
00525 std::map < std::string, Value > f = ss.asObject();
00526
00527 rc = lsm_fs_ss_record_alloc(f["id"].asString().c_str(),
00528 f["name"].asString().c_str(),
00529 f["ts"].asUint64_t(),
00530 f["plugin_data"].asC_str());
00531 } else {
00532 throw ValueException("value_to_ss: Not correct type");
00533 }
00534 return rc;
00535 }
00536
00537 Value ss_to_value(lsm_fs_ss * ss)
00538 {
00539 if (LSM_IS_SS(ss)) {
00540 std::map < std::string, Value > f;
00541 f["class"] = Value(CLASS_NAME_FS_SNAPSHOT);
00542 f["id"] = Value(ss->id);
00543 f["name"] = Value(ss->name);
00544 f["ts"] = Value(ss->ts);
00545 f["plugin_data"] = Value(ss->plugin_data);
00546 return Value(f);
00547 }
00548 return Value();
00549 }
00550
00551 lsm_nfs_export *value_to_nfs_export(Value & exp)
00552 {
00553 lsm_nfs_export *rc = NULL;
00554 if (is_expected_object(exp, CLASS_NAME_FS_EXPORT)) {
00555 int ok = 0;
00556 lsm_string_list *root = NULL;
00557 lsm_string_list *rw = NULL;
00558 lsm_string_list *ro = NULL;
00559
00560 std::map < std::string, Value > i = exp.asObject();
00561
00562
00563 root = value_to_string_list(i["root"]);
00564 if (root) {
00565 rw = value_to_string_list(i["rw"]);
00566 if (rw) {
00567 ro = value_to_string_list(i["ro"]);
00568 if (!ro) {
00569 lsm_string_list_free(rw);
00570 lsm_string_list_free(root);
00571 rw = NULL;
00572 root = NULL;
00573 } else {
00574 ok = 1;
00575 }
00576 } else {
00577 lsm_string_list_free(root);
00578 root = NULL;
00579 }
00580 }
00581
00582 if (ok) {
00583 rc = lsm_nfs_export_record_alloc(i["id"].asC_str(),
00584 i["fs_id"].asC_str(),
00585 i["export_path"].asC_str(),
00586 i["auth"].asC_str(),
00587 root,
00588 rw,
00589 ro,
00590 i["anonuid"].asUint64_t(),
00591 i["anongid"].asUint64_t(),
00592 i["options"].asC_str(),
00593 i["plugin_data"].asC_str());
00594
00595 lsm_string_list_free(root);
00596 lsm_string_list_free(rw);
00597 lsm_string_list_free(ro);
00598 }
00599 } else {
00600 throw ValueException("value_to_nfs_export: Not correct type");
00601 }
00602 return rc;
00603 }
00604
00605 Value nfs_export_to_value(lsm_nfs_export * exp)
00606 {
00607 if (LSM_IS_NFS_EXPORT(exp)) {
00608 std::map < std::string, Value > f;
00609 f["class"] = Value(CLASS_NAME_FS_EXPORT);
00610 f["id"] = Value(exp->id);
00611 f["fs_id"] = Value(exp->fs_id);
00612 f["export_path"] = Value(exp->export_path);
00613 f["auth"] = Value(exp->auth_type);
00614 f["root"] = Value(string_list_to_value(exp->root));
00615 f["rw"] = Value(string_list_to_value(exp->rw));
00616 f["ro"] = Value(string_list_to_value(exp->ro));
00617 f["anonuid"] = Value(exp->anonuid);
00618 f["anongid"] = Value(exp->anongid);
00619 f["options"] = Value(exp->options);
00620 f["plugin_data"] = Value(exp->plugin_data);
00621 return Value(f);
00622 }
00623 return Value();
00624
00625 }
00626
00627 lsm_storage_capabilities *value_to_capabilities(Value & exp)
00628 {
00629 lsm_storage_capabilities *rc = NULL;
00630 if (is_expected_object(exp, CLASS_NAME_CAPABILITIES)) {
00631 const char *val = exp["cap"].asC_str();
00632 rc = lsm_capability_record_alloc(val);
00633 } else {
00634 throw ValueException("value_to_capabilities: Not correct type");
00635 }
00636 return rc;
00637 }
00638
00639 Value capabilities_to_value(lsm_storage_capabilities * cap)
00640 {
00641 if (LSM_IS_CAPABILITIY(cap)) {
00642 std::map < std::string, Value > c;
00643 char *t = capability_string(cap);
00644 c["class"] = Value(CLASS_NAME_CAPABILITIES);
00645 c["cap"] = Value(t);
00646 free(t);
00647 return Value(c);
00648 }
00649 return Value();
00650 }
00651
00652
00653 lsm_target_port *value_to_target_port(Value & tp)
00654 {
00655 lsm_target_port *rc = NULL;
00656 if (is_expected_object(tp, CLASS_NAME_TARGET_PORT)) {
00657 rc = lsm_target_port_record_alloc(tp["id"].asC_str(),
00658 (lsm_target_port_type)
00659 tp["port_type"].asInt32_t(),
00660 tp["service_address"].asC_str(),
00661 tp["network_address"].asC_str(),
00662 tp["physical_address"].asC_str(),
00663 tp["physical_name"].asC_str(),
00664 tp["system_id"].asC_str(),
00665 tp["plugin_data"].asC_str());
00666 } else {
00667 throw ValueException("value_to_target_port: Not correct type");
00668 }
00669 return rc;
00670 }
00671
00672 Value target_port_to_value(lsm_target_port * tp)
00673 {
00674 if (LSM_IS_TARGET_PORT(tp)) {
00675 std::map < std::string, Value > p;
00676 p["class"] = Value(CLASS_NAME_TARGET_PORT);
00677 p["id"] = Value(tp->id);
00678 p["port_type"] = Value(tp->port_type);
00679 p["service_address"] = Value(tp->service_address);
00680 p["network_address"] = Value(tp->network_address);
00681 p["physical_address"] = Value(tp->physical_address);
00682 p["physical_name"] = Value(tp->physical_name);
00683 p["system_id"] = Value(tp->system_id);
00684 p["plugin_data"] = Value(tp->plugin_data);
00685 return Value(p);
00686 }
00687 return Value();
00688 }
00689
00690 int values_to_uint32_array(Value & value, uint32_t ** uint32_array,
00691 uint32_t * count)
00692 {
00693 int rc = LSM_ERR_OK;
00694 *count = 0;
00695 try {
00696 std::vector < Value > data = value.asArray();
00697 *count = data.size();
00698 if (*count) {
00699 *uint32_array = (uint32_t *) malloc(sizeof(uint32_t) * *count);
00700 if (*uint32_array) {
00701 uint32_t i;
00702 for (i = 0; i < *count; i++) {
00703 (*uint32_array)[i] = data[i].asUint32_t();
00704 }
00705 } else {
00706 rc = LSM_ERR_NO_MEMORY;
00707 }
00708 }
00709 }
00710 catch(const ValueException & ve) {
00711 if (*count) {
00712 free(*uint32_array);
00713 *uint32_array = NULL;
00714 *count = 0;
00715 }
00716 rc = LSM_ERR_LIB_BUG;
00717 }
00718 return rc;
00719 }
00720
00721 Value uint32_array_to_value(uint32_t * uint32_array, uint32_t count)
00722 {
00723 std::vector < Value > rc;
00724 if (uint32_array && count) {
00725 uint32_t i;
00726 rc.reserve(count);
00727 for (i = 0; i < count; i++) {
00728 rc.push_back(uint32_array[i]);
00729 }
00730 }
00731 return rc;
00732 }