2015-09-13 17:34:17 +08:00
|
|
|
#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"
|
2015-09-13 17:34:17 +08:00
|
|
|
#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
|
|
|
{
|
2015-08-30 07:12:46 +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
|
|
|
};
|
|
|
|
|
2015-10-08 06:58:29 +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();
|
2015-10-08 06:58:29 +08:00
|
|
|
|
|
|
|
return stream << "Vertex"
|
|
|
|
<< "(xmin = " << record.tx.min()
|
|
|
|
<< ", xmax = " << record.tx.max()
|
2015-10-14 02:32:54 +08:00
|
|
|
<< "): " << buffer.str();
|
2015-10-08 06:58:29 +08:00
|
|
|
}
|
2015-07-07 22:18:26 +08:00
|
|
|
#endif
|