inline void stinger_vertex_to_json(const stinger_vertices_t * vertices, stinger_physmap_t * phys, vindex_t v, FILE * out, int64_t indent_level) { const stinger_vertex_t * vout = VTX(v); JSON_INIT(out, indent_level); JSON_OBJECT_START_UNLABELED(); JSON_INT64(vid, v); JSON_VTYPE(vtype, vout->type); JSON_VWEIGHT(vweight, vout->weight); JSON_INT64(inDegree, vout->inDegree); JSON_INT64(outDegree, vout->outDegree); JSON_SUBOBJECT(physID); stinger_physmap_id_to_json(phys, v, out, indent_level+1); #if defined(STINGER_VERTEX_KEY_VALUE_STORE) /* TODO attributes */ #endif JSON_OBJECT_END(); JSON_END(); }
inline void stinger_vertex_to_json_with_type_strings(const stinger_vertices_t * vertices, const stinger_names_t * tn, stinger_physmap_t * phys, vindex_t v, FILE * out, int64_t indent_level) { const stinger_vertex_t * vout = VTX(v); JSON_INIT(out, indent_level); JSON_OBJECT_START_UNLABELED(); JSON_INT64(vid, v); char * vtype = stinger_names_lookup_name(tn,vout->type); if(vtype) { JSON_STRING(vtype, vtype); } else { JSON_INT64(vtype, vout->type); } JSON_VWEIGHT(vweight, vout->weight); JSON_INT64(inDegree, vout->inDegree); JSON_INT64(outDegree, vout->outDegree); JSON_SUBOBJECT(physID); stinger_physmap_id_to_json(phys, v, out, indent_level+1); #if defined(STINGER_VERTEX_KEY_VALUE_STORE) /* TODO attributes */ #endif JSON_OBJECT_END(); JSON_END(); }
inline vweight_t stinger_vertex_weight_increment(const stinger_vertices_t * vertices, vindex_t v, vweight_t weight) { return stinger_vweight_fetch_add(&(VTX(v)->weight), weight); }
inline vweight_t stinger_vertex_weight_get(const stinger_vertices_t * vertices, vindex_t v) { return VTX(v)->weight; }
inline vweight_t stinger_vertex_weight_set(const stinger_vertices_t * vertices, vindex_t v, vweight_t weight) { return (VTX(v)->weight = weight); }
inline vtype_t stinger_vertex_type_get(const stinger_vertices_t * vertices, vindex_t v) { return VTX(v)->type; }
inline vtype_t stinger_vertex_type_set(const stinger_vertices_t * vertices, vindex_t v, vtype_t type) { return (VTX(v)->type = type); }
inline adjacency_t stinger_vertex_edges_get_and_lock(const stinger_vertices_t * vertices, vindex_t v) { return readfe(&(VTX(v)->edges)); }
inline adjacency_t stinger_vertex_edges_set(const stinger_vertices_t * vertices, vindex_t v, adjacency_t edges) { return (VTX(v)->edges = edges); }
inline adjacency_t * stinger_vertex_edges_pointer_get(const stinger_vertices_t * vertices, vindex_t v) { return &(VTX(v)->edges); }
inline vdegree_t stinger_vertex_outdegree_increment_atomic(const stinger_vertices_t * vertices, vindex_t v, vdegree_t degree) { return stinger_vdegree_fetch_add_atomic(&(VTX(v)->outDegree), degree); }
inline vdegree_t stinger_vertex_outdegree_increment(const stinger_vertices_t * vertices, vindex_t v, vdegree_t degree) { return (VTX(v)->outDegree += degree); }
inline vdegree_t stinger_vertex_outdegree_get(const stinger_vertices_t * vertices, vindex_t v) { return VTX(v)->outDegree; }
inline vdegree_t stinger_vertex_indegree_set(const stinger_vertices_t * vertices, vindex_t v, vdegree_t degree) { return (VTX(v)->inDegree = degree); }