~ubuntu-branches/ubuntu/trusty/protobuf/trusty-proposed

« back to all changes in this revision

Viewing changes to src/google/protobuf/compiler/cpp/cpp_message_field.cc

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2011-05-31 14:41:47 UTC
  • mfrom: (2.2.8 sid)
  • Revision ID: james.westby@ubuntu.com-20110531144147-s41g5fozgvyo462l
Tags: 2.4.0a-2ubuntu1
* Merge with Debian; remaining changes:
  - Fix linking with -lpthread.

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
GenerateAccessorDeclarations(io::Printer* printer) const {
76
76
  printer->Print(variables_,
77
77
    "inline const $type$& $name$() const$deprecation$;\n"
78
 
    "inline $type$* mutable_$name$()$deprecation$;\n");
 
78
    "inline $type$* mutable_$name$()$deprecation$;\n"
 
79
    "inline $type$* release_$name$()$deprecation$;\n");
79
80
}
80
81
 
81
82
void MessageFieldGenerator::
85
86
    "  return $name$_ != NULL ? *$name$_ : *default_instance_->$name$_;\n"
86
87
    "}\n"
87
88
    "inline $type$* $classname$::mutable_$name$() {\n"
88
 
    "  _set_bit($index$);\n"
 
89
    "  set_has_$name$();\n"
89
90
    "  if ($name$_ == NULL) $name$_ = new $type$;\n"
90
91
    "  return $name$_;\n"
 
92
    "}\n"
 
93
    "inline $type$* $classname$::release_$name$() {\n"
 
94
    "  clear_has_$name$();\n"
 
95
    "  $type$* temp = $name$_;\n"
 
96
    "  $name$_ = NULL;\n"
 
97
    "  return temp;\n"
91
98
    "}\n");
92
99
}
93
100