mirror of https://gitee.com/bigwinds/arangodb
move edge-related functionality to file of its own
This commit is contained in:
parent
6847caac80
commit
dca19fcd32
24
Makefile.in
24
Makefile.in
|
@ -587,6 +587,7 @@ am__bin_arangod_SOURCES_DIST = arangod/Actions/actions.cpp \
|
|||
arangod/VocBase/collection.c arangod/VocBase/compactor.c \
|
||||
arangod/VocBase/datafile.c \
|
||||
arangod/VocBase/document-collection.c \
|
||||
arangod/VocBase/edge-collection.c \
|
||||
arangod/VocBase/general-cursor.c arangod/VocBase/headers.c \
|
||||
arangod/VocBase/index.c arangod/VocBase/primary-collection.c \
|
||||
arangod/VocBase/shadow-data.c \
|
||||
|
@ -656,6 +657,7 @@ am_bin_arangod_OBJECTS = \
|
|||
arangod/VocBase/bin_arangod-compactor.$(OBJEXT) \
|
||||
arangod/VocBase/bin_arangod-datafile.$(OBJEXT) \
|
||||
arangod/VocBase/bin_arangod-document-collection.$(OBJEXT) \
|
||||
arangod/VocBase/bin_arangod-edge-collection.$(OBJEXT) \
|
||||
arangod/VocBase/bin_arangod-general-cursor.$(OBJEXT) \
|
||||
arangod/VocBase/bin_arangod-headers.$(OBJEXT) \
|
||||
arangod/VocBase/bin_arangod-index.$(OBJEXT) \
|
||||
|
@ -1422,6 +1424,7 @@ bin_arangod_SOURCES = arangod/Actions/actions.cpp \
|
|||
arangod/VocBase/collection.c arangod/VocBase/compactor.c \
|
||||
arangod/VocBase/datafile.c \
|
||||
arangod/VocBase/document-collection.c \
|
||||
arangod/VocBase/edge-collection.c \
|
||||
arangod/VocBase/general-cursor.c arangod/VocBase/headers.c \
|
||||
arangod/VocBase/index.c arangod/VocBase/primary-collection.c \
|
||||
arangod/VocBase/shadow-data.c \
|
||||
|
@ -2655,6 +2658,9 @@ arangod/VocBase/bin_arangod-datafile.$(OBJEXT): \
|
|||
arangod/VocBase/bin_arangod-document-collection.$(OBJEXT): \
|
||||
arangod/VocBase/$(am__dirstamp) \
|
||||
arangod/VocBase/$(DEPDIR)/$(am__dirstamp)
|
||||
arangod/VocBase/bin_arangod-edge-collection.$(OBJEXT): \
|
||||
arangod/VocBase/$(am__dirstamp) \
|
||||
arangod/VocBase/$(DEPDIR)/$(am__dirstamp)
|
||||
arangod/VocBase/bin_arangod-general-cursor.$(OBJEXT): \
|
||||
arangod/VocBase/$(am__dirstamp) \
|
||||
arangod/VocBase/$(DEPDIR)/$(am__dirstamp)
|
||||
|
@ -2834,6 +2840,7 @@ mostlyclean-compile:
|
|||
-rm -f arangod/VocBase/bin_arangod-compactor.$(OBJEXT)
|
||||
-rm -f arangod/VocBase/bin_arangod-datafile.$(OBJEXT)
|
||||
-rm -f arangod/VocBase/bin_arangod-document-collection.$(OBJEXT)
|
||||
-rm -f arangod/VocBase/bin_arangod-edge-collection.$(OBJEXT)
|
||||
-rm -f arangod/VocBase/bin_arangod-general-cursor.$(OBJEXT)
|
||||
-rm -f arangod/VocBase/bin_arangod-headers.$(OBJEXT)
|
||||
-rm -f arangod/VocBase/bin_arangod-index.$(OBJEXT)
|
||||
|
@ -3089,6 +3096,7 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@arangod/VocBase/$(DEPDIR)/bin_arangod-compactor.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@arangod/VocBase/$(DEPDIR)/bin_arangod-datafile.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@arangod/VocBase/$(DEPDIR)/bin_arangod-document-collection.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@arangod/VocBase/$(DEPDIR)/bin_arangod-edge-collection.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@arangod/VocBase/$(DEPDIR)/bin_arangod-general-cursor.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@arangod/VocBase/$(DEPDIR)/bin_arangod-headers.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@arangod/VocBase/$(DEPDIR)/bin_arangod-index.Po@am__quote@
|
||||
|
@ -3951,6 +3959,22 @@ arangod/VocBase/bin_arangod-document-collection.obj: arangod/VocBase/document-co
|
|||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bin_arangod_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o arangod/VocBase/bin_arangod-document-collection.obj `if test -f 'arangod/VocBase/document-collection.c'; then $(CYGPATH_W) 'arangod/VocBase/document-collection.c'; else $(CYGPATH_W) '$(srcdir)/arangod/VocBase/document-collection.c'; fi`
|
||||
|
||||
arangod/VocBase/bin_arangod-edge-collection.o: arangod/VocBase/edge-collection.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bin_arangod_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT arangod/VocBase/bin_arangod-edge-collection.o -MD -MP -MF arangod/VocBase/$(DEPDIR)/bin_arangod-edge-collection.Tpo -c -o arangod/VocBase/bin_arangod-edge-collection.o `test -f 'arangod/VocBase/edge-collection.c' || echo '$(srcdir)/'`arangod/VocBase/edge-collection.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) arangod/VocBase/$(DEPDIR)/bin_arangod-edge-collection.Tpo arangod/VocBase/$(DEPDIR)/bin_arangod-edge-collection.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='arangod/VocBase/edge-collection.c' object='arangod/VocBase/bin_arangod-edge-collection.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bin_arangod_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o arangod/VocBase/bin_arangod-edge-collection.o `test -f 'arangod/VocBase/edge-collection.c' || echo '$(srcdir)/'`arangod/VocBase/edge-collection.c
|
||||
|
||||
arangod/VocBase/bin_arangod-edge-collection.obj: arangod/VocBase/edge-collection.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bin_arangod_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT arangod/VocBase/bin_arangod-edge-collection.obj -MD -MP -MF arangod/VocBase/$(DEPDIR)/bin_arangod-edge-collection.Tpo -c -o arangod/VocBase/bin_arangod-edge-collection.obj `if test -f 'arangod/VocBase/edge-collection.c'; then $(CYGPATH_W) 'arangod/VocBase/edge-collection.c'; else $(CYGPATH_W) '$(srcdir)/arangod/VocBase/edge-collection.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) arangod/VocBase/$(DEPDIR)/bin_arangod-edge-collection.Tpo arangod/VocBase/$(DEPDIR)/bin_arangod-edge-collection.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='arangod/VocBase/edge-collection.c' object='arangod/VocBase/bin_arangod-edge-collection.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bin_arangod_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o arangod/VocBase/bin_arangod-edge-collection.obj `if test -f 'arangod/VocBase/edge-collection.c'; then $(CYGPATH_W) 'arangod/VocBase/edge-collection.c'; else $(CYGPATH_W) '$(srcdir)/arangod/VocBase/edge-collection.c'; fi`
|
||||
|
||||
arangod/VocBase/bin_arangod-general-cursor.o: arangod/VocBase/general-cursor.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bin_arangod_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT arangod/VocBase/bin_arangod-general-cursor.o -MD -MP -MF arangod/VocBase/$(DEPDIR)/bin_arangod-general-cursor.Tpo -c -o arangod/VocBase/bin_arangod-general-cursor.o `test -f 'arangod/VocBase/general-cursor.c' || echo '$(srcdir)/'`arangod/VocBase/general-cursor.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) arangod/VocBase/$(DEPDIR)/bin_arangod-general-cursor.Tpo arangod/VocBase/$(DEPDIR)/bin_arangod-general-cursor.Po
|
||||
|
|
|
@ -79,6 +79,7 @@ bin_arangod_SOURCES = \
|
|||
arangod/VocBase/compactor.c \
|
||||
arangod/VocBase/datafile.c \
|
||||
arangod/VocBase/document-collection.c \
|
||||
arangod/VocBase/edge-collection.c \
|
||||
arangod/VocBase/general-cursor.c \
|
||||
arangod/VocBase/headers.c \
|
||||
arangod/VocBase/index.c \
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "Rest/HttpRequest.h"
|
||||
#include "Rest/JsonContainer.h"
|
||||
#include "VocBase/document-collection.h"
|
||||
#include "VocBase/edge-collection.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace triagens::basics;
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "V8/v8-conv.h"
|
||||
#include "V8/v8-utils.h"
|
||||
#include "V8Server/v8-vocbase.h"
|
||||
#include "VocBase/edge-collection.h"
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- HELPER FUNCTIONS
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#include "VocBase/datafile.h"
|
||||
#include "VocBase/general-cursor.h"
|
||||
#include "VocBase/document-collection.h"
|
||||
#include "VocBase/edge-collection.h"
|
||||
#include "VocBase/voc-shaper.h"
|
||||
#include "Basics/Utf8Helper.h"
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief simple collection with global read-write lock
|
||||
/// @brief document collection with global read-write lock
|
||||
///
|
||||
/// @file
|
||||
///
|
||||
|
@ -33,6 +33,7 @@
|
|||
#include "BasicsC/logging.h"
|
||||
#include "BasicsC/strings.h"
|
||||
#include "ShapedJson/shape-accessor.h"
|
||||
#include "VocBase/edge-collection.h"
|
||||
#include "VocBase/index.h"
|
||||
#include "VocBase/voc-shaper.h"
|
||||
|
||||
|
@ -3201,56 +3202,6 @@ static TRI_json_t* JsonPrimary (TRI_index_t* idx, TRI_primary_collection_t const
|
|||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- EDGES INDEX
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup VocBase
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief looks up edges
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
TRI_vector_pointer_t TRI_LookupEdgesDocumentCollection (TRI_document_collection_t* edges,
|
||||
TRI_edge_direction_e direction,
|
||||
TRI_voc_cid_t cid,
|
||||
TRI_voc_did_t did) {
|
||||
union { TRI_doc_mptr_t* v; TRI_doc_mptr_t const* c; } cnv;
|
||||
TRI_vector_pointer_t result;
|
||||
TRI_edge_header_t entry;
|
||||
TRI_vector_pointer_t found;
|
||||
size_t i;
|
||||
|
||||
TRI_InitVectorPointer(&result, TRI_UNKNOWN_MEM_ZONE);
|
||||
|
||||
entry._direction = direction;
|
||||
entry._cid = cid;
|
||||
entry._did = did;
|
||||
|
||||
found = TRI_LookupByKeyMultiPointer(TRI_UNKNOWN_MEM_ZONE, &edges->_edgesIndex, &entry);
|
||||
|
||||
for (i = 0; i < found._length; ++i) {
|
||||
cnv.c = ((TRI_edge_header_t*) found._buffer[i])->_mptr;
|
||||
|
||||
TRI_PushBackVectorPointer(&result, cnv.v);
|
||||
}
|
||||
|
||||
TRI_DestroyVectorPointer(&found);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- CAP CONSTRAINT
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
@ -202,43 +202,6 @@ typedef struct TRI_document_collection_s {
|
|||
}
|
||||
TRI_document_collection_t;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief edge from and to
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef struct TRI_document_edge_s {
|
||||
TRI_voc_cid_t _fromCid;
|
||||
TRI_voc_did_t _fromDid;
|
||||
|
||||
TRI_voc_cid_t _toCid;
|
||||
TRI_voc_did_t _toDid;
|
||||
}
|
||||
TRI_document_edge_t;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief edge direction
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef enum {
|
||||
TRI_EDGE_UNUSED = 0,
|
||||
TRI_EDGE_IN = 1,
|
||||
TRI_EDGE_OUT = 2,
|
||||
TRI_EDGE_ANY = 3
|
||||
}
|
||||
TRI_edge_direction_e;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief index entry for edges
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef struct TRI_edge_header_s {
|
||||
TRI_doc_mptr_t const* _mptr;
|
||||
TRI_edge_direction_e _direction;
|
||||
TRI_voc_cid_t _cid; // from or to, depending on the direction
|
||||
TRI_voc_did_t _did; // from or to, depending on the direction
|
||||
}
|
||||
TRI_edge_header_t;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -347,32 +310,6 @@ bool TRI_DropIndexDocumentCollection (TRI_document_collection_t* collection, TRI
|
|||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- EDGES INDEX
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup VocBase
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief looks up edges
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
TRI_vector_pointer_t TRI_LookupEdgesDocumentCollection (TRI_document_collection_t* edges,
|
||||
TRI_edge_direction_e direction,
|
||||
TRI_voc_cid_t cid,
|
||||
TRI_voc_did_t did);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- CAP CONSTRAINT
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
@ -0,0 +1,92 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief edge collection
|
||||
///
|
||||
/// @file
|
||||
///
|
||||
/// DISCLAIMER
|
||||
///
|
||||
/// Copyright 2010-2011 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 triAGENS GmbH, Cologne, Germany
|
||||
///
|
||||
/// @author Dr. Frank Celler
|
||||
/// @author Copyright 2011, triagens GmbH, Cologne, Germany
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "edge-collection.h"
|
||||
|
||||
//#include "BasicsC/conversions.h"
|
||||
//#include "BasicsC/files.h"
|
||||
//#include "BasicsC/hashes.h"
|
||||
//#include "BasicsC/logging.h"
|
||||
//#include "BasicsC/strings.h"
|
||||
//#include "ShapedJson/shape-accessor.h"
|
||||
//#include "VocBase/index.h"
|
||||
//#include "VocBase/voc-shaper.h"
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- EDGES INDEX
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup VocBase
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief looks up edges
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
TRI_vector_pointer_t TRI_LookupEdgesDocumentCollection (TRI_document_collection_t* edges,
|
||||
TRI_edge_direction_e direction,
|
||||
TRI_voc_cid_t cid,
|
||||
TRI_voc_did_t did) {
|
||||
union { TRI_doc_mptr_t* v; TRI_doc_mptr_t const* c; } cnv;
|
||||
TRI_vector_pointer_t result;
|
||||
TRI_edge_header_t entry;
|
||||
TRI_vector_pointer_t found;
|
||||
size_t i;
|
||||
|
||||
TRI_InitVectorPointer(&result, TRI_UNKNOWN_MEM_ZONE);
|
||||
|
||||
entry._direction = direction;
|
||||
entry._cid = cid;
|
||||
entry._did = did;
|
||||
|
||||
found = TRI_LookupByKeyMultiPointer(TRI_UNKNOWN_MEM_ZONE, &edges->_edgesIndex, &entry);
|
||||
|
||||
for (i = 0; i < found._length; ++i) {
|
||||
cnv.c = ((TRI_edge_header_t*) found._buffer[i])->_mptr;
|
||||
|
||||
TRI_PushBackVectorPointer(&result, cnv.v);
|
||||
}
|
||||
|
||||
TRI_DestroyVectorPointer(&found);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Local Variables:
|
||||
// mode: outline-minor
|
||||
// outline-regexp: "^\\(/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|// --SECTION--\\|/// @\\}\\)"
|
||||
// End:
|
|
@ -0,0 +1,126 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief edge collection
|
||||
///
|
||||
/// @file
|
||||
///
|
||||
/// DISCLAIMER
|
||||
///
|
||||
/// Copyright 2010-2011 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 triAGENS GmbH, Cologne, Germany
|
||||
///
|
||||
/// @author Dr. Frank Celler
|
||||
/// @author Copyright 2011, triagens GmbH, Cologne, Germany
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef TRIAGENS_DURHAM_VOC_BASE_EDGE_COLLECTION_H
|
||||
#define TRIAGENS_DURHAM_VOC_BASE_EDGE_COLLECTION_H 1
|
||||
|
||||
#include <VocBase/document-collection.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- EDGE COLLECTION
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public types
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup VocBase
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief edge from and to
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef struct TRI_document_edge_s {
|
||||
TRI_voc_cid_t _fromCid;
|
||||
TRI_voc_did_t _fromDid;
|
||||
|
||||
TRI_voc_cid_t _toCid;
|
||||
TRI_voc_did_t _toDid;
|
||||
}
|
||||
TRI_document_edge_t;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief edge direction
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef enum {
|
||||
TRI_EDGE_UNUSED = 0,
|
||||
TRI_EDGE_IN = 1,
|
||||
TRI_EDGE_OUT = 2,
|
||||
TRI_EDGE_ANY = 3
|
||||
}
|
||||
TRI_edge_direction_e;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief index entry for edges
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef struct TRI_edge_header_s {
|
||||
TRI_doc_mptr_t const* _mptr;
|
||||
TRI_edge_direction_e _direction;
|
||||
TRI_voc_cid_t _cid; // from or to, depending on the direction
|
||||
TRI_voc_did_t _did; // from or to, depending on the direction
|
||||
}
|
||||
TRI_edge_header_t;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- EDGES INDEX
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup VocBase
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief looks up edges
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
TRI_vector_pointer_t TRI_LookupEdgesDocumentCollection (TRI_document_collection_t* edges,
|
||||
TRI_edge_direction_e direction,
|
||||
TRI_voc_cid_t cid,
|
||||
TRI_voc_did_t did);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// Local Variables:
|
||||
// mode: outline-minor
|
||||
// outline-regexp: "^\\(/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|// --SECTION--\\|/// @\\}\\)"
|
||||
// End:
|
Loading…
Reference in New Issue