1 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 // -*- mode: C++ -*- 3 // 4 // Copyright 2022-2024 Google LLC 5 // 6 // Licensed under the Apache License v2.0 with LLVM Exceptions (the 7 // "License"); you may not use this file except in compliance with the 8 // License. You may obtain a copy of the License at 9 // 10 // https://llvm.org/LICENSE.txt 11 // 12 // Unless required by applicable law or agreed to in writing, software 13 // distributed under the License is distributed on an "AS IS" BASIS, 14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 // See the License for the specific language governing permissions and 16 // limitations under the License. 17 // 18 // Author: Siddharth Nayyar 19 20 #ifndef STG_PROTO_WRITER_H_ 21 #define STG_PROTO_WRITER_H_ 22 23 #include <google/protobuf/io/zero_copy_stream.h> 24 #include "graph.h" 25 26 namespace stg { 27 namespace proto { 28 29 class Writer { 30 public: Writer(const stg::Graph & graph)31 explicit Writer(const stg::Graph& graph) : graph_(graph) {} 32 void Write(const Id&, google::protobuf::io::ZeroCopyOutputStream&, bool); 33 34 private: 35 const stg::Graph& graph_; 36 }; 37 38 } // namespace proto 39 } // namespace stg 40 41 #endif // STG_PROTO_WRITER_H_ 42