Kùzu C++ API
Loading...
Searching...
No Matches
node.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <memory>
5#include <string>
6#include <utility>
7#include <vector>
8
9#include "api.h"
10
11namespace kuzu {
12namespace common {
13
14class Value;
15
20class NodeVal {
21public:
27 KUZU_API static std::vector<std::pair<std::string, std::unique_ptr<Value>>> getProperties(
28 const Value* val);
32 KUZU_API static uint64_t getNumProperties(const Value* val);
33
37 KUZU_API static std::string getPropertyName(const Value* val, uint64_t index);
38
42 KUZU_API static Value* getPropertyVal(const Value* val, uint64_t index);
46 KUZU_API static Value* getNodeIDVal(const Value* val);
50 KUZU_API static Value* getLabelVal(const Value* val);
54 KUZU_API static std::string toString(const Value* val);
55
56private:
57 static void throwIfNotNode(const Value* val);
58 // 2 offsets for id and label.
59 static constexpr uint64_t OFFSET = 2;
60};
61
62} // namespace common
63} // namespace kuzu
#define KUZU_API
Definition api.h:25
NodeVal represents a node in the graph and stores the nodeID, label and properties of that node.
Definition node.h:20
static KUZU_API std::vector< std::pair< std::string, std::unique_ptr< Value > > > getProperties(const Value *val)
static KUZU_API std::string toString(const Value *val)
static KUZU_API Value * getPropertyVal(const Value *val, uint64_t index)
static KUZU_API uint64_t getNumProperties(const Value *val)
static KUZU_API Value * getNodeIDVal(const Value *val)
static KUZU_API Value * getLabelVal(const Value *val)
static KUZU_API std::string getPropertyName(const Value *val, uint64_t index)
Definition value.h:26
Definition array_utils.h:7