<commit_before>////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2014-2016 ArangoDB GmbH, Cologne, Germany
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
///     http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
///
/// @author <NAME>
////////////////////////////////////////////////////////////////////////////////

#ifndef ARANGOD_GRAPH_EDGEDOCUMENTTOKEN_H
#define ARANGOD_GRAPH_EDGEDOCUMENTTOKEN_H 1

#include "Basics/Common.h"
#include "Basics/StringRef.h"
#include "StorageEngine/DocumentIdentifierToken.h"
#include "VocBase/voc-types.h"

namespace arangodb {

namespace graph {

/// @brief Pure virtual abstract class to uniquely identify an edge
struct EdgeDocumentToken {
  
  EdgeDocumentToken() noexcept
    : _data(0, DocumentIdentifierToken()) {}
  
  EdgeDocumentToken(EdgeDocumentToken&& edtkn) noexcept {
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
    _type = edtkn._type;
#endif
    memmove(&(this->_data), &(edtkn._data), sizeof(TokenData));
  }
  
  EdgeDocumentToken(EdgeDocumentToken const& edtkn) noexcept {
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
    _type = edtkn._type;
#endif
    memcpy(&(this->_data), &(edtkn._data), sizeof(TokenData));
  }
  
  EdgeDocumentToken(TRI_voc_cid_t const cid,
                    DocumentIdentifierToken const token) noexcept : _data(cid, token) {
    _type = EdgeDocumentToken::TokenType::LOCAL;
  }
  
  EdgeDocumentToken(arangodb::velocypack::Slice const& edge) noexcept : _data(edge) {
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
    _type = EdgeDocumentToken::TokenType::COORDINATOR;
#endif
  }
  
  EdgeDocumentToken& operator=(EdgeDocumentToken&& edtkn) {
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
    _type = edtkn._type;
#endif
    memcpy(&(this->_data), &(edtkn._data), sizeof(TokenData));
    return *this;
  }
  
  TRI_voc_cid_t cid() const {
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
    TRI_ASSERT(_type == TokenType::LOCAL);
#endif
    TRI_ASSERT(_data.document.cid != 0);
    return _data.document.cid;
  }
  
  DocumentIdentifierToken token() const {<commit_msg>fix compilation in non-maintainer-mode<commit_after>////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2014-2016 ArangoDB GmbH, Cologne, Germany
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
///     http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
///
/// @author <NAME>
////////////////////////////////////////////////////////////////////////////////

#ifndef ARANGOD_GRAPH_EDGEDOCUMENTTOKEN_H
#define ARANGOD_GRAPH_EDGEDOCUMENTTOKEN_H 1

#include "Basics/Common.h"
#include "Basics/StringRef.h"
#include "StorageEngine/DocumentIdentifierToken.h"
#include "VocBase/voc-types.h"

namespace arangodb {

namespace graph {

/// @brief Pure virtual abstract class to uniquely identify an edge
struct EdgeDocumentToken {
  
  EdgeDocumentToken() noexcept
    : _data(0, DocumentIdentifierToken()) {}
  
  EdgeDocumentToken(EdgeDocumentToken&& edtkn) noexcept {
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
    _type = edtkn._type;
#endif
    memmove(&(this->_data), &(edtkn._data), sizeof(TokenData));
  }
  
  EdgeDocumentToken(EdgeDocumentToken const& edtkn) noexcept {
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
    _type = edtkn._type;
#endif
    memcpy(&(this->_data), &(edtkn._data), sizeof(TokenData));
  }
  
  EdgeDocumentToken(TRI_voc_cid_t const cid,
                    DocumentIdentifierToken const token) noexcept : _data(cid, token) {
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
    _type = EdgeDocumentToken::TokenType::LOCAL;
#endif
  }
  
  EdgeDocumentToken(arangodb::velocypack::Slice const& edge) noexcept : _data(edge) {
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
    _type = EdgeDocumentToken::TokenType::COORDINATOR;
#endif
  }
  
  EdgeDocumentToken& operator=(EdgeDocumentToken&& edtkn) {
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
    _type = edtkn._type;
#endif
    memcpy(&(this->_data), &(edtkn._data), sizeof(TokenData));
    return *this;
  }
  
  TRI_voc_cid_t cid() const {
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
    TRI_ASSERT(_type == TokenType::LOCAL);
#endif
    TRI_ASSERT(_data.document.cid != 0);
    return _data.document.cid;
  }
  
  DocumentIdentifierToken token() const {
{'fraction_non_alphanumeric': 0.16484534172995, 'fraction_numerical': 0.008520096314132248, 'mean_word_length': 3.15065334358186, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7465716', 'n_tokens_mistral': 1698, 'n_tokens_neox': 1624, 'n_words': 418}