-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathgrpc_reader_writer_interface.proto
More file actions
165 lines (124 loc) · 5.13 KB
/
grpc_reader_writer_interface.proto
File metadata and controls
165 lines (124 loc) · 5.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/*
---- Copyright Start ----
This file is part of the OpenVectorFormatTools collection. This collection provides tools to facilitate the usage of the OpenVectorFormat.
Copyright (C) 2024 Digital-Production-Aachen
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
---- Copyright End ----
*/
syntax = "proto3";
package grpc_reader_writer_interface;
import "submodules/OpenVectorFormat/open_vector_format.proto";
// The service definition.
service VectorFileHandler {
// Reading a job
rpc SimpleJobRead (SimpleJobReadRequest) returns (SimpleJobReadReply) {}
rpc PartialRead (stream PartialReadRequest) returns (stream PartialReadReply) {}
// Writing a job
rpc SimpleJobWrite (SimpleJobWriteRequest) returns (SimpleJobWriteReply) {}
rpc PartialWrite (stream PartialWriteRequest) returns (stream PartialWriteReply) {}
// Helper functions
rpc IsFormatSupported (IsFormatSupportedRequest) returns (IsFormatSupportedReply) {}
}
// ------- Messages for reader functions -------
message SimpleJobReadRequest {
string job_uri = 1;
}
message SimpleJobReadReply {
string info_message = 1;
open_vector_format.Job job = 2;
}
// The names of the commands are the same as in the FileReader implementation of AbstractVectorFileHandler. Functionality, parameters etc. are also the same.
enum PartialReadCommandMode {
OPEN_JOB = 0;
UNLOAD_JOB_FROM_MEMORY = 1;
GET_JOB_SHELL = 2;
GET_PLANE = 3;
GET_VECTOR_BLOCK = 4;
}
message PartialReadRequest {
PartialReadCommandMode selected_command_mode = 1;
// Will be included in response to make identification easier.
uint64 request_id = 2;
// if true, this PartialReadRequest message will be included in the response for debugging.
bool reflect_request = 3;
// must be set for PartialReadCommandMode.OpenJob
string job_uri = 4;
// must be set for PartialReadCommandMode.GetPlane and PartialReadCommandMode.GetVectorBlock
int32 plane_index = 5;
// must be set for PartialReadCommandMode.GetVectorBlock
int32 vector_block_index = 6;
}
message PartialReadReply {
// only set in case there is extra information
string info_message = 1;
// Corresponding request ID
uint64 request_id = 2;
// Corresponding request for identification. Only set if requested in the PartialReadRequest.
PartialReadRequest request = 3;
// set for PartialReadCommandMode.GetJobShell
open_vector_format.Job job_shell = 4;
// set for PartialReadCommandMode.GetPlane
open_vector_format.WorkPlane work_plane = 5;
// set for PartialReadCommandMode.GetVectorBlock
open_vector_format.VectorBlock vector_block = 6;
// set for PartialReadCommandMode.FileLoadingFinished
bool loading_finished = 7;
}
// ------- Messages for writer functions -------
message SimpleJobWriteRequest {
string job_uri = 1;
open_vector_format.Job job = 2;
}
message SimpleJobWriteReply {
string info_message = 1;
}
// The names of the commands are the same as in the FileWriter implementation of AbstractVectorFileHandler. Functionality, parameters etc. are also the same.
enum PartialWriteCommandMode {
START_WRITE_PARTIAL = 0;
ADD_PLANE_PARTIAL = 1;
ADD_VECTOR_BLOCK_PARTIAL = 2;
}
message PartialWriteRequest {
PartialWriteCommandMode selected_command_mode = 1;
// Will be included in response to make identification easier.
uint64 request_id = 2;
// if true, this PartialWriteRequest message with all geometry data will be included in the response for debugging.
bool reflect_request = 3;
// must be set for PartialWriteCommandMode.StartWritePartial
string job_uri = 4;
open_vector_format.Job job_shell = 5;
// must be set for PartialWriteCommandMode.AddPlanePartial
open_vector_format.WorkPlane work_plane = 6;
// must be set for PartialWriteCommandMode.AddVectorBlockPartial
open_vector_format.VectorBlock vector_block = 7;
}
message PartialWriteReply {
// Corresponding request ID
uint64 request_id = 1;
// only set in case there is extra information
string info_message = 2;
// only set if reflectRequest == true in input message
PartialWriteRequest request = 3;
}
// ------- Messages for helper functions -------
// Request Message for IsFormatSupported. Should only contain file extension.
message IsFormatSupportedRequest {
string file_extension = 1;
}
// Response Message for IsFormatSupported.
message IsFormatSupportedReply {
bool read_support = 1;
bool write_support = 2;
string all_read_supported_formats = 3;
string all_write_supported_formats = 4;
}