This is an automated email from the ASF dual-hosted git repository.
xiaokang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-graphar.git
The following commit(s) were added to refs/heads/main by this push:
new 23816405 feat(c++): specify underlying types for enums in fwd.h (#811)
23816405 is described below
commit 238164054f48c67d7789a5f5bfc7b5b9aea4e203
Author: devadhe sb <[email protected]>
AuthorDate: Thu Dec 25 17:00:11 2025 +0530
feat(c++): specify underlying types for enums in fwd.h (#811)
* updated types to platform independent types
* updated types
* removed forward declaration for Type class
* Apply clang-format and cpplint fixes
* Format C++ code with clang-format-8
* formatted with clang-format-8 to meet github action pipeline
---
cpp/src/graphar/fwd.h | 11 +++++------
cpp/src/graphar/types.h | 4 ++--
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/cpp/src/graphar/fwd.h b/cpp/src/graphar/fwd.h
index e7feefd0..4da33c79 100644
--- a/cpp/src/graphar/fwd.h
+++ b/cpp/src/graphar/fwd.h
@@ -70,16 +70,15 @@ class FileSystem;
/** Type of vertex id or vertex index. */
using IdType = int64_t;
-enum class Type;
class DataType;
/** Defines how multiple values are handled for a given property key */
-enum Cardinality { SINGLE, LIST, SET };
+enum Cardinality : int32_t { SINGLE, LIST, SET };
/** Type of file format */
-enum FileType { CSV = 0, PARQUET = 1, ORC = 2, JSON = 3 };
-enum SelectType { PROPERTIES = 0, LABELS = 1 };
+enum FileType : int32_t { CSV = 0, PARQUET = 1, ORC = 2, JSON = 3 };
+enum SelectType : int32_t { PROPERTIES = 0, LABELS = 1 };
/** GetChunkVersion: V1 use scanner, V2 use FileReader */
-enum GetChunkVersion { AUTO = 0, V1 = 1, V2 = 2 };
-enum class AdjListType : uint8_t;
+enum GetChunkVersion : int32_t { AUTO = 0, V1 = 1, V2 = 2 };
+enum class AdjListType : int32_t;
template <typename T>
class Array;
diff --git a/cpp/src/graphar/types.h b/cpp/src/graphar/types.h
index 54f322ee..9e5bb93f 100644
--- a/cpp/src/graphar/types.h
+++ b/cpp/src/graphar/types.h
@@ -36,7 +36,7 @@ class DataType;
namespace graphar {
/** @brief Main data type enumeration. */
-enum class Type {
+enum class Type : int32_t {
/** Boolean */
BOOL = 0,
@@ -170,7 +170,7 @@ class Date {
};
/** Adj list type enumeration for adjacency list of graph. */
-enum class AdjListType : std::uint8_t {
+enum class AdjListType : std::int32_t {
/// collection of edges by source, but unordered, can represent COO format
unordered_by_source = 0b00000001,
/// collection of edges by destination, but unordered, can represent COO
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]