Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ if(MSVC)
# Avoid GCC/Clang-specific flags on MSVC.
# C++17 is already enforced via CMAKE_CXX_STANDARD/target features.
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra -Wno-unused-parameter -Wno-empty-body")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra -Wno-unused-parameter -Wno-unused-function -Wno-empty-body")
endif()

if (APPLE)
Expand Down Expand Up @@ -665,7 +665,11 @@ if (BUILD_BENCHMARKS)
add_executable(${target} ${add_test_SRCS})
target_compile_features(${target} PRIVATE cxx_std_${GAR_CXX_STANDARD})
target_include_directories(${target} PRIVATE ${PROJECT_SOURCE_DIR}/thirdparty)
target_link_libraries(${target} PRIVATE benchmark::benchmark_main graphar ${CMAKE_DL_LIBS})
if(APPLE)
target_link_libraries(${target} PRIVATE benchmark::benchmark_main graphar Arrow::arrow_shared Parquet::parquet_shared ${CMAKE_DL_LIBS})
else()
target_link_libraries(${target} PRIVATE benchmark::benchmark_main graphar parquet arrow ${CMAKE_DL_LIBS})
endif()
if (BUILD_ARROW_FROM_SOURCE)
target_include_directories(${target} SYSTEM BEFORE PRIVATE ${GAR_ARROW_INCLUDE_DIR})
if (APPLE)
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/graphar/arrow/chunk_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class VertexPropertyWriter {
*
* @param validate_level The validate level to set.
*/
inline void SetValidateLevel(const ValidateLevel& validate_level) {
void SetValidateLevel(const ValidateLevel& validate_level) {
if (validate_level == ValidateLevel::default_validate) {
return;
}
Expand All @@ -89,7 +89,7 @@ class VertexPropertyWriter {
*
* @return The validate level of this writer.
*/
inline ValidateLevel GetValidateLevel() const { return validate_level_; }
ValidateLevel GetValidateLevel() const { return validate_level_; }

/**
* @brief Write the number of vertices into the file.
Expand Down Expand Up @@ -354,7 +354,7 @@ class EdgeChunkWriter {
*
* @return The validate level of this writer.
*/
inline ValidateLevel GetValidateLevel() const { return validate_level_; }
ValidateLevel GetValidateLevel() const { return validate_level_; }

/**
* @brief Write the number of edges into the file.
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/graphar/expression.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ class ExpressionBinaryOp : public Expression {
~ExpressionBinaryOp() = default;

protected:
inline Status CheckNullArgs(std::shared_ptr<Expression> lhs,
std::shared_ptr<Expression> rhs) noexcept {
Status CheckNullArgs(std::shared_ptr<Expression> lhs,
std::shared_ptr<Expression> rhs) noexcept {
if (lhs == nullptr || rhs == nullptr) {
return Status::Invalid("Invalid expression: lhs or rhs is null");
}
Expand Down
10 changes: 5 additions & 5 deletions cpp/src/graphar/graph_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ class PropertyGroup {
*
* @return The file type of group.
*/
inline FileType GetFileType() const { return file_type_; }
FileType GetFileType() const { return file_type_; }

/** Get the prefix of property group chunk file.
*
* @return The path prefix of group.
*/
inline const std::string& GetPrefix() const { return prefix_; }
const std::string& GetPrefix() const { return prefix_; }

/**
* Check if the property group is validated.
Expand Down Expand Up @@ -143,21 +143,21 @@ class AdjacentList {
*
* @return The type of adjacent list
*/
inline AdjListType GetType() const { return type_; }
AdjListType GetType() const { return type_; }

/**
* @brief Get the file type of adjacent list
*
* @return The file type of adjacent list
*/
inline FileType GetFileType() const { return file_type_; }
FileType GetFileType() const { return file_type_; }

/**
* @brief Get the prefix of adjacent list
*
* @return The path prefix of adjacent list
*/
inline const std::string& GetPrefix() const { return prefix_; }
const std::string& GetPrefix() const { return prefix_; }

/**
* Returns whether the adjacent list is validated.
Expand Down
25 changes: 12 additions & 13 deletions cpp/src/graphar/high-level/edges_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,21 @@ class Edge {
*
* @return true/false.
*/
inline bool Empty() const noexcept { return empty_; }
bool Empty() const noexcept { return empty_; }

/**
* @brief Get source id of the edge.
*
* @return The id of the source vertex.
*/
inline IdType GetSource() const noexcept { return src_id_; }
IdType GetSource() const noexcept { return src_id_; }

/**
* @brief Get destination id of the edge.
*
* @return The id of the destination vertex.
*/
inline IdType GetDestination() const noexcept { return dst_id_; }
IdType GetDestination() const noexcept { return dst_id_; }

/**
* @brief Add a property to the edge.
Expand All @@ -81,7 +81,7 @@ class Edge {
* @param val The value of the property.
*/
// TODO(@acezen): Enable the property to be a vector(list).
inline void AddProperty(const std::string& name, const std::any& val) {
void AddProperty(const std::string& name, const std::any& val) {
empty_ = false;
properties_[name] = val;
}
Expand All @@ -92,7 +92,7 @@ class Edge {
* @param property The name of the property.
* @return The value of the property.
*/
inline const std::any& GetProperty(const std::string& property) const {
const std::any& GetProperty(const std::string& property) const {
return properties_.at(property);
}

Expand All @@ -101,8 +101,7 @@ class Edge {
*
* @return The map containing all properties of the edge.
*/
inline const std::unordered_map<std::string, std::any>& GetProperties()
const {
const std::unordered_map<std::string, std::any>& GetProperties() const {
return properties_;
}

Expand All @@ -112,7 +111,7 @@ class Edge {
* @param property The name of the property.
* @return true/false.
*/
inline bool ContainProperty(const std::string& property) const {
bool ContainProperty(const std::string& property) const {
return (properties_.find(property) != properties_.end());
}

Expand Down Expand Up @@ -207,7 +206,7 @@ class EdgesBuilder {
*
* @param validate_level The validate level to set.
*/
inline void SetValidateLevel(const ValidateLevel& validate_level) {
void SetValidateLevel(const ValidateLevel& validate_level) {
if (validate_level == ValidateLevel::default_validate) {
return;
}
Expand All @@ -220,7 +219,7 @@ class EdgesBuilder {
* @return The writerOptions provides configuration options for different file
* format writers.
*/
inline void SetWriterOptions(std::shared_ptr<WriterOptions> writer_options) {
void SetWriterOptions(std::shared_ptr<WriterOptions> writer_options) {
this->writer_options_ = writer_options;
}
/**
Expand All @@ -229,7 +228,7 @@ class EdgesBuilder {
* @param writerOptions The writerOptions provides configuration options for
* different file format writers.
*/
inline std::shared_ptr<WriterOptions> GetWriterOptions() {
std::shared_ptr<WriterOptions> GetWriterOptions() {
return this->writer_options_;
}

Expand All @@ -238,12 +237,12 @@ class EdgesBuilder {
*
* @return The validate level of this writer.
*/
inline ValidateLevel GetValidateLevel() const { return validate_level_; }
ValidateLevel GetValidateLevel() const { return validate_level_; }

/**
* @brief Clear the edges in this EdgesBuilder.
*/
inline void Clear() {
void Clear() {
edges_.clear();
num_edges_ = 0;
is_saved_ = false;
Expand Down
10 changes: 5 additions & 5 deletions cpp/src/graphar/high-level/graph_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Vertex {
*
* @return The id of the vertex.
*/
inline IdType id() const noexcept { return id_; }
IdType id() const noexcept { return id_; }

/**
* @brief Get the property value of the vertex.
Expand All @@ -86,7 +86,7 @@ class Vertex {
* @param property The property name.
* @return True if value at the property is valid, False otherwise.
*/
inline bool IsValid(const std::string& property) const {
bool IsValid(const std::string& property) const {
if (properties_.find(property) != properties_.end()) {
return properties_.at(property).has_value();
}
Expand Down Expand Up @@ -123,14 +123,14 @@ class Edge {
*
* @return The id of the source vertex.
*/
inline IdType source() const noexcept { return src_id_; }
IdType source() const noexcept { return src_id_; }

/**
* @brief Get destination id of the edge.
*
* @return The id of the destination vertex.
*/
inline IdType destination() const noexcept { return dst_id_; }
IdType destination() const noexcept { return dst_id_; }

/**
* @brief Get the property value of the edge.
Expand All @@ -147,7 +147,7 @@ class Edge {
* @param property The property name.
* @return True if value at the property is valid, False otherwise.
*/
inline bool IsValid(const std::string& property) const {
bool IsValid(const std::string& property) const {
if (properties_.find(property) != properties_.end()) {
return properties_.at(property).has_value();
}
Expand Down
31 changes: 15 additions & 16 deletions cpp/src/graphar/high-level/vertices_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,21 @@ class Vertex {
*
* @return The id of the vertex.
*/
inline IdType GetId() const noexcept { return id_; }
IdType GetId() const noexcept { return id_; }

/**
* @brief Set id of the vertex.
*
* @param id The id of the vertex.
*/
inline void SetId(IdType id) { id_ = id; }
void SetId(IdType id) { id_ = id; }

/**
* @brief Check if the vertex is empty.
*
* @return true/false.
*/
inline bool Empty() const noexcept { return empty_; }
bool Empty() const noexcept { return empty_; }

/**
* @brief Add a property to the vertex.
Expand All @@ -88,13 +88,13 @@ class Vertex {
* @param val The value of the property.
*/
// TODO(@acezen): Enable the property to be a vector(list).
inline void AddProperty(const std::string& name, const std::any& val) {
void AddProperty(const std::string& name, const std::any& val) {
empty_ = false;
properties_[name] = val;
}

inline void AddProperty(const Cardinality cardinality,
const std::string& name, const std::any& val) {
void AddProperty(const Cardinality cardinality, const std::string& name,
const std::any& val) {
if (cardinality == Cardinality::SINGLE) {
cardinalities_[name] = Cardinality::SINGLE;
AddProperty(name, val);
Expand Down Expand Up @@ -123,7 +123,7 @@ class Vertex {
* @param property The name of the property.
* @return The value of the property.
*/
inline const std::any& GetProperty(const std::string& property) const {
const std::any& GetProperty(const std::string& property) const {
return properties_.at(property);
}

Expand All @@ -132,8 +132,7 @@ class Vertex {
*
* @return The map containing all properties of the vertex.
*/
inline const std::unordered_map<std::string, std::any>& GetProperties()
const {
const std::unordered_map<std::string, std::any>& GetProperties() const {
return properties_;
}

Expand All @@ -143,11 +142,11 @@ class Vertex {
* @param property The name of the property.
* @return true/false.
*/
inline bool ContainProperty(const std::string& property) {
bool ContainProperty(const std::string& property) {
return (properties_.find(property) != properties_.end());
}

inline bool IsMultiProperty(const std::string& property) const {
bool IsMultiProperty(const std::string& property) const {
return (cardinalities_.find(property) != cardinalities_.end() &&
cardinalities_.at(property) != Cardinality::SINGLE);
}
Expand Down Expand Up @@ -260,7 +259,7 @@ class VerticesBuilder {
/**
* @brief Clear the vertices in this VerciesBuilder.
*/
inline void Clear() {
void Clear() {
vertices_.clear();
num_vertices_ = 0;
is_saved_ = false;
Expand All @@ -272,7 +271,7 @@ class VerticesBuilder {
* @return The writerOptions provides configuration options for different file
* format writers.
*/
inline void SetWriterOptions(std::shared_ptr<WriterOptions> writer_options) {
void SetWriterOptions(std::shared_ptr<WriterOptions> writer_options) {
this->writer_options_ = writer_options;
}

Expand All @@ -282,7 +281,7 @@ class VerticesBuilder {
* @param writerOptions The writerOptions provides configuration options for
* different file format writers.
*/
inline std::shared_ptr<WriterOptions> GetWriterOptions() {
std::shared_ptr<WriterOptions> GetWriterOptions() {
return this->writer_options_;
}

Expand All @@ -291,7 +290,7 @@ class VerticesBuilder {
*
* @param validate_level The validate level to set.
*/
inline void SetValidateLevel(const ValidateLevel& validate_level) {
void SetValidateLevel(const ValidateLevel& validate_level) {
if (validate_level == ValidateLevel::default_validate) {
return;
}
Expand All @@ -303,7 +302,7 @@ class VerticesBuilder {
*
* @return The validate level of this writer.
*/
inline ValidateLevel GetValidateLevel() const { return validate_level_; }
ValidateLevel GetValidateLevel() const { return validate_level_; }

/**
* @brief Add a vertex with the given index.
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/graphar/result.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ namespace graphar::internal {
// Extract Status from Status or Result<T>
// Useful for the status check macros such as RETURN_NOT_OK.
template <typename T>
inline const Status& GenericToStatus(const Result<T>& res) {
const Status& GenericToStatus(const Result<T>& res) {
return res.status();
}
template <typename T>
inline Status GenericToStatus(Result<T>&& res) {
Status GenericToStatus(Result<T>&& res) {
return std::move(res).status();
}

Expand Down
Loading
Loading