Home | History | Annotate | Download | only in libprofiling
      1 /*
      2  *  * Copyright (C) 2017 The Android Open Source Project
      3  *
      4  *  Licensed under the Apache License, Version 2.0 (the "License");
      5  *  you may not use this file except in compliance with the License.
      6  *  You may obtain a copy of the License at
      7  *
      8  *  http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  *  Unless required by applicable law or agreed to in writing,
     11  *  software distributed under the License is distributed on an "AS IS" BASIS,
     12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  *  See the License for the specific language governing permissions and
     14  *  limitations under the License.
     15  *
     16  */
     17 #ifndef DRIVERS_HAL_COMMON_UTILS_VTSPROFILINGUTIL_H_
     18 #define DRIVERS_HAL_COMMON_UTILS_VTSPROFILINGUTIL_H_
     19 
     20 #include "google/protobuf/io/zero_copy_stream.h"
     21 #include "google/protobuf/message_lite.h"
     22 
     23 // This file defines methods for serialization of protobuf messages in the same
     24 // way as Java's writeDelimitedTo()/parseDelimitedFrom().
     25 namespace android {
     26 namespace vts {
     27 
     28 // Serializes one message to the out file, delimited by message size.
     29 bool writeOneDelimited(const ::google::protobuf::MessageLite& message,
     30                        google::protobuf::io::ZeroCopyOutputStream* out);
     31 
     32 // Deserialize one message from the in file, delimited by message size.
     33 bool readOneDelimited(::google::protobuf::MessageLite* message,
     34                       google::protobuf::io::ZeroCopyInputStream* in);
     35 
     36 }  // namespace vts
     37 }  // namespace android
     38 #endif  // DRIVERS_HAL_COMMON_UTILS_VTSPROFILINGUTIL_H_
     39