• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc.  All rights reserved.
3 //
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file or at
6 // https://developers.google.com/open-source/licenses/bsd
7 
8 // Author: seongkim@google.com (Seong Beom Kim)
9 //  Based on original Protocol Buffers design by
10 //  Sanjay Ghemawat, Jeff Dean, and others.
11 
12 #ifndef GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_LAYOUT_HELPER_H__
13 #define GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_LAYOUT_HELPER_H__
14 
15 #include "google/protobuf/compiler/cpp/options.h"
16 #include "google/protobuf/descriptor.h"
17 
18 namespace google {
19 namespace protobuf {
20 namespace compiler {
21 namespace cpp {
22 
23 class MessageSCCAnalyzer;
24 
25 // Provides an abstract interface to optimize message layout
26 // by rearranging the fields of a message.
27 class MessageLayoutHelper {
28  public:
~MessageLayoutHelper()29   virtual ~MessageLayoutHelper() {}
30 
31   virtual void OptimizeLayout(std::vector<const FieldDescriptor*>* fields,
32                               const Options& options,
33                               MessageSCCAnalyzer* scc_analyzer) = 0;
34 };
35 
36 }  // namespace cpp
37 }  // namespace compiler
38 }  // namespace protobuf
39 }  // namespace google
40 
41 #endif  // GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_LAYOUT_HELPER_H__
42