TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
google::protobuf::io::CodedOutputStream Class Reference

#include <coded_stream.h>

Classes

struct  StaticVarintSize32
 

Public Member Functions

 CodedOutputStream (ZeroCopyOutputStream *output)
 
 ~CodedOutputStream ()
 
bool Skip (int count)
 
bool GetDirectBufferPointer (void **data, int *size)
 
uint8GetDirectBufferForNBytesAndAdvance (int size)
 
void WriteRaw (const void *buffer, int size)
 
void WriteRawMaybeAliased (const void *data, int size)
 
void WriteString (const string &str)
 
void EnableAliasing (bool enabled)
 
void WriteLittleEndian32 (uint32 value)
 
void WriteLittleEndian64 (uint64 value)
 
void WriteVarint32 (uint32 value)
 
void WriteVarint64 (uint64 value)
 
void WriteVarint32SignExtended (int32 value)
 
void WriteTag (uint32 value)
 
int ByteCount () const
 
bool HadError () const
 

Static Public Member Functions

static uint8WriteRawToArray (const void *buffer, int size, uint8 *target)
 
static uint8WriteStringToArray (const string &str, uint8 *target)
 
static uint8WriteStringWithSizeToArray (const string &str, uint8 *target)
 
static uint8WriteLittleEndian32ToArray (uint32 value, uint8 *target)
 
static uint8WriteLittleEndian64ToArray (uint64 value, uint8 *target)
 
static uint8WriteVarint32ToArray (uint32 value, uint8 *target)
 
static uint8WriteVarint64ToArray (uint64 value, uint8 *target)
 
static uint8WriteVarint32SignExtendedToArray (int32 value, uint8 *target)
 
static uint8WriteTagToArray (uint32 value, uint8 *target) GOOGLE_ATTRIBUTE_ALWAYS_INLINE
 
static int VarintSize32 (uint32 value)
 
static int VarintSize64 (uint64 value)
 
static int VarintSize32SignExtended (int32 value)
 

Private Member Functions

 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS (CodedOutputStream)
 
void Advance (int amount)
 
bool Refresh ()
 
void WriteAliasedRaw (const void *buffer, int size)
 

Static Private Member Functions

static uint8WriteVarint32FallbackToArray (uint32 value, uint8 *target)
 
static uint8WriteVarint32FallbackToArrayInline (uint32 value, uint8 *target) GOOGLE_ATTRIBUTE_ALWAYS_INLINE
 
static uint8WriteVarint64ToArrayInline (uint64 value, uint8 *target) GOOGLE_ATTRIBUTE_ALWAYS_INLINE
 
static int VarintSize32Fallback (uint32 value)
 

Private Attributes

ZeroCopyOutputStreamoutput_
 
uint8buffer_
 
int buffer_size_
 
int total_bytes_
 
bool had_error_
 
bool aliasing_enabled_
 

Constructor & Destructor Documentation

google::protobuf::io::CodedOutputStream::CodedOutputStream ( ZeroCopyOutputStream output)
explicit
google::protobuf::io::CodedOutputStream::~CodedOutputStream ( )

Member Function Documentation

void google::protobuf::io::CodedOutputStream::Advance ( int  amount)
inlineprivate
1129  {
1130  buffer_ += amount;
1131  buffer_size_ -= amount;
1132 }
uint8 * buffer_
Definition: coded_stream.h:755
int buffer_size_
Definition: coded_stream.h:756

+ Here is the caller graph for this function:

int google::protobuf::io::CodedOutputStream::ByteCount ( ) const
inline
1121  {
1122  return total_bytes_ - buffer_size_;
1123 }
int total_bytes_
Definition: coded_stream.h:757
int buffer_size_
Definition: coded_stream.h:756
void google::protobuf::io::CodedOutputStream::EnableAliasing ( bool  enabled)
uint8 * google::protobuf::io::CodedOutputStream::GetDirectBufferForNBytesAndAdvance ( int  size)
inline
999  {
1000  if (buffer_size_ < size) {
1001  return NULL;
1002  } else {
1003  uint8* result = buffer_;
1004  Advance(size);
1005  return result;
1006  }
1007 }
uint8 * buffer_
Definition: coded_stream.h:755
arena_t NULL
Definition: jemalloc_internal.h:624
void Advance(int amount)
Definition: coded_stream.h:1129
uint8_t uint8
Definition: Define.h:152
int buffer_size_
Definition: coded_stream.h:756

+ Here is the call graph for this function:

