memgraph/storage/vertex.hpp

31 lines
711 B
C++
Raw Normal View History

#ifndef MEMGRAPH_STORAGE_VERTEX_HPP
#define MEMGRAPH_STORAGE_VERTEX_HPP
2015-07-07 22:18:26 +08:00
#include <vector>
2015-10-14 02:32:54 +08:00
#include "model/properties/jsonwriter.hpp"
#include "model/record.hpp"
2015-07-07 22:18:26 +08:00
#include "edge.hpp"
2015-07-31 18:31:08 +08:00
struct Vertex : public Record<Vertex>
2015-07-07 22:18:26 +08:00
{
std::vector<Edge*> in;
2015-07-31 18:31:08 +08:00
std::vector<Edge*> out;
2015-07-07 22:18:26 +08:00
};
inline std::ostream& operator<<(std::ostream& stream, Vertex& record)
{
2015-10-14 02:32:54 +08:00
StringBuffer buffer;
JsonWriter<StringBuffer> writer(buffer);
// dump properties in this buffer
record.properties.accept(writer);
2015-10-14 02:44:14 +08:00
writer.finish();
return stream << "Vertex"
<< "(xmin = " << record.tx.min()
<< ", xmax = " << record.tx.max()
2015-10-14 02:32:54 +08:00
<< "): " << buffer.str();
}
2015-07-07 22:18:26 +08:00
#endif