id.h 450 Bytes
Newer Older
Vladislav Perepelkin's avatar
made id    
Vladislav Perepelkin committed
1
2
#pragma once

Vladislav Perepelkin's avatar
Vladislav Perepelkin committed
3
#include "serializable.h"
Vladislav Perepelkin's avatar
made id    
Vladislav Perepelkin committed
4

Vladislav Perepelkin's avatar
Vladislav Perepelkin committed
5
6
7
#include <vector>

class Id
Vladislav Perepelkin's avatar
made id    
Vladislav Perepelkin committed
8
{
Vladislav Perepelkin's avatar
Vladislav Perepelkin committed
9
	std::vector<int> idx_;
Vladislav Perepelkin's avatar
made id    
Vladislav Perepelkin committed
10
11
public:
	Id();
Vladislav Perepelkin's avatar
Vladislav Perepelkin committed
12
	Id(const std::vector<int> &);
Vladislav Perepelkin's avatar
made id    
Vladislav Perepelkin committed
13

Vladislav Perepelkin's avatar
Vladislav Perepelkin committed
14
15
16
	bool operator<(const Id &) const;
	
	operator bool() const;
Vladislav Perepelkin's avatar
made id    
Vladislav Perepelkin committed
17

Vladislav Perepelkin's avatar
Vladislav Perepelkin committed
18
	Id operator[](int) const;
Vladislav Perepelkin's avatar
made id    
Vladislav Perepelkin committed
19
20

	std::string to_string() const;
Vladislav Perepelkin's avatar
Vladislav Perepelkin committed
21

22
	virtual size_t get_serialization_size() const noexcept;
Vladislav Perepelkin's avatar
Vladislav Perepelkin committed
23
24
25
	virtual size_t serialize(void *buf, size_t buf_size) const;
	virtual size_t deserialize(const void *buf, size_t buf_size);

Vladislav Perepelkin's avatar
made id    
Vladislav Perepelkin committed
26
};