bool google::protobuf::io::CodedOutputStream::GetDirectBufferPointer ( void **  data,
int *  size 
)
google::protobuf::io::CodedOutputStream::GOOGLE_DISALLOW_EVIL_CONSTRUCTORS ( CodedOutputStream  )
private
bool google::protobuf::io::CodedOutputStream::HadError ( ) const
inline
749 { return had_error_; }
bool had_error_
Definition: coded_stream.h:758
bool google::protobuf::io::CodedOutputStream::Refresh ( )
private
bool google::protobuf::io::CodedOutputStream::Skip ( int  count)
int google::protobuf::io::CodedOutputStream::VarintSize32 ( uint32  value)
inlinestatic
1087  {
1088  if (value < (1 << 7)) {
1089  return 1;
1090  } else {
1091  return VarintSize32Fallback(value);
1092  }
1093 }
static int VarintSize32Fallback(uint32 value)
const FieldDescriptor value
Definition: descriptor.h:1522

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int google::protobuf::io::CodedOutputStream::VarintSize32Fallback ( uint32  value)
staticprivate

+ Here is the caller graph for this function:

int google::protobuf::io::CodedOutputStream::VarintSize32SignExtended ( int32  value)
inlinestatic
1095  {
1096  if (value < 0) {
1097  return 10; // TODO(kenton): Make this a symbolic constant.
1098  } else {
1099  return VarintSize32(static_cast<uint32>(value));
1100  }
1101 }
const FieldDescriptor value
Definition: descriptor.h:1522
static int VarintSize32(uint32 value)
Definition: coded_stream.h:1087

+ Here is the call graph for this function:

static int google::protobuf::io::CodedOutputStream::VarintSize64 ( uint64  value)
static
void google::protobuf::io::CodedOutputStream::WriteAliasedRaw ( const void *  buffer,
int  size 
)
private

+ Here is the caller graph for this function:

void google::protobuf::io::CodedOutputStream::WriteLittleEndian32 ( uint32  value)

+ Here is the caller graph for this function:

uint8 * google::protobuf::io::CodedOutputStream::WriteLittleEndian32ToArray ( uint32  value,
uint8 target 
)
inlinestatic
1037  {
1038 #if defined(PROTOBUF_LITTLE_ENDIAN)
1039  memcpy(target, &value, sizeof(value));
1040 #else
1041  target[0] = static_cast<uint8>(value);
1042  target[1] = static_cast<uint8>(value >> 8);
1043  target[2] = static_cast<uint8>(value >> 16);
1044  target[3] = static_cast<uint8>(value >> 24);
1045 #endif
1046  return target + sizeof(value);
1047 }
uint8_t uint8
Definition: Define.h:152
const FieldDescriptor value
Definition: descriptor.h:1522

+ Here is the caller graph for this function:

void google::protobuf::io::CodedOutputStream::WriteLittleEndian64 ( uint64  value)

+ Here is the caller graph for this function:

uint8 * google::protobuf::io::CodedOutputStream::WriteLittleEndian64ToArray ( uint64  value,
uint8 target 
)
inlinestatic
1050  {
1051 #if defined(PROTOBUF_LITTLE_ENDIAN)
1052  memcpy(target, &value, sizeof(value));
1053 #else
1054  uint32 part0 = static_cast<uint32>(value);
1055  uint32 part1 = static_cast<uint32>(value >> 32);
1056 
1057  target[0] = static_cast<uint8>(part0);
1058  target[1] = static_cast<uint8>(part0 >> 8);
1059  target[2] = static_cast<uint8>(part0 >> 16);
1060  target[3] = static_cast<uint8>(part0 >> 24);
1061  target[4] = static_cast<uint8>(part1);
1062  target[5] = static_cast<uint8>(part1 >> 8);
1063  target[6] = static_cast<uint8>(part1 >> 16);
1064  target[7] = static_cast<uint8>(part1 >> 24);
1065 #endif
1066  return target + sizeof(value);
1067 }
uint32_t uint32
Definition: Define.h:150
uint8_t uint8
Definition: Define.h:152
const FieldDescriptor value
Definition: descriptor.h:1522

+ Here is the caller graph for this function:

void google::protobuf::io::CodedOutputStream::WriteRaw ( const void *  buffer,
int  size 
)

+ Here is the caller graph for this function:

void google::protobuf::io::CodedOutputStream::WriteRawMaybeAliased ( const void *  data,
int  size 
)
inline
1108  {
1109  if (aliasing_enabled_) {
1110  WriteAliasedRaw(data, size);
1111  } else {
1112  WriteRaw(data, size);
1113  }
1114 }
void WriteRaw(const void *buffer, int size)
void WriteAliasedRaw(const void *buffer, int size)
bool aliasing_enabled_
Definition: coded_stream.h:759

+ Here is the call graph for this function:

static uint8* google::protobuf::io::CodedOutputStream::WriteRawToArray ( const void *  buffer,
int  size,
uint8 target 
)
static

