lgraph_types
-
namespace lgraph_api
Typedefs
-
typedef std::vector<std::pair<std::string, std::string>> EdgeConstraints
Edge constraints type define
Enums
-
enum class AccessLevel
Access level a user or role has on a graph. NONE: no permission. READ: read-only, no write access. WRITE: can read and write vertex and edge, but cannot change meta data such as schema or access. FULL: full access, can modify schema, grant access to other users, or even delete this graph.
Values:
-
enumerator NONE
-
enumerator READ
-
enumerator WRITE
-
enumerator FULL
-
enumerator NONE
-
enum FieldType
Field and value types.
Values:
-
enumerator NUL
-
enumerator BOOL
-
enumerator INT8
-
enumerator INT16
-
enumerator INT32
-
enumerator INT64
-
enumerator FLOAT
-
enumerator DOUBLE
-
enumerator DATE
-
enumerator DATETIME
-
enumerator STRING
-
enumerator BLOB
-
enumerator NUL
-
enum class LGraphType : uint16_t
a type of value used in result entry and parameter in procedure or plugin signature
- Param INTEGER
- Param FLOAT
- Param DOUBLE
- Param BOOLEAN
- Param STRING
- Param MAP
<string, FieldData>
- Param NODE
VertexIterator, VertexId
- Param RELATIONSHIP
- Param PATH
lgraph_api::Path
- Param LIST
<string, FieldData>
- Param ANY
like Object in Java, its procedure author’s responsibility to check the underlying concrete type whether valid in runtime.
Values:
-
enumerator NUL
-
enumerator INTEGER
-
enumerator FLOAT
-
enumerator DOUBLE
-
enumerator BOOLEAN
-
enumerator STRING
-
enumerator NODE
-
enumerator RELATIONSHIP
-
enumerator PATH
-
enumerator LIST
-
enumerator MAP
-
enumerator ANY
Functions
-
static inline std::string to_string(const AccessLevel &v)
-
static inline std::string to_string(const FieldAccessLevel &v)
-
inline const std::string to_string(FieldType v)
Get the name of the given FieldType.
- 抛出
std::runtime_error – when an unrecognizable FieldType is given.
- 参数
v – A FieldType.
- 返回
Name of the given FieldType.
-
inline auto LGraphTypeIsField(LGraphType type) -> bool
-
inline auto LGraphTypeIsGraphElement(LGraphType type) -> bool
-
inline auto LGraphTypeIsCollection(LGraphType type) -> bool
-
inline auto LGraphTypeIsAny(LGraphType type) -> bool
-
inline std::string PluginCodeTypeStr(PluginCodeType code_type)
Get the name of plugin code types.
-
struct EdgeOptions : public LabelOptions
- #include <lgraph_types.h>
Edge label options, contain fields only edge have
Public Functions
-
EdgeOptions() = default
-
inline explicit EdgeOptions(const EdgeConstraints &edge_constraints)
-
inline virtual std::string to_string() const
-
inline virtual void clear()
-
EdgeOptions() = default
-
struct EdgeUid
- #include <lgraph_types.h>
Public Functions
-
inline EdgeUid()
-
inline EdgeUid(int64_t s, int64_t d, uint16_t l, int64_t t, int64_t e)
-
inline void Reverse()
Reverses side of this edge
-
inline std::string ToString() const
Get string representation of this object
-
inline EdgeUid()
-
struct FieldData
- #include <lgraph_types.h>
A class that represents variant type.
Public Functions
-
inline FieldData()
-
inline explicit FieldData(bool b)
-
inline explicit FieldData(int8_t integer)
-
inline explicit FieldData(int16_t integer)
-
inline explicit FieldData(int32_t integer)
-
inline explicit FieldData(int64_t integer)
-
inline explicit FieldData(float real)
-
inline explicit FieldData(double real)
-
inline explicit FieldData(const std::string &buf)
-
inline explicit FieldData(std::string &&str)
-
inline explicit FieldData(const char *buf)
-
inline explicit FieldData(const char *buf, size_t s)
-
inline ~FieldData()
-
inline int64_t integer() const
Access the FieldData as int64. Valid only when the FieldData is of INT8, INT16, INT32, or INT64 types.
- 抛出
std::bad_cast – Thrown when the FieldData is not of int types.
- 返回
An int64_t.
-
inline double real() const
Access the FieldData as a double. The FieldData must be of FLOAT or DOUBLE types.
- 抛出
std::bad_cast – Thrown if the FieldData is not of FLOAT or DOUBLE types.
- 返回
A double.
-
inline const std::string &string() const
Access the FieldData as std::string. Valid only for STRING and BLOB. BLOB data is returned as-is, since std::string can also hold byte array.
- 抛出
std::bad_cast – Thrown when a bad cast error condition occurs.
- 返回
A reference to a const std::string.
-
inline bool AsBool() const
-
inline int8_t AsInt8() const
-
inline int16_t AsInt16() const
-
inline int32_t AsInt32() const
-
inline int64_t AsInt64() const
-
inline float AsFloat() const
-
inline double AsDouble() const
- inline inline ::lgraph_api::Date AsDate () const
- inline inline ::lgraph_api::DateTime AsDateTime () const
-
inline std::string AsString() const
-
inline std::string AsBlob() const
-
inline std::string AsBase64Blob() const
-
inline std::string ToString(const std::string &null_value = "NUL") const
Get string representation of this FieldData.
-
inline bool is_null() const
-
inline bool is_buf() const
-
inline bool is_empty_buf() const
-
inline bool IsNull() const
Query if this object is null
-
inline bool IsBool() const
Query if this object is bool
-
inline bool IsBlob() const
Query if this object is BLOB
-
inline bool IsString() const
Query if this object is string
-
inline bool IsInt8() const
Query if this object is INT8
-
inline bool IsInt16() const
Query if this object is INT16
-
inline bool IsInt32() const
Query if this object is INT32
-
inline bool IsInt64() const
Query if this object is INT64
-
inline bool IsInteger() const
Is this a INT8, INT16, INT32 or INT64?
-
inline bool IsFloat() const
Query if this object is float
-
inline bool IsDouble() const
Query if this object is double
-
inline bool IsReal() const
Is this a FLOAT or DOUBLE?
-
inline bool IsDate() const
Query if this object is date
-
inline bool IsDateTime() const
Query if this object is date time
Public Members
-
bool boolean
-
int8_t int8
-
int16_t int16
-
int32_t int32
-
int64_t int64
-
float sp
-
double dp
-
std::string *buf
-
union lgraph_api::FieldData::[anonymous] data
Public Static Functions
-
static inline FieldData Date(const ::lgraph_api::Date &d)
-
static inline FieldData DateTime(const ::lgraph_api::DateTime &d)
-
inline FieldData()
-
struct FieldSpec
- #include <lgraph_types.h>
Specification for a field.
-
struct IndexSpec
- #include <lgraph_types.h>
An index specifier.
-
struct LabelOptions
- #include <lgraph_types.h>
Label options, base class, define some common fields and methods
Subclassed by EdgeOptions, VertexOptions
Public Functions
-
virtual std::string to_string() const = 0
-
virtual void clear() = 0
-
inline virtual ~LabelOptions()
Public Members
-
bool detach_property = false
-
virtual std::string to_string() const = 0
-
struct Parameter
- #include <lgraph_types.h>
The parameter of procedure/plugin
Public Members
-
std::string name
-
int index
name of the parameter
-
LGraphType type
index of the parameter list in which the parameter stay
-
std::string name
-
struct RoleInfo
- #include <lgraph_types.h>
Information about the role.
Public Members
-
std::string desc
description
-
std::map<std::string, AccessLevel> graph_access
access levels on different graphs
-
bool disabled = false
is this role disabled?
-
std::string desc
-
struct SigSpec
- #include <lgraph_types.h>
-
struct UserInfo
- #include <lgraph_types.h>
Information about the user.
-
struct VertexOptions : public LabelOptions
- #include <lgraph_types.h>
Vertex label options, contain fields only vertex have
Public Functions
-
VertexOptions() = default
-
inline explicit VertexOptions(const std::string &primary_field)
-
inline virtual std::string to_string() const
-
inline virtual void clear()
Public Members
-
std::string primary_field
-
VertexOptions() = default
-
typedef std::vector<std::pair<std::string, std::string>> EdgeConstraints