.. _program_listing_file_src_rdf4cpp_BlankNode.hpp: Program Listing for File BlankNode.hpp ====================================== |exhale_lsh| :ref:`Return to documentation for file ` (``src/rdf4cpp/BlankNode.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef RDF4CPP_BLANKNODE_HPP #define RDF4CPP_BLANKNODE_HPP #include #include #include namespace rdf4cpp { struct BlankNode : Node { BlankNode() noexcept; explicit BlankNode(storage::identifier::NodeBackendHandle handle) noexcept; explicit BlankNode(std::string_view identifier, storage::DynNodeStoragePtr node_storage = storage::default_node_storage); [[nodiscard]] static BlankNode make_null() noexcept; [[nodiscard]] static BlankNode make(std::string_view identifier, storage::DynNodeStoragePtr node_storage = storage::default_node_storage); [[nodiscard]] static BlankNode make_unchecked(std::string_view identifier, storage::DynNodeStoragePtr node_storage = storage::default_node_storage); BlankNode to_node_storage(storage::DynNodeStoragePtr node_storage) const; [[nodiscard]] BlankNode try_get_in_node_storage(storage::DynNodeStoragePtr node_storage) const noexcept; [[nodiscard]] static BlankNode find(std::string_view identifier, storage::DynNodeStoragePtr node_storage = storage::default_node_storage) noexcept; static void validate(std::string_view identifier); [[nodiscard]] CowString identifier() const noexcept; [[nodiscard]] FetchOrSerializeResult fetch_or_serialize_identifier(std::string_view &out, writer::BufWriterParts writer) const noexcept; bool serialize(writer::BufWriterParts writer) const noexcept; [[nodiscard]] std::strong_ordering order(BlankNode const &other) const noexcept; [[nodiscard]] bool order_eq(BlankNode const &other) const noexcept; [[nodiscard]] bool order_ne(BlankNode const &other) const noexcept; [[nodiscard]] bool eq(BlankNode const &other) const noexcept; [[nodiscard]] bool ne(BlankNode const &other) const noexcept; [[nodiscard]] explicit operator std::string() const noexcept; friend std::ostream &operator<<(std::ostream &os, BlankNode const &node); bool is_literal() const noexcept = delete; bool is_variable() const noexcept = delete; bool is_blank_node() const noexcept = delete; bool is_iri() const noexcept = delete; friend struct Node; }; inline namespace shorthands { BlankNode operator""_bnode(char const *str, size_t len); } // namespace shorthands } // namespace rdf4cpp template<> struct std::hash { inline size_t operator()(rdf4cpp::BlankNode const &v) const noexcept { return std::hash()(v); } }; template<> struct std::formatter : std::formatter { auto format(rdf4cpp::BlankNode n, format_context &ctx) const -> decltype(ctx.out()); }; #endif //RDF4CPP_BLANKNODE_HPP