+ Here is the caller graph for this function:

void google::protobuf::io::CodedOutputStream::WriteString ( const string &  str)
inline
1103  {
1104  WriteRaw(str.data(), static_cast<int>(str.size()));
1105 }
void WriteRaw(const void *buffer, int size)

+ Here is the call graph for this function:

uint8 * google::protobuf::io::CodedOutputStream::WriteStringToArray ( const string &  str,
uint8 target 
)
inlinestatic
1117  {
1118  return WriteRawToArray(str.data(), static_cast<int>(str.size()), target);
1119 }
static uint8 * WriteRawToArray(const void *buffer, int size, uint8 *target)

+ Here is the call graph for this function:

static uint8* google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray ( const string &  str,
uint8 target 
)
static

+ Here is the caller graph for this function:

void google::protobuf::io::CodedOutputStream::WriteTag ( uint32  value)
inline
1069  {
1071 }
const FieldDescriptor value
Definition: descriptor.h:1522

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint8 * google::protobuf::io::CodedOutputStream::WriteTagToArray ( uint32  value,
uint8 target 
)
inlinestatic
1074  {
1075  if (value < (1 << 7)) {
1076  target[0] = value;
1077  return target + 1;
1078  } else if (value < (1 << 14)) {
1079  target[0] = static_cast<uint8>(value | 0x80);
1080  target[1] = static_cast<uint8>(value >> 7);
1081  return target + 2;
1082  } else {
1083  return WriteVarint32FallbackToArray(value, target);
1084  }
1085 }
static uint8 * WriteVarint32FallbackToArray(uint32 value, uint8 *target)
uint8_t uint8
Definition: Define.h:152
const FieldDescriptor value
Definition: descriptor.h:1522

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void google::protobuf::io::CodedOutputStream::WriteVarint32 ( uint32  value)

+ Here is the caller graph for this function:

static uint8* google::protobuf::io::CodedOutputStream::WriteVarint32FallbackToArray ( uint32  value,
uint8 target 
)
staticprivate

+ Here is the caller graph for this function:

static uint8* google::protobuf::io::CodedOutputStream::WriteVarint32FallbackToArrayInline ( uint32  value,
uint8 target 
)
staticprivate
void google::protobuf::io::CodedOutputStream::WriteVarint32SignExtended ( int32  value)
inline
1019  {
1020  if (value < 0) {
1021  WriteVarint64(static_cast<uint64>(value));
1022  } else {
1023  WriteVarint32(static_cast<uint32>(value));
1024  }
1025 }
const FieldDescriptor value
Definition: descriptor.h:1522

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint8 * google::protobuf::io::CodedOutputStream::WriteVarint32SignExtendedToArray ( int32  value,
uint8 target 
)
inlinestatic
1028  {
1029  if (value < 0) {
1030  return WriteVarint64ToArray(static_cast<uint64>(value), target);
1031  } else {
1032  return WriteVarint32ToArray(static_cast<uint32>(value), target);
1033  }
1034 }
static uint8 * WriteVarint32ToArray(uint32 value, uint8 *target)
Definition: coded_stream.h:1009
static uint8 * WriteVarint64ToArray(uint64 value, uint8 *target)
const FieldDescriptor value
Definition: descriptor.h:1522

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint8 * google::protobuf::io::CodedOutputStream::WriteVarint32ToArray ( uint32  value,
uint8 target 
)
inlinestatic
1010  {
1011  if (value < 0x80) {
1012  *target = value;
1013  return target + 1;
1014  } else {
1015  return WriteVarint32FallbackToArray(value, target);
1016  }
1017 }
static uint8 * WriteVarint32FallbackToArray(uint32 value, uint8 *target)
const FieldDescriptor value
Definition: descriptor.h:1522

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void google::protobuf::io::CodedOutputStream::WriteVarint64 ( uint64  value)

+ Here is the caller graph for this function:

static uint8* google::protobuf::io::CodedOutputStream::WriteVarint64ToArray ( uint64  value,
uint8 target 
)
static

+ Here is the caller graph for this function:

static uint8* google::protobuf::io::CodedOutputStream::WriteVarint64ToArrayInline ( uint64  value,
uint8 target 
)
staticprivate

Member Data Documentation

bool google::protobuf::io::CodedOutputStream::aliasing_enabled_
private
uint8* google::protobuf::io::CodedOutputStream::buffer_
private
int google::protobuf::io::CodedOutputStream::buffer_size_
private
bool google::protobuf::io::CodedOutputStream::had_error_
private
ZeroCopyOutputStream* google::protobuf::io::CodedOutputStream::output_
private
int google::protobuf::io::CodedOutputStream::total_bytes_
private

The documentation for this class was generated from the following file: