blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 3 264 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 5 140 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 986
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 3.89k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 23
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 145
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 10.4M | extension stringclasses 122
values | content stringlengths 3 10.4M | authors listlengths 1 1 | author_id stringlengths 0 158 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5bc6f37deb2b3cd428220415fc38c371952cd09a | 92e3a61247c0f88fdc44c390e1b6f39ec7eb1427 | /Applications/HAI/msvQHAIAboutDialog.cxx | 9a92570af0b2108c9c775412705d33cb96e6adee | [
"Apache-2.0"
] | permissive | MSV-Project/MSVTK | a1205fa86208309be5bb25488a09ff2d16916a45 | f988a31f2320eeeafe8d90697748231d69ecd89e | refs/heads/master | 2021-01-02T08:57:59.142821 | 2014-07-07T12:27:35 | 2014-07-07T12:27:35 | 1,576,221 | 4 | 1 | null | 2013-01-31T06:11:53 | 2011-04-06T08:26:41 | C++ | UTF-8 | C++ | false | false | 1,727 | cxx | /*==============================================================================
Library: MSVTK
Copyright (c) Kitware Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0.txt
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
// HAI includes
#include "msvQHAIAboutDialog.h"
#include "ui_msvQHAIAboutDialog.h"
//------------------------------------------------------------------------------
// msvQHAIAboutDialogPrivate methods
//------------------------------------------------------------------------------
class msvQHAIAboutDialogPrivate: public Ui_msvQHAIAboutDialog
{
public:
};
//------------------------------------------------------------------------------
// msvQHAIAboutDialog methods
//------------------------------------------------------------------------------
// msvQHAIAboutDialog methods
msvQHAIAboutDialog::msvQHAIAboutDialog(QWidget* parentWidget)
: QDialog(parentWidget), d_ptr(new msvQHAIAboutDialogPrivate)
{
Q_D(msvQHAIAboutDialog);
d->setupUi(this);
d->CreditsTextEdit->moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor);
}
//------------------------------------------------------------------------------
msvQHAIAboutDialog::~msvQHAIAboutDialog()
{
}
| [
"julien.finet@kitware.com"
] | julien.finet@kitware.com |
d4564cd125932072f8a6b131b32630073e0f4338 | b4242845310b2e32b744fea2de97e36ea9ccd1e9 | /cs179/lab5/src/layers.cpp | 92bdcf419f7dd355d948f19fbd12e25a65b0511e | [] | no_license | Duconnor/ML-Online-Courses | b645e8bbaf9570dad8535559d2c499ad8315426a | e42511b3409218366699400ff701e30861bda5be | refs/heads/master | 2022-12-04T12:33:08.370027 | 2021-10-27T12:30:20 | 2021-10-27T12:30:20 | 181,634,596 | 0 | 0 | null | 2022-11-21T21:26:07 | 2019-04-16T07:09:04 | Jupyter Notebook | UTF-8 | C++ | false | false | 28,980 | cpp | /**
* Implementations of each layer that could appear in a neural network
* @author Aadyot Bhatnagar
* @date April 22, 2018
*/
#include <cstdlib>
#include <algorithm>
#include <iostream>
#include <cassert>
#include <string>
#include <sstream>
#include <random>
#include <cuda_runtime.h>
#include <cublas_v2.h>
#include <curand.h>
#include <cudnn.h>
#include "layers.hpp"
#include "utils.cuh"
#include "helper_cuda.h"
/******************************************************************************/
/* GENERIC LAYER SUPERCLASS */
/******************************************************************************/
/**
* If there is a previous layer, initialize this layer's input as the previous
* layer's' output (as well as the tensor descriptor).
*/
Layer::Layer(Layer *prev, cublasHandle_t cublasHandle,
cudnnHandle_t cudnnHandle)
{
this->prev = prev;
this->cublasHandle = cublasHandle;
this->cudnnHandle = cudnnHandle;
CUDNN_CALL( cudnnCreateTensorDescriptor(&in_shape) );
if (prev)
{
cudnnDataType_t dtype;
int n, c, h, w, nStride, cStride, hStride, wStride;
CUDNN_CALL( cudnnGetTensor4dDescriptor(prev->get_out_shape(), &dtype,
&n, &c, &h, &w, &nStride, &cStride, &hStride, &wStride) );
CUDNN_CALL( cudnnSetTensor4dDescriptor(in_shape, CUDNN_TENSOR_NCHW,
dtype, n, c, h, w) );
}
CUDNN_CALL( cudnnCreateTensorDescriptor(&out_shape) );
}
/** Free the memory being used for internal batch and error representations. */
Layer::~Layer()
{
if (out_batch != in_batch)
CUDA_CALL(cudaFree(out_batch));
if (grad_out_batch != grad_in_batch)
CUDA_CALL(cudaFree(grad_out_batch));
if (weights)
CUDA_CALL(cudaFree(weights));
if (biases)
CUDA_CALL(cudaFree(biases));
if (grad_weights)
CUDA_CALL(cudaFree(grad_weights));
if (grad_biases)
CUDA_CALL(cudaFree(grad_biases));
CUDNN_CALL(cudnnDestroyTensorDescriptor(in_shape));
CUDNN_CALL(cudnnDestroyTensorDescriptor(out_shape));
}
/**
* Returns the size of the workspace needed by the current layer to implement
* the specified algorithm. 0 by default, but can be overridden.
*/
size_t Layer::get_workspace_size() const
{
return 0;
}
/** Sets the workspace (and its size) to the specified values. */
void Layer::set_workspace(float *workspace, size_t workspace_size)
{
this->workspace = workspace;
this->workspace_size = workspace_size;
}
/** Returns the shape of the layer's input. */
cudnnTensorDescriptor_t Layer::get_in_shape() const
{
return in_shape;
}
/** Returns the shape of the layer's output. */
cudnnTensorDescriptor_t Layer::get_out_shape() const
{
return out_shape;
}
/** Returns the previous layer */
Layer *Layer::get_prev() const
{
return this->prev;
}
/** Returns the output for the next layer to take in the forward pass. */
float *Layer::get_output_fwd() const
{
return out_batch;
}
/**
* Returns the input from the next layer to be passed back during the backward
* pass. This will be used by the next layer's constructor to initialize its
* grad_in_batch.
*/
float *Layer::get_input_bwd() const
{
return grad_out_batch;
}
/* These method definitions are included for polymorphism purposes, but calling
* either of them from non loss layers is illegal. */
float Layer::get_loss()
{
assert(false && "Non-loss layer has no loss.");
return 0;
}
float Layer::get_accuracy()
{
assert(false && "Non-loss layer does not support accuracy estimates.");
return 0;
}
/**
* Allocates space for a minibatch of output data in memory, as well as for the
* weights and biases associated with this layer (if any). Allocations are done
* based on layer shape parameters (namely in_shape, out_shape, n_weights, and
* n_biases).
*
* @pre Layer shape parameters have already been set (e.g. in constructor)
*/
void Layer::allocate_buffers()
{
// The buffers to store the input minibatch in_batch and its derivative
// grad_in_batch are already stored in the previous layer, so just share a
// pointer.
if (prev)
{
this->in_batch = prev->get_output_fwd();
this->grad_in_batch = prev->get_input_bwd();
}
// Get the shape of the output
cudnnDataType_t dtype;
int n, c, h, w, n_stride, c_stride, h_stride, w_stride;
CUDNN_CALL( cudnnGetTensor4dDescriptor(out_shape, &dtype,
&n, &c, &h, &w, &n_stride, &c_stride, &h_stride, &w_stride) );
// out_batch and grad_out_batch have the same shape as the output
int out_size = n * c * h * w;
CUDA_CALL( cudaMalloc(&out_batch, out_size * sizeof(float)) );
CUDA_CALL( cudaMalloc(&grad_out_batch, out_size * sizeof(float)) );
// Allocate buffers for the weights and biases (if there are any)
if (n_weights > 0)
{
CUDA_CALL( cudaMalloc(&weights, n_weights * sizeof(float)) );
CUDA_CALL( cudaMalloc(&grad_weights, n_weights * sizeof(float)) );
}
if (n_biases > 0)
{
CUDA_CALL( cudaMalloc(&biases, n_biases * sizeof(float)) );
CUDA_CALL( cudaMalloc(&grad_biases, n_biases * sizeof(float)) );
}
}
/**
* Initializes all weights from a uniform distribution bounded between
* -1/sqrt(input_size) and +1/sqrt(input_size). Initializes all biases to 0.
*/
void Layer::init_weights_biases()
{
cudnnDataType_t dtype;
int n, c, h, w, n_stride, c_stride, h_stride, w_stride;
CUDNN_CALL(cudnnGetTensor4dDescriptor(in_shape, &dtype, &n, &c, &h, &w,
&n_stride, &c_stride, &h_stride, &w_stride));
curandGenerator_t gen;
float minus_half = -0.5;
float range = 2 / sqrt(static_cast<float>(c * h * w));
std::random_device rd;
CURAND_CALL( curandCreateGenerator(&gen, CURAND_RNG_PSEUDO_DEFAULT) );
CURAND_CALL( curandSetPseudoRandomGeneratorSeed(gen, rd()) );
if (weights)
{
CURAND_CALL( curandGenerateUniform(gen, weights, n_weights) );
CUBLAS_CALL( cublasSaxpy(cublasHandle, n_weights,
&minus_half, weights, 1, weights, 1) );
CUBLAS_CALL( cublasSscal(cublasHandle, n_weights, &range, weights, 1) );
}
if (biases)
cudaMemsetType<float>(biases, 0.0f, n_biases);
CURAND_CALL( curandDestroyGenerator(gen) );
}
/******************************************************************************/
/* INPUT LAYER IMPLEMENTATION */
/******************************************************************************/
/**
* The output of an input layer is just
*/
Input::Input(int n, int c, int h, int w,
cublasHandle_t cublasHandle, cudnnHandle_t cudnnHandle)
: Layer(nullptr, cublasHandle, cudnnHandle)
{
// TODO (set 5): set output tensor descriptor out_shape to have format
// NCHW, be floats, and have dimensions n, c, h, w
CUDNN_CALL( cudnnSetTensor4dDescriptor(out_shape, CUDNN_TENSOR_NCHW,
CUDNN_DATA_FLOAT, n, c, h, w) );
// DONE
allocate_buffers();
}
Input::~Input() = default;
/** Input layer does no processing on its input. */
void Input::forward_pass() {}
/** Nothing is behind the input layer. */
void Input::backward_pass(float learning_rate) {}
/******************************************************************************/
/* DENSE LAYER IMPLEMENTATION */
/******************************************************************************/
/**
* Flattens the input shape, sets the output shape based on the specified
* output dimension, and allocates and initializes buffers appropriately.
*/
Dense::Dense(Layer *prev, int out_dim,
cublasHandle_t cublasHandle, cudnnHandle_t cudnnHandle)
: Layer(prev, cublasHandle, cudnnHandle)
{
// Get the input shape for the layer and flatten it if needed
cudnnDataType_t dtype;
int n, c, h, w, n_stride, c_stride, h_stride, w_stride;
CUDNN_CALL( cudnnGetTensor4dDescriptor(in_shape, &dtype, &n, &c, &h, &w,
&n_stride, &c_stride, &h_stride, &w_stride) );
CUDNN_CALL( cudnnSetTensor4dDescriptor(in_shape, CUDNN_TENSOR_NCHW,
dtype, n, c * h * w, 1, 1) );
// Initialize the output shape to be N out_size-dimensional vectors
CUDNN_CALL(cudnnSetTensor4dDescriptor(out_shape, CUDNN_TENSOR_NCHW, dtype,
n, out_dim, 1, 1));
// Initialize local shape parameters appropriately
this->batch_size = n;
this->in_size = c * h * w;
this->out_size = out_dim;
// The weights matrix is in_size by out_size, and there are out_size biases
this->n_weights = in_size * out_size;
this->n_biases = out_size;
allocate_buffers();
init_weights_biases();
// Allocate a vector of all ones (filled with thrust::fill)
CUDA_CALL( cudaMalloc(&onevec, batch_size * sizeof(float)) );
cudaMemsetType<float>(onevec, 1.0f, batch_size);
}
Dense::~Dense()
{
CUDA_CALL( cudaFree(onevec) );
}
/**
* A dense layer's forward pass takes the output from the previous layer,
* multiplies it with this layer's matrix of weights, and then adds the
* bias vector.
*/
void Dense::forward_pass()
{
float one = 1.0, zero = 0.0;
// TODO (set 5): out_batch = weights^T * in_batch (without biases)
CUBLAS_CALL( cublasSgemm(cublasHandle, CUBLAS_OP_T, CUBLAS_OP_N,
out_size, batch_size, in_size,
&one,
weights, in_size,
in_batch, in_size,
&zero,
out_batch, out_size) );
// DONE
// out_batch += bias * 1_vec^T (to distribute bias to all outputs in
// this minibatch of data)
CUBLAS_CALL( cublasSgemm(cublasHandle, CUBLAS_OP_N, CUBLAS_OP_T,
out_size, batch_size, 1,
&one,
biases, out_size,
onevec, batch_size,
&one,
out_batch, out_size) );
}
/**
* A dense layer's backward pass computes the gradient of the loss function
* with respect to its weights, biases, and input minibatch of data. It does
* so given the gradient with respect to its output, computed by the next
* layer.
*/
void Dense::backward_pass(float learning_rate)
{
float one = 1.0, zero = 0.0;
// TODO (set 5): grad_weights = in_batch * (grad_out_batch)^T
CUBLAS_CALL( cublasSgemm(cublasHandle, CUBLAS_OP_N, CUBLAS_OP_T,
in_size, out_size, batch_size,
&one,
in_batch, in_size,
grad_out_batch, out_size,
&zero,
grad_weights, in_size) );
// DONE
// grad_biases = grad_out_batch * 1_vec
CUBLAS_CALL( cublasSgemv(cublasHandle, CUBLAS_OP_N,
out_size, batch_size,
&one,
grad_out_batch, out_size,
onevec, 1,
&zero,
grad_biases, 1) );
// TODO (set 5): grad_in_batch = W * grad_out_batch
// Note that grad_out_batch is the next layer's grad_in_batch, and
// grad_in_batch is the previous layer's grad_out_batch
CUBLAS_CALL( cublasSgemm(cublasHandle, CUBLAS_OP_N, CUBLAS_OP_N,
in_size, batch_size, out_size,
&one,
weights, in_size,
grad_out_batch, out_size,
&zero,
grad_in_batch, in_size) );
// DONE
// Descend along the gradients of weights and biases using cublasSaxpy
float eta = -learning_rate;
// TODO (set 5): weights = weights + eta * grad_weights
CUBLAS_CALL( cublasSaxpy(cublasHandle, in_size * out_size,
&eta,
grad_weights, 1,
weights, 1) );
// DONE
// TODO (set 5): biases = biases + eta * grad_biases
CUBLAS_CALL( cublasSaxpy(cublasHandle, 1,
&eta,
grad_biases, 1,
biases, 1) );
// DONE
}
/******************************************************************************/
/* ACTIVATION LAYER IMPLEMENTATION */
/******************************************************************************/
/**
* Initialize output shape to be the same as input shape, and initialize an
* activation descriptor as appropriate.
*/
Activation::Activation(Layer *prev, cudnnActivationMode_t activationMode,
double coef, cublasHandle_t cublasHandle, cudnnHandle_t cudnnHandle)
: Layer(prev, cublasHandle, cudnnHandle)
{
cudnnDataType_t dtype;
int n, c, h, w, nStride, cStride, hStride, wStride;
// TODO (set 5): get descriptor of input minibatch, in_shape
CUDNN_CALL( cudnnGetTensor4dDescriptor(in_shape, &dtype, &n, &c, &h, &w, &nStride, &cStride, &hStride, &wStride) );
// DONE
// TODO (set 5): set descriptor of output minibatch, out_shape, to have the
// same parameters as in_shape and be ordered NCHW
CUDNN_CALL( cudnnSetTensor4dDescriptor(out_shape, CUDNN_TENSOR_NCHW, dtype, n, c, h, w) );
// DONE
allocate_buffers();
// TODO (set 5): create activation descriptor, and set it to have the given
// activationMode, propagate NaN's, and have coefficient coef
std::cout << coef << std::endl;
CUDNN_CALL( cudnnCreateActivationDescriptor(&activation_desc) );
CUDNN_CALL( cudnnSetActivationDescriptor(activation_desc, activationMode, CUDNN_PROPAGATE_NAN, coef) );
// DONE
}
Activation::~Activation()
{
// TODO (set 5): destroy the activation descriptor
CUDNN_CALL( cudnnDestroyActivationDescriptor(activation_desc) );
// DONE
}
/**
* Applies the activation on {\link Layer::in_batch} and stores the result in
* {\link Layer::out_batch}.
*/
void Activation::forward_pass()
{
float one = 1.0, zero = 0.0;
// TODO (set 5): apply activation, i.e. out_batch = activation(in_batch)
CUDNN_CALL( cudnnActivationForward(cudnnHandle, activation_desc, &one, in_shape, in_batch, &zero, out_shape, out_batch) );
// DONE
}
/**
* Uses the chain rule to compute the gradient wrt the input batch based on the
* values of {\link Layer::grad_out_batch} (computed by the next layer), as well
* as {\link Layer::out_batch} and {\link Layer::in_batch} (computed during the
* forward pass). Stores the result in {\link Layer::grad_in_batch}.
*/
void Activation::backward_pass(float learning_rate)
{
float one = 1.0, zero = 0.0;
// TODO (set 5): do activation backwards, i.e. compute grad_in_batch
CUDNN_CALL( cudnnActivationBackward(cudnnHandle,
activation_desc,
&one,
out_shape, out_batch,
out_shape, grad_out_batch,
in_shape, in_batch,
&zero,
in_shape, grad_in_batch) );
// DONE
}
/******************************************************************************/
/* CONV LAYER IMPLEMENTATION */
/******************************************************************************/
/**
* Initialize filter descriptor, convolution descriptor, and output shape, as
* well as algorithms to use for forwards and backwards convolutions. n_kernels
* is the number of output channels desired, the size of each convolutional
* kernel is (kernel_size x kernel_size), the stride of the convolution is
* (stride x stride).
*/
Conv2D::Conv2D(Layer *prev, int n_kernels, int kernel_size, int stride,
cublasHandle_t cublasHandle, cudnnHandle_t cudnnHandle)
: Layer(prev, cublasHandle, cudnnHandle)
{
cudnnDataType_t dtype;
int n, c, h, w, n_stride, c_stride, h_stride, w_stride;
// TODO (set 6): Get the input tensor descriptor in_shape into the variables
// declared above
CUDNN_CALL( cudnnGetTensor4dDescriptor(in_shape, &dtype, &n, &c, &h, &w, &n_stride, &c_stride, &h_stride, &w_stride) );
// DONE
// Compute nubmer of weights and biases
this->n_weights = n_kernels * c * kernel_size * kernel_size;
this->n_biases = n_kernels;
// TODO (set 6): Create & set a filter descriptor for a float array ordered
// NCHW, w/ shape n_kernels x c x kernel_size x kernel_size.
// This is class field filter_desc.
CUDNN_CALL( cudnnCreateFilterDescriptor(&filter_desc) );
CUDNN_CALL( cudnnSetFilter4dDescriptor(filter_desc, dtype, CUDNN_TENSOR_NCHW, n_kernels, c, kernel_size, kernel_size) );
// DONE
// Set tensor descriptor for biases (to broadcast adding biases)
CUDNN_CALL( cudnnCreateTensorDescriptor(&bias_desc) );
CUDNN_CALL( cudnnSetTensor4dDescriptor(bias_desc, CUDNN_TENSOR_NCHW,
CUDNN_DATA_FLOAT, 1, n_kernels, 1, 1) );
// TODO (set 6): Create and set a convolution descriptor. This will
// correspond to a CUDNN_CONVOLUTION on floats with zero
// padding (x and y), a stride (in both x and y) equal to
// argument stride, and horizontal and vertical dilation
// factors of 1. This is class field conv_desc.
CUDNN_CALL( cudnnCreateConvolutionDescriptor(&conv_desc) );
CUDNN_CALL( cudnnSetConvolution2dDescriptor(conv_desc, 0, 0, 1, 1, 1, 1, CUDNN_CONVOLUTION, CUDNN_DATA_FLOAT) );
// DONE
// Set output shape descriptor
CUDNN_CALL( cudnnGetConvolution2dForwardOutputDim(conv_desc,
in_shape, filter_desc, &n, &c, &h, &w) );
CUDNN_CALL( cudnnSetTensor4dDescriptor(out_shape,
CUDNN_TENSOR_NCHW, CUDNN_DATA_FLOAT, n, c, h, w) );
// Get convolution algorithms to use
CUDNN_CALL( cudnnGetConvolutionForwardAlgorithm(cudnnHandle,
in_shape, filter_desc, conv_desc, out_shape,
CUDNN_CONVOLUTION_FWD_PREFER_FASTEST, 0, &fwd_algo) );
CUDNN_CALL(cudnnGetConvolutionBackwardFilterAlgorithm(cudnnHandle,
in_shape, out_shape, conv_desc, filter_desc,
CUDNN_CONVOLUTION_BWD_FILTER_PREFER_FASTEST, 0, &bwd_filter_algo));
CUDNN_CALL( cudnnGetConvolutionBackwardDataAlgorithm(cudnnHandle,
filter_desc, out_shape, conv_desc, in_shape,
CUDNN_CONVOLUTION_BWD_DATA_PREFER_FASTEST, 0, &bwd_data_algo) );
// Allocate all relevant buffers and initialize filters and biases
allocate_buffers();
init_weights_biases();
}
Conv2D::~Conv2D()
{
CUDNN_CALL( cudnnDestroyTensorDescriptor(bias_desc) );
// TODO (set 6): Destroy filter_desc and conv_desc
CUDNN_CALL( cudnnDestroyFilterDescriptor(filter_desc) );
CUDNN_CALL( cudnnDestroyConvolutionDescriptor(conv_desc) );
// DONE
}
/**
* Determins the largest workspace size needed by any of the convolution
* algorithms being used and returns it.
*/
size_t Conv2D::get_workspace_size() const
{
size_t acc = 0, tmp = 0;
CUDNN_CALL( cudnnGetConvolutionForwardWorkspaceSize(cudnnHandle,
in_shape, filter_desc, conv_desc, out_shape, fwd_algo, &tmp) );
acc = std::max(acc, tmp);
CUDNN_CALL(cudnnGetConvolutionBackwardFilterWorkspaceSize(cudnnHandle,
in_shape, out_shape, conv_desc, filter_desc, bwd_filter_algo, &tmp));
acc = std::max(acc, tmp);
CUDNN_CALL(cudnnGetConvolutionBackwardDataWorkspaceSize(cudnnHandle,
filter_desc, out_shape, conv_desc, in_shape, bwd_data_algo, &tmp));
acc = std::max(acc, tmp);
return acc;
}
/**
* Forward pass through a convolution layer performs the convolution and
* adds the biases.
*/
void Conv2D::forward_pass()
{
float zero = 0, one = 1;
// TODO (set 6): Perform convolution forward pass (store in out_batch).
// Use class fields workspace and workspace_size for the
// workspace related arguments in the function call, and
// use fwd_algo for the algorithm.
CUDNN_CALL( cudnnConvolutionForward(cudnnHandle, &one,
in_shape, in_batch,
filter_desc, weights,
conv_desc, fwd_algo, workspace, workspace_size,
&zero, out_shape, out_batch) );
// DONE
CUDNN_CALL( cudnnAddTensor(cudnnHandle,
&one, bias_desc, biases,
&one, out_shape, out_batch) );
}
/**
* Backwards pass through a convolution layer computes gradients with respect
* to filters, biases, and input minibatch of data. It then descends the
* gradients with respect to filters and biases.
*/
void Conv2D::backward_pass(float learning_rate)
{
float zero = 0, one = 1;
// TODO (set 6): Compute the gradient with respect to the filters/weights
// and store them in grad_weights.
// Use class fields workspace and workspace_size for the
// workspace related arguments in the function call, and use
// bwd_filter_algo for the algorithm.
CUDNN_CALL( cudnnConvolutionBackwardFilter(cudnnHandle, &one,
in_shape, in_batch,
out_shape, grad_out_batch,
conv_desc, bwd_filter_algo, workspace, workspace_size, &zero,
filter_desc, grad_weights) );
// DONE
// Compute the gradient with respect to the biases
CUDNN_CALL( cudnnConvolutionBackwardBias(cudnnHandle,
&one, out_shape, grad_out_batch,
&zero, bias_desc, grad_biases) );
// TODO (set 6): Compute the gradient with respect to the input data
// in_batch, and store it in grad_in_batch.
// Use class fields workspace and workspace_size for the
// workspace related arguments in the function call and use
// bwd_data_algo for the algorithm.
CUDNN_CALL( cudnnConvolutionBackwardData(cudnnHandle, &one,
filter_desc, weights,
out_shape, grad_out_batch,
conv_desc, bwd_data_algo, workspace, workspace_size, &zero,
in_shape, grad_in_batch) );
// DONE
// Descend along the gradients of the weights and biases using cublasSaxpy
float eta = -learning_rate;
// TODO (set 6): weights = weights + eta * grad_weights
CUBLAS_CALL( cublasSaxpy(cublasHandle, n_weights,
&eta,
grad_weights, 1,
weights, 1) );
// DONE
// TODO (set 6): biases = biases + eta * grad_biases
CUBLAS_CALL( cublasSaxpy(cublasHandle, n_biases,
&eta,
grad_biases, 1,
biases, 1) );
// DONE
}
/******************************************************************************/
/* POOLING LAYER IMPLEMENTATION */
/******************************************************************************/
/**
* Allocates a pooling descriptor with a (stride x stride) window and a
* (stride x stride) stride to do mode-type pooling. Also computes output shape
* of this operation.
*/
Pool2D::Pool2D(Layer* prev, int stride, cudnnPoolingMode_t mode,
cublasHandle_t cublasHandle, cudnnHandle_t cudnnHandle)
: Layer(prev, cublasHandle, cudnnHandle)
{
// TODO (set 6): Create and set pooling descriptor to have the given mode,
// propagate NaN's, have window size (stride x stride), have
// no padding, and have stride (stride x stride)
CUDNN_CALL( cudnnCreatePoolingDescriptor(&pooling_desc) );
CUDNN_CALL( cudnnSetPooling2dDescriptor(pooling_desc, mode, CUDNN_PROPAGATE_NAN, stride, stride, 0, 0, stride, stride) );
// DONE
// Set output shape
int n, c, h, w;
CUDNN_CALL( cudnnGetPooling2dForwardOutputDim(pooling_desc, in_shape,
&n, &c, &h, &w) );
CUDNN_CALL( cudnnSetTensor4dDescriptor(out_shape, CUDNN_TENSOR_NCHW,
CUDNN_DATA_FLOAT, n, c, h, w) );
// Allocate output buffer
allocate_buffers();
}
Pool2D::~Pool2D()
{
// TODO (set 6): destroy the pooling descriptor
CUDNN_CALL( cudnnDestroyPoolingDescriptor(pooling_desc) );
// DONE
}
/**
* Pools the input data minibatch in the forward direction.
*/
void Pool2D::forward_pass()
{
float zero = 0, one = 1;
// TODO (set 6): do pooling in forward direction, store in out_batch
CUDNN_CALL( cudnnPoolingForward(cudnnHandle, pooling_desc,
&one, in_shape, in_batch,
&zero, out_shape, out_batch) );
// DONE
}
/**
* Computes the gradients of the pooling operation wrt the input data minibatch.
*/
void Pool2D::backward_pass(float learning_rate)
{
float zero = 0, one = 1;
// TODO (set 6): do pooling backwards, store gradient in grad_in_batch
CUDNN_CALL( cudnnPoolingBackward(cudnnHandle, pooling_desc, &one,
out_shape, out_batch,
out_shape, grad_out_batch,
in_shape, in_batch,
&zero,
in_shape, grad_in_batch) );
// DONE
}
/******************************************************************************/
/* GENERIC LOSS ABSTRACT CLASS */
/******************************************************************************/
/** Inherits from a {\link Layer}. */
Loss::Loss(Layer *prev, cublasHandle_t cublasHandle, cudnnHandle_t cudnnHandle)
: Layer(prev, cublasHandle, cudnnHandle) {}
Loss::~Loss() = default;
/******************************************************************************/
/* SOFTMAX + CROSS-ENTROPY LOSS IMPLEMENTATION */
/******************************************************************************/
SoftmaxCrossEntropy::SoftmaxCrossEntropy(Layer *prev,
cublasHandle_t cublasHandle, cudnnHandle_t cudnnHandle)
: Loss(prev, cublasHandle, cudnnHandle)
{
cudnnDataType_t dtype;
int n, c, h, w, nStride, cStride, hStride, wStride;
// TODO (set 5): get descriptor of input minibatch, in_shape, into variables
// declared above
CUDNN_CALL( cudnnGetTensor4dDescriptor(in_shape, &dtype, &n, &c, &h, &w, &nStride, &cStride, &hStride, &wStride) );
// DONE
// TODO (set 5): set descriptor of output minibatch, out_shape, to have the
// same parameters as in_shape and be ordered NCHW
CUDNN_CALL( cudnnSetTensor4dDescriptor(out_shape, CUDNN_TENSOR_NCHW, dtype, n, c, h, w) );
// DONE
allocate_buffers();
}
SoftmaxCrossEntropy::~SoftmaxCrossEntropy() = default;
void SoftmaxCrossEntropy::forward_pass()
{
float one = 1.0, zero = 0.0;
// TODO (set 5): do softmax forward pass using accurate softmax and
// per instance mode. store result in out_batch.
CUDNN_CALL( cudnnSoftmaxForward(cudnnHandle, CUDNN_SOFTMAX_ACCURATE, CUDNN_SOFTMAX_MODE_INSTANCE, &one, in_shape, in_batch, &zero, out_shape, out_batch) );
// DONE
}
/**
* The gradient of the softmax/cross-entropy loss function wrt its input
* minibatch is softmax(X) - Y, where X is the input minibatch, and Y is the
* associated ground truth output minibatch.
*/
void SoftmaxCrossEntropy::backward_pass(float lr)
{
cudnnDataType_t dtype;
int n, c, h, w, nStride, cStride, hStride, wStride;
CUDNN_CALL( cudnnGetTensor4dDescriptor(out_shape, &dtype, &n, &c, &h, &w,
&nStride, &cStride, &hStride, &wStride) );
int size = n * c * h * w;
// grad_in_batch = softmax(in_batch) - true_Y
// = out_batch - grad_out_batch
// all have a length equal to "size" variable defined above
float minus_one = -1.0;
// TODO (set 5): first, copy grad_in_batch = out_batch
CUBLAS_CALL( cublasScopy(cublasHandle, size,
out_batch, 1,
grad_in_batch, 1) );
// DONE
// TODO (set 5): set grad_in_batch = grad_in_batch - grad_out_batch using
// cublasSaxpy
CUBLAS_CALL( cublasSaxpy(cublasHandle, size,
&minus_one,
grad_out_batch, 1,
grad_in_batch, 1) );
// DONE
// normalize the gradient by the batch size (do it once in the beginning, so
// we don't have to worry about it again later)
float scale = 1.0f / static_cast<float>(n);
CUBLAS_CALL( cublasSscal(cublasHandle, size, &scale, grad_in_batch, 1) );
}
/**
* @return The cross-entropy loss between our model's probabilistic predictions
* (based on the softmax function) and the ground truth.
*
* @pre A forward pass has been run (so {\link Layer::out_batch} contains our
* predictions on some input batch) and {\link Layer::grad_out_batch}
* contains the ground truth we want to predict.
*/
float SoftmaxCrossEntropy::get_loss()
{
cudnnDataType_t dtype;
int n, c, h, w, nStride, cStride, hStride, wStride;
CUDNN_CALL( cudnnGetTensor4dDescriptor(out_shape, &dtype, &n, &c, &h, &w,
&nStride, &cStride, &hStride, &wStride) );
loss = CrossEntropyLoss(out_batch, grad_out_batch, n, c, h, w);
return loss;
}
/**
* @return The accuracy of the model's predictions on a minibatch, given the
* ground truth. Here, we treat the model's prediction as the class
* assigned the highest probability by softmax.
*
* @pre A forward pass has been run (so {\link Layer::out_batch} contains our
* predictions on some input batch) and {\link Layer::grad_out_batch}
* contains the ground truth we want to predict.
*/
float SoftmaxCrossEntropy::get_accuracy()
{
cudnnDataType_t dtype;
int n, c, h, w, nStride, cStride, hStride, wStride;
CUDNN_CALL(cudnnGetTensor4dDescriptor(out_shape, &dtype, &n, &c, &h, &w,
&nStride, &cStride, &hStride, &wStride));
acc = SoftThresholdAccuracy(out_batch, grad_out_batch, n, c, h, w);
return acc;
}
| [
"duconnor@outlook.com"
] | duconnor@outlook.com |
527e56c580c593dd1c5ea17e9156968c1a32a9d4 | c67ed12eae84af574406e453106b7d898ff47dc7 | /chap09/Exer09_27.cpp | cb8ef1b516a296e2fadbcf9d0c695f72ecedf5d8 | [
"Apache-2.0"
] | permissive | chihyang/CPP_Primer | 8374396b58ea0e1b0f4c4adaf093a7c0116a6901 | 9e268d46e9582d60d1e9c3d8d2a41c1e7b83293b | refs/heads/master | 2022-09-16T08:54:59.465691 | 2022-09-03T17:25:59 | 2022-09-03T17:25:59 | 43,039,810 | 58 | 23 | Apache-2.0 | 2023-01-14T07:06:19 | 2015-09-24T02:25:47 | C++ | UTF-8 | C++ | false | false | 555 | cpp | #include <iostream>
#include <forward_list>
using std::cout;
using std::endl;
using std::forward_list;
int main()
{
forward_list<int> flst = { 12, 73, 35, 13, 65, 86, 0 };
auto prev = flst.before_begin();
auto curr = flst.begin();
while(curr != flst.end())
{
if(*curr % 2)
curr = flst.erase_after(prev);
else
{
prev = curr;
++curr;
}
}
for(const auto &ele : flst) // output the remaining elements
cout << ele << " ";
cout << endl;
return 0;
}
| [
"chihyanghsin@gmail.com"
] | chihyanghsin@gmail.com |
6ac02af9b6d22a3e59697982c624d601cc29df1f | 7e8c72c099b231078a763ea7da6bba4bd6bac77b | /other_projects/base_station_monitor/Client/reference SDK/General_NetSDK_Chn_IS_V3.36.0.R.100505/Demo/分类应用/NVD视频上墙/NVDSDKDemo/ExSliderCtrl.cpp | 8d8a957b1bf68da1b9d849b59abb1650c8dd883a | [] | no_license | github188/demodemo | fd910a340d5c5fbf4c8755580db8ab871759290b | 96ed049eb398c4c188a688e9c1bc2fe8cd2dc80b | refs/heads/master | 2021-01-12T17:16:36.199708 | 2012-08-15T14:20:51 | 2012-08-15T14:20:51 | 71,537,068 | 1 | 2 | null | 2016-10-21T06:38:22 | 2016-10-21T06:38:22 | null | UTF-8 | C++ | false | false | 1,334 | cpp | // ExSliderCtrl.cpp : implementation file
//
#include "stdafx.h"
#include "NVDSDKDemo.h"
#include "PlayBackProcess.h"
#include "ExSliderCtrl.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CExSliderCtrl
CExSliderCtrl::CExSliderCtrl()
{
m_bIsMouseDown = FALSE;
}
CExSliderCtrl::~CExSliderCtrl()
{
}
BEGIN_MESSAGE_MAP(CExSliderCtrl, CSliderCtrl)
//{{AFX_MSG_MAP(CExSliderCtrl)
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CExSliderCtrl message handlers
void CExSliderCtrl::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if(!m_bIsMouseDown)
{
m_bIsMouseDown = TRUE;
((CPlayBackProcess*)GetParent())->ExSliderButtonDown();
}
CSliderCtrl::OnLButtonDown(nFlags, point);
}
void CExSliderCtrl::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if(m_bIsMouseDown)
{
m_bIsMouseDown = FALSE;
((CPlayBackProcess*)GetParent())->ExSliderButtonUp();
}
CSliderCtrl::OnLButtonUp(nFlags, point);
}
| [
"thinkinnight@b18a5524-d64a-0410-9f42-ad3cd61580fb"
] | thinkinnight@b18a5524-d64a-0410-9f42-ad3cd61580fb |
13af2fedc897cad4c954abdcf1ec3ba2346a3619 | f3e5b5552f9e06092226e491bcde125c4fff8dcd | /gcdandlcm.cpp | bcf5d7431aa9979f37e12283d75db74539c9a9c4 | [] | no_license | computer-discussion/Niladri | 0585a95a3050dbb410e9f957eb14bf20e1487c17 | 4a0e0289241f2e8ef6c239426e9bd6ecb1e74560 | refs/heads/master | 2020-04-03T02:45:13.392888 | 2018-11-03T16:12:09 | 2018-11-03T16:12:09 | 154,966,005 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,159 | cpp | #include<stdio.h>
int lcm_recursion (int n1,int n2)
{
static int flag =1;
if(flag % n1 == 0 && flag % n2 ==0)
{
return flag;
}
flag ++;
lcm_recursion (n1,n2);
return flag;
}
int gcd_recursion (int n1, int n2)
{
if(n1==0)
return n2;
return gcd_recursion(n2%n1,n1);
}
int lcm_result (int n1,int n2)
{
int gcd,lcm,x,y;
x=n1;
y=n2;
while(n1!=n2)
{
if(n1<n2)
n2=n2-n1;
else
n1=n1-n2;
}
gcd = n1;
printf("\n gcd_normal = %d\n",gcd);
lcm = (x*y)/gcd;
return lcm;
}
int hcf_result (int n1 , int n2)
{
int low,i,hcf;
if(n1<n2) low=n1;
else low=n2;
for (i=1;i<=low;i++)
{
if(n1%i==0 && n2%i==0)
hcf = i;
}
return hcf;
}
int main()
{
int n1,n2,n3,n4,n5,n6;
printf(" put the numbers \n");
scanf("%d %d",&n1,&n2);
n3= lcm_result(n1,n2);
printf("\n the lcm = %d",n3);
n4= lcm_recursion(n1,n2);
printf("\n the lcm_recursion is = %d",n4);
n5 = gcd_recursion (n1,n2);
printf("\n the gcd_recursion is = %d",n5);
n6 = hcf_result (n1 , n2);
printf("\n the hcf_result is = %d",n6);
}
| [
"noreply@github.com"
] | computer-discussion.noreply@github.com |
f8d9e195428a28b029ab373153955b706dc9aa4f | 617ad4b1bf8be9cbd6ed2d1827029f1d4dd6f16b | /TrabajoFinal/CAnimacion.hpp | 017f06a5012dfc78d518eebea0c9667a4bea03f6 | [] | no_license | MacT22/TP-2021-01-Reimplementacion-TP-2020-02 | e248859d52d1444160fff2794afddeb7d9dd0e41 | 1ab3dcf959952a9bee81b4bd015b797f2751d5f1 | refs/heads/main | 2023-04-11T12:47:26.553821 | 2021-04-26T00:50:33 | 2021-04-26T00:50:33 | 361,574,197 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,104 | hpp | #pragma once
#include "CImagen.hpp"
template<class B>
ref class CAnimacion :
public CImagen
{
short n_filas;
short n_columnas;
short n_subimagenes;
short indice;
public:
CAnimacion(String^ ruta, System::Drawing::Rectangle area_dibujo, short n_filas, short n_columnas, short n_subimagenes)
: CImagen(ruta, area_dibujo), n_filas(n_filas), n_columnas(n_columnas), n_subimagenes(n_subimagenes), indice(0) {}
void dibujar(Graphics^ graficador) override {
System::Drawing::Rectangle area_recorte = calc_area_recorte();
graficador->DrawImage(imagen, area_dibujo, area_recorte, GraphicsUnit::Pixel);
if (indice < n_subimagenes) ++indice;
}
private:
System::Drawing::Rectangle calc_area_recorte() {
short ancho_subimagen = this->imagen->Width / this->n_columnas;
short alto_subimagen = this->imagen->Height / this->n_filas;
short x = this->indice * ancho_subimagen;
short y = this->indice % n_columnas * alto_subimagen;
return System::Drawing::Rectangle(x, y, ancho_subimagen, alto_subimagen);
}
};
| [
"63481429+MacT22@users.noreply.github.com"
] | 63481429+MacT22@users.noreply.github.com |
e3927aa3e68efedffb53a8e9fb96b855d8b893f4 | 5aad40ba5a1eb29799c1ad1c21495faa07e99b36 | /src/examples/opengl/TexturePerformancePBO/ImagePusherDoublePBO.h | 29766a11de3bd21b2c67a531878250cad7b9677d | [] | no_license | q4a/navidia_proj | 3525bcfdb12dc20dcecf08f2603324feceef7394 | 32c839744ad849f8d4d0273c635c4d601cc1980f | refs/heads/master | 2023-04-16T10:44:39.466782 | 2019-11-30T10:26:47 | 2019-11-30T10:26:47 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,813 | h | #ifndef IMAGE_PUSHER_DOUBLE_PBO_H
#define IMAGE_PUSHER_DOUBLE_PBO_H
// ----------------------------------------------------------------------------
//
// Content:
// ImagePusherDoublePBO class
//
// Description:
// A class managing OpenEXR images via OpenGL pixel buffer objects (PBO).
//
// Author: Frank Jargstorff (03/19/04)
//
// Note:
// Copyright (C) 2004 by NVIDIA Croporation. All rights reserved.
//
// ----------------------------------------------------------------------------
//
// Includes
//
#include "ImagePusher.h"
//
// Defines
//
#define N_MAX_BUFFERS 2
// ----------------------------------------------------------------------------
// ImagePusherDoublePBO class
//
class ImagePusherDoublePBO: public ImagePusher
{
public:
//
// Public data
//
static const char * ClassName;
static const char * ClassDescription;
public:
//
// Construction and destruction
//
// Default constructor
//
// Description:
// Loads OpenEXR image if given.
//
// Parameters:
// zFileName - name of the OpenEXR image to load.
//
// Note:
// As a side-effect the constructor leaves the image
// bound to the OpenGL texture unit active upon invocation
// of this constructor.
//
ImagePusherDoublePBO();
// Destructor
//
~ImagePusherDoublePBO();
//
// Public methods
//
// setImage
//
// Description:
// Specify a new image.
//
// Parameters:
// rImage - const reference to the image object.
//
// Returns:
// None
//
virtual
void
setImage(const Image & rImage);
// pushNewFrame
//
// Description:
// Pushes a new frame up to the graphics board.
// This specific image pusher imprints a time stamp
// bit-pattern in the left-bottom corner of the image.
// Pushing a new frame increments the frame counter.
//
// Parameters:
// nFrameStamp - the frame number to imprint.
//
// Returns:
// The number of bytes actually pushed across the bus
// to the graphics card.
//
virtual
unsigned int
pushNewFrame();
protected:
//
// Protected data
//
GLuint _haPixelBuffer[N_MAX_BUFFERS];
unsigned int _nCurrentBuffer;
};
#endif // IMAGE_PUSHER_DOUBLE_PBO_H
| [
"xtKnightMM@iCloud.com"
] | xtKnightMM@iCloud.com |
7e52153e7d90413ac37dc04a0d320fc3a75f35f3 | 8befbd37235312d55d76b6b27c92b28358c16305 | /SpellCorrect/server/Acceptor.h | 22ca21ec406a1356dd31ee2365307746afad4348 | [] | no_license | rtll/MY | cb922de88df29b9043ed66fb2c7f4401b0c6fcb0 | 2388c4f7669b939bd5bb82a73dafee77da4b84bc | refs/heads/master | 2020-06-19T22:26:52.719946 | 2019-07-15T01:44:49 | 2019-07-15T01:44:49 | 196,897,464 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 435 | h | #ifndef __ACCEPTOR_H__
#define __ACCEPTOR_H__
#include "InetAddress.h"
#include "Socket.h"
class Acceptor
{
public:
Acceptor(unsigned short port);
Acceptor(const string & ip, unsigned short port);
void ready();
int accept();
int fd() const { return _listensock.fd(); }
private:
void setReuseAddr(bool on);
void setReusePort(bool on);
void bind();
void listen();
private:
InetAddress _addr;
Socket _listensock;
};
#endif
| [
"759809718@qq.com"
] | 759809718@qq.com |
99476613892760478a1d422772bf422d82713a51 | 88ae8695987ada722184307301e221e1ba3cc2fa | /media/muxers/webm_muxer.cc | f1fd902249309b6636fada9aab4ed7de37731b5b | [
"BSD-3-Clause"
] | permissive | iridium-browser/iridium-browser | 71d9c5ff76e014e6900b825f67389ab0ccd01329 | 5ee297f53dc7f8e70183031cff62f37b0f19d25f | refs/heads/master | 2023-08-03T16:44:16.844552 | 2023-07-20T15:17:00 | 2023-07-23T16:09:30 | 220,016,632 | 341 | 40 | BSD-3-Clause | 2021-08-13T13:54:45 | 2019-11-06T14:32:31 | null | UTF-8 | C++ | false | false | 22,882 | cc | // Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "media/muxers/webm_muxer.h"
#include <algorithm>
#include <cstdint>
#include <cstring>
#include <memory>
#include <string>
#include "base/check.h"
#include "base/containers/circular_deque.h"
#include "base/logging.h"
#include "base/memory/scoped_refptr.h"
#include "base/metrics/histogram_functions.h"
#include "base/numerics/safe_math.h"
#include "base/sequence_checker.h"
#include "base/time/time.h"
#include "base/timer/elapsed_timer.h"
#include "base/trace_event/trace_event.h"
#include "media/base/audio_codecs.h"
#include "media/base/audio_parameters.h"
#include "media/base/limits.h"
#include "media/base/video_codecs.h"
#include "media/base/video_frame.h"
#include "media/formats/common/opus_constants.h"
#include "media/muxers/muxer.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "third_party/libwebm/source/mkvmuxer.hpp"
#include "ui/gfx/color_space.h"
#include "ui/gfx/geometry/size.h"
namespace media {
namespace {
namespace av1 {
// CodecPrivate for AV1. See
// https://github.com/ietf-wg-cellar/matroska-specification/blob/master/codec/av1.md.
constexpr int high_bitdepth = 0;
constexpr int twelve_bit = 0;
constexpr int monochrome = 0;
constexpr int initial_presentation_delay_present = 0;
constexpr int initial_presentation_delay_minus_one = 0;
constexpr int chroma_sample_position = 0;
constexpr int seq_profile = 0; // Main
constexpr int seq_level_idx_0 = 9; // level 4.1 ~1920x1080@60fps
constexpr int seq_tier_0 = 0;
constexpr int chroma_subsampling_x = 1;
constexpr int chroma_subsampling_y = 1;
constexpr uint8_t codec_private[4] = {
255, //
(seq_profile << 5) | seq_level_idx_0, //
(seq_tier_0 << 7) | //
(high_bitdepth << 6) | //
(twelve_bit << 5) | //
(monochrome << 4) | //
(chroma_subsampling_x << 3) | //
(chroma_subsampling_y << 2) | //
chroma_sample_position, //
(initial_presentation_delay_present << 4) | //
initial_presentation_delay_minus_one //
};
} // namespace av1
// Force new clusters at a maximum rate of 10 Hz.
constexpr base::TimeDelta kMinimumForcedClusterDuration =
base::Milliseconds(100);
void WriteOpusHeader(const AudioParameters& params, uint8_t* header) {
// See https://wiki.xiph.org/OggOpus#ID_Header.
// Set magic signature.
std::string label = "OpusHead";
memcpy(header + OPUS_EXTRADATA_LABEL_OFFSET, label.c_str(), label.size());
// Set Opus version.
header[OPUS_EXTRADATA_VERSION_OFFSET] = 1;
// Set channel count.
DCHECK_LE(params.channels(), 2);
header[OPUS_EXTRADATA_CHANNELS_OFFSET] = params.channels();
// Set pre-skip
uint16_t skip = 0;
memcpy(header + OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET, &skip, sizeof(uint16_t));
// Set original input sample rate in Hz.
uint32_t sample_rate = params.sample_rate();
memcpy(header + OPUS_EXTRADATA_SAMPLE_RATE_OFFSET, &sample_rate,
sizeof(uint32_t));
// Set output gain in dB.
uint16_t gain = 0;
memcpy(header + OPUS_EXTRADATA_GAIN_OFFSET, &gain, 2);
header[OPUS_EXTRADATA_CHANNEL_MAPPING_OFFSET] = 0;
}
static double GetFrameRate(const Muxer::VideoParameters& params) {
const double kZeroFrameRate = 0.0;
const double kDefaultFrameRate = 30.0;
double frame_rate = params.frame_rate;
if (frame_rate <= kZeroFrameRate ||
frame_rate > limits::kMaxFramesPerSecond) {
frame_rate = kDefaultFrameRate;
}
return frame_rate;
}
static const char kH264CodecId[] = "V_MPEG4/ISO/AVC";
static const char kPcmCodecId[] = "A_PCM/FLOAT/IEEE";
static const char* MkvCodeIcForMediaVideoCodecId(VideoCodec video_codec) {
switch (video_codec) {
case VideoCodec::kVP8:
return mkvmuxer::Tracks::kVp8CodecId;
case VideoCodec::kVP9:
return mkvmuxer::Tracks::kVp9CodecId;
case VideoCodec::kAV1:
return mkvmuxer::Tracks::kAv1CodecId;
case VideoCodec::kH264:
return kH264CodecId;
default:
NOTREACHED() << "Unsupported codec " << GetCodecName(video_codec);
return "";
}
}
absl::optional<mkvmuxer::Colour> ColorFromColorSpace(
const gfx::ColorSpace& color) {
using mkvmuxer::Colour;
using MatrixID = gfx::ColorSpace::MatrixID;
using RangeID = gfx::ColorSpace::RangeID;
using TransferID = gfx::ColorSpace::TransferID;
using PrimaryID = gfx::ColorSpace::PrimaryID;
Colour colour;
int matrix_coefficients;
switch (color.GetMatrixID()) {
case MatrixID::BT709:
matrix_coefficients = Colour::kBt709;
break;
case MatrixID::BT2020_NCL:
matrix_coefficients = Colour::kBt2020NonConstantLuminance;
break;
default:
return absl::nullopt;
}
colour.set_matrix_coefficients(matrix_coefficients);
int range;
switch (color.GetRangeID()) {
case RangeID::LIMITED:
range = Colour::kBroadcastRange;
break;
case RangeID::FULL:
range = Colour::kFullRange;
break;
default:
return absl::nullopt;
}
colour.set_range(range);
int transfer_characteristics;
switch (color.GetTransferID()) {
case TransferID::BT709:
transfer_characteristics = Colour::kIturBt709Tc;
break;
case TransferID::SRGB:
transfer_characteristics = Colour::kIec6196621;
break;
case TransferID::PQ:
transfer_characteristics = Colour::kSmpteSt2084;
break;
default:
return absl::nullopt;
}
colour.set_transfer_characteristics(transfer_characteristics);
int primaries;
switch (color.GetPrimaryID()) {
case PrimaryID::BT709:
primaries = Colour::kIturBt709P;
break;
case PrimaryID::BT2020:
primaries = Colour::kIturBt2020;
break;
default:
return absl::nullopt;
}
colour.set_primaries(primaries);
return colour;
}
} // anonymous namespace
// -----------------------------------------------------------------------------
// WebmMuxer::Delegate:
WebmMuxer::Delegate::Delegate() {
// Creation can be done on a different sequence than main activities.
DETACH_FROM_SEQUENCE(sequence_checker_);
}
WebmMuxer::Delegate::~Delegate() = default;
mkvmuxer::int32 WebmMuxer::Delegate::Write(const void* buf,
mkvmuxer::uint32 len) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DVLOG(2) << __func__ << " len " << len;
DCHECK(buf);
last_data_output_timestamp_ = base::TimeTicks::Now();
const auto result = DoWrite(buf, len);
position_ += len;
return result;
}
// -----------------------------------------------------------------------------
// WebmMuxer:
WebmMuxer::WebmMuxer(AudioCodec audio_codec,
bool has_video,
bool has_audio,
std::unique_ptr<Delegate> delegate)
: audio_codec_(audio_codec),
video_codec_(VideoCodec::kUnknown),
video_track_index_(0),
audio_track_index_(0),
has_video_(has_video),
has_audio_(has_audio),
delegate_(std::move(delegate)),
force_one_libwebm_error_(false) {
DCHECK(has_video_ || has_audio_);
DCHECK(delegate_);
DCHECK(audio_codec == AudioCodec::kOpus || audio_codec == AudioCodec::kPCM)
<< " Unsupported audio codec: " << GetCodecName(audio_codec);
delegate_->InitSegment(&segment_);
mkvmuxer::SegmentInfo* const info = segment_.GetSegmentInfo();
info->set_writing_app("Chrome");
info->set_muxing_app("Chrome");
// Creation can be done on a different sequence than main activities.
DETACH_FROM_SEQUENCE(sequence_checker_);
}
WebmMuxer::~WebmMuxer() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
Flush();
if (has_audio_ && !has_video_) {
base::UmaHistogramBoolean(
"Media.WebmMuxer.DidAdjustTimestamp.AudioOnly.Muxer",
did_adjust_muxer_timestamp_);
base::UmaHistogramBoolean(
"Media.WebmMuxer.DidAdjustTimestamp.AudioOnly.Audio",
did_adjust_audio_timestamp_);
} else if (!has_audio_ && has_video_) {
base::UmaHistogramBoolean(
"Media.WebmMuxer.DidAdjustTimestamp.VideoOnly.Muxer",
did_adjust_muxer_timestamp_);
base::UmaHistogramBoolean(
"Media.WebmMuxer.DidAdjustTimestamp.VideoOnly.Video",
did_adjust_video_timestamp_);
} else {
base::UmaHistogramBoolean(
"Media.WebmMuxer.DidAdjustTimestamp.AudioVideo.Muxer",
did_adjust_muxer_timestamp_);
base::UmaHistogramBoolean(
"Media.WebmMuxer.DidAdjustTimestamp.AudioVideo.Audio",
did_adjust_audio_timestamp_);
base::UmaHistogramBoolean(
"Media.WebmMuxer.DidAdjustTimestamp.AudioVideo.Video",
did_adjust_video_timestamp_);
}
}
void WebmMuxer::SetMaximumDurationToForceDataOutput(base::TimeDelta interval) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
max_data_output_interval_ = std::max(interval, kMinimumForcedClusterDuration);
}
bool WebmMuxer::OnEncodedVideo(const VideoParameters& params,
std::string encoded_data,
std::string encoded_alpha,
base::TimeTicks timestamp,
bool is_key_frame) {
TRACE_EVENT2("media", __func__, "timestamp", timestamp - base::TimeTicks(),
"is_key_frame", is_key_frame);
DVLOG(2) << __func__ << " - " << encoded_data.size() << "B ts " << timestamp;
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(params.codec == VideoCodec::kVP8 || params.codec == VideoCodec::kVP9 ||
params.codec == VideoCodec::kH264 || params.codec == VideoCodec::kAV1)
<< " Unsupported video codec: " << GetCodecName(params.codec);
DCHECK(video_codec_ == VideoCodec::kUnknown || video_codec_ == params.codec)
<< "Unsupported: codec switched, to: " << GetCodecName(params.codec);
if (encoded_data.size() == 0u) {
DLOG(WARNING) << __func__ << ": zero size encoded frame, skipping";
// Some encoders give sporadic zero-size data, see https://crbug.com/716451.
return true;
}
if (!video_track_index_) {
// |track_index_|, cannot be zero (!), initialize WebmMuxer in that case.
// http://www.matroska.org/technical/specs/index.html#Tracks
video_codec_ = params.codec;
AddVideoTrack(params.visible_rect_size, GetFrameRate(params),
params.color_space);
// Add codec private for AV1.
if (params.codec == VideoCodec::kAV1 &&
!segment_.GetTrackByNumber(video_track_index_)
->SetCodecPrivate(av1::codec_private, sizeof(av1::codec_private)))
LOG(ERROR) << __func__ << " failed to set CodecPrivate for AV1.";
}
// TODO(ajose): Support multiple tracks: http://crbug.com/528523
if (has_audio_ && !audio_track_index_) {
DVLOG(1) << __func__ << ": delaying until audio track ready.";
if (is_key_frame) // Upon Key frame reception, empty the encoded queue.
video_frames_.clear();
}
// Compensate for time in pause spent before the first frame.
auto timestamp_minus_paused = timestamp - total_time_in_pause_;
if (!video_timestamp_source_.has_value()) {
video_timestamp_source_.emplace(timestamp_minus_paused,
did_adjust_video_timestamp_);
}
video_frames_.push_back(EncodedFrame{
std::move(encoded_data), std::move(encoded_alpha),
video_timestamp_source_->UpdateAndGetNext(timestamp_minus_paused),
is_key_frame});
return PartiallyFlushQueues();
}
bool WebmMuxer::OnEncodedAudio(const AudioParameters& params,
std::string encoded_data,
base::TimeTicks timestamp) {
TRACE_EVENT1("media", __func__, "timestamp", timestamp - base::TimeTicks());
DVLOG(2) << __func__ << " - " << encoded_data.size() << "B ts " << timestamp;
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
MaybeForceNewCluster();
if (!audio_track_index_) {
AddAudioTrack(params);
}
// Compensate for time in pause spent before the first frame.
auto timestamp_minus_paused = timestamp - total_time_in_pause_;
if (!audio_timestamp_source_.has_value()) {
audio_timestamp_source_.emplace(timestamp_minus_paused,
did_adjust_audio_timestamp_);
}
audio_frames_.push_back(EncodedFrame{
encoded_data, std::string(),
audio_timestamp_source_->UpdateAndGetNext(timestamp_minus_paused),
/*is_keyframe=*/true});
return PartiallyFlushQueues();
}
void WebmMuxer::SetLiveAndEnabled(bool track_live_and_enabled, bool is_video) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
bool& written_track_live_and_enabled =
is_video ? video_track_live_and_enabled_ : audio_track_live_and_enabled_;
if (written_track_live_and_enabled != track_live_and_enabled) {
DVLOG(1) << __func__ << (is_video ? " video " : " audio ")
<< "track live-and-enabled changed to " << track_live_and_enabled;
}
written_track_live_and_enabled = track_live_and_enabled;
}
void WebmMuxer::Pause() {
DVLOG(1) << __func__;
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (!elapsed_time_in_pause_)
elapsed_time_in_pause_.emplace();
}
void WebmMuxer::Resume() {
DVLOG(1) << __func__;
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (elapsed_time_in_pause_) {
total_time_in_pause_ += elapsed_time_in_pause_->Elapsed();
elapsed_time_in_pause_.reset();
}
}
bool WebmMuxer::Flush() {
// Depending on the |delegate_|, it can be either non-seekable (i.e. a live
// stream), or seekable (file mode). So calling |segment_.Finalize()| here is
// needed.
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
FlushQueues();
return segment_.Finalize();
}
void WebmMuxer::AddVideoTrack(
const gfx::Size& frame_size,
double frame_rate,
const absl::optional<gfx::ColorSpace>& color_space) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK_EQ(0u, video_track_index_)
<< "WebmMuxer can only be initialized once.";
video_track_index_ =
segment_.AddVideoTrack(frame_size.width(), frame_size.height(), 0);
if (video_track_index_ <= 0) { // See https://crbug.com/616391.
NOTREACHED() << "Error adding video track";
return;
}
mkvmuxer::VideoTrack* const video_track =
reinterpret_cast<mkvmuxer::VideoTrack*>(
segment_.GetTrackByNumber(video_track_index_));
if (color_space) {
auto colour = ColorFromColorSpace(*color_space);
if (colour)
video_track->SetColour(*colour);
}
DCHECK(video_track);
video_track->set_codec_id(MkvCodeIcForMediaVideoCodecId(video_codec_));
DCHECK_EQ(0ull, video_track->crop_right());
DCHECK_EQ(0ull, video_track->crop_left());
DCHECK_EQ(0ull, video_track->crop_top());
DCHECK_EQ(0ull, video_track->crop_bottom());
DCHECK_EQ(0.0f, video_track->frame_rate());
// Segment's timestamps should be in milliseconds, DCHECK it. See
// http://www.webmproject.org/docs/container/#muxer-guidelines
DCHECK_EQ(1000000ull, segment_.GetSegmentInfo()->timecode_scale());
// Set alpha channel parameters for only VPX (crbug.com/711825).
if (video_codec_ == VideoCodec::kH264)
return;
video_track->SetAlphaMode(mkvmuxer::VideoTrack::kAlpha);
// Alpha channel, if present, is stored in a BlockAdditional next to the
// associated opaque Block, see
// https://matroska.org/technical/specs/index.html#BlockAdditional.
// This follows Method 1 for VP8 encoding of A-channel described on
// http://wiki.webmproject.org/alpha-channel.
video_track->set_max_block_additional_id(1);
}
void WebmMuxer::AddAudioTrack(const AudioParameters& params) {
DVLOG(1) << __func__ << " " << params.AsHumanReadableString();
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK_EQ(0u, audio_track_index_)
<< "WebmMuxer audio can only be initialised once.";
audio_track_index_ =
segment_.AddAudioTrack(params.sample_rate(), params.channels(), 0);
if (audio_track_index_ <= 0) { // See https://crbug.com/616391.
NOTREACHED() << "Error adding audio track";
return;
}
mkvmuxer::AudioTrack* const audio_track =
reinterpret_cast<mkvmuxer::AudioTrack*>(
segment_.GetTrackByNumber(audio_track_index_));
DCHECK(audio_track);
DCHECK_EQ(params.sample_rate(), audio_track->sample_rate());
DCHECK_EQ(params.channels(), static_cast<int>(audio_track->channels()));
DCHECK_LE(params.channels(), 2)
<< "Only 1 or 2 channels supported, requested " << params.channels();
// Audio data is always pcm_f32le.
audio_track->set_bit_depth(32u);
if (audio_codec_ == AudioCodec::kOpus) {
audio_track->set_codec_id(mkvmuxer::Tracks::kOpusCodecId);
uint8_t opus_header[OPUS_EXTRADATA_SIZE];
WriteOpusHeader(params, opus_header);
if (!audio_track->SetCodecPrivate(opus_header, OPUS_EXTRADATA_SIZE))
LOG(ERROR) << __func__ << ": failed to set opus header.";
// Segment's timestamps should be in milliseconds, DCHECK it. See
// http://www.webmproject.org/docs/container/#muxer-guidelines
DCHECK_EQ(1000000ull, segment_.GetSegmentInfo()->timecode_scale());
} else if (audio_codec_ == AudioCodec::kPCM) {
audio_track->set_codec_id(kPcmCodecId);
}
}
void WebmMuxer::FlushQueues() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
while ((!video_frames_.empty() || !audio_frames_.empty()) &&
FlushNextFrame()) {
}
}
bool WebmMuxer::PartiallyFlushQueues() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// Punt writing until all tracks have been created.
if ((has_audio_ && !audio_track_index_) ||
(has_video_ && !video_track_index_)) {
return true;
}
bool result = true;
// We strictly sort by timestamp unless a track is not live-and-enabled. In
// that case we relax this and allow drainage of the live-and-enabled leg.
while ((!has_video_ || !video_frames_.empty() ||
!video_track_live_and_enabled_) &&
(!has_audio_ || !audio_frames_.empty() ||
!audio_track_live_and_enabled_) &&
result) {
if (video_frames_.empty() && audio_frames_.empty())
return true;
result = FlushNextFrame();
}
return result;
}
bool WebmMuxer::FlushNextFrame() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
base::TimeTicks min_timestamp = base::TimeTicks::Max();
base::circular_deque<EncodedFrame>* queue = &video_frames_;
uint8_t track_index = video_track_index_;
if (!video_frames_.empty())
min_timestamp = video_frames_.front().timestamp_minus_paused_;
if (!audio_frames_.empty() &&
audio_frames_.front().timestamp_minus_paused_ < min_timestamp) {
queue = &audio_frames_;
track_index = audio_track_index_;
}
EncodedFrame frame = std::move(queue->front());
queue->pop_front();
// Update the first timestamp if necessary so we can write relative timestamps
// into the muxer.
if (first_timestamp_.is_null()) {
first_timestamp_ = frame.timestamp_minus_paused_;
}
// The logic tracking live-and-enabled that temporarily relaxes the strict
// timestamp sorting allows for draining a track's queue completely in the
// presence of the other track being muted. When the muted track becomes
// live-and-enabled again the sorting recommences. However, tracks get encoded
// data before live-and-enabled transitions to true. This can lead to us
// emitting non-monotonic timestamps to the muxer, which results in an error
// return. Fix this by enforcing monotonicity by rewriting timestamps.
// TODO(crbug.com/1145203): If this causes audio glitches in the field,
// reconsider this solution. For example, consider auto-marking a track
// live-and-enabled when media appears and remove this catch-all.
base::TimeDelta relative_timestamp =
frame.timestamp_minus_paused_ - first_timestamp_;
DLOG_IF(WARNING, relative_timestamp < last_timestamp_written_)
<< "Enforced a monotonically increasing timestamp. Last written "
<< last_timestamp_written_ << " new " << relative_timestamp;
did_adjust_muxer_timestamp_ |= (relative_timestamp < last_timestamp_written_);
relative_timestamp = std::max(relative_timestamp, last_timestamp_written_);
last_timestamp_written_ = relative_timestamp;
auto recorded_timestamp = relative_timestamp.InMicroseconds() *
base::Time::kNanosecondsPerMicrosecond;
if (force_one_libwebm_error_) {
DVLOG(1) << "Forcing a libwebm error";
force_one_libwebm_error_ = false;
return false;
}
DCHECK(frame.data.data());
TRACE_EVENT2("media", __func__, "is_video", queue == &video_frames_,
"recorded_timestamp", recorded_timestamp);
bool result =
frame.alpha_data.empty()
? segment_.AddFrame(
reinterpret_cast<const uint8_t*>(frame.data.data()),
frame.data.size(), track_index, recorded_timestamp,
frame.is_keyframe)
: segment_.AddFrameWithAdditional(
reinterpret_cast<const uint8_t*>(frame.data.data()),
frame.data.size(),
reinterpret_cast<const uint8_t*>(frame.alpha_data.data()),
frame.alpha_data.size(), 1 /* add_id */, track_index,
recorded_timestamp, frame.is_keyframe);
return result;
}
void WebmMuxer::MaybeForceNewCluster() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (!has_video_ || max_data_output_interval_.is_zero() ||
delegate_->last_data_output_timestamp().is_null()) {
return;
}
// TODO(crbug.com/1381323): consider if cluster output should be based on
// media timestamps
if (base::TimeTicks::Now() - delegate_->last_data_output_timestamp() >=
max_data_output_interval_) {
TRACE_EVENT0("media", "ForceNewClusterOnNextFrame");
segment_.ForceNewClusterOnNextFrame();
}
}
WebmMuxer::MonotonicTimestampSequence::MonotonicTimestampSequence(
base::TimeTicks first_timestamp,
bool& did_adjust_timestamp)
: last_timestamp_(first_timestamp),
did_adjust_timestamp_(did_adjust_timestamp) {}
base::TimeTicks WebmMuxer::MonotonicTimestampSequence::UpdateAndGetNext(
base::TimeTicks timestamp) {
DVLOG(3) << __func__ << " ts " << timestamp << " last " << last_timestamp_;
// In theory, time increases monotonically. In practice, it does not.
// See http://crbug/618407.
DLOG_IF(WARNING, timestamp < last_timestamp_)
<< "Encountered a non-monotonically increasing timestamp. Was: "
<< last_timestamp_ << ", timestamp: " << timestamp;
*did_adjust_timestamp_ |= (timestamp < last_timestamp_);
last_timestamp_ = std::max(last_timestamp_, timestamp);
return last_timestamp_;
}
} // namespace media
| [
"jengelh@inai.de"
] | jengelh@inai.de |
f69d546afebd74abaa492dc6777656e7de83229f | 041b9e8e5771e92f8d56b6cc31a16cd108d8178c | /os/syncPrintf.cpp | 477be5e4398e60530e3da6815b703fefe6fee08a | [] | no_license | kostaDimitrijevic/OperatingSystem | 5ecc176cdc07aeb6bbfe8e56040cbe2eaf547127 | 9c6ef92c45288e0309b79a2673466e19cce708c1 | refs/heads/main | 2023-08-21T05:28:26.238602 | 2021-10-24T19:11:44 | 2021-10-24T19:11:44 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 275 | cpp | #include <DOS.H>
#include <STDIO.H>
#include <STDARG.H>
#include "thread.h"
int syncPrintf(const char *format, ...)
{
int res;
va_list args;
#ifndef BCC_BLOCK_IGNORE
lock
va_start(args, format);
res = vprintf(format, args);
va_end(args);
unlock
#endif
return res;
}
| [
"kole.dimi99@gmail.com"
] | kole.dimi99@gmail.com |
a6f1cc6bbcdb59abd239c5e6814bf0dffff94ff7 | c668866a625b078004eb7afb494165ccd20ec91b | /NetworkProcess/IndexedDB/WebIDBServer.cpp | 40038a0f35935d406e93b11adcb631a3df8157a6 | [] | no_license | apple-opensource/WebKit2 | a8cef8558d6fcb06ce3c3deb133663ee81588881 | 8d6325f1f1b8e5951ffe5a32b1e1d671552e968b | refs/heads/master | 2021-11-18T06:02:53.240866 | 2021-07-28T00:05:58 | 2021-07-28T00:05:58 | 249,039,843 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 15,613 | cpp | /*
* Copyright (C) 2019 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "WebIDBServer.h"
#include "WebIDBConnectionToClient.h"
#include "WebIDBServerMessages.h"
#include <WebCore/SQLiteDatabaseTracker.h>
#include <WebCore/StorageQuotaManager.h>
#include <wtf/threads/BinarySemaphore.h>
#if ENABLE(INDEXED_DATABASE)
namespace WebKit {
Ref<WebIDBServer> WebIDBServer::create(PAL::SessionID sessionID, const String& directory, WebCore::IDBServer::IDBServer::StorageQuotaManagerSpaceRequester&& spaceRequester, CompletionHandler<void()>&& closeCallback)
{
return adoptRef(*new WebIDBServer(sessionID, directory, WTFMove(spaceRequester), WTFMove(closeCallback)));
}
WebIDBServer::WebIDBServer(PAL::SessionID sessionID, const String& directory, WebCore::IDBServer::IDBServer::StorageQuotaManagerSpaceRequester&& spaceRequester, CompletionHandler<void()>&& closeCallback)
: CrossThreadTaskHandler("com.apple.WebKit.IndexedDBServer", WTF::CrossThreadTaskHandler::AutodrainedPoolForRunLoop::Use)
, m_dataTaskCounter([this](RefCounterEvent) { tryClose(); })
, m_closeCallback(WTFMove(closeCallback))
{
ASSERT(RunLoop::isMain());
BinarySemaphore semaphore;
postTask([this, protectedThis = makeRef(*this), &semaphore, sessionID, directory = directory.isolatedCopy(), spaceRequester = WTFMove(spaceRequester)] () mutable {
m_server = makeUnique<WebCore::IDBServer::IDBServer>(sessionID, directory, WTFMove(spaceRequester));
semaphore.signal();
});
semaphore.wait();
}
WebIDBServer::~WebIDBServer()
{
ASSERT(RunLoop::isMain());
// close() has to be called to make sure thread exits.
ASSERT(!m_closeCallback);
}
void WebIDBServer::getOrigins(CompletionHandler<void(HashSet<WebCore::SecurityOriginData>&&)>&& callback)
{
ASSERT(RunLoop::isMain());
postTask([this, protectedThis = makeRef(*this), callback = WTFMove(callback), token = m_dataTaskCounter.count()]() mutable {
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
postTaskReply(CrossThreadTask([callback = WTFMove(callback), token = WTFMove(token), origins = crossThreadCopy(m_server->getOrigins())]() mutable {
callback(WTFMove(origins));
}));
});
}
void WebIDBServer::closeAndDeleteDatabasesModifiedSince(WallTime modificationTime, CompletionHandler<void()>&& callback)
{
ASSERT(RunLoop::isMain());
postTask([this, protectedThis = makeRef(*this), modificationTime, callback = WTFMove(callback), token = m_dataTaskCounter.count()]() mutable {
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->closeAndDeleteDatabasesModifiedSince(modificationTime);
postTaskReply(CrossThreadTask([callback = WTFMove(callback), token = WTFMove(token)]() mutable {
callback();
}));
});
}
void WebIDBServer::closeAndDeleteDatabasesForOrigins(const Vector<WebCore::SecurityOriginData>& originDatas, CompletionHandler<void()>&& callback)
{
ASSERT(RunLoop::isMain());
postTask([this, protectedThis = makeRef(*this), originDatas = originDatas.isolatedCopy(), callback = WTFMove(callback), token = m_dataTaskCounter.count()] () mutable {
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->closeAndDeleteDatabasesForOrigins(originDatas);
postTaskReply(CrossThreadTask([callback = WTFMove(callback), token = WTFMove(token)]() mutable {
callback();
}));
});
}
void WebIDBServer::renameOrigin(const WebCore::SecurityOriginData& oldOrigin, const WebCore::SecurityOriginData& newOrigin, CompletionHandler<void()>&& callback)
{
ASSERT(RunLoop::isMain());
postTask([this, protectedThis = makeRef(*this), oldOrigin = oldOrigin.isolatedCopy(), newOrigin = newOrigin.isolatedCopy(), callback = WTFMove(callback), token = m_dataTaskCounter.count()] () mutable {
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->renameOrigin(oldOrigin, newOrigin);
postTaskReply(CrossThreadTask([callback = WTFMove(callback), token = WTFMove(token)]() mutable {
callback();
}));
});
}
void WebIDBServer::suspend()
{
ASSERT(RunLoop::isMain());
if (m_isSuspended)
return;
m_isSuspended = true;
m_server->lock().lock();
m_server->stopDatabaseActivitiesOnMainThread();
}
void WebIDBServer::resume()
{
ASSERT(RunLoop::isMain());
if (!m_isSuspended)
return;
m_isSuspended = false;
m_server->lock().unlock();
}
void WebIDBServer::openDatabase(const WebCore::IDBRequestData& requestData)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->openDatabase(requestData);
}
void WebIDBServer::deleteDatabase(const WebCore::IDBRequestData& requestData)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->deleteDatabase(requestData);
}
void WebIDBServer::abortTransaction(const WebCore::IDBResourceIdentifier& transactionIdentifier)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->abortTransaction(transactionIdentifier);
}
void WebIDBServer::commitTransaction(const WebCore::IDBResourceIdentifier& transactionIdentifier)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->commitTransaction(transactionIdentifier);
}
void WebIDBServer::didFinishHandlingVersionChangeTransaction(uint64_t databaseConnectionIdentifier, const WebCore::IDBResourceIdentifier& transactionIdentifier)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->didFinishHandlingVersionChangeTransaction(databaseConnectionIdentifier, transactionIdentifier);
}
void WebIDBServer::createObjectStore(const WebCore::IDBRequestData& requestData, const WebCore::IDBObjectStoreInfo& objectStoreInfo)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->createObjectStore(requestData, objectStoreInfo);
}
void WebIDBServer::deleteObjectStore(const WebCore::IDBRequestData& requestData, const String& objectStoreName)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->deleteObjectStore(requestData, objectStoreName);
}
void WebIDBServer::renameObjectStore(const WebCore::IDBRequestData& requestData, uint64_t objectStoreIdentifier, const String& newName)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->renameObjectStore(requestData, objectStoreIdentifier, newName);
}
void WebIDBServer::clearObjectStore(const WebCore::IDBRequestData& requestData, uint64_t objectStoreIdentifier)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->clearObjectStore(requestData, objectStoreIdentifier);
}
void WebIDBServer::createIndex(const WebCore::IDBRequestData& requestData, const WebCore::IDBIndexInfo& indexInfo)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->createIndex(requestData, indexInfo);
}
void WebIDBServer::deleteIndex(const WebCore::IDBRequestData& requestData, uint64_t objectStoreIdentifier, const String& indexName)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->deleteIndex(requestData, objectStoreIdentifier, indexName);
}
void WebIDBServer::renameIndex(const WebCore::IDBRequestData& requestData, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String& newName)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->renameIndex(requestData, objectStoreIdentifier, indexIdentifier, newName);
}
void WebIDBServer::putOrAdd(const WebCore::IDBRequestData& requestData, const WebCore::IDBKeyData& keyData, const WebCore::IDBValue& value, WebCore::IndexedDB::ObjectStoreOverwriteMode overWriteMode)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->putOrAdd(requestData, keyData, value, overWriteMode);
}
void WebIDBServer::getRecord(const WebCore::IDBRequestData& requestData, const WebCore::IDBGetRecordData& getRecordData)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->getRecord(requestData, getRecordData);
}
void WebIDBServer::getAllRecords(const WebCore::IDBRequestData& requestData, const WebCore::IDBGetAllRecordsData& getAllRecordsData)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->getAllRecords(requestData, getAllRecordsData);
}
void WebIDBServer::getCount(const WebCore::IDBRequestData& requestData, const WebCore::IDBKeyRangeData& keyRangeData)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->getCount(requestData, keyRangeData);
}
void WebIDBServer::deleteRecord(const WebCore::IDBRequestData& requestData, const WebCore::IDBKeyRangeData& keyRangeData)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->deleteRecord(requestData, keyRangeData);
}
void WebIDBServer::openCursor(const WebCore::IDBRequestData& requestData, const WebCore::IDBCursorInfo& cursorInfo)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->openCursor(requestData, cursorInfo);
}
void WebIDBServer::iterateCursor(const WebCore::IDBRequestData& requestData, const WebCore::IDBIterateCursorData& iterateCursorData)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->iterateCursor(requestData, iterateCursorData);
}
void WebIDBServer::establishTransaction(uint64_t databaseConnectionIdentifier, const WebCore::IDBTransactionInfo& transactionInfo)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->establishTransaction(databaseConnectionIdentifier, transactionInfo);
}
void WebIDBServer::databaseConnectionPendingClose(uint64_t databaseConnectionIdentifier)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->databaseConnectionPendingClose(databaseConnectionIdentifier);
}
void WebIDBServer::databaseConnectionClosed(uint64_t databaseConnectionIdentifier)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->databaseConnectionClosed(databaseConnectionIdentifier);
}
void WebIDBServer::abortOpenAndUpgradeNeeded(uint64_t databaseConnectionIdentifier, const WebCore::IDBResourceIdentifier& transactionIdentifier)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->abortOpenAndUpgradeNeeded(databaseConnectionIdentifier, transactionIdentifier);
}
void WebIDBServer::didFireVersionChangeEvent(uint64_t databaseConnectionIdentifier, const WebCore::IDBResourceIdentifier& requestIdentifier, WebCore::IndexedDB::ConnectionClosedOnBehalfOfServer connectionClosed)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->didFireVersionChangeEvent(databaseConnectionIdentifier, requestIdentifier, connectionClosed);
}
void WebIDBServer::openDBRequestCancelled(const WebCore::IDBRequestData& requestData)
{
ASSERT(!RunLoop::isMain());
LockHolder locker(m_server->lock());
m_server->openDBRequestCancelled(requestData);
}
void WebIDBServer::getAllDatabaseNamesAndVersions(IPC::Connection& connection, const WebCore::IDBResourceIdentifier& requestIdentifier, const WebCore::ClientOrigin& origin)
{
ASSERT(!RunLoop::isMain());
auto* webIDBConnection = m_connectionMap.get(connection.uniqueID());
ASSERT(webIDBConnection);
LockHolder locker(m_server->lock());
m_server->getAllDatabaseNamesAndVersions(webIDBConnection->identifier(), requestIdentifier, origin);
}
void WebIDBServer::addConnection(IPC::Connection& connection, WebCore::ProcessIdentifier processIdentifier)
{
ASSERT(RunLoop::isMain());
postTask([this, protectedThis = makeRef(*this), protectedConnection = makeRefPtr(connection), processIdentifier] {
auto[iter, isNewEntry] = m_connectionMap.ensure(protectedConnection->uniqueID(), [&] {
return makeUnique<WebIDBConnectionToClient>(*protectedConnection, processIdentifier);
});
ASSERT_UNUSED(isNewEntry, isNewEntry);
LockHolder locker(m_server->lock());
m_server->registerConnection(iter->value->connectionToClient());
});
m_connections.add(&connection);
connection.addThreadMessageReceiver(Messages::WebIDBServer::messageReceiverName(), this);
}
void WebIDBServer::removeConnection(IPC::Connection& connection)
{
ASSERT(RunLoop::isMain());
auto* takenConnection = m_connections.take(&connection);
if (!takenConnection)
return;
takenConnection->removeThreadMessageReceiver(Messages::WebIDBServer::messageReceiverName());
postTask([this, protectedThis = makeRef(*this), connectionID = connection.uniqueID()] {
auto connection = m_connectionMap.take(connectionID);
ASSERT(connection);
LockHolder locker(m_server->lock());
m_server->unregisterConnection(connection->connectionToClient());
});
tryClose();
}
void WebIDBServer::postTask(Function<void()>&& task)
{
ASSERT(RunLoop::isMain());
CrossThreadTaskHandler::postTask(CrossThreadTask(WTFMove(task)));
}
void WebIDBServer::dispatchToThread(Function<void()>&& task)
{
CrossThreadTaskHandler::postTask(CrossThreadTask(WTFMove(task)));
}
void WebIDBServer::close()
{
ASSERT(RunLoop::isMain());
if (!m_closeCallback)
return;
// Remove the references held by IPC::Connection.
for (auto* connection : m_connections)
connection->removeThreadMessageReceiver(Messages::WebIDBServer::messageReceiverName());
CrossThreadTaskHandler::setCompletionCallback([protectedThis = makeRef(*this)]() mutable {
ASSERT(!RunLoop::isMain());
callOnMainRunLoop([protectedThis = WTFMove(protectedThis)]() mutable { });
});
postTask([this]() mutable {
m_connectionMap.clear();
m_server = nullptr;
CrossThreadTaskHandler::kill();
});
m_closeCallback();
}
void WebIDBServer::tryClose()
{
if (!m_connections.isEmpty() || m_dataTaskCounter.value())
return;
close();
}
} // namespace WebKit
#endif
| [
"apple.opensource@gmail.com"
] | apple.opensource@gmail.com |
b3b450f7ca270803195bb2468fcaeee64740f170 | a11e2edaa536604d5bdc867f5f1e04bbc0b58700 | /AggroEngine/src/Subsystem/Graphics/Impl/OpenGL/CommandTree/GBuffer/HasTangents/HasTangents.hpp | f52238c0c9c7734d3778689687eddf035646bda9 | [] | no_license | Argo15/Aggro-Engine | bd9be7b996ec0c3c9e70fe10ee4d02fc3e57ab18 | 7df2211900e6b3572a06f3195cbb357d23677e5f | refs/heads/master | 2021-12-31T12:23:12.208908 | 2021-10-07T22:10:32 | 2021-10-07T22:10:32 | 72,375,974 | 6 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 206 | hpp | #pragma once
#include "Layer.hpp"
class HasTangents : public Layer
{
public:
HasTangents();
shared_ptr<CommandTreeItem> getCommands(RenderOptions &renderOptions, shared_ptr<RenderNode> renderNodes);
}; | [
"wcrane15@gmail.com"
] | wcrane15@gmail.com |
ee8163f4da41d27c77c868ba3b1d42a29b043e60 | 92b2589fa4a9ba032f6eb3c6c0ecfe78adbcda69 | /src/server/main.cpp | 5fc713a95872918baea48af4e0e50de84c5a1822 | [] | no_license | PKtoon/chat_app | 66f77999ecad1f5e04aaaaa67579d338e982b155 | 5a32ba6ecb233a830c284c783c09684330dbb88e | refs/heads/master | 2022-02-12T06:38:44.453078 | 2022-01-30T16:08:55 | 2022-01-30T16:08:55 | 194,858,659 | 5 | 0 | null | 2020-01-08T18:40:04 | 2019-07-02T12:26:48 | C++ | UTF-8 | C++ | false | false | 337 | cpp | #include <iostream>
#include "server.hpp"
int main(int argc, char* argv[])
{
if(argc != 3)
{
std::cerr<<"Usage: server [PORT] [POSTGRESQL URI]\n";
exit(1);
}
#ifndef NDEBUG
std::cerr<<"This is debug build! Only for testing purpose!\n";
#endif
Server s(std::atoi(argv[1]), argv[2]);
return 0;
}
| [
"pratik_khanke005@yahoo.com"
] | pratik_khanke005@yahoo.com |
b482bde32a2622b85b9a4ed2511ce75ae2cc7830 | 228f6b237771a5979490fd958e6f7b3e6e33382b | /google/protobuf/unittest.pb.h | 4f6474bceb66d5cfb8f9d7d85b6086aea7cf8371 | [] | no_license | yangchengjian/tensorflow-jni | 26511be8b98be2a1f7f542b79369d4267744d8de | afbcc90e93d1979d4a90efb5db227933b2f5a58c | refs/heads/master | 2022-12-23T18:49:30.916996 | 2017-08-14T07:46:17 | 2017-08-14T07:46:17 | 99,997,589 | 0 | 1 | null | 2022-12-18T02:36:24 | 2017-08-11T06:12:44 | C++ | UTF-8 | C++ | false | true | 959,944 | h | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/unittest.proto
#ifndef PROTOBUF_google_2fprotobuf_2funittest_2eproto__INCLUDED
#define PROTOBUF_google_2fprotobuf_2funittest_2eproto__INCLUDED
#include <string>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 3000000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include <google/protobuf/arena.h>
#include <google/protobuf/arenastring.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/metadata.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/generated_enum_reflection.h>
#include <google/protobuf/service.h>
#include <google/protobuf/unknown_field_set.h>
#include "google/protobuf/unittest_import.pb.h"
// @@protoc_insertion_point(includes)
namespace protobuf_unittest {
// Internal implementation detail -- do not call these.
void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
class BarRequest;
class BarResponse;
class BoolMessage;
class FooClientMessage;
class FooRequest;
class FooResponse;
class FooServerMessage;
class ForeignMessage;
class Int32Message;
class Int64Message;
class MoreBytes;
class MoreString;
class NestedTestAllTypes;
class OneBytes;
class OneString;
class OptionalGroup_extension;
class RepeatedGroup_extension;
class SparseEnumMessage;
class TestAllExtensions;
class TestAllTypes;
class TestAllTypes_NestedMessage;
class TestAllTypes_OptionalGroup;
class TestAllTypes_RepeatedGroup;
class TestCamelCaseFieldNames;
class TestCommentInjectionMessage;
class TestDeprecatedFields;
class TestDupFieldNumber;
class TestDupFieldNumber_Bar;
class TestDupFieldNumber_Foo;
class TestDynamicExtensions;
class TestDynamicExtensions_DynamicMessageType;
class TestEagerMessage;
class TestEmptyMessage;
class TestEmptyMessageWithExtensions;
class TestExtremeDefaultValues;
class TestFieldOrderings;
class TestFieldOrderings_NestedMessage;
class TestForeignNested;
class TestLazyMessage;
class TestMultipleExtensionRanges;
class TestMutualRecursionA;
class TestMutualRecursionB;
class TestNestedExtension;
class TestNestedMessageHasBits;
class TestNestedMessageHasBits_NestedMessage;
class TestOneof;
class TestOneof2;
class TestOneof2_FooGroup;
class TestOneof2_NestedMessage;
class TestOneofBackwardsCompatible;
class TestOneofBackwardsCompatible_FooGroup;
class TestOneof_FooGroup;
class TestPackedExtensions;
class TestPackedTypes;
class TestParsingMerge;
class TestParsingMerge_OptionalGroup;
class TestParsingMerge_RepeatedFieldsGenerator;
class TestParsingMerge_RepeatedFieldsGenerator_Group1;
class TestParsingMerge_RepeatedFieldsGenerator_Group2;
class TestParsingMerge_RepeatedGroup;
class TestReallyLargeTagNumber;
class TestRecursiveMessage;
class TestRepeatedScalarDifferentTagSizes;
class TestRequired;
class TestRequiredForeign;
class TestRequiredOneof;
class TestRequiredOneof_NestedMessage;
class TestReservedFields;
class TestUnpackedExtensions;
class TestUnpackedTypes;
class Uint32Message;
class Uint64Message;
enum TestAllTypes_NestedEnum {
TestAllTypes_NestedEnum_FOO = 1,
TestAllTypes_NestedEnum_BAR = 2,
TestAllTypes_NestedEnum_BAZ = 3,
TestAllTypes_NestedEnum_NEG = -1
};
bool TestAllTypes_NestedEnum_IsValid(int value);
const TestAllTypes_NestedEnum TestAllTypes_NestedEnum_NestedEnum_MIN = TestAllTypes_NestedEnum_NEG;
const TestAllTypes_NestedEnum TestAllTypes_NestedEnum_NestedEnum_MAX = TestAllTypes_NestedEnum_BAZ;
const int TestAllTypes_NestedEnum_NestedEnum_ARRAYSIZE = TestAllTypes_NestedEnum_NestedEnum_MAX + 1;
const ::google::protobuf::EnumDescriptor* TestAllTypes_NestedEnum_descriptor();
inline const ::std::string& TestAllTypes_NestedEnum_Name(TestAllTypes_NestedEnum value) {
return ::google::protobuf::internal::NameOfEnum(
TestAllTypes_NestedEnum_descriptor(), value);
}
inline bool TestAllTypes_NestedEnum_Parse(
const ::std::string& name, TestAllTypes_NestedEnum* value) {
return ::google::protobuf::internal::ParseNamedEnum<TestAllTypes_NestedEnum>(
TestAllTypes_NestedEnum_descriptor(), name, value);
}
enum TestOneof2_NestedEnum {
TestOneof2_NestedEnum_FOO = 1,
TestOneof2_NestedEnum_BAR = 2,
TestOneof2_NestedEnum_BAZ = 3
};
bool TestOneof2_NestedEnum_IsValid(int value);
const TestOneof2_NestedEnum TestOneof2_NestedEnum_NestedEnum_MIN = TestOneof2_NestedEnum_FOO;
const TestOneof2_NestedEnum TestOneof2_NestedEnum_NestedEnum_MAX = TestOneof2_NestedEnum_BAZ;
const int TestOneof2_NestedEnum_NestedEnum_ARRAYSIZE = TestOneof2_NestedEnum_NestedEnum_MAX + 1;
const ::google::protobuf::EnumDescriptor* TestOneof2_NestedEnum_descriptor();
inline const ::std::string& TestOneof2_NestedEnum_Name(TestOneof2_NestedEnum value) {
return ::google::protobuf::internal::NameOfEnum(
TestOneof2_NestedEnum_descriptor(), value);
}
inline bool TestOneof2_NestedEnum_Parse(
const ::std::string& name, TestOneof2_NestedEnum* value) {
return ::google::protobuf::internal::ParseNamedEnum<TestOneof2_NestedEnum>(
TestOneof2_NestedEnum_descriptor(), name, value);
}
enum TestDynamicExtensions_DynamicEnumType {
TestDynamicExtensions_DynamicEnumType_DYNAMIC_FOO = 2200,
TestDynamicExtensions_DynamicEnumType_DYNAMIC_BAR = 2201,
TestDynamicExtensions_DynamicEnumType_DYNAMIC_BAZ = 2202
};
bool TestDynamicExtensions_DynamicEnumType_IsValid(int value);
const TestDynamicExtensions_DynamicEnumType TestDynamicExtensions_DynamicEnumType_DynamicEnumType_MIN = TestDynamicExtensions_DynamicEnumType_DYNAMIC_FOO;
const TestDynamicExtensions_DynamicEnumType TestDynamicExtensions_DynamicEnumType_DynamicEnumType_MAX = TestDynamicExtensions_DynamicEnumType_DYNAMIC_BAZ;
const int TestDynamicExtensions_DynamicEnumType_DynamicEnumType_ARRAYSIZE = TestDynamicExtensions_DynamicEnumType_DynamicEnumType_MAX + 1;
const ::google::protobuf::EnumDescriptor* TestDynamicExtensions_DynamicEnumType_descriptor();
inline const ::std::string& TestDynamicExtensions_DynamicEnumType_Name(TestDynamicExtensions_DynamicEnumType value) {
return ::google::protobuf::internal::NameOfEnum(
TestDynamicExtensions_DynamicEnumType_descriptor(), value);
}
inline bool TestDynamicExtensions_DynamicEnumType_Parse(
const ::std::string& name, TestDynamicExtensions_DynamicEnumType* value) {
return ::google::protobuf::internal::ParseNamedEnum<TestDynamicExtensions_DynamicEnumType>(
TestDynamicExtensions_DynamicEnumType_descriptor(), name, value);
}
enum ForeignEnum {
FOREIGN_FOO = 4,
FOREIGN_BAR = 5,
FOREIGN_BAZ = 6
};
bool ForeignEnum_IsValid(int value);
const ForeignEnum ForeignEnum_MIN = FOREIGN_FOO;
const ForeignEnum ForeignEnum_MAX = FOREIGN_BAZ;
const int ForeignEnum_ARRAYSIZE = ForeignEnum_MAX + 1;
const ::google::protobuf::EnumDescriptor* ForeignEnum_descriptor();
inline const ::std::string& ForeignEnum_Name(ForeignEnum value) {
return ::google::protobuf::internal::NameOfEnum(
ForeignEnum_descriptor(), value);
}
inline bool ForeignEnum_Parse(
const ::std::string& name, ForeignEnum* value) {
return ::google::protobuf::internal::ParseNamedEnum<ForeignEnum>(
ForeignEnum_descriptor(), name, value);
}
enum TestEnumWithDupValue {
FOO1 = 1,
BAR1 = 2,
BAZ = 3,
FOO2 = 1,
BAR2 = 2
};
bool TestEnumWithDupValue_IsValid(int value);
const TestEnumWithDupValue TestEnumWithDupValue_MIN = FOO1;
const TestEnumWithDupValue TestEnumWithDupValue_MAX = BAZ;
const int TestEnumWithDupValue_ARRAYSIZE = TestEnumWithDupValue_MAX + 1;
const ::google::protobuf::EnumDescriptor* TestEnumWithDupValue_descriptor();
inline const ::std::string& TestEnumWithDupValue_Name(TestEnumWithDupValue value) {
return ::google::protobuf::internal::NameOfEnum(
TestEnumWithDupValue_descriptor(), value);
}
inline bool TestEnumWithDupValue_Parse(
const ::std::string& name, TestEnumWithDupValue* value) {
return ::google::protobuf::internal::ParseNamedEnum<TestEnumWithDupValue>(
TestEnumWithDupValue_descriptor(), name, value);
}
enum TestSparseEnum {
SPARSE_A = 123,
SPARSE_B = 62374,
SPARSE_C = 12589234,
SPARSE_D = -15,
SPARSE_E = -53452,
SPARSE_F = 0,
SPARSE_G = 2
};
bool TestSparseEnum_IsValid(int value);
const TestSparseEnum TestSparseEnum_MIN = SPARSE_E;
const TestSparseEnum TestSparseEnum_MAX = SPARSE_C;
const int TestSparseEnum_ARRAYSIZE = TestSparseEnum_MAX + 1;
const ::google::protobuf::EnumDescriptor* TestSparseEnum_descriptor();
inline const ::std::string& TestSparseEnum_Name(TestSparseEnum value) {
return ::google::protobuf::internal::NameOfEnum(
TestSparseEnum_descriptor(), value);
}
inline bool TestSparseEnum_Parse(
const ::std::string& name, TestSparseEnum* value) {
return ::google::protobuf::internal::ParseNamedEnum<TestSparseEnum>(
TestSparseEnum_descriptor(), name, value);
}
// ===================================================================
class TestAllTypes_NestedMessage : public ::google::protobuf::Message {
public:
TestAllTypes_NestedMessage();
virtual ~TestAllTypes_NestedMessage();
TestAllTypes_NestedMessage(const TestAllTypes_NestedMessage& from);
inline TestAllTypes_NestedMessage& operator=(const TestAllTypes_NestedMessage& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestAllTypes_NestedMessage& default_instance();
void UnsafeArenaSwap(TestAllTypes_NestedMessage* other);
void Swap(TestAllTypes_NestedMessage* other);
// implements Message ----------------------------------------------
inline TestAllTypes_NestedMessage* New() const { return New(NULL); }
TestAllTypes_NestedMessage* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestAllTypes_NestedMessage& from);
void MergeFrom(const TestAllTypes_NestedMessage& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestAllTypes_NestedMessage* other);
protected:
explicit TestAllTypes_NestedMessage(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int32 bb = 1;
bool has_bb() const;
void clear_bb();
static const int kBbFieldNumber = 1;
::google::protobuf::int32 bb() const;
void set_bb(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestAllTypes.NestedMessage)
private:
inline void set_has_bb();
inline void clear_has_bb();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::int32 bb_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestAllTypes_NestedMessage* default_instance_;
};
// -------------------------------------------------------------------
class TestAllTypes_OptionalGroup : public ::google::protobuf::Message {
public:
TestAllTypes_OptionalGroup();
virtual ~TestAllTypes_OptionalGroup();
TestAllTypes_OptionalGroup(const TestAllTypes_OptionalGroup& from);
inline TestAllTypes_OptionalGroup& operator=(const TestAllTypes_OptionalGroup& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestAllTypes_OptionalGroup& default_instance();
void UnsafeArenaSwap(TestAllTypes_OptionalGroup* other);
void Swap(TestAllTypes_OptionalGroup* other);
// implements Message ----------------------------------------------
inline TestAllTypes_OptionalGroup* New() const { return New(NULL); }
TestAllTypes_OptionalGroup* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestAllTypes_OptionalGroup& from);
void MergeFrom(const TestAllTypes_OptionalGroup& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestAllTypes_OptionalGroup* other);
protected:
explicit TestAllTypes_OptionalGroup(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int32 a = 17;
bool has_a() const;
void clear_a();
static const int kAFieldNumber = 17;
::google::protobuf::int32 a() const;
void set_a(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestAllTypes.OptionalGroup)
private:
inline void set_has_a();
inline void clear_has_a();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::int32 a_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestAllTypes_OptionalGroup* default_instance_;
};
// -------------------------------------------------------------------
class TestAllTypes_RepeatedGroup : public ::google::protobuf::Message {
public:
TestAllTypes_RepeatedGroup();
virtual ~TestAllTypes_RepeatedGroup();
TestAllTypes_RepeatedGroup(const TestAllTypes_RepeatedGroup& from);
inline TestAllTypes_RepeatedGroup& operator=(const TestAllTypes_RepeatedGroup& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestAllTypes_RepeatedGroup& default_instance();
void UnsafeArenaSwap(TestAllTypes_RepeatedGroup* other);
void Swap(TestAllTypes_RepeatedGroup* other);
// implements Message ----------------------------------------------
inline TestAllTypes_RepeatedGroup* New() const { return New(NULL); }
TestAllTypes_RepeatedGroup* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestAllTypes_RepeatedGroup& from);
void MergeFrom(const TestAllTypes_RepeatedGroup& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestAllTypes_RepeatedGroup* other);
protected:
explicit TestAllTypes_RepeatedGroup(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int32 a = 47;
bool has_a() const;
void clear_a();
static const int kAFieldNumber = 47;
::google::protobuf::int32 a() const;
void set_a(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestAllTypes.RepeatedGroup)
private:
inline void set_has_a();
inline void clear_has_a();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::int32 a_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestAllTypes_RepeatedGroup* default_instance_;
};
// -------------------------------------------------------------------
class TestAllTypes : public ::google::protobuf::Message {
public:
TestAllTypes();
virtual ~TestAllTypes();
TestAllTypes(const TestAllTypes& from);
inline TestAllTypes& operator=(const TestAllTypes& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestAllTypes& default_instance();
enum OneofFieldCase {
kOneofUint32 = 111,
kOneofNestedMessage = 112,
kOneofString = 113,
kOneofBytes = 114,
ONEOF_FIELD_NOT_SET = 0,
};
void UnsafeArenaSwap(TestAllTypes* other);
void Swap(TestAllTypes* other);
// implements Message ----------------------------------------------
inline TestAllTypes* New() const { return New(NULL); }
TestAllTypes* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestAllTypes& from);
void MergeFrom(const TestAllTypes& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestAllTypes* other);
protected:
explicit TestAllTypes(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
typedef TestAllTypes_NestedMessage NestedMessage;
typedef TestAllTypes_OptionalGroup OptionalGroup;
typedef TestAllTypes_RepeatedGroup RepeatedGroup;
typedef TestAllTypes_NestedEnum NestedEnum;
static const NestedEnum FOO = TestAllTypes_NestedEnum_FOO;
static const NestedEnum BAR = TestAllTypes_NestedEnum_BAR;
static const NestedEnum BAZ = TestAllTypes_NestedEnum_BAZ;
static const NestedEnum NEG = TestAllTypes_NestedEnum_NEG;
static inline bool NestedEnum_IsValid(int value) {
return TestAllTypes_NestedEnum_IsValid(value);
}
static const NestedEnum NestedEnum_MIN =
TestAllTypes_NestedEnum_NestedEnum_MIN;
static const NestedEnum NestedEnum_MAX =
TestAllTypes_NestedEnum_NestedEnum_MAX;
static const int NestedEnum_ARRAYSIZE =
TestAllTypes_NestedEnum_NestedEnum_ARRAYSIZE;
static inline const ::google::protobuf::EnumDescriptor*
NestedEnum_descriptor() {
return TestAllTypes_NestedEnum_descriptor();
}
static inline const ::std::string& NestedEnum_Name(NestedEnum value) {
return TestAllTypes_NestedEnum_Name(value);
}
static inline bool NestedEnum_Parse(const ::std::string& name,
NestedEnum* value) {
return TestAllTypes_NestedEnum_Parse(name, value);
}
// accessors -------------------------------------------------------
// optional int32 optional_int32 = 1;
bool has_optional_int32() const;
void clear_optional_int32();
static const int kOptionalInt32FieldNumber = 1;
::google::protobuf::int32 optional_int32() const;
void set_optional_int32(::google::protobuf::int32 value);
// optional int64 optional_int64 = 2;
bool has_optional_int64() const;
void clear_optional_int64();
static const int kOptionalInt64FieldNumber = 2;
::google::protobuf::int64 optional_int64() const;
void set_optional_int64(::google::protobuf::int64 value);
// optional uint32 optional_uint32 = 3;
bool has_optional_uint32() const;
void clear_optional_uint32();
static const int kOptionalUint32FieldNumber = 3;
::google::protobuf::uint32 optional_uint32() const;
void set_optional_uint32(::google::protobuf::uint32 value);
// optional uint64 optional_uint64 = 4;
bool has_optional_uint64() const;
void clear_optional_uint64();
static const int kOptionalUint64FieldNumber = 4;
::google::protobuf::uint64 optional_uint64() const;
void set_optional_uint64(::google::protobuf::uint64 value);
// optional sint32 optional_sint32 = 5;
bool has_optional_sint32() const;
void clear_optional_sint32();
static const int kOptionalSint32FieldNumber = 5;
::google::protobuf::int32 optional_sint32() const;
void set_optional_sint32(::google::protobuf::int32 value);
// optional sint64 optional_sint64 = 6;
bool has_optional_sint64() const;
void clear_optional_sint64();
static const int kOptionalSint64FieldNumber = 6;
::google::protobuf::int64 optional_sint64() const;
void set_optional_sint64(::google::protobuf::int64 value);
// optional fixed32 optional_fixed32 = 7;
bool has_optional_fixed32() const;
void clear_optional_fixed32();
static const int kOptionalFixed32FieldNumber = 7;
::google::protobuf::uint32 optional_fixed32() const;
void set_optional_fixed32(::google::protobuf::uint32 value);
// optional fixed64 optional_fixed64 = 8;
bool has_optional_fixed64() const;
void clear_optional_fixed64();
static const int kOptionalFixed64FieldNumber = 8;
::google::protobuf::uint64 optional_fixed64() const;
void set_optional_fixed64(::google::protobuf::uint64 value);
// optional sfixed32 optional_sfixed32 = 9;
bool has_optional_sfixed32() const;
void clear_optional_sfixed32();
static const int kOptionalSfixed32FieldNumber = 9;
::google::protobuf::int32 optional_sfixed32() const;
void set_optional_sfixed32(::google::protobuf::int32 value);
// optional sfixed64 optional_sfixed64 = 10;
bool has_optional_sfixed64() const;
void clear_optional_sfixed64();
static const int kOptionalSfixed64FieldNumber = 10;
::google::protobuf::int64 optional_sfixed64() const;
void set_optional_sfixed64(::google::protobuf::int64 value);
// optional float optional_float = 11;
bool has_optional_float() const;
void clear_optional_float();
static const int kOptionalFloatFieldNumber = 11;
float optional_float() const;
void set_optional_float(float value);
// optional double optional_double = 12;
bool has_optional_double() const;
void clear_optional_double();
static const int kOptionalDoubleFieldNumber = 12;
double optional_double() const;
void set_optional_double(double value);
// optional bool optional_bool = 13;
bool has_optional_bool() const;
void clear_optional_bool();
static const int kOptionalBoolFieldNumber = 13;
bool optional_bool() const;
void set_optional_bool(bool value);
// optional string optional_string = 14;
bool has_optional_string() const;
void clear_optional_string();
static const int kOptionalStringFieldNumber = 14;
const ::std::string& optional_string() const;
void set_optional_string(const ::std::string& value);
void set_optional_string(const char* value);
void set_optional_string(const char* value, size_t size);
::std::string* mutable_optional_string();
::std::string* release_optional_string();
void set_allocated_optional_string(::std::string* optional_string);
::std::string* unsafe_arena_release_optional_string();
void unsafe_arena_set_allocated_optional_string(
::std::string* optional_string);
// optional bytes optional_bytes = 15;
bool has_optional_bytes() const;
void clear_optional_bytes();
static const int kOptionalBytesFieldNumber = 15;
const ::std::string& optional_bytes() const;
void set_optional_bytes(const ::std::string& value);
void set_optional_bytes(const char* value);
void set_optional_bytes(const void* value, size_t size);
::std::string* mutable_optional_bytes();
::std::string* release_optional_bytes();
void set_allocated_optional_bytes(::std::string* optional_bytes);
::std::string* unsafe_arena_release_optional_bytes();
void unsafe_arena_set_allocated_optional_bytes(
::std::string* optional_bytes);
// optional group OptionalGroup = 16 { ... };
bool has_optionalgroup() const;
void clear_optionalgroup();
static const int kOptionalgroupFieldNumber = 16;
private:
void _slow_mutable_optionalgroup();
void _slow_set_allocated_optionalgroup(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestAllTypes_OptionalGroup** optionalgroup);
::protobuf_unittest::TestAllTypes_OptionalGroup* _slow_release_optionalgroup();
public:
const ::protobuf_unittest::TestAllTypes_OptionalGroup& optionalgroup() const;
::protobuf_unittest::TestAllTypes_OptionalGroup* mutable_optionalgroup();
::protobuf_unittest::TestAllTypes_OptionalGroup* release_optionalgroup();
void set_allocated_optionalgroup(::protobuf_unittest::TestAllTypes_OptionalGroup* optionalgroup);
::protobuf_unittest::TestAllTypes_OptionalGroup* unsafe_arena_release_optionalgroup();
void unsafe_arena_set_allocated_optionalgroup(
::protobuf_unittest::TestAllTypes_OptionalGroup* optionalgroup);
// optional .protobuf_unittest.TestAllTypes.NestedMessage optional_nested_message = 18;
bool has_optional_nested_message() const;
void clear_optional_nested_message();
static const int kOptionalNestedMessageFieldNumber = 18;
private:
void _slow_mutable_optional_nested_message();
void _slow_set_allocated_optional_nested_message(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestAllTypes_NestedMessage** optional_nested_message);
::protobuf_unittest::TestAllTypes_NestedMessage* _slow_release_optional_nested_message();
public:
const ::protobuf_unittest::TestAllTypes_NestedMessage& optional_nested_message() const;
::protobuf_unittest::TestAllTypes_NestedMessage* mutable_optional_nested_message();
::protobuf_unittest::TestAllTypes_NestedMessage* release_optional_nested_message();
void set_allocated_optional_nested_message(::protobuf_unittest::TestAllTypes_NestedMessage* optional_nested_message);
::protobuf_unittest::TestAllTypes_NestedMessage* unsafe_arena_release_optional_nested_message();
void unsafe_arena_set_allocated_optional_nested_message(
::protobuf_unittest::TestAllTypes_NestedMessage* optional_nested_message);
// optional .protobuf_unittest.ForeignMessage optional_foreign_message = 19;
bool has_optional_foreign_message() const;
void clear_optional_foreign_message();
static const int kOptionalForeignMessageFieldNumber = 19;
private:
void _slow_mutable_optional_foreign_message();
void _slow_set_allocated_optional_foreign_message(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::ForeignMessage** optional_foreign_message);
::protobuf_unittest::ForeignMessage* _slow_release_optional_foreign_message();
public:
const ::protobuf_unittest::ForeignMessage& optional_foreign_message() const;
::protobuf_unittest::ForeignMessage* mutable_optional_foreign_message();
::protobuf_unittest::ForeignMessage* release_optional_foreign_message();
void set_allocated_optional_foreign_message(::protobuf_unittest::ForeignMessage* optional_foreign_message);
::protobuf_unittest::ForeignMessage* unsafe_arena_release_optional_foreign_message();
void unsafe_arena_set_allocated_optional_foreign_message(
::protobuf_unittest::ForeignMessage* optional_foreign_message);
// optional .protobuf_unittest_import.ImportMessage optional_import_message = 20;
bool has_optional_import_message() const;
void clear_optional_import_message();
static const int kOptionalImportMessageFieldNumber = 20;
private:
void _slow_mutable_optional_import_message();
void _slow_set_allocated_optional_import_message(
::google::protobuf::Arena* message_arena, ::protobuf_unittest_import::ImportMessage** optional_import_message);
::protobuf_unittest_import::ImportMessage* _slow_release_optional_import_message();
public:
const ::protobuf_unittest_import::ImportMessage& optional_import_message() const;
::protobuf_unittest_import::ImportMessage* mutable_optional_import_message();
::protobuf_unittest_import::ImportMessage* release_optional_import_message();
void set_allocated_optional_import_message(::protobuf_unittest_import::ImportMessage* optional_import_message);
::protobuf_unittest_import::ImportMessage* unsafe_arena_release_optional_import_message();
void unsafe_arena_set_allocated_optional_import_message(
::protobuf_unittest_import::ImportMessage* optional_import_message);
// optional .protobuf_unittest.TestAllTypes.NestedEnum optional_nested_enum = 21;
bool has_optional_nested_enum() const;
void clear_optional_nested_enum();
static const int kOptionalNestedEnumFieldNumber = 21;
::protobuf_unittest::TestAllTypes_NestedEnum optional_nested_enum() const;
void set_optional_nested_enum(::protobuf_unittest::TestAllTypes_NestedEnum value);
// optional .protobuf_unittest.ForeignEnum optional_foreign_enum = 22;
bool has_optional_foreign_enum() const;
void clear_optional_foreign_enum();
static const int kOptionalForeignEnumFieldNumber = 22;
::protobuf_unittest::ForeignEnum optional_foreign_enum() const;
void set_optional_foreign_enum(::protobuf_unittest::ForeignEnum value);
// optional .protobuf_unittest_import.ImportEnum optional_import_enum = 23;
bool has_optional_import_enum() const;
void clear_optional_import_enum();
static const int kOptionalImportEnumFieldNumber = 23;
::protobuf_unittest_import::ImportEnum optional_import_enum() const;
void set_optional_import_enum(::protobuf_unittest_import::ImportEnum value);
// optional string optional_string_piece = 24 [ctype = STRING_PIECE];
bool has_optional_string_piece() const;
void clear_optional_string_piece();
static const int kOptionalStringPieceFieldNumber = 24;
private:
// Hidden due to unknown ctype option.
const ::std::string& optional_string_piece() const;
void set_optional_string_piece(const ::std::string& value);
void set_optional_string_piece(const char* value);
void set_optional_string_piece(const char* value, size_t size);
::std::string* mutable_optional_string_piece();
::std::string* release_optional_string_piece();
void set_allocated_optional_string_piece(::std::string* optional_string_piece);
::std::string* unsafe_arena_release_optional_string_piece();
void unsafe_arena_set_allocated_optional_string_piece(
::std::string* optional_string_piece);
public:
// optional string optional_cord = 25 [ctype = CORD];
bool has_optional_cord() const;
void clear_optional_cord();
static const int kOptionalCordFieldNumber = 25;
private:
// Hidden due to unknown ctype option.
const ::std::string& optional_cord() const;
void set_optional_cord(const ::std::string& value);
void set_optional_cord(const char* value);
void set_optional_cord(const char* value, size_t size);
::std::string* mutable_optional_cord();
::std::string* release_optional_cord();
void set_allocated_optional_cord(::std::string* optional_cord);
::std::string* unsafe_arena_release_optional_cord();
void unsafe_arena_set_allocated_optional_cord(
::std::string* optional_cord);
public:
// optional .protobuf_unittest_import.PublicImportMessage optional_public_import_message = 26;
bool has_optional_public_import_message() const;
void clear_optional_public_import_message();
static const int kOptionalPublicImportMessageFieldNumber = 26;
private:
void _slow_mutable_optional_public_import_message();
::protobuf_unittest_import::PublicImportMessage* _slow_release_optional_public_import_message();
public:
const ::protobuf_unittest_import::PublicImportMessage& optional_public_import_message() const;
::protobuf_unittest_import::PublicImportMessage* mutable_optional_public_import_message();
::protobuf_unittest_import::PublicImportMessage* release_optional_public_import_message();
void set_allocated_optional_public_import_message(::protobuf_unittest_import::PublicImportMessage* optional_public_import_message);
::protobuf_unittest_import::PublicImportMessage* unsafe_arena_release_optional_public_import_message();
void unsafe_arena_set_allocated_optional_public_import_message(
::protobuf_unittest_import::PublicImportMessage* optional_public_import_message);
// optional .protobuf_unittest.TestAllTypes.NestedMessage optional_lazy_message = 27 [lazy = true];
bool has_optional_lazy_message() const;
void clear_optional_lazy_message();
static const int kOptionalLazyMessageFieldNumber = 27;
private:
void _slow_mutable_optional_lazy_message();
void _slow_set_allocated_optional_lazy_message(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestAllTypes_NestedMessage** optional_lazy_message);
::protobuf_unittest::TestAllTypes_NestedMessage* _slow_release_optional_lazy_message();
public:
const ::protobuf_unittest::TestAllTypes_NestedMessage& optional_lazy_message() const;
::protobuf_unittest::TestAllTypes_NestedMessage* mutable_optional_lazy_message();
::protobuf_unittest::TestAllTypes_NestedMessage* release_optional_lazy_message();
void set_allocated_optional_lazy_message(::protobuf_unittest::TestAllTypes_NestedMessage* optional_lazy_message);
::protobuf_unittest::TestAllTypes_NestedMessage* unsafe_arena_release_optional_lazy_message();
void unsafe_arena_set_allocated_optional_lazy_message(
::protobuf_unittest::TestAllTypes_NestedMessage* optional_lazy_message);
// repeated int32 repeated_int32 = 31;
int repeated_int32_size() const;
void clear_repeated_int32();
static const int kRepeatedInt32FieldNumber = 31;
::google::protobuf::int32 repeated_int32(int index) const;
void set_repeated_int32(int index, ::google::protobuf::int32 value);
void add_repeated_int32(::google::protobuf::int32 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
repeated_int32() const;
::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
mutable_repeated_int32();
// repeated int64 repeated_int64 = 32;
int repeated_int64_size() const;
void clear_repeated_int64();
static const int kRepeatedInt64FieldNumber = 32;
::google::protobuf::int64 repeated_int64(int index) const;
void set_repeated_int64(int index, ::google::protobuf::int64 value);
void add_repeated_int64(::google::protobuf::int64 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
repeated_int64() const;
::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
mutable_repeated_int64();
// repeated uint32 repeated_uint32 = 33;
int repeated_uint32_size() const;
void clear_repeated_uint32();
static const int kRepeatedUint32FieldNumber = 33;
::google::protobuf::uint32 repeated_uint32(int index) const;
void set_repeated_uint32(int index, ::google::protobuf::uint32 value);
void add_repeated_uint32(::google::protobuf::uint32 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
repeated_uint32() const;
::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
mutable_repeated_uint32();
// repeated uint64 repeated_uint64 = 34;
int repeated_uint64_size() const;
void clear_repeated_uint64();
static const int kRepeatedUint64FieldNumber = 34;
::google::protobuf::uint64 repeated_uint64(int index) const;
void set_repeated_uint64(int index, ::google::protobuf::uint64 value);
void add_repeated_uint64(::google::protobuf::uint64 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
repeated_uint64() const;
::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
mutable_repeated_uint64();
// repeated sint32 repeated_sint32 = 35;
int repeated_sint32_size() const;
void clear_repeated_sint32();
static const int kRepeatedSint32FieldNumber = 35;
::google::protobuf::int32 repeated_sint32(int index) const;
void set_repeated_sint32(int index, ::google::protobuf::int32 value);
void add_repeated_sint32(::google::protobuf::int32 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
repeated_sint32() const;
::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
mutable_repeated_sint32();
// repeated sint64 repeated_sint64 = 36;
int repeated_sint64_size() const;
void clear_repeated_sint64();
static const int kRepeatedSint64FieldNumber = 36;
::google::protobuf::int64 repeated_sint64(int index) const;
void set_repeated_sint64(int index, ::google::protobuf::int64 value);
void add_repeated_sint64(::google::protobuf::int64 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
repeated_sint64() const;
::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
mutable_repeated_sint64();
// repeated fixed32 repeated_fixed32 = 37;
int repeated_fixed32_size() const;
void clear_repeated_fixed32();
static const int kRepeatedFixed32FieldNumber = 37;
::google::protobuf::uint32 repeated_fixed32(int index) const;
void set_repeated_fixed32(int index, ::google::protobuf::uint32 value);
void add_repeated_fixed32(::google::protobuf::uint32 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
repeated_fixed32() const;
::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
mutable_repeated_fixed32();
// repeated fixed64 repeated_fixed64 = 38;
int repeated_fixed64_size() const;
void clear_repeated_fixed64();
static const int kRepeatedFixed64FieldNumber = 38;
::google::protobuf::uint64 repeated_fixed64(int index) const;
void set_repeated_fixed64(int index, ::google::protobuf::uint64 value);
void add_repeated_fixed64(::google::protobuf::uint64 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
repeated_fixed64() const;
::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
mutable_repeated_fixed64();
// repeated sfixed32 repeated_sfixed32 = 39;
int repeated_sfixed32_size() const;
void clear_repeated_sfixed32();
static const int kRepeatedSfixed32FieldNumber = 39;
::google::protobuf::int32 repeated_sfixed32(int index) const;
void set_repeated_sfixed32(int index, ::google::protobuf::int32 value);
void add_repeated_sfixed32(::google::protobuf::int32 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
repeated_sfixed32() const;
::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
mutable_repeated_sfixed32();
// repeated sfixed64 repeated_sfixed64 = 40;
int repeated_sfixed64_size() const;
void clear_repeated_sfixed64();
static const int kRepeatedSfixed64FieldNumber = 40;
::google::protobuf::int64 repeated_sfixed64(int index) const;
void set_repeated_sfixed64(int index, ::google::protobuf::int64 value);
void add_repeated_sfixed64(::google::protobuf::int64 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
repeated_sfixed64() const;
::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
mutable_repeated_sfixed64();
// repeated float repeated_float = 41;
int repeated_float_size() const;
void clear_repeated_float();
static const int kRepeatedFloatFieldNumber = 41;
float repeated_float(int index) const;
void set_repeated_float(int index, float value);
void add_repeated_float(float value);
const ::google::protobuf::RepeatedField< float >&
repeated_float() const;
::google::protobuf::RepeatedField< float >*
mutable_repeated_float();
// repeated double repeated_double = 42;
int repeated_double_size() const;
void clear_repeated_double();
static const int kRepeatedDoubleFieldNumber = 42;
double repeated_double(int index) const;
void set_repeated_double(int index, double value);
void add_repeated_double(double value);
const ::google::protobuf::RepeatedField< double >&
repeated_double() const;
::google::protobuf::RepeatedField< double >*
mutable_repeated_double();
// repeated bool repeated_bool = 43;
int repeated_bool_size() const;
void clear_repeated_bool();
static const int kRepeatedBoolFieldNumber = 43;
bool repeated_bool(int index) const;
void set_repeated_bool(int index, bool value);
void add_repeated_bool(bool value);
const ::google::protobuf::RepeatedField< bool >&
repeated_bool() const;
::google::protobuf::RepeatedField< bool >*
mutable_repeated_bool();
// repeated string repeated_string = 44;
int repeated_string_size() const;
void clear_repeated_string();
static const int kRepeatedStringFieldNumber = 44;
const ::std::string& repeated_string(int index) const;
::std::string* mutable_repeated_string(int index);
void set_repeated_string(int index, const ::std::string& value);
void set_repeated_string(int index, const char* value);
void set_repeated_string(int index, const char* value, size_t size);
::std::string* add_repeated_string();
void add_repeated_string(const ::std::string& value);
void add_repeated_string(const char* value);
void add_repeated_string(const char* value, size_t size);
const ::google::protobuf::RepeatedPtrField< ::std::string>& repeated_string() const;
::google::protobuf::RepeatedPtrField< ::std::string>* mutable_repeated_string();
// repeated bytes repeated_bytes = 45;
int repeated_bytes_size() const;
void clear_repeated_bytes();
static const int kRepeatedBytesFieldNumber = 45;
const ::std::string& repeated_bytes(int index) const;
::std::string* mutable_repeated_bytes(int index);
void set_repeated_bytes(int index, const ::std::string& value);
void set_repeated_bytes(int index, const char* value);
void set_repeated_bytes(int index, const void* value, size_t size);
::std::string* add_repeated_bytes();
void add_repeated_bytes(const ::std::string& value);
void add_repeated_bytes(const char* value);
void add_repeated_bytes(const void* value, size_t size);
const ::google::protobuf::RepeatedPtrField< ::std::string>& repeated_bytes() const;
::google::protobuf::RepeatedPtrField< ::std::string>* mutable_repeated_bytes();
// repeated group RepeatedGroup = 46 { ... };
int repeatedgroup_size() const;
void clear_repeatedgroup();
static const int kRepeatedgroupFieldNumber = 46;
const ::protobuf_unittest::TestAllTypes_RepeatedGroup& repeatedgroup(int index) const;
::protobuf_unittest::TestAllTypes_RepeatedGroup* mutable_repeatedgroup(int index);
::protobuf_unittest::TestAllTypes_RepeatedGroup* add_repeatedgroup();
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes_RepeatedGroup >*
mutable_repeatedgroup();
const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes_RepeatedGroup >&
repeatedgroup() const;
// repeated .protobuf_unittest.TestAllTypes.NestedMessage repeated_nested_message = 48;
int repeated_nested_message_size() const;
void clear_repeated_nested_message();
static const int kRepeatedNestedMessageFieldNumber = 48;
const ::protobuf_unittest::TestAllTypes_NestedMessage& repeated_nested_message(int index) const;
::protobuf_unittest::TestAllTypes_NestedMessage* mutable_repeated_nested_message(int index);
::protobuf_unittest::TestAllTypes_NestedMessage* add_repeated_nested_message();
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes_NestedMessage >*
mutable_repeated_nested_message();
const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes_NestedMessage >&
repeated_nested_message() const;
// repeated .protobuf_unittest.ForeignMessage repeated_foreign_message = 49;
int repeated_foreign_message_size() const;
void clear_repeated_foreign_message();
static const int kRepeatedForeignMessageFieldNumber = 49;
const ::protobuf_unittest::ForeignMessage& repeated_foreign_message(int index) const;
::protobuf_unittest::ForeignMessage* mutable_repeated_foreign_message(int index);
::protobuf_unittest::ForeignMessage* add_repeated_foreign_message();
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::ForeignMessage >*
mutable_repeated_foreign_message();
const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::ForeignMessage >&
repeated_foreign_message() const;
// repeated .protobuf_unittest_import.ImportMessage repeated_import_message = 50;
int repeated_import_message_size() const;
void clear_repeated_import_message();
static const int kRepeatedImportMessageFieldNumber = 50;
const ::protobuf_unittest_import::ImportMessage& repeated_import_message(int index) const;
::protobuf_unittest_import::ImportMessage* mutable_repeated_import_message(int index);
::protobuf_unittest_import::ImportMessage* add_repeated_import_message();
::google::protobuf::RepeatedPtrField< ::protobuf_unittest_import::ImportMessage >*
mutable_repeated_import_message();
const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest_import::ImportMessage >&
repeated_import_message() const;
// repeated .protobuf_unittest.TestAllTypes.NestedEnum repeated_nested_enum = 51;
int repeated_nested_enum_size() const;
void clear_repeated_nested_enum();
static const int kRepeatedNestedEnumFieldNumber = 51;
::protobuf_unittest::TestAllTypes_NestedEnum repeated_nested_enum(int index) const;
void set_repeated_nested_enum(int index, ::protobuf_unittest::TestAllTypes_NestedEnum value);
void add_repeated_nested_enum(::protobuf_unittest::TestAllTypes_NestedEnum value);
const ::google::protobuf::RepeatedField<int>& repeated_nested_enum() const;
::google::protobuf::RepeatedField<int>* mutable_repeated_nested_enum();
// repeated .protobuf_unittest.ForeignEnum repeated_foreign_enum = 52;
int repeated_foreign_enum_size() const;
void clear_repeated_foreign_enum();
static const int kRepeatedForeignEnumFieldNumber = 52;
::protobuf_unittest::ForeignEnum repeated_foreign_enum(int index) const;
void set_repeated_foreign_enum(int index, ::protobuf_unittest::ForeignEnum value);
void add_repeated_foreign_enum(::protobuf_unittest::ForeignEnum value);
const ::google::protobuf::RepeatedField<int>& repeated_foreign_enum() const;
::google::protobuf::RepeatedField<int>* mutable_repeated_foreign_enum();
// repeated .protobuf_unittest_import.ImportEnum repeated_import_enum = 53;
int repeated_import_enum_size() const;
void clear_repeated_import_enum();
static const int kRepeatedImportEnumFieldNumber = 53;
::protobuf_unittest_import::ImportEnum repeated_import_enum(int index) const;
void set_repeated_import_enum(int index, ::protobuf_unittest_import::ImportEnum value);
void add_repeated_import_enum(::protobuf_unittest_import::ImportEnum value);
const ::google::protobuf::RepeatedField<int>& repeated_import_enum() const;
::google::protobuf::RepeatedField<int>* mutable_repeated_import_enum();
// repeated string repeated_string_piece = 54 [ctype = STRING_PIECE];
int repeated_string_piece_size() const;
void clear_repeated_string_piece();
static const int kRepeatedStringPieceFieldNumber = 54;
private:
// Hidden due to unknown ctype option.
const ::std::string& repeated_string_piece(int index) const;
::std::string* mutable_repeated_string_piece(int index);
void set_repeated_string_piece(int index, const ::std::string& value);
void set_repeated_string_piece(int index, const char* value);
void set_repeated_string_piece(int index, const char* value, size_t size);
::std::string* add_repeated_string_piece();
void add_repeated_string_piece(const ::std::string& value);
void add_repeated_string_piece(const char* value);
void add_repeated_string_piece(const char* value, size_t size);
const ::google::protobuf::RepeatedPtrField< ::std::string>& repeated_string_piece() const;
::google::protobuf::RepeatedPtrField< ::std::string>* mutable_repeated_string_piece();
public:
// repeated string repeated_cord = 55 [ctype = CORD];
int repeated_cord_size() const;
void clear_repeated_cord();
static const int kRepeatedCordFieldNumber = 55;
private:
// Hidden due to unknown ctype option.
const ::std::string& repeated_cord(int index) const;
::std::string* mutable_repeated_cord(int index);
void set_repeated_cord(int index, const ::std::string& value);
void set_repeated_cord(int index, const char* value);
void set_repeated_cord(int index, const char* value, size_t size);
::std::string* add_repeated_cord();
void add_repeated_cord(const ::std::string& value);
void add_repeated_cord(const char* value);
void add_repeated_cord(const char* value, size_t size);
const ::google::protobuf::RepeatedPtrField< ::std::string>& repeated_cord() const;
::google::protobuf::RepeatedPtrField< ::std::string>* mutable_repeated_cord();
public:
// repeated .protobuf_unittest.TestAllTypes.NestedMessage repeated_lazy_message = 57 [lazy = true];
int repeated_lazy_message_size() const;
void clear_repeated_lazy_message();
static const int kRepeatedLazyMessageFieldNumber = 57;
const ::protobuf_unittest::TestAllTypes_NestedMessage& repeated_lazy_message(int index) const;
::protobuf_unittest::TestAllTypes_NestedMessage* mutable_repeated_lazy_message(int index);
::protobuf_unittest::TestAllTypes_NestedMessage* add_repeated_lazy_message();
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes_NestedMessage >*
mutable_repeated_lazy_message();
const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes_NestedMessage >&
repeated_lazy_message() const;
// optional int32 default_int32 = 61 [default = 41];
bool has_default_int32() const;
void clear_default_int32();
static const int kDefaultInt32FieldNumber = 61;
::google::protobuf::int32 default_int32() const;
void set_default_int32(::google::protobuf::int32 value);
// optional int64 default_int64 = 62 [default = 42];
bool has_default_int64() const;
void clear_default_int64();
static const int kDefaultInt64FieldNumber = 62;
::google::protobuf::int64 default_int64() const;
void set_default_int64(::google::protobuf::int64 value);
// optional uint32 default_uint32 = 63 [default = 43];
bool has_default_uint32() const;
void clear_default_uint32();
static const int kDefaultUint32FieldNumber = 63;
::google::protobuf::uint32 default_uint32() const;
void set_default_uint32(::google::protobuf::uint32 value);
// optional uint64 default_uint64 = 64 [default = 44];
bool has_default_uint64() const;
void clear_default_uint64();
static const int kDefaultUint64FieldNumber = 64;
::google::protobuf::uint64 default_uint64() const;
void set_default_uint64(::google::protobuf::uint64 value);
// optional sint32 default_sint32 = 65 [default = -45];
bool has_default_sint32() const;
void clear_default_sint32();
static const int kDefaultSint32FieldNumber = 65;
::google::protobuf::int32 default_sint32() const;
void set_default_sint32(::google::protobuf::int32 value);
// optional sint64 default_sint64 = 66 [default = 46];
bool has_default_sint64() const;
void clear_default_sint64();
static const int kDefaultSint64FieldNumber = 66;
::google::protobuf::int64 default_sint64() const;
void set_default_sint64(::google::protobuf::int64 value);
// optional fixed32 default_fixed32 = 67 [default = 47];
bool has_default_fixed32() const;
void clear_default_fixed32();
static const int kDefaultFixed32FieldNumber = 67;
::google::protobuf::uint32 default_fixed32() const;
void set_default_fixed32(::google::protobuf::uint32 value);
// optional fixed64 default_fixed64 = 68 [default = 48];
bool has_default_fixed64() const;
void clear_default_fixed64();
static const int kDefaultFixed64FieldNumber = 68;
::google::protobuf::uint64 default_fixed64() const;
void set_default_fixed64(::google::protobuf::uint64 value);
// optional sfixed32 default_sfixed32 = 69 [default = 49];
bool has_default_sfixed32() const;
void clear_default_sfixed32();
static const int kDefaultSfixed32FieldNumber = 69;
::google::protobuf::int32 default_sfixed32() const;
void set_default_sfixed32(::google::protobuf::int32 value);
// optional sfixed64 default_sfixed64 = 70 [default = -50];
bool has_default_sfixed64() const;
void clear_default_sfixed64();
static const int kDefaultSfixed64FieldNumber = 70;
::google::protobuf::int64 default_sfixed64() const;
void set_default_sfixed64(::google::protobuf::int64 value);
// optional float default_float = 71 [default = 51.5];
bool has_default_float() const;
void clear_default_float();
static const int kDefaultFloatFieldNumber = 71;
float default_float() const;
void set_default_float(float value);
// optional double default_double = 72 [default = 52000];
bool has_default_double() const;
void clear_default_double();
static const int kDefaultDoubleFieldNumber = 72;
double default_double() const;
void set_default_double(double value);
// optional bool default_bool = 73 [default = true];
bool has_default_bool() const;
void clear_default_bool();
static const int kDefaultBoolFieldNumber = 73;
bool default_bool() const;
void set_default_bool(bool value);
// optional string default_string = 74 [default = "hello"];
bool has_default_string() const;
void clear_default_string();
static const int kDefaultStringFieldNumber = 74;
const ::std::string& default_string() const;
void set_default_string(const ::std::string& value);
void set_default_string(const char* value);
void set_default_string(const char* value, size_t size);
::std::string* mutable_default_string();
::std::string* release_default_string();
void set_allocated_default_string(::std::string* default_string);
::std::string* unsafe_arena_release_default_string();
void unsafe_arena_set_allocated_default_string(
::std::string* default_string);
// optional bytes default_bytes = 75 [default = "world"];
bool has_default_bytes() const;
void clear_default_bytes();
static const int kDefaultBytesFieldNumber = 75;
const ::std::string& default_bytes() const;
void set_default_bytes(const ::std::string& value);
void set_default_bytes(const char* value);
void set_default_bytes(const void* value, size_t size);
::std::string* mutable_default_bytes();
::std::string* release_default_bytes();
void set_allocated_default_bytes(::std::string* default_bytes);
::std::string* unsafe_arena_release_default_bytes();
void unsafe_arena_set_allocated_default_bytes(
::std::string* default_bytes);
// optional .protobuf_unittest.TestAllTypes.NestedEnum default_nested_enum = 81 [default = BAR];
bool has_default_nested_enum() const;
void clear_default_nested_enum();
static const int kDefaultNestedEnumFieldNumber = 81;
::protobuf_unittest::TestAllTypes_NestedEnum default_nested_enum() const;
void set_default_nested_enum(::protobuf_unittest::TestAllTypes_NestedEnum value);
// optional .protobuf_unittest.ForeignEnum default_foreign_enum = 82 [default = FOREIGN_BAR];
bool has_default_foreign_enum() const;
void clear_default_foreign_enum();
static const int kDefaultForeignEnumFieldNumber = 82;
::protobuf_unittest::ForeignEnum default_foreign_enum() const;
void set_default_foreign_enum(::protobuf_unittest::ForeignEnum value);
// optional .protobuf_unittest_import.ImportEnum default_import_enum = 83 [default = IMPORT_BAR];
bool has_default_import_enum() const;
void clear_default_import_enum();
static const int kDefaultImportEnumFieldNumber = 83;
::protobuf_unittest_import::ImportEnum default_import_enum() const;
void set_default_import_enum(::protobuf_unittest_import::ImportEnum value);
// optional string default_string_piece = 84 [default = "abc", ctype = STRING_PIECE];
bool has_default_string_piece() const;
void clear_default_string_piece();
static const int kDefaultStringPieceFieldNumber = 84;
private:
// Hidden due to unknown ctype option.
const ::std::string& default_string_piece() const;
void set_default_string_piece(const ::std::string& value);
void set_default_string_piece(const char* value);
void set_default_string_piece(const char* value, size_t size);
::std::string* mutable_default_string_piece();
::std::string* release_default_string_piece();
void set_allocated_default_string_piece(::std::string* default_string_piece);
::std::string* unsafe_arena_release_default_string_piece();
void unsafe_arena_set_allocated_default_string_piece(
::std::string* default_string_piece);
public:
// optional string default_cord = 85 [default = "123", ctype = CORD];
bool has_default_cord() const;
void clear_default_cord();
static const int kDefaultCordFieldNumber = 85;
private:
// Hidden due to unknown ctype option.
const ::std::string& default_cord() const;
void set_default_cord(const ::std::string& value);
void set_default_cord(const char* value);
void set_default_cord(const char* value, size_t size);
::std::string* mutable_default_cord();
::std::string* release_default_cord();
void set_allocated_default_cord(::std::string* default_cord);
::std::string* unsafe_arena_release_default_cord();
void unsafe_arena_set_allocated_default_cord(
::std::string* default_cord);
public:
// optional uint32 oneof_uint32 = 111;
bool has_oneof_uint32() const;
void clear_oneof_uint32();
static const int kOneofUint32FieldNumber = 111;
::google::protobuf::uint32 oneof_uint32() const;
void set_oneof_uint32(::google::protobuf::uint32 value);
// optional .protobuf_unittest.TestAllTypes.NestedMessage oneof_nested_message = 112;
bool has_oneof_nested_message() const;
void clear_oneof_nested_message();
static const int kOneofNestedMessageFieldNumber = 112;
private:
void _slow_mutable_oneof_nested_message();
void _slow_set_allocated_oneof_nested_message(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestAllTypes_NestedMessage** oneof_nested_message);
::protobuf_unittest::TestAllTypes_NestedMessage* _slow_release_oneof_nested_message();
public:
const ::protobuf_unittest::TestAllTypes_NestedMessage& oneof_nested_message() const;
::protobuf_unittest::TestAllTypes_NestedMessage* mutable_oneof_nested_message();
::protobuf_unittest::TestAllTypes_NestedMessage* release_oneof_nested_message();
void set_allocated_oneof_nested_message(::protobuf_unittest::TestAllTypes_NestedMessage* oneof_nested_message);
::protobuf_unittest::TestAllTypes_NestedMessage* unsafe_arena_release_oneof_nested_message();
void unsafe_arena_set_allocated_oneof_nested_message(
::protobuf_unittest::TestAllTypes_NestedMessage* oneof_nested_message);
// optional string oneof_string = 113;
bool has_oneof_string() const;
void clear_oneof_string();
static const int kOneofStringFieldNumber = 113;
const ::std::string& oneof_string() const;
void set_oneof_string(const ::std::string& value);
void set_oneof_string(const char* value);
void set_oneof_string(const char* value, size_t size);
::std::string* mutable_oneof_string();
::std::string* release_oneof_string();
void set_allocated_oneof_string(::std::string* oneof_string);
::std::string* unsafe_arena_release_oneof_string();
void unsafe_arena_set_allocated_oneof_string(
::std::string* oneof_string);
// optional bytes oneof_bytes = 114;
bool has_oneof_bytes() const;
void clear_oneof_bytes();
static const int kOneofBytesFieldNumber = 114;
const ::std::string& oneof_bytes() const;
void set_oneof_bytes(const ::std::string& value);
void set_oneof_bytes(const char* value);
void set_oneof_bytes(const void* value, size_t size);
::std::string* mutable_oneof_bytes();
::std::string* release_oneof_bytes();
void set_allocated_oneof_bytes(::std::string* oneof_bytes);
::std::string* unsafe_arena_release_oneof_bytes();
void unsafe_arena_set_allocated_oneof_bytes(
::std::string* oneof_bytes);
OneofFieldCase oneof_field_case() const;
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestAllTypes)
private:
inline void set_has_optional_int32();
inline void clear_has_optional_int32();
inline void set_has_optional_int64();
inline void clear_has_optional_int64();
inline void set_has_optional_uint32();
inline void clear_has_optional_uint32();
inline void set_has_optional_uint64();
inline void clear_has_optional_uint64();
inline void set_has_optional_sint32();
inline void clear_has_optional_sint32();
inline void set_has_optional_sint64();
inline void clear_has_optional_sint64();
inline void set_has_optional_fixed32();
inline void clear_has_optional_fixed32();
inline void set_has_optional_fixed64();
inline void clear_has_optional_fixed64();
inline void set_has_optional_sfixed32();
inline void clear_has_optional_sfixed32();
inline void set_has_optional_sfixed64();
inline void clear_has_optional_sfixed64();
inline void set_has_optional_float();
inline void clear_has_optional_float();
inline void set_has_optional_double();
inline void clear_has_optional_double();
inline void set_has_optional_bool();
inline void clear_has_optional_bool();
inline void set_has_optional_string();
inline void clear_has_optional_string();
inline void set_has_optional_bytes();
inline void clear_has_optional_bytes();
inline void set_has_optionalgroup();
inline void clear_has_optionalgroup();
inline void set_has_optional_nested_message();
inline void clear_has_optional_nested_message();
inline void set_has_optional_foreign_message();
inline void clear_has_optional_foreign_message();
inline void set_has_optional_import_message();
inline void clear_has_optional_import_message();
inline void set_has_optional_nested_enum();
inline void clear_has_optional_nested_enum();
inline void set_has_optional_foreign_enum();
inline void clear_has_optional_foreign_enum();
inline void set_has_optional_import_enum();
inline void clear_has_optional_import_enum();
inline void set_has_optional_string_piece();
inline void clear_has_optional_string_piece();
inline void set_has_optional_cord();
inline void clear_has_optional_cord();
inline void set_has_optional_public_import_message();
inline void clear_has_optional_public_import_message();
inline void set_has_optional_lazy_message();
inline void clear_has_optional_lazy_message();
inline void set_has_default_int32();
inline void clear_has_default_int32();
inline void set_has_default_int64();
inline void clear_has_default_int64();
inline void set_has_default_uint32();
inline void clear_has_default_uint32();
inline void set_has_default_uint64();
inline void clear_has_default_uint64();
inline void set_has_default_sint32();
inline void clear_has_default_sint32();
inline void set_has_default_sint64();
inline void clear_has_default_sint64();
inline void set_has_default_fixed32();
inline void clear_has_default_fixed32();
inline void set_has_default_fixed64();
inline void clear_has_default_fixed64();
inline void set_has_default_sfixed32();
inline void clear_has_default_sfixed32();
inline void set_has_default_sfixed64();
inline void clear_has_default_sfixed64();
inline void set_has_default_float();
inline void clear_has_default_float();
inline void set_has_default_double();
inline void clear_has_default_double();
inline void set_has_default_bool();
inline void clear_has_default_bool();
inline void set_has_default_string();
inline void clear_has_default_string();
inline void set_has_default_bytes();
inline void clear_has_default_bytes();
inline void set_has_default_nested_enum();
inline void clear_has_default_nested_enum();
inline void set_has_default_foreign_enum();
inline void clear_has_default_foreign_enum();
inline void set_has_default_import_enum();
inline void clear_has_default_import_enum();
inline void set_has_default_string_piece();
inline void clear_has_default_string_piece();
inline void set_has_default_cord();
inline void clear_has_default_cord();
inline void set_has_oneof_uint32();
inline void set_has_oneof_nested_message();
inline void set_has_oneof_string();
inline void set_has_oneof_bytes();
inline bool has_oneof_field() const;
void clear_oneof_field();
inline void clear_has_oneof_field();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[3];
mutable int _cached_size_;
::google::protobuf::int64 optional_int64_;
::google::protobuf::int32 optional_int32_;
::google::protobuf::uint32 optional_uint32_;
::google::protobuf::uint64 optional_uint64_;
::google::protobuf::int64 optional_sint64_;
::google::protobuf::int32 optional_sint32_;
::google::protobuf::uint32 optional_fixed32_;
::google::protobuf::uint64 optional_fixed64_;
::google::protobuf::int64 optional_sfixed64_;
::google::protobuf::int32 optional_sfixed32_;
float optional_float_;
double optional_double_;
::google::protobuf::internal::ArenaStringPtr optional_string_;
::google::protobuf::internal::ArenaStringPtr optional_bytes_;
::protobuf_unittest::TestAllTypes_OptionalGroup* optionalgroup_;
::protobuf_unittest::TestAllTypes_NestedMessage* optional_nested_message_;
::protobuf_unittest::ForeignMessage* optional_foreign_message_;
::protobuf_unittest_import::ImportMessage* optional_import_message_;
int optional_nested_enum_;
int optional_foreign_enum_;
::google::protobuf::internal::ArenaStringPtr optional_string_piece_;
::google::protobuf::internal::ArenaStringPtr optional_cord_;
::protobuf_unittest_import::PublicImportMessage* optional_public_import_message_;
::protobuf_unittest::TestAllTypes_NestedMessage* optional_lazy_message_;
::google::protobuf::RepeatedField< ::google::protobuf::int32 > repeated_int32_;
::google::protobuf::RepeatedField< ::google::protobuf::int64 > repeated_int64_;
::google::protobuf::RepeatedField< ::google::protobuf::uint32 > repeated_uint32_;
::google::protobuf::RepeatedField< ::google::protobuf::uint64 > repeated_uint64_;
::google::protobuf::RepeatedField< ::google::protobuf::int32 > repeated_sint32_;
::google::protobuf::RepeatedField< ::google::protobuf::int64 > repeated_sint64_;
::google::protobuf::RepeatedField< ::google::protobuf::uint32 > repeated_fixed32_;
int optional_import_enum_;
bool optional_bool_;
bool default_bool_;
::google::protobuf::RepeatedField< ::google::protobuf::uint64 > repeated_fixed64_;
::google::protobuf::RepeatedField< ::google::protobuf::int32 > repeated_sfixed32_;
::google::protobuf::RepeatedField< ::google::protobuf::int64 > repeated_sfixed64_;
::google::protobuf::RepeatedField< float > repeated_float_;
::google::protobuf::RepeatedField< double > repeated_double_;
::google::protobuf::RepeatedField< bool > repeated_bool_;
::google::protobuf::RepeatedPtrField< ::std::string> repeated_string_;
::google::protobuf::RepeatedPtrField< ::std::string> repeated_bytes_;
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes_RepeatedGroup > repeatedgroup_;
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes_NestedMessage > repeated_nested_message_;
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::ForeignMessage > repeated_foreign_message_;
::google::protobuf::RepeatedPtrField< ::protobuf_unittest_import::ImportMessage > repeated_import_message_;
::google::protobuf::RepeatedField<int> repeated_nested_enum_;
::google::protobuf::RepeatedField<int> repeated_foreign_enum_;
::google::protobuf::RepeatedField<int> repeated_import_enum_;
::google::protobuf::RepeatedPtrField< ::std::string> repeated_string_piece_;
::google::protobuf::RepeatedPtrField< ::std::string> repeated_cord_;
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes_NestedMessage > repeated_lazy_message_;
::google::protobuf::int64 default_int64_;
::google::protobuf::int32 default_int32_;
::google::protobuf::uint32 default_uint32_;
::google::protobuf::uint64 default_uint64_;
::google::protobuf::int64 default_sint64_;
::google::protobuf::int32 default_sint32_;
::google::protobuf::uint32 default_fixed32_;
::google::protobuf::uint64 default_fixed64_;
::google::protobuf::int64 default_sfixed64_;
::google::protobuf::int32 default_sfixed32_;
float default_float_;
double default_double_;
static ::std::string* _default_default_string_;
::google::protobuf::internal::ArenaStringPtr default_string_;
static ::std::string* _default_default_bytes_;
::google::protobuf::internal::ArenaStringPtr default_bytes_;
int default_nested_enum_;
int default_foreign_enum_;
static ::std::string* _default_default_string_piece_;
::google::protobuf::internal::ArenaStringPtr default_string_piece_;
static ::std::string* _default_default_cord_;
::google::protobuf::internal::ArenaStringPtr default_cord_;
int default_import_enum_;
union OneofFieldUnion {
OneofFieldUnion() {}
::google::protobuf::uint32 oneof_uint32_;
::protobuf_unittest::TestAllTypes_NestedMessage* oneof_nested_message_;
::google::protobuf::internal::ArenaStringPtr oneof_string_;
::google::protobuf::internal::ArenaStringPtr oneof_bytes_;
} oneof_field_;
::google::protobuf::uint32 _oneof_case_[1];
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestAllTypes* default_instance_;
};
// -------------------------------------------------------------------
class NestedTestAllTypes : public ::google::protobuf::Message {
public:
NestedTestAllTypes();
virtual ~NestedTestAllTypes();
NestedTestAllTypes(const NestedTestAllTypes& from);
inline NestedTestAllTypes& operator=(const NestedTestAllTypes& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const NestedTestAllTypes& default_instance();
void UnsafeArenaSwap(NestedTestAllTypes* other);
void Swap(NestedTestAllTypes* other);
// implements Message ----------------------------------------------
inline NestedTestAllTypes* New() const { return New(NULL); }
NestedTestAllTypes* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const NestedTestAllTypes& from);
void MergeFrom(const NestedTestAllTypes& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(NestedTestAllTypes* other);
protected:
explicit NestedTestAllTypes(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional .protobuf_unittest.NestedTestAllTypes child = 1;
bool has_child() const;
void clear_child();
static const int kChildFieldNumber = 1;
private:
void _slow_mutable_child();
void _slow_set_allocated_child(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::NestedTestAllTypes** child);
::protobuf_unittest::NestedTestAllTypes* _slow_release_child();
public:
const ::protobuf_unittest::NestedTestAllTypes& child() const;
::protobuf_unittest::NestedTestAllTypes* mutable_child();
::protobuf_unittest::NestedTestAllTypes* release_child();
void set_allocated_child(::protobuf_unittest::NestedTestAllTypes* child);
::protobuf_unittest::NestedTestAllTypes* unsafe_arena_release_child();
void unsafe_arena_set_allocated_child(
::protobuf_unittest::NestedTestAllTypes* child);
// optional .protobuf_unittest.TestAllTypes payload = 2;
bool has_payload() const;
void clear_payload();
static const int kPayloadFieldNumber = 2;
private:
void _slow_mutable_payload();
void _slow_set_allocated_payload(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestAllTypes** payload);
::protobuf_unittest::TestAllTypes* _slow_release_payload();
public:
const ::protobuf_unittest::TestAllTypes& payload() const;
::protobuf_unittest::TestAllTypes* mutable_payload();
::protobuf_unittest::TestAllTypes* release_payload();
void set_allocated_payload(::protobuf_unittest::TestAllTypes* payload);
::protobuf_unittest::TestAllTypes* unsafe_arena_release_payload();
void unsafe_arena_set_allocated_payload(
::protobuf_unittest::TestAllTypes* payload);
// repeated .protobuf_unittest.NestedTestAllTypes repeated_child = 3;
int repeated_child_size() const;
void clear_repeated_child();
static const int kRepeatedChildFieldNumber = 3;
const ::protobuf_unittest::NestedTestAllTypes& repeated_child(int index) const;
::protobuf_unittest::NestedTestAllTypes* mutable_repeated_child(int index);
::protobuf_unittest::NestedTestAllTypes* add_repeated_child();
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::NestedTestAllTypes >*
mutable_repeated_child();
const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::NestedTestAllTypes >&
repeated_child() const;
// @@protoc_insertion_point(class_scope:protobuf_unittest.NestedTestAllTypes)
private:
inline void set_has_child();
inline void clear_has_child();
inline void set_has_payload();
inline void clear_has_payload();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::protobuf_unittest::NestedTestAllTypes* child_;
::protobuf_unittest::TestAllTypes* payload_;
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::NestedTestAllTypes > repeated_child_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static NestedTestAllTypes* default_instance_;
};
// -------------------------------------------------------------------
class TestDeprecatedFields : public ::google::protobuf::Message {
public:
TestDeprecatedFields();
virtual ~TestDeprecatedFields();
TestDeprecatedFields(const TestDeprecatedFields& from);
inline TestDeprecatedFields& operator=(const TestDeprecatedFields& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestDeprecatedFields& default_instance();
void UnsafeArenaSwap(TestDeprecatedFields* other);
void Swap(TestDeprecatedFields* other);
// implements Message ----------------------------------------------
inline TestDeprecatedFields* New() const { return New(NULL); }
TestDeprecatedFields* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestDeprecatedFields& from);
void MergeFrom(const TestDeprecatedFields& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestDeprecatedFields* other);
protected:
explicit TestDeprecatedFields(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int32 deprecated_int32 = 1 [deprecated = true];
bool has_deprecated_int32() const PROTOBUF_DEPRECATED;
void clear_deprecated_int32() PROTOBUF_DEPRECATED;
static const int kDeprecatedInt32FieldNumber = 1;
::google::protobuf::int32 deprecated_int32() const PROTOBUF_DEPRECATED;
void set_deprecated_int32(::google::protobuf::int32 value) PROTOBUF_DEPRECATED;
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestDeprecatedFields)
private:
inline void set_has_deprecated_int32();
inline void clear_has_deprecated_int32();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::int32 deprecated_int32_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestDeprecatedFields* default_instance_;
};
// -------------------------------------------------------------------
class ForeignMessage : public ::google::protobuf::Message {
public:
ForeignMessage();
virtual ~ForeignMessage();
ForeignMessage(const ForeignMessage& from);
inline ForeignMessage& operator=(const ForeignMessage& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const ForeignMessage& default_instance();
void UnsafeArenaSwap(ForeignMessage* other);
void Swap(ForeignMessage* other);
// implements Message ----------------------------------------------
inline ForeignMessage* New() const { return New(NULL); }
ForeignMessage* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const ForeignMessage& from);
void MergeFrom(const ForeignMessage& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(ForeignMessage* other);
protected:
explicit ForeignMessage(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int32 c = 1;
bool has_c() const;
void clear_c();
static const int kCFieldNumber = 1;
::google::protobuf::int32 c() const;
void set_c(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:protobuf_unittest.ForeignMessage)
private:
inline void set_has_c();
inline void clear_has_c();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::int32 c_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static ForeignMessage* default_instance_;
};
// -------------------------------------------------------------------
class TestReservedFields : public ::google::protobuf::Message {
public:
TestReservedFields();
virtual ~TestReservedFields();
TestReservedFields(const TestReservedFields& from);
inline TestReservedFields& operator=(const TestReservedFields& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestReservedFields& default_instance();
void UnsafeArenaSwap(TestReservedFields* other);
void Swap(TestReservedFields* other);
// implements Message ----------------------------------------------
inline TestReservedFields* New() const { return New(NULL); }
TestReservedFields* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestReservedFields& from);
void MergeFrom(const TestReservedFields& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestReservedFields* other);
protected:
explicit TestReservedFields(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestReservedFields)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestReservedFields* default_instance_;
};
// -------------------------------------------------------------------
class TestAllExtensions : public ::google::protobuf::Message {
public:
TestAllExtensions();
virtual ~TestAllExtensions();
TestAllExtensions(const TestAllExtensions& from);
inline TestAllExtensions& operator=(const TestAllExtensions& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestAllExtensions& default_instance();
void UnsafeArenaSwap(TestAllExtensions* other);
void Swap(TestAllExtensions* other);
// implements Message ----------------------------------------------
inline TestAllExtensions* New() const { return New(NULL); }
TestAllExtensions* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestAllExtensions& from);
void MergeFrom(const TestAllExtensions& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestAllExtensions* other);
protected:
explicit TestAllExtensions(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(TestAllExtensions)
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestAllExtensions)
private:
::google::protobuf::internal::ExtensionSet _extensions_;
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestAllExtensions* default_instance_;
};
// -------------------------------------------------------------------
class OptionalGroup_extension : public ::google::protobuf::Message {
public:
OptionalGroup_extension();
virtual ~OptionalGroup_extension();
OptionalGroup_extension(const OptionalGroup_extension& from);
inline OptionalGroup_extension& operator=(const OptionalGroup_extension& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const OptionalGroup_extension& default_instance();
void UnsafeArenaSwap(OptionalGroup_extension* other);
void Swap(OptionalGroup_extension* other);
// implements Message ----------------------------------------------
inline OptionalGroup_extension* New() const { return New(NULL); }
OptionalGroup_extension* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const OptionalGroup_extension& from);
void MergeFrom(const OptionalGroup_extension& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(OptionalGroup_extension* other);
protected:
explicit OptionalGroup_extension(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int32 a = 17;
bool has_a() const;
void clear_a();
static const int kAFieldNumber = 17;
::google::protobuf::int32 a() const;
void set_a(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:protobuf_unittest.OptionalGroup_extension)
private:
inline void set_has_a();
inline void clear_has_a();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::int32 a_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static OptionalGroup_extension* default_instance_;
};
// -------------------------------------------------------------------
class RepeatedGroup_extension : public ::google::protobuf::Message {
public:
RepeatedGroup_extension();
virtual ~RepeatedGroup_extension();
RepeatedGroup_extension(const RepeatedGroup_extension& from);
inline RepeatedGroup_extension& operator=(const RepeatedGroup_extension& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const RepeatedGroup_extension& default_instance();
void UnsafeArenaSwap(RepeatedGroup_extension* other);
void Swap(RepeatedGroup_extension* other);
// implements Message ----------------------------------------------
inline RepeatedGroup_extension* New() const { return New(NULL); }
RepeatedGroup_extension* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const RepeatedGroup_extension& from);
void MergeFrom(const RepeatedGroup_extension& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(RepeatedGroup_extension* other);
protected:
explicit RepeatedGroup_extension(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int32 a = 47;
bool has_a() const;
void clear_a();
static const int kAFieldNumber = 47;
::google::protobuf::int32 a() const;
void set_a(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:protobuf_unittest.RepeatedGroup_extension)
private:
inline void set_has_a();
inline void clear_has_a();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::int32 a_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static RepeatedGroup_extension* default_instance_;
};
// -------------------------------------------------------------------
class TestNestedExtension : public ::google::protobuf::Message {
public:
TestNestedExtension();
virtual ~TestNestedExtension();
TestNestedExtension(const TestNestedExtension& from);
inline TestNestedExtension& operator=(const TestNestedExtension& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestNestedExtension& default_instance();
void UnsafeArenaSwap(TestNestedExtension* other);
void Swap(TestNestedExtension* other);
// implements Message ----------------------------------------------
inline TestNestedExtension* New() const { return New(NULL); }
TestNestedExtension* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestNestedExtension& from);
void MergeFrom(const TestNestedExtension& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestNestedExtension* other);
protected:
explicit TestNestedExtension(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
static const int kTestFieldNumber = 1002;
static ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::StringTypeTraits, 9, false >
test;
static const int kNestedStringExtensionFieldNumber = 1003;
static ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::StringTypeTraits, 9, false >
nested_string_extension;
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestNestedExtension)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestNestedExtension* default_instance_;
};
// -------------------------------------------------------------------
class TestRequired : public ::google::protobuf::Message {
public:
TestRequired();
virtual ~TestRequired();
TestRequired(const TestRequired& from);
inline TestRequired& operator=(const TestRequired& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestRequired& default_instance();
void UnsafeArenaSwap(TestRequired* other);
void Swap(TestRequired* other);
// implements Message ----------------------------------------------
inline TestRequired* New() const { return New(NULL); }
TestRequired* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestRequired& from);
void MergeFrom(const TestRequired& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestRequired* other);
protected:
explicit TestRequired(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// required int32 a = 1;
bool has_a() const;
void clear_a();
static const int kAFieldNumber = 1;
::google::protobuf::int32 a() const;
void set_a(::google::protobuf::int32 value);
// optional int32 dummy2 = 2;
bool has_dummy2() const;
void clear_dummy2();
static const int kDummy2FieldNumber = 2;
::google::protobuf::int32 dummy2() const;
void set_dummy2(::google::protobuf::int32 value);
// required int32 b = 3;
bool has_b() const;
void clear_b();
static const int kBFieldNumber = 3;
::google::protobuf::int32 b() const;
void set_b(::google::protobuf::int32 value);
// optional int32 dummy4 = 4;
bool has_dummy4() const;
void clear_dummy4();
static const int kDummy4FieldNumber = 4;
::google::protobuf::int32 dummy4() const;
void set_dummy4(::google::protobuf::int32 value);
// optional int32 dummy5 = 5;
bool has_dummy5() const;
void clear_dummy5();
static const int kDummy5FieldNumber = 5;
::google::protobuf::int32 dummy5() const;
void set_dummy5(::google::protobuf::int32 value);
// optional int32 dummy6 = 6;
bool has_dummy6() const;
void clear_dummy6();
static const int kDummy6FieldNumber = 6;
::google::protobuf::int32 dummy6() const;
void set_dummy6(::google::protobuf::int32 value);
// optional int32 dummy7 = 7;
bool has_dummy7() const;
void clear_dummy7();
static const int kDummy7FieldNumber = 7;
::google::protobuf::int32 dummy7() const;
void set_dummy7(::google::protobuf::int32 value);
// optional int32 dummy8 = 8;
bool has_dummy8() const;
void clear_dummy8();
static const int kDummy8FieldNumber = 8;
::google::protobuf::int32 dummy8() const;
void set_dummy8(::google::protobuf::int32 value);
// optional int32 dummy9 = 9;
bool has_dummy9() const;
void clear_dummy9();
static const int kDummy9FieldNumber = 9;
::google::protobuf::int32 dummy9() const;
void set_dummy9(::google::protobuf::int32 value);
// optional int32 dummy10 = 10;
bool has_dummy10() const;
void clear_dummy10();
static const int kDummy10FieldNumber = 10;
::google::protobuf::int32 dummy10() const;
void set_dummy10(::google::protobuf::int32 value);
// optional int32 dummy11 = 11;
bool has_dummy11() const;
void clear_dummy11();
static const int kDummy11FieldNumber = 11;
::google::protobuf::int32 dummy11() const;
void set_dummy11(::google::protobuf::int32 value);
// optional int32 dummy12 = 12;
bool has_dummy12() const;
void clear_dummy12();
static const int kDummy12FieldNumber = 12;
::google::protobuf::int32 dummy12() const;
void set_dummy12(::google::protobuf::int32 value);
// optional int32 dummy13 = 13;
bool has_dummy13() const;
void clear_dummy13();
static const int kDummy13FieldNumber = 13;
::google::protobuf::int32 dummy13() const;
void set_dummy13(::google::protobuf::int32 value);
// optional int32 dummy14 = 14;
bool has_dummy14() const;
void clear_dummy14();
static const int kDummy14FieldNumber = 14;
::google::protobuf::int32 dummy14() const;
void set_dummy14(::google::protobuf::int32 value);
// optional int32 dummy15 = 15;
bool has_dummy15() const;
void clear_dummy15();
static const int kDummy15FieldNumber = 15;
::google::protobuf::int32 dummy15() const;
void set_dummy15(::google::protobuf::int32 value);
// optional int32 dummy16 = 16;
bool has_dummy16() const;
void clear_dummy16();
static const int kDummy16FieldNumber = 16;
::google::protobuf::int32 dummy16() const;
void set_dummy16(::google::protobuf::int32 value);
// optional int32 dummy17 = 17;
bool has_dummy17() const;
void clear_dummy17();
static const int kDummy17FieldNumber = 17;
::google::protobuf::int32 dummy17() const;
void set_dummy17(::google::protobuf::int32 value);
// optional int32 dummy18 = 18;
bool has_dummy18() const;
void clear_dummy18();
static const int kDummy18FieldNumber = 18;
::google::protobuf::int32 dummy18() const;
void set_dummy18(::google::protobuf::int32 value);
// optional int32 dummy19 = 19;
bool has_dummy19() const;
void clear_dummy19();
static const int kDummy19FieldNumber = 19;
::google::protobuf::int32 dummy19() const;
void set_dummy19(::google::protobuf::int32 value);
// optional int32 dummy20 = 20;
bool has_dummy20() const;
void clear_dummy20();
static const int kDummy20FieldNumber = 20;
::google::protobuf::int32 dummy20() const;
void set_dummy20(::google::protobuf::int32 value);
// optional int32 dummy21 = 21;
bool has_dummy21() const;
void clear_dummy21();
static const int kDummy21FieldNumber = 21;
::google::protobuf::int32 dummy21() const;
void set_dummy21(::google::protobuf::int32 value);
// optional int32 dummy22 = 22;
bool has_dummy22() const;
void clear_dummy22();
static const int kDummy22FieldNumber = 22;
::google::protobuf::int32 dummy22() const;
void set_dummy22(::google::protobuf::int32 value);
// optional int32 dummy23 = 23;
bool has_dummy23() const;
void clear_dummy23();
static const int kDummy23FieldNumber = 23;
::google::protobuf::int32 dummy23() const;
void set_dummy23(::google::protobuf::int32 value);
// optional int32 dummy24 = 24;
bool has_dummy24() const;
void clear_dummy24();
static const int kDummy24FieldNumber = 24;
::google::protobuf::int32 dummy24() const;
void set_dummy24(::google::protobuf::int32 value);
// optional int32 dummy25 = 25;
bool has_dummy25() const;
void clear_dummy25();
static const int kDummy25FieldNumber = 25;
::google::protobuf::int32 dummy25() const;
void set_dummy25(::google::protobuf::int32 value);
// optional int32 dummy26 = 26;
bool has_dummy26() const;
void clear_dummy26();
static const int kDummy26FieldNumber = 26;
::google::protobuf::int32 dummy26() const;
void set_dummy26(::google::protobuf::int32 value);
// optional int32 dummy27 = 27;
bool has_dummy27() const;
void clear_dummy27();
static const int kDummy27FieldNumber = 27;
::google::protobuf::int32 dummy27() const;
void set_dummy27(::google::protobuf::int32 value);
// optional int32 dummy28 = 28;
bool has_dummy28() const;
void clear_dummy28();
static const int kDummy28FieldNumber = 28;
::google::protobuf::int32 dummy28() const;
void set_dummy28(::google::protobuf::int32 value);
// optional int32 dummy29 = 29;
bool has_dummy29() const;
void clear_dummy29();
static const int kDummy29FieldNumber = 29;
::google::protobuf::int32 dummy29() const;
void set_dummy29(::google::protobuf::int32 value);
// optional int32 dummy30 = 30;
bool has_dummy30() const;
void clear_dummy30();
static const int kDummy30FieldNumber = 30;
::google::protobuf::int32 dummy30() const;
void set_dummy30(::google::protobuf::int32 value);
// optional int32 dummy31 = 31;
bool has_dummy31() const;
void clear_dummy31();
static const int kDummy31FieldNumber = 31;
::google::protobuf::int32 dummy31() const;
void set_dummy31(::google::protobuf::int32 value);
// optional int32 dummy32 = 32;
bool has_dummy32() const;
void clear_dummy32();
static const int kDummy32FieldNumber = 32;
::google::protobuf::int32 dummy32() const;
void set_dummy32(::google::protobuf::int32 value);
// required int32 c = 33;
bool has_c() const;
void clear_c();
static const int kCFieldNumber = 33;
::google::protobuf::int32 c() const;
void set_c(::google::protobuf::int32 value);
static const int kSingleFieldNumber = 1000;
static ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::TestRequired >, 11, false >
single;
static const int kMultiFieldNumber = 1001;
static ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedMessageTypeTraits< ::protobuf_unittest::TestRequired >, 11, false >
multi;
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestRequired)
private:
inline void set_has_a();
inline void clear_has_a();
inline void set_has_dummy2();
inline void clear_has_dummy2();
inline void set_has_b();
inline void clear_has_b();
inline void set_has_dummy4();
inline void clear_has_dummy4();
inline void set_has_dummy5();
inline void clear_has_dummy5();
inline void set_has_dummy6();
inline void clear_has_dummy6();
inline void set_has_dummy7();
inline void clear_has_dummy7();
inline void set_has_dummy8();
inline void clear_has_dummy8();
inline void set_has_dummy9();
inline void clear_has_dummy9();
inline void set_has_dummy10();
inline void clear_has_dummy10();
inline void set_has_dummy11();
inline void clear_has_dummy11();
inline void set_has_dummy12();
inline void clear_has_dummy12();
inline void set_has_dummy13();
inline void clear_has_dummy13();
inline void set_has_dummy14();
inline void clear_has_dummy14();
inline void set_has_dummy15();
inline void clear_has_dummy15();
inline void set_has_dummy16();
inline void clear_has_dummy16();
inline void set_has_dummy17();
inline void clear_has_dummy17();
inline void set_has_dummy18();
inline void clear_has_dummy18();
inline void set_has_dummy19();
inline void clear_has_dummy19();
inline void set_has_dummy20();
inline void clear_has_dummy20();
inline void set_has_dummy21();
inline void clear_has_dummy21();
inline void set_has_dummy22();
inline void clear_has_dummy22();
inline void set_has_dummy23();
inline void clear_has_dummy23();
inline void set_has_dummy24();
inline void clear_has_dummy24();
inline void set_has_dummy25();
inline void clear_has_dummy25();
inline void set_has_dummy26();
inline void clear_has_dummy26();
inline void set_has_dummy27();
inline void clear_has_dummy27();
inline void set_has_dummy28();
inline void clear_has_dummy28();
inline void set_has_dummy29();
inline void clear_has_dummy29();
inline void set_has_dummy30();
inline void clear_has_dummy30();
inline void set_has_dummy31();
inline void clear_has_dummy31();
inline void set_has_dummy32();
inline void clear_has_dummy32();
inline void set_has_c();
inline void clear_has_c();
// helper for ByteSize()
int RequiredFieldsByteSizeFallback() const;
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[2];
::google::protobuf::int32 a_;
::google::protobuf::int32 dummy2_;
::google::protobuf::int32 b_;
::google::protobuf::int32 dummy4_;
::google::protobuf::int32 dummy5_;
::google::protobuf::int32 dummy6_;
::google::protobuf::int32 dummy7_;
::google::protobuf::int32 dummy8_;
::google::protobuf::int32 dummy9_;
::google::protobuf::int32 dummy10_;
::google::protobuf::int32 dummy11_;
::google::protobuf::int32 dummy12_;
::google::protobuf::int32 dummy13_;
::google::protobuf::int32 dummy14_;
::google::protobuf::int32 dummy15_;
::google::protobuf::int32 dummy16_;
::google::protobuf::int32 dummy17_;
::google::protobuf::int32 dummy18_;
::google::protobuf::int32 dummy19_;
::google::protobuf::int32 dummy20_;
::google::protobuf::int32 dummy21_;
::google::protobuf::int32 dummy22_;
::google::protobuf::int32 dummy23_;
::google::protobuf::int32 dummy24_;
::google::protobuf::int32 dummy25_;
::google::protobuf::int32 dummy26_;
::google::protobuf::int32 dummy27_;
::google::protobuf::int32 dummy28_;
::google::protobuf::int32 dummy29_;
::google::protobuf::int32 dummy30_;
::google::protobuf::int32 dummy31_;
::google::protobuf::int32 dummy32_;
::google::protobuf::int32 c_;
mutable int _cached_size_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestRequired* default_instance_;
};
// -------------------------------------------------------------------
class TestRequiredForeign : public ::google::protobuf::Message {
public:
TestRequiredForeign();
virtual ~TestRequiredForeign();
TestRequiredForeign(const TestRequiredForeign& from);
inline TestRequiredForeign& operator=(const TestRequiredForeign& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestRequiredForeign& default_instance();
void UnsafeArenaSwap(TestRequiredForeign* other);
void Swap(TestRequiredForeign* other);
// implements Message ----------------------------------------------
inline TestRequiredForeign* New() const { return New(NULL); }
TestRequiredForeign* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestRequiredForeign& from);
void MergeFrom(const TestRequiredForeign& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestRequiredForeign* other);
protected:
explicit TestRequiredForeign(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional .protobuf_unittest.TestRequired optional_message = 1;
bool has_optional_message() const;
void clear_optional_message();
static const int kOptionalMessageFieldNumber = 1;
private:
void _slow_mutable_optional_message();
void _slow_set_allocated_optional_message(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestRequired** optional_message);
::protobuf_unittest::TestRequired* _slow_release_optional_message();
public:
const ::protobuf_unittest::TestRequired& optional_message() const;
::protobuf_unittest::TestRequired* mutable_optional_message();
::protobuf_unittest::TestRequired* release_optional_message();
void set_allocated_optional_message(::protobuf_unittest::TestRequired* optional_message);
::protobuf_unittest::TestRequired* unsafe_arena_release_optional_message();
void unsafe_arena_set_allocated_optional_message(
::protobuf_unittest::TestRequired* optional_message);
// repeated .protobuf_unittest.TestRequired repeated_message = 2;
int repeated_message_size() const;
void clear_repeated_message();
static const int kRepeatedMessageFieldNumber = 2;
const ::protobuf_unittest::TestRequired& repeated_message(int index) const;
::protobuf_unittest::TestRequired* mutable_repeated_message(int index);
::protobuf_unittest::TestRequired* add_repeated_message();
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestRequired >*
mutable_repeated_message();
const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestRequired >&
repeated_message() const;
// optional int32 dummy = 3;
bool has_dummy() const;
void clear_dummy();
static const int kDummyFieldNumber = 3;
::google::protobuf::int32 dummy() const;
void set_dummy(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestRequiredForeign)
private:
inline void set_has_optional_message();
inline void clear_has_optional_message();
inline void set_has_dummy();
inline void clear_has_dummy();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::protobuf_unittest::TestRequired* optional_message_;
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestRequired > repeated_message_;
::google::protobuf::int32 dummy_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestRequiredForeign* default_instance_;
};
// -------------------------------------------------------------------
class TestForeignNested : public ::google::protobuf::Message {
public:
TestForeignNested();
virtual ~TestForeignNested();
TestForeignNested(const TestForeignNested& from);
inline TestForeignNested& operator=(const TestForeignNested& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestForeignNested& default_instance();
void UnsafeArenaSwap(TestForeignNested* other);
void Swap(TestForeignNested* other);
// implements Message ----------------------------------------------
inline TestForeignNested* New() const { return New(NULL); }
TestForeignNested* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestForeignNested& from);
void MergeFrom(const TestForeignNested& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestForeignNested* other);
protected:
explicit TestForeignNested(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional .protobuf_unittest.TestAllTypes.NestedMessage foreign_nested = 1;
bool has_foreign_nested() const;
void clear_foreign_nested();
static const int kForeignNestedFieldNumber = 1;
private:
void _slow_mutable_foreign_nested();
void _slow_set_allocated_foreign_nested(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestAllTypes_NestedMessage** foreign_nested);
::protobuf_unittest::TestAllTypes_NestedMessage* _slow_release_foreign_nested();
public:
const ::protobuf_unittest::TestAllTypes_NestedMessage& foreign_nested() const;
::protobuf_unittest::TestAllTypes_NestedMessage* mutable_foreign_nested();
::protobuf_unittest::TestAllTypes_NestedMessage* release_foreign_nested();
void set_allocated_foreign_nested(::protobuf_unittest::TestAllTypes_NestedMessage* foreign_nested);
::protobuf_unittest::TestAllTypes_NestedMessage* unsafe_arena_release_foreign_nested();
void unsafe_arena_set_allocated_foreign_nested(
::protobuf_unittest::TestAllTypes_NestedMessage* foreign_nested);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestForeignNested)
private:
inline void set_has_foreign_nested();
inline void clear_has_foreign_nested();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::protobuf_unittest::TestAllTypes_NestedMessage* foreign_nested_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestForeignNested* default_instance_;
};
// -------------------------------------------------------------------
class TestEmptyMessage : public ::google::protobuf::Message {
public:
TestEmptyMessage();
virtual ~TestEmptyMessage();
TestEmptyMessage(const TestEmptyMessage& from);
inline TestEmptyMessage& operator=(const TestEmptyMessage& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestEmptyMessage& default_instance();
void UnsafeArenaSwap(TestEmptyMessage* other);
void Swap(TestEmptyMessage* other);
// implements Message ----------------------------------------------
inline TestEmptyMessage* New() const { return New(NULL); }
TestEmptyMessage* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestEmptyMessage& from);
void MergeFrom(const TestEmptyMessage& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestEmptyMessage* other);
protected:
explicit TestEmptyMessage(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestEmptyMessage)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestEmptyMessage* default_instance_;
};
// -------------------------------------------------------------------
class TestEmptyMessageWithExtensions : public ::google::protobuf::Message {
public:
TestEmptyMessageWithExtensions();
virtual ~TestEmptyMessageWithExtensions();
TestEmptyMessageWithExtensions(const TestEmptyMessageWithExtensions& from);
inline TestEmptyMessageWithExtensions& operator=(const TestEmptyMessageWithExtensions& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestEmptyMessageWithExtensions& default_instance();
void UnsafeArenaSwap(TestEmptyMessageWithExtensions* other);
void Swap(TestEmptyMessageWithExtensions* other);
// implements Message ----------------------------------------------
inline TestEmptyMessageWithExtensions* New() const { return New(NULL); }
TestEmptyMessageWithExtensions* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestEmptyMessageWithExtensions& from);
void MergeFrom(const TestEmptyMessageWithExtensions& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestEmptyMessageWithExtensions* other);
protected:
explicit TestEmptyMessageWithExtensions(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(TestEmptyMessageWithExtensions)
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestEmptyMessageWithExtensions)
private:
::google::protobuf::internal::ExtensionSet _extensions_;
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestEmptyMessageWithExtensions* default_instance_;
};
// -------------------------------------------------------------------
class TestMultipleExtensionRanges : public ::google::protobuf::Message {
public:
TestMultipleExtensionRanges();
virtual ~TestMultipleExtensionRanges();
TestMultipleExtensionRanges(const TestMultipleExtensionRanges& from);
inline TestMultipleExtensionRanges& operator=(const TestMultipleExtensionRanges& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestMultipleExtensionRanges& default_instance();
void UnsafeArenaSwap(TestMultipleExtensionRanges* other);
void Swap(TestMultipleExtensionRanges* other);
// implements Message ----------------------------------------------
inline TestMultipleExtensionRanges* New() const { return New(NULL); }
TestMultipleExtensionRanges* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestMultipleExtensionRanges& from);
void MergeFrom(const TestMultipleExtensionRanges& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestMultipleExtensionRanges* other);
protected:
explicit TestMultipleExtensionRanges(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(TestMultipleExtensionRanges)
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestMultipleExtensionRanges)
private:
::google::protobuf::internal::ExtensionSet _extensions_;
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestMultipleExtensionRanges* default_instance_;
};
// -------------------------------------------------------------------
class TestReallyLargeTagNumber : public ::google::protobuf::Message {
public:
TestReallyLargeTagNumber();
virtual ~TestReallyLargeTagNumber();
TestReallyLargeTagNumber(const TestReallyLargeTagNumber& from);
inline TestReallyLargeTagNumber& operator=(const TestReallyLargeTagNumber& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestReallyLargeTagNumber& default_instance();
void UnsafeArenaSwap(TestReallyLargeTagNumber* other);
void Swap(TestReallyLargeTagNumber* other);
// implements Message ----------------------------------------------
inline TestReallyLargeTagNumber* New() const { return New(NULL); }
TestReallyLargeTagNumber* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestReallyLargeTagNumber& from);
void MergeFrom(const TestReallyLargeTagNumber& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestReallyLargeTagNumber* other);
protected:
explicit TestReallyLargeTagNumber(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int32 a = 1;
bool has_a() const;
void clear_a();
static const int kAFieldNumber = 1;
::google::protobuf::int32 a() const;
void set_a(::google::protobuf::int32 value);
// optional int32 bb = 268435455;
bool has_bb() const;
void clear_bb();
static const int kBbFieldNumber = 268435455;
::google::protobuf::int32 bb() const;
void set_bb(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestReallyLargeTagNumber)
private:
inline void set_has_a();
inline void clear_has_a();
inline void set_has_bb();
inline void clear_has_bb();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::int32 a_;
::google::protobuf::int32 bb_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestReallyLargeTagNumber* default_instance_;
};
// -------------------------------------------------------------------
class TestRecursiveMessage : public ::google::protobuf::Message {
public:
TestRecursiveMessage();
virtual ~TestRecursiveMessage();
TestRecursiveMessage(const TestRecursiveMessage& from);
inline TestRecursiveMessage& operator=(const TestRecursiveMessage& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestRecursiveMessage& default_instance();
void UnsafeArenaSwap(TestRecursiveMessage* other);
void Swap(TestRecursiveMessage* other);
// implements Message ----------------------------------------------
inline TestRecursiveMessage* New() const { return New(NULL); }
TestRecursiveMessage* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestRecursiveMessage& from);
void MergeFrom(const TestRecursiveMessage& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestRecursiveMessage* other);
protected:
explicit TestRecursiveMessage(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional .protobuf_unittest.TestRecursiveMessage a = 1;
bool has_a() const;
void clear_a();
static const int kAFieldNumber = 1;
private:
void _slow_mutable_a();
void _slow_set_allocated_a(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestRecursiveMessage** a);
::protobuf_unittest::TestRecursiveMessage* _slow_release_a();
public:
const ::protobuf_unittest::TestRecursiveMessage& a() const;
::protobuf_unittest::TestRecursiveMessage* mutable_a();
::protobuf_unittest::TestRecursiveMessage* release_a();
void set_allocated_a(::protobuf_unittest::TestRecursiveMessage* a);
::protobuf_unittest::TestRecursiveMessage* unsafe_arena_release_a();
void unsafe_arena_set_allocated_a(
::protobuf_unittest::TestRecursiveMessage* a);
// optional int32 i = 2;
bool has_i() const;
void clear_i();
static const int kIFieldNumber = 2;
::google::protobuf::int32 i() const;
void set_i(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestRecursiveMessage)
private:
inline void set_has_a();
inline void clear_has_a();
inline void set_has_i();
inline void clear_has_i();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::protobuf_unittest::TestRecursiveMessage* a_;
::google::protobuf::int32 i_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestRecursiveMessage* default_instance_;
};
// -------------------------------------------------------------------
class TestMutualRecursionA : public ::google::protobuf::Message {
public:
TestMutualRecursionA();
virtual ~TestMutualRecursionA();
TestMutualRecursionA(const TestMutualRecursionA& from);
inline TestMutualRecursionA& operator=(const TestMutualRecursionA& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestMutualRecursionA& default_instance();
void UnsafeArenaSwap(TestMutualRecursionA* other);
void Swap(TestMutualRecursionA* other);
// implements Message ----------------------------------------------
inline TestMutualRecursionA* New() const { return New(NULL); }
TestMutualRecursionA* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestMutualRecursionA& from);
void MergeFrom(const TestMutualRecursionA& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestMutualRecursionA* other);
protected:
explicit TestMutualRecursionA(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional .protobuf_unittest.TestMutualRecursionB bb = 1;
bool has_bb() const;
void clear_bb();
static const int kBbFieldNumber = 1;
private:
void _slow_mutable_bb();
void _slow_set_allocated_bb(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestMutualRecursionB** bb);
::protobuf_unittest::TestMutualRecursionB* _slow_release_bb();
public:
const ::protobuf_unittest::TestMutualRecursionB& bb() const;
::protobuf_unittest::TestMutualRecursionB* mutable_bb();
::protobuf_unittest::TestMutualRecursionB* release_bb();
void set_allocated_bb(::protobuf_unittest::TestMutualRecursionB* bb);
::protobuf_unittest::TestMutualRecursionB* unsafe_arena_release_bb();
void unsafe_arena_set_allocated_bb(
::protobuf_unittest::TestMutualRecursionB* bb);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestMutualRecursionA)
private:
inline void set_has_bb();
inline void clear_has_bb();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::protobuf_unittest::TestMutualRecursionB* bb_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestMutualRecursionA* default_instance_;
};
// -------------------------------------------------------------------
class TestMutualRecursionB : public ::google::protobuf::Message {
public:
TestMutualRecursionB();
virtual ~TestMutualRecursionB();
TestMutualRecursionB(const TestMutualRecursionB& from);
inline TestMutualRecursionB& operator=(const TestMutualRecursionB& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestMutualRecursionB& default_instance();
void UnsafeArenaSwap(TestMutualRecursionB* other);
void Swap(TestMutualRecursionB* other);
// implements Message ----------------------------------------------
inline TestMutualRecursionB* New() const { return New(NULL); }
TestMutualRecursionB* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestMutualRecursionB& from);
void MergeFrom(const TestMutualRecursionB& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestMutualRecursionB* other);
protected:
explicit TestMutualRecursionB(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional .protobuf_unittest.TestMutualRecursionA a = 1;
bool has_a() const;
void clear_a();
static const int kAFieldNumber = 1;
private:
void _slow_mutable_a();
void _slow_set_allocated_a(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestMutualRecursionA** a);
::protobuf_unittest::TestMutualRecursionA* _slow_release_a();
public:
const ::protobuf_unittest::TestMutualRecursionA& a() const;
::protobuf_unittest::TestMutualRecursionA* mutable_a();
::protobuf_unittest::TestMutualRecursionA* release_a();
void set_allocated_a(::protobuf_unittest::TestMutualRecursionA* a);
::protobuf_unittest::TestMutualRecursionA* unsafe_arena_release_a();
void unsafe_arena_set_allocated_a(
::protobuf_unittest::TestMutualRecursionA* a);
// optional int32 optional_int32 = 2;
bool has_optional_int32() const;
void clear_optional_int32();
static const int kOptionalInt32FieldNumber = 2;
::google::protobuf::int32 optional_int32() const;
void set_optional_int32(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestMutualRecursionB)
private:
inline void set_has_a();
inline void clear_has_a();
inline void set_has_optional_int32();
inline void clear_has_optional_int32();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::protobuf_unittest::TestMutualRecursionA* a_;
::google::protobuf::int32 optional_int32_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestMutualRecursionB* default_instance_;
};
// -------------------------------------------------------------------
class TestDupFieldNumber_Foo : public ::google::protobuf::Message {
public:
TestDupFieldNumber_Foo();
virtual ~TestDupFieldNumber_Foo();
TestDupFieldNumber_Foo(const TestDupFieldNumber_Foo& from);
inline TestDupFieldNumber_Foo& operator=(const TestDupFieldNumber_Foo& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestDupFieldNumber_Foo& default_instance();
void UnsafeArenaSwap(TestDupFieldNumber_Foo* other);
void Swap(TestDupFieldNumber_Foo* other);
// implements Message ----------------------------------------------
inline TestDupFieldNumber_Foo* New() const { return New(NULL); }
TestDupFieldNumber_Foo* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestDupFieldNumber_Foo& from);
void MergeFrom(const TestDupFieldNumber_Foo& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestDupFieldNumber_Foo* other);
protected:
explicit TestDupFieldNumber_Foo(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int32 a = 1;
bool has_a() const;
void clear_a();
static const int kAFieldNumber = 1;
::google::protobuf::int32 a() const;
void set_a(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestDupFieldNumber.Foo)
private:
inline void set_has_a();
inline void clear_has_a();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::int32 a_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestDupFieldNumber_Foo* default_instance_;
};
// -------------------------------------------------------------------
class TestDupFieldNumber_Bar : public ::google::protobuf::Message {
public:
TestDupFieldNumber_Bar();
virtual ~TestDupFieldNumber_Bar();
TestDupFieldNumber_Bar(const TestDupFieldNumber_Bar& from);
inline TestDupFieldNumber_Bar& operator=(const TestDupFieldNumber_Bar& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestDupFieldNumber_Bar& default_instance();
void UnsafeArenaSwap(TestDupFieldNumber_Bar* other);
void Swap(TestDupFieldNumber_Bar* other);
// implements Message ----------------------------------------------
inline TestDupFieldNumber_Bar* New() const { return New(NULL); }
TestDupFieldNumber_Bar* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestDupFieldNumber_Bar& from);
void MergeFrom(const TestDupFieldNumber_Bar& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestDupFieldNumber_Bar* other);
protected:
explicit TestDupFieldNumber_Bar(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int32 a = 1;
bool has_a() const;
void clear_a();
static const int kAFieldNumber = 1;
::google::protobuf::int32 a() const;
void set_a(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestDupFieldNumber.Bar)
private:
inline void set_has_a();
inline void clear_has_a();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::int32 a_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestDupFieldNumber_Bar* default_instance_;
};
// -------------------------------------------------------------------
class TestDupFieldNumber : public ::google::protobuf::Message {
public:
TestDupFieldNumber();
virtual ~TestDupFieldNumber();
TestDupFieldNumber(const TestDupFieldNumber& from);
inline TestDupFieldNumber& operator=(const TestDupFieldNumber& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestDupFieldNumber& default_instance();
void UnsafeArenaSwap(TestDupFieldNumber* other);
void Swap(TestDupFieldNumber* other);
// implements Message ----------------------------------------------
inline TestDupFieldNumber* New() const { return New(NULL); }
TestDupFieldNumber* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestDupFieldNumber& from);
void MergeFrom(const TestDupFieldNumber& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestDupFieldNumber* other);
protected:
explicit TestDupFieldNumber(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
typedef TestDupFieldNumber_Foo Foo;
typedef TestDupFieldNumber_Bar Bar;
// accessors -------------------------------------------------------
// optional int32 a = 1;
bool has_a() const;
void clear_a();
static const int kAFieldNumber = 1;
::google::protobuf::int32 a() const;
void set_a(::google::protobuf::int32 value);
// optional group Foo = 2 { ... };
bool has_foo() const;
void clear_foo();
static const int kFooFieldNumber = 2;
private:
void _slow_mutable_foo();
void _slow_set_allocated_foo(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestDupFieldNumber_Foo** foo);
::protobuf_unittest::TestDupFieldNumber_Foo* _slow_release_foo();
public:
const ::protobuf_unittest::TestDupFieldNumber_Foo& foo() const;
::protobuf_unittest::TestDupFieldNumber_Foo* mutable_foo();
::protobuf_unittest::TestDupFieldNumber_Foo* release_foo();
void set_allocated_foo(::protobuf_unittest::TestDupFieldNumber_Foo* foo);
::protobuf_unittest::TestDupFieldNumber_Foo* unsafe_arena_release_foo();
void unsafe_arena_set_allocated_foo(
::protobuf_unittest::TestDupFieldNumber_Foo* foo);
// optional group Bar = 3 { ... };
bool has_bar() const;
void clear_bar();
static const int kBarFieldNumber = 3;
private:
void _slow_mutable_bar();
void _slow_set_allocated_bar(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestDupFieldNumber_Bar** bar);
::protobuf_unittest::TestDupFieldNumber_Bar* _slow_release_bar();
public:
const ::protobuf_unittest::TestDupFieldNumber_Bar& bar() const;
::protobuf_unittest::TestDupFieldNumber_Bar* mutable_bar();
::protobuf_unittest::TestDupFieldNumber_Bar* release_bar();
void set_allocated_bar(::protobuf_unittest::TestDupFieldNumber_Bar* bar);
::protobuf_unittest::TestDupFieldNumber_Bar* unsafe_arena_release_bar();
void unsafe_arena_set_allocated_bar(
::protobuf_unittest::TestDupFieldNumber_Bar* bar);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestDupFieldNumber)
private:
inline void set_has_a();
inline void clear_has_a();
inline void set_has_foo();
inline void clear_has_foo();
inline void set_has_bar();
inline void clear_has_bar();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::protobuf_unittest::TestDupFieldNumber_Foo* foo_;
::protobuf_unittest::TestDupFieldNumber_Bar* bar_;
::google::protobuf::int32 a_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestDupFieldNumber* default_instance_;
};
// -------------------------------------------------------------------
class TestEagerMessage : public ::google::protobuf::Message {
public:
TestEagerMessage();
virtual ~TestEagerMessage();
TestEagerMessage(const TestEagerMessage& from);
inline TestEagerMessage& operator=(const TestEagerMessage& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestEagerMessage& default_instance();
void UnsafeArenaSwap(TestEagerMessage* other);
void Swap(TestEagerMessage* other);
// implements Message ----------------------------------------------
inline TestEagerMessage* New() const { return New(NULL); }
TestEagerMessage* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestEagerMessage& from);
void MergeFrom(const TestEagerMessage& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestEagerMessage* other);
protected:
explicit TestEagerMessage(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional .protobuf_unittest.TestAllTypes sub_message = 1 [lazy = false];
bool has_sub_message() const;
void clear_sub_message();
static const int kSubMessageFieldNumber = 1;
private:
void _slow_mutable_sub_message();
void _slow_set_allocated_sub_message(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestAllTypes** sub_message);
::protobuf_unittest::TestAllTypes* _slow_release_sub_message();
public:
const ::protobuf_unittest::TestAllTypes& sub_message() const;
::protobuf_unittest::TestAllTypes* mutable_sub_message();
::protobuf_unittest::TestAllTypes* release_sub_message();
void set_allocated_sub_message(::protobuf_unittest::TestAllTypes* sub_message);
::protobuf_unittest::TestAllTypes* unsafe_arena_release_sub_message();
void unsafe_arena_set_allocated_sub_message(
::protobuf_unittest::TestAllTypes* sub_message);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestEagerMessage)
private:
inline void set_has_sub_message();
inline void clear_has_sub_message();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::protobuf_unittest::TestAllTypes* sub_message_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestEagerMessage* default_instance_;
};
// -------------------------------------------------------------------
class TestLazyMessage : public ::google::protobuf::Message {
public:
TestLazyMessage();
virtual ~TestLazyMessage();
TestLazyMessage(const TestLazyMessage& from);
inline TestLazyMessage& operator=(const TestLazyMessage& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestLazyMessage& default_instance();
void UnsafeArenaSwap(TestLazyMessage* other);
void Swap(TestLazyMessage* other);
// implements Message ----------------------------------------------
inline TestLazyMessage* New() const { return New(NULL); }
TestLazyMessage* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestLazyMessage& from);
void MergeFrom(const TestLazyMessage& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestLazyMessage* other);
protected:
explicit TestLazyMessage(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional .protobuf_unittest.TestAllTypes sub_message = 1 [lazy = true];
bool has_sub_message() const;
void clear_sub_message();
static const int kSubMessageFieldNumber = 1;
private:
void _slow_mutable_sub_message();
void _slow_set_allocated_sub_message(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestAllTypes** sub_message);
::protobuf_unittest::TestAllTypes* _slow_release_sub_message();
public:
const ::protobuf_unittest::TestAllTypes& sub_message() const;
::protobuf_unittest::TestAllTypes* mutable_sub_message();
::protobuf_unittest::TestAllTypes* release_sub_message();
void set_allocated_sub_message(::protobuf_unittest::TestAllTypes* sub_message);
::protobuf_unittest::TestAllTypes* unsafe_arena_release_sub_message();
void unsafe_arena_set_allocated_sub_message(
::protobuf_unittest::TestAllTypes* sub_message);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestLazyMessage)
private:
inline void set_has_sub_message();
inline void clear_has_sub_message();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::protobuf_unittest::TestAllTypes* sub_message_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestLazyMessage* default_instance_;
};
// -------------------------------------------------------------------
class TestNestedMessageHasBits_NestedMessage : public ::google::protobuf::Message {
public:
TestNestedMessageHasBits_NestedMessage();
virtual ~TestNestedMessageHasBits_NestedMessage();
TestNestedMessageHasBits_NestedMessage(const TestNestedMessageHasBits_NestedMessage& from);
inline TestNestedMessageHasBits_NestedMessage& operator=(const TestNestedMessageHasBits_NestedMessage& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestNestedMessageHasBits_NestedMessage& default_instance();
void UnsafeArenaSwap(TestNestedMessageHasBits_NestedMessage* other);
void Swap(TestNestedMessageHasBits_NestedMessage* other);
// implements Message ----------------------------------------------
inline TestNestedMessageHasBits_NestedMessage* New() const { return New(NULL); }
TestNestedMessageHasBits_NestedMessage* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestNestedMessageHasBits_NestedMessage& from);
void MergeFrom(const TestNestedMessageHasBits_NestedMessage& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestNestedMessageHasBits_NestedMessage* other);
protected:
explicit TestNestedMessageHasBits_NestedMessage(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// repeated int32 nestedmessage_repeated_int32 = 1;
int nestedmessage_repeated_int32_size() const;
void clear_nestedmessage_repeated_int32();
static const int kNestedmessageRepeatedInt32FieldNumber = 1;
::google::protobuf::int32 nestedmessage_repeated_int32(int index) const;
void set_nestedmessage_repeated_int32(int index, ::google::protobuf::int32 value);
void add_nestedmessage_repeated_int32(::google::protobuf::int32 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
nestedmessage_repeated_int32() const;
::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
mutable_nestedmessage_repeated_int32();
// repeated .protobuf_unittest.ForeignMessage nestedmessage_repeated_foreignmessage = 2;
int nestedmessage_repeated_foreignmessage_size() const;
void clear_nestedmessage_repeated_foreignmessage();
static const int kNestedmessageRepeatedForeignmessageFieldNumber = 2;
const ::protobuf_unittest::ForeignMessage& nestedmessage_repeated_foreignmessage(int index) const;
::protobuf_unittest::ForeignMessage* mutable_nestedmessage_repeated_foreignmessage(int index);
::protobuf_unittest::ForeignMessage* add_nestedmessage_repeated_foreignmessage();
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::ForeignMessage >*
mutable_nestedmessage_repeated_foreignmessage();
const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::ForeignMessage >&
nestedmessage_repeated_foreignmessage() const;
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestNestedMessageHasBits.NestedMessage)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::RepeatedField< ::google::protobuf::int32 > nestedmessage_repeated_int32_;
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::ForeignMessage > nestedmessage_repeated_foreignmessage_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestNestedMessageHasBits_NestedMessage* default_instance_;
};
// -------------------------------------------------------------------
class TestNestedMessageHasBits : public ::google::protobuf::Message {
public:
TestNestedMessageHasBits();
virtual ~TestNestedMessageHasBits();
TestNestedMessageHasBits(const TestNestedMessageHasBits& from);
inline TestNestedMessageHasBits& operator=(const TestNestedMessageHasBits& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestNestedMessageHasBits& default_instance();
void UnsafeArenaSwap(TestNestedMessageHasBits* other);
void Swap(TestNestedMessageHasBits* other);
// implements Message ----------------------------------------------
inline TestNestedMessageHasBits* New() const { return New(NULL); }
TestNestedMessageHasBits* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestNestedMessageHasBits& from);
void MergeFrom(const TestNestedMessageHasBits& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestNestedMessageHasBits* other);
protected:
explicit TestNestedMessageHasBits(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
typedef TestNestedMessageHasBits_NestedMessage NestedMessage;
// accessors -------------------------------------------------------
// optional .protobuf_unittest.TestNestedMessageHasBits.NestedMessage optional_nested_message = 1;
bool has_optional_nested_message() const;
void clear_optional_nested_message();
static const int kOptionalNestedMessageFieldNumber = 1;
private:
void _slow_mutable_optional_nested_message();
void _slow_set_allocated_optional_nested_message(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestNestedMessageHasBits_NestedMessage** optional_nested_message);
::protobuf_unittest::TestNestedMessageHasBits_NestedMessage* _slow_release_optional_nested_message();
public:
const ::protobuf_unittest::TestNestedMessageHasBits_NestedMessage& optional_nested_message() const;
::protobuf_unittest::TestNestedMessageHasBits_NestedMessage* mutable_optional_nested_message();
::protobuf_unittest::TestNestedMessageHasBits_NestedMessage* release_optional_nested_message();
void set_allocated_optional_nested_message(::protobuf_unittest::TestNestedMessageHasBits_NestedMessage* optional_nested_message);
::protobuf_unittest::TestNestedMessageHasBits_NestedMessage* unsafe_arena_release_optional_nested_message();
void unsafe_arena_set_allocated_optional_nested_message(
::protobuf_unittest::TestNestedMessageHasBits_NestedMessage* optional_nested_message);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestNestedMessageHasBits)
private:
inline void set_has_optional_nested_message();
inline void clear_has_optional_nested_message();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::protobuf_unittest::TestNestedMessageHasBits_NestedMessage* optional_nested_message_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestNestedMessageHasBits* default_instance_;
};
// -------------------------------------------------------------------
class TestCamelCaseFieldNames : public ::google::protobuf::Message {
public:
TestCamelCaseFieldNames();
virtual ~TestCamelCaseFieldNames();
TestCamelCaseFieldNames(const TestCamelCaseFieldNames& from);
inline TestCamelCaseFieldNames& operator=(const TestCamelCaseFieldNames& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestCamelCaseFieldNames& default_instance();
void UnsafeArenaSwap(TestCamelCaseFieldNames* other);
void Swap(TestCamelCaseFieldNames* other);
// implements Message ----------------------------------------------
inline TestCamelCaseFieldNames* New() const { return New(NULL); }
TestCamelCaseFieldNames* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestCamelCaseFieldNames& from);
void MergeFrom(const TestCamelCaseFieldNames& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestCamelCaseFieldNames* other);
protected:
explicit TestCamelCaseFieldNames(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int32 PrimitiveField = 1;
bool has_primitivefield() const;
void clear_primitivefield();
static const int kPrimitiveFieldFieldNumber = 1;
::google::protobuf::int32 primitivefield() const;
void set_primitivefield(::google::protobuf::int32 value);
// optional string StringField = 2;
bool has_stringfield() const;
void clear_stringfield();
static const int kStringFieldFieldNumber = 2;
const ::std::string& stringfield() const;
void set_stringfield(const ::std::string& value);
void set_stringfield(const char* value);
void set_stringfield(const char* value, size_t size);
::std::string* mutable_stringfield();
::std::string* release_stringfield();
void set_allocated_stringfield(::std::string* stringfield);
::std::string* unsafe_arena_release_stringfield();
void unsafe_arena_set_allocated_stringfield(
::std::string* stringfield);
// optional .protobuf_unittest.ForeignEnum EnumField = 3;
bool has_enumfield() const;
void clear_enumfield();
static const int kEnumFieldFieldNumber = 3;
::protobuf_unittest::ForeignEnum enumfield() const;
void set_enumfield(::protobuf_unittest::ForeignEnum value);
// optional .protobuf_unittest.ForeignMessage MessageField = 4;
bool has_messagefield() const;
void clear_messagefield();
static const int kMessageFieldFieldNumber = 4;
private:
void _slow_mutable_messagefield();
void _slow_set_allocated_messagefield(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::ForeignMessage** messagefield);
::protobuf_unittest::ForeignMessage* _slow_release_messagefield();
public:
const ::protobuf_unittest::ForeignMessage& messagefield() const;
::protobuf_unittest::ForeignMessage* mutable_messagefield();
::protobuf_unittest::ForeignMessage* release_messagefield();
void set_allocated_messagefield(::protobuf_unittest::ForeignMessage* messagefield);
::protobuf_unittest::ForeignMessage* unsafe_arena_release_messagefield();
void unsafe_arena_set_allocated_messagefield(
::protobuf_unittest::ForeignMessage* messagefield);
// optional string StringPieceField = 5 [ctype = STRING_PIECE];
bool has_stringpiecefield() const;
void clear_stringpiecefield();
static const int kStringPieceFieldFieldNumber = 5;
private:
// Hidden due to unknown ctype option.
const ::std::string& stringpiecefield() const;
void set_stringpiecefield(const ::std::string& value);
void set_stringpiecefield(const char* value);
void set_stringpiecefield(const char* value, size_t size);
::std::string* mutable_stringpiecefield();
::std::string* release_stringpiecefield();
void set_allocated_stringpiecefield(::std::string* stringpiecefield);
::std::string* unsafe_arena_release_stringpiecefield();
void unsafe_arena_set_allocated_stringpiecefield(
::std::string* stringpiecefield);
public:
// optional string CordField = 6 [ctype = CORD];
bool has_cordfield() const;
void clear_cordfield();
static const int kCordFieldFieldNumber = 6;
private:
// Hidden due to unknown ctype option.
const ::std::string& cordfield() const;
void set_cordfield(const ::std::string& value);
void set_cordfield(const char* value);
void set_cordfield(const char* value, size_t size);
::std::string* mutable_cordfield();
::std::string* release_cordfield();
void set_allocated_cordfield(::std::string* cordfield);
::std::string* unsafe_arena_release_cordfield();
void unsafe_arena_set_allocated_cordfield(
::std::string* cordfield);
public:
// repeated int32 RepeatedPrimitiveField = 7;
int repeatedprimitivefield_size() const;
void clear_repeatedprimitivefield();
static const int kRepeatedPrimitiveFieldFieldNumber = 7;
::google::protobuf::int32 repeatedprimitivefield(int index) const;
void set_repeatedprimitivefield(int index, ::google::protobuf::int32 value);
void add_repeatedprimitivefield(::google::protobuf::int32 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
repeatedprimitivefield() const;
::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
mutable_repeatedprimitivefield();
// repeated string RepeatedStringField = 8;
int repeatedstringfield_size() const;
void clear_repeatedstringfield();
static const int kRepeatedStringFieldFieldNumber = 8;
const ::std::string& repeatedstringfield(int index) const;
::std::string* mutable_repeatedstringfield(int index);
void set_repeatedstringfield(int index, const ::std::string& value);
void set_repeatedstringfield(int index, const char* value);
void set_repeatedstringfield(int index, const char* value, size_t size);
::std::string* add_repeatedstringfield();
void add_repeatedstringfield(const ::std::string& value);
void add_repeatedstringfield(const char* value);
void add_repeatedstringfield(const char* value, size_t size);
const ::google::protobuf::RepeatedPtrField< ::std::string>& repeatedstringfield() const;
::google::protobuf::RepeatedPtrField< ::std::string>* mutable_repeatedstringfield();
// repeated .protobuf_unittest.ForeignEnum RepeatedEnumField = 9;
int repeatedenumfield_size() const;
void clear_repeatedenumfield();
static const int kRepeatedEnumFieldFieldNumber = 9;
::protobuf_unittest::ForeignEnum repeatedenumfield(int index) const;
void set_repeatedenumfield(int index, ::protobuf_unittest::ForeignEnum value);
void add_repeatedenumfield(::protobuf_unittest::ForeignEnum value);
const ::google::protobuf::RepeatedField<int>& repeatedenumfield() const;
::google::protobuf::RepeatedField<int>* mutable_repeatedenumfield();
// repeated .protobuf_unittest.ForeignMessage RepeatedMessageField = 10;
int repeatedmessagefield_size() const;
void clear_repeatedmessagefield();
static const int kRepeatedMessageFieldFieldNumber = 10;
const ::protobuf_unittest::ForeignMessage& repeatedmessagefield(int index) const;
::protobuf_unittest::ForeignMessage* mutable_repeatedmessagefield(int index);
::protobuf_unittest::ForeignMessage* add_repeatedmessagefield();
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::ForeignMessage >*
mutable_repeatedmessagefield();
const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::ForeignMessage >&
repeatedmessagefield() const;
// repeated string RepeatedStringPieceField = 11 [ctype = STRING_PIECE];
int repeatedstringpiecefield_size() const;
void clear_repeatedstringpiecefield();
static const int kRepeatedStringPieceFieldFieldNumber = 11;
private:
// Hidden due to unknown ctype option.
const ::std::string& repeatedstringpiecefield(int index) const;
::std::string* mutable_repeatedstringpiecefield(int index);
void set_repeatedstringpiecefield(int index, const ::std::string& value);
void set_repeatedstringpiecefield(int index, const char* value);
void set_repeatedstringpiecefield(int index, const char* value, size_t size);
::std::string* add_repeatedstringpiecefield();
void add_repeatedstringpiecefield(const ::std::string& value);
void add_repeatedstringpiecefield(const char* value);
void add_repeatedstringpiecefield(const char* value, size_t size);
const ::google::protobuf::RepeatedPtrField< ::std::string>& repeatedstringpiecefield() const;
::google::protobuf::RepeatedPtrField< ::std::string>* mutable_repeatedstringpiecefield();
public:
// repeated string RepeatedCordField = 12 [ctype = CORD];
int repeatedcordfield_size() const;
void clear_repeatedcordfield();
static const int kRepeatedCordFieldFieldNumber = 12;
private:
// Hidden due to unknown ctype option.
const ::std::string& repeatedcordfield(int index) const;
::std::string* mutable_repeatedcordfield(int index);
void set_repeatedcordfield(int index, const ::std::string& value);
void set_repeatedcordfield(int index, const char* value);
void set_repeatedcordfield(int index, const char* value, size_t size);
::std::string* add_repeatedcordfield();
void add_repeatedcordfield(const ::std::string& value);
void add_repeatedcordfield(const char* value);
void add_repeatedcordfield(const char* value, size_t size);
const ::google::protobuf::RepeatedPtrField< ::std::string>& repeatedcordfield() const;
::google::protobuf::RepeatedPtrField< ::std::string>* mutable_repeatedcordfield();
public:
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestCamelCaseFieldNames)
private:
inline void set_has_primitivefield();
inline void clear_has_primitivefield();
inline void set_has_stringfield();
inline void clear_has_stringfield();
inline void set_has_enumfield();
inline void clear_has_enumfield();
inline void set_has_messagefield();
inline void clear_has_messagefield();
inline void set_has_stringpiecefield();
inline void clear_has_stringpiecefield();
inline void set_has_cordfield();
inline void clear_has_cordfield();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::internal::ArenaStringPtr stringfield_;
::google::protobuf::int32 primitivefield_;
int enumfield_;
::protobuf_unittest::ForeignMessage* messagefield_;
::google::protobuf::internal::ArenaStringPtr stringpiecefield_;
::google::protobuf::internal::ArenaStringPtr cordfield_;
::google::protobuf::RepeatedField< ::google::protobuf::int32 > repeatedprimitivefield_;
::google::protobuf::RepeatedPtrField< ::std::string> repeatedstringfield_;
::google::protobuf::RepeatedField<int> repeatedenumfield_;
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::ForeignMessage > repeatedmessagefield_;
::google::protobuf::RepeatedPtrField< ::std::string> repeatedstringpiecefield_;
::google::protobuf::RepeatedPtrField< ::std::string> repeatedcordfield_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestCamelCaseFieldNames* default_instance_;
};
// -------------------------------------------------------------------
class TestFieldOrderings_NestedMessage : public ::google::protobuf::Message {
public:
TestFieldOrderings_NestedMessage();
virtual ~TestFieldOrderings_NestedMessage();
TestFieldOrderings_NestedMessage(const TestFieldOrderings_NestedMessage& from);
inline TestFieldOrderings_NestedMessage& operator=(const TestFieldOrderings_NestedMessage& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestFieldOrderings_NestedMessage& default_instance();
void UnsafeArenaSwap(TestFieldOrderings_NestedMessage* other);
void Swap(TestFieldOrderings_NestedMessage* other);
// implements Message ----------------------------------------------
inline TestFieldOrderings_NestedMessage* New() const { return New(NULL); }
TestFieldOrderings_NestedMessage* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestFieldOrderings_NestedMessage& from);
void MergeFrom(const TestFieldOrderings_NestedMessage& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestFieldOrderings_NestedMessage* other);
protected:
explicit TestFieldOrderings_NestedMessage(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int64 oo = 2;
bool has_oo() const;
void clear_oo();
static const int kOoFieldNumber = 2;
::google::protobuf::int64 oo() const;
void set_oo(::google::protobuf::int64 value);
// optional int32 bb = 1;
bool has_bb() const;
void clear_bb();
static const int kBbFieldNumber = 1;
::google::protobuf::int32 bb() const;
void set_bb(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestFieldOrderings.NestedMessage)
private:
inline void set_has_oo();
inline void clear_has_oo();
inline void set_has_bb();
inline void clear_has_bb();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::int64 oo_;
::google::protobuf::int32 bb_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestFieldOrderings_NestedMessage* default_instance_;
};
// -------------------------------------------------------------------
class TestFieldOrderings : public ::google::protobuf::Message {
public:
TestFieldOrderings();
virtual ~TestFieldOrderings();
TestFieldOrderings(const TestFieldOrderings& from);
inline TestFieldOrderings& operator=(const TestFieldOrderings& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestFieldOrderings& default_instance();
void UnsafeArenaSwap(TestFieldOrderings* other);
void Swap(TestFieldOrderings* other);
// implements Message ----------------------------------------------
inline TestFieldOrderings* New() const { return New(NULL); }
TestFieldOrderings* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestFieldOrderings& from);
void MergeFrom(const TestFieldOrderings& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestFieldOrderings* other);
protected:
explicit TestFieldOrderings(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
typedef TestFieldOrderings_NestedMessage NestedMessage;
// accessors -------------------------------------------------------
// optional string my_string = 11;
bool has_my_string() const;
void clear_my_string();
static const int kMyStringFieldNumber = 11;
const ::std::string& my_string() const;
void set_my_string(const ::std::string& value);
void set_my_string(const char* value);
void set_my_string(const char* value, size_t size);
::std::string* mutable_my_string();
::std::string* release_my_string();
void set_allocated_my_string(::std::string* my_string);
::std::string* unsafe_arena_release_my_string();
void unsafe_arena_set_allocated_my_string(
::std::string* my_string);
// optional int64 my_int = 1;
bool has_my_int() const;
void clear_my_int();
static const int kMyIntFieldNumber = 1;
::google::protobuf::int64 my_int() const;
void set_my_int(::google::protobuf::int64 value);
// optional float my_float = 101;
bool has_my_float() const;
void clear_my_float();
static const int kMyFloatFieldNumber = 101;
float my_float() const;
void set_my_float(float value);
// optional .protobuf_unittest.TestFieldOrderings.NestedMessage optional_nested_message = 200;
bool has_optional_nested_message() const;
void clear_optional_nested_message();
static const int kOptionalNestedMessageFieldNumber = 200;
private:
void _slow_mutable_optional_nested_message();
void _slow_set_allocated_optional_nested_message(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestFieldOrderings_NestedMessage** optional_nested_message);
::protobuf_unittest::TestFieldOrderings_NestedMessage* _slow_release_optional_nested_message();
public:
const ::protobuf_unittest::TestFieldOrderings_NestedMessage& optional_nested_message() const;
::protobuf_unittest::TestFieldOrderings_NestedMessage* mutable_optional_nested_message();
::protobuf_unittest::TestFieldOrderings_NestedMessage* release_optional_nested_message();
void set_allocated_optional_nested_message(::protobuf_unittest::TestFieldOrderings_NestedMessage* optional_nested_message);
::protobuf_unittest::TestFieldOrderings_NestedMessage* unsafe_arena_release_optional_nested_message();
void unsafe_arena_set_allocated_optional_nested_message(
::protobuf_unittest::TestFieldOrderings_NestedMessage* optional_nested_message);
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(TestFieldOrderings)
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestFieldOrderings)
private:
inline void set_has_my_string();
inline void clear_has_my_string();
inline void set_has_my_int();
inline void clear_has_my_int();
inline void set_has_my_float();
inline void clear_has_my_float();
inline void set_has_optional_nested_message();
inline void clear_has_optional_nested_message();
::google::protobuf::internal::ExtensionSet _extensions_;
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::internal::ArenaStringPtr my_string_;
::google::protobuf::int64 my_int_;
::protobuf_unittest::TestFieldOrderings_NestedMessage* optional_nested_message_;
float my_float_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestFieldOrderings* default_instance_;
};
// -------------------------------------------------------------------
class TestExtremeDefaultValues : public ::google::protobuf::Message {
public:
TestExtremeDefaultValues();
virtual ~TestExtremeDefaultValues();
TestExtremeDefaultValues(const TestExtremeDefaultValues& from);
inline TestExtremeDefaultValues& operator=(const TestExtremeDefaultValues& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestExtremeDefaultValues& default_instance();
void UnsafeArenaSwap(TestExtremeDefaultValues* other);
void Swap(TestExtremeDefaultValues* other);
// implements Message ----------------------------------------------
inline TestExtremeDefaultValues* New() const { return New(NULL); }
TestExtremeDefaultValues* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestExtremeDefaultValues& from);
void MergeFrom(const TestExtremeDefaultValues& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestExtremeDefaultValues* other);
protected:
explicit TestExtremeDefaultValues(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional bytes escaped_bytes = 1 [default = "\000\001\007\010\014\n\r\t\013\\\'\"\376"];
bool has_escaped_bytes() const;
void clear_escaped_bytes();
static const int kEscapedBytesFieldNumber = 1;
const ::std::string& escaped_bytes() const;
void set_escaped_bytes(const ::std::string& value);
void set_escaped_bytes(const char* value);
void set_escaped_bytes(const void* value, size_t size);
::std::string* mutable_escaped_bytes();
::std::string* release_escaped_bytes();
void set_allocated_escaped_bytes(::std::string* escaped_bytes);
::std::string* unsafe_arena_release_escaped_bytes();
void unsafe_arena_set_allocated_escaped_bytes(
::std::string* escaped_bytes);
// optional uint32 large_uint32 = 2 [default = 4294967295];
bool has_large_uint32() const;
void clear_large_uint32();
static const int kLargeUint32FieldNumber = 2;
::google::protobuf::uint32 large_uint32() const;
void set_large_uint32(::google::protobuf::uint32 value);
// optional uint64 large_uint64 = 3 [default = 18446744073709551615];
bool has_large_uint64() const;
void clear_large_uint64();
static const int kLargeUint64FieldNumber = 3;
::google::protobuf::uint64 large_uint64() const;
void set_large_uint64(::google::protobuf::uint64 value);
// optional int32 small_int32 = 4 [default = -2147483647];
bool has_small_int32() const;
void clear_small_int32();
static const int kSmallInt32FieldNumber = 4;
::google::protobuf::int32 small_int32() const;
void set_small_int32(::google::protobuf::int32 value);
// optional int64 small_int64 = 5 [default = -9223372036854775807];
bool has_small_int64() const;
void clear_small_int64();
static const int kSmallInt64FieldNumber = 5;
::google::protobuf::int64 small_int64() const;
void set_small_int64(::google::protobuf::int64 value);
// optional int32 really_small_int32 = 21 [default = -2147483648];
bool has_really_small_int32() const;
void clear_really_small_int32();
static const int kReallySmallInt32FieldNumber = 21;
::google::protobuf::int32 really_small_int32() const;
void set_really_small_int32(::google::protobuf::int32 value);
// optional int64 really_small_int64 = 22 [default = -9223372036854775808];
bool has_really_small_int64() const;
void clear_really_small_int64();
static const int kReallySmallInt64FieldNumber = 22;
::google::protobuf::int64 really_small_int64() const;
void set_really_small_int64(::google::protobuf::int64 value);
// optional string utf8_string = 6 [default = "\341\210\264"];
bool has_utf8_string() const;
void clear_utf8_string();
static const int kUtf8StringFieldNumber = 6;
const ::std::string& utf8_string() const;
void set_utf8_string(const ::std::string& value);
void set_utf8_string(const char* value);
void set_utf8_string(const char* value, size_t size);
::std::string* mutable_utf8_string();
::std::string* release_utf8_string();
void set_allocated_utf8_string(::std::string* utf8_string);
::std::string* unsafe_arena_release_utf8_string();
void unsafe_arena_set_allocated_utf8_string(
::std::string* utf8_string);
// optional float zero_float = 7 [default = 0];
bool has_zero_float() const;
void clear_zero_float();
static const int kZeroFloatFieldNumber = 7;
float zero_float() const;
void set_zero_float(float value);
// optional float one_float = 8 [default = 1];
bool has_one_float() const;
void clear_one_float();
static const int kOneFloatFieldNumber = 8;
float one_float() const;
void set_one_float(float value);
// optional float small_float = 9 [default = 1.5];
bool has_small_float() const;
void clear_small_float();
static const int kSmallFloatFieldNumber = 9;
float small_float() const;
void set_small_float(float value);
// optional float negative_one_float = 10 [default = -1];
bool has_negative_one_float() const;
void clear_negative_one_float();
static const int kNegativeOneFloatFieldNumber = 10;
float negative_one_float() const;
void set_negative_one_float(float value);
// optional float negative_float = 11 [default = -1.5];
bool has_negative_float() const;
void clear_negative_float();
static const int kNegativeFloatFieldNumber = 11;
float negative_float() const;
void set_negative_float(float value);
// optional float large_float = 12 [default = 2e+08];
bool has_large_float() const;
void clear_large_float();
static const int kLargeFloatFieldNumber = 12;
float large_float() const;
void set_large_float(float value);
// optional float small_negative_float = 13 [default = -8e-28];
bool has_small_negative_float() const;
void clear_small_negative_float();
static const int kSmallNegativeFloatFieldNumber = 13;
float small_negative_float() const;
void set_small_negative_float(float value);
// optional double inf_double = 14 [default = inf];
bool has_inf_double() const;
void clear_inf_double();
static const int kInfDoubleFieldNumber = 14;
double inf_double() const;
void set_inf_double(double value);
// optional double neg_inf_double = 15 [default = -inf];
bool has_neg_inf_double() const;
void clear_neg_inf_double();
static const int kNegInfDoubleFieldNumber = 15;
double neg_inf_double() const;
void set_neg_inf_double(double value);
// optional double nan_double = 16 [default = nan];
bool has_nan_double() const;
void clear_nan_double();
static const int kNanDoubleFieldNumber = 16;
double nan_double() const;
void set_nan_double(double value);
// optional float inf_float = 17 [default = inf];
bool has_inf_float() const;
void clear_inf_float();
static const int kInfFloatFieldNumber = 17;
float inf_float() const;
void set_inf_float(float value);
// optional float neg_inf_float = 18 [default = -inf];
bool has_neg_inf_float() const;
void clear_neg_inf_float();
static const int kNegInfFloatFieldNumber = 18;
float neg_inf_float() const;
void set_neg_inf_float(float value);
// optional float nan_float = 19 [default = nan];
bool has_nan_float() const;
void clear_nan_float();
static const int kNanFloatFieldNumber = 19;
float nan_float() const;
void set_nan_float(float value);
// optional string cpp_trigraph = 20 [default = "? ? ?? ?? ??? ??/ ??-"];
bool has_cpp_trigraph() const;
void clear_cpp_trigraph();
static const int kCppTrigraphFieldNumber = 20;
const ::std::string& cpp_trigraph() const;
void set_cpp_trigraph(const ::std::string& value);
void set_cpp_trigraph(const char* value);
void set_cpp_trigraph(const char* value, size_t size);
::std::string* mutable_cpp_trigraph();
::std::string* release_cpp_trigraph();
void set_allocated_cpp_trigraph(::std::string* cpp_trigraph);
::std::string* unsafe_arena_release_cpp_trigraph();
void unsafe_arena_set_allocated_cpp_trigraph(
::std::string* cpp_trigraph);
// optional string string_with_zero = 23 [default = "hel\000lo"];
bool has_string_with_zero() const;
void clear_string_with_zero();
static const int kStringWithZeroFieldNumber = 23;
const ::std::string& string_with_zero() const;
void set_string_with_zero(const ::std::string& value);
void set_string_with_zero(const char* value);
void set_string_with_zero(const char* value, size_t size);
::std::string* mutable_string_with_zero();
::std::string* release_string_with_zero();
void set_allocated_string_with_zero(::std::string* string_with_zero);
::std::string* unsafe_arena_release_string_with_zero();
void unsafe_arena_set_allocated_string_with_zero(
::std::string* string_with_zero);
// optional bytes bytes_with_zero = 24 [default = "wor\000ld"];
bool has_bytes_with_zero() const;
void clear_bytes_with_zero();
static const int kBytesWithZeroFieldNumber = 24;
const ::std::string& bytes_with_zero() const;
void set_bytes_with_zero(const ::std::string& value);
void set_bytes_with_zero(const char* value);
void set_bytes_with_zero(const void* value, size_t size);
::std::string* mutable_bytes_with_zero();
::std::string* release_bytes_with_zero();
void set_allocated_bytes_with_zero(::std::string* bytes_with_zero);
::std::string* unsafe_arena_release_bytes_with_zero();
void unsafe_arena_set_allocated_bytes_with_zero(
::std::string* bytes_with_zero);
// optional string string_piece_with_zero = 25 [default = "ab\000c", ctype = STRING_PIECE];
bool has_string_piece_with_zero() const;
void clear_string_piece_with_zero();
static const int kStringPieceWithZeroFieldNumber = 25;
private:
// Hidden due to unknown ctype option.
const ::std::string& string_piece_with_zero() const;
void set_string_piece_with_zero(const ::std::string& value);
void set_string_piece_with_zero(const char* value);
void set_string_piece_with_zero(const char* value, size_t size);
::std::string* mutable_string_piece_with_zero();
::std::string* release_string_piece_with_zero();
void set_allocated_string_piece_with_zero(::std::string* string_piece_with_zero);
::std::string* unsafe_arena_release_string_piece_with_zero();
void unsafe_arena_set_allocated_string_piece_with_zero(
::std::string* string_piece_with_zero);
public:
// optional string cord_with_zero = 26 [default = "12\0003", ctype = CORD];
bool has_cord_with_zero() const;
void clear_cord_with_zero();
static const int kCordWithZeroFieldNumber = 26;
private:
// Hidden due to unknown ctype option.
const ::std::string& cord_with_zero() const;
void set_cord_with_zero(const ::std::string& value);
void set_cord_with_zero(const char* value);
void set_cord_with_zero(const char* value, size_t size);
::std::string* mutable_cord_with_zero();
::std::string* release_cord_with_zero();
void set_allocated_cord_with_zero(::std::string* cord_with_zero);
::std::string* unsafe_arena_release_cord_with_zero();
void unsafe_arena_set_allocated_cord_with_zero(
::std::string* cord_with_zero);
public:
// optional string replacement_string = 27 [default = "${unknown}"];
bool has_replacement_string() const;
void clear_replacement_string();
static const int kReplacementStringFieldNumber = 27;
const ::std::string& replacement_string() const;
void set_replacement_string(const ::std::string& value);
void set_replacement_string(const char* value);
void set_replacement_string(const char* value, size_t size);
::std::string* mutable_replacement_string();
::std::string* release_replacement_string();
void set_allocated_replacement_string(::std::string* replacement_string);
::std::string* unsafe_arena_release_replacement_string();
void unsafe_arena_set_allocated_replacement_string(
::std::string* replacement_string);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestExtremeDefaultValues)
private:
inline void set_has_escaped_bytes();
inline void clear_has_escaped_bytes();
inline void set_has_large_uint32();
inline void clear_has_large_uint32();
inline void set_has_large_uint64();
inline void clear_has_large_uint64();
inline void set_has_small_int32();
inline void clear_has_small_int32();
inline void set_has_small_int64();
inline void clear_has_small_int64();
inline void set_has_really_small_int32();
inline void clear_has_really_small_int32();
inline void set_has_really_small_int64();
inline void clear_has_really_small_int64();
inline void set_has_utf8_string();
inline void clear_has_utf8_string();
inline void set_has_zero_float();
inline void clear_has_zero_float();
inline void set_has_one_float();
inline void clear_has_one_float();
inline void set_has_small_float();
inline void clear_has_small_float();
inline void set_has_negative_one_float();
inline void clear_has_negative_one_float();
inline void set_has_negative_float();
inline void clear_has_negative_float();
inline void set_has_large_float();
inline void clear_has_large_float();
inline void set_has_small_negative_float();
inline void clear_has_small_negative_float();
inline void set_has_inf_double();
inline void clear_has_inf_double();
inline void set_has_neg_inf_double();
inline void clear_has_neg_inf_double();
inline void set_has_nan_double();
inline void clear_has_nan_double();
inline void set_has_inf_float();
inline void clear_has_inf_float();
inline void set_has_neg_inf_float();
inline void clear_has_neg_inf_float();
inline void set_has_nan_float();
inline void clear_has_nan_float();
inline void set_has_cpp_trigraph();
inline void clear_has_cpp_trigraph();
inline void set_has_string_with_zero();
inline void clear_has_string_with_zero();
inline void set_has_bytes_with_zero();
inline void clear_has_bytes_with_zero();
inline void set_has_string_piece_with_zero();
inline void clear_has_string_piece_with_zero();
inline void set_has_cord_with_zero();
inline void clear_has_cord_with_zero();
inline void set_has_replacement_string();
inline void clear_has_replacement_string();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
static ::std::string* _default_escaped_bytes_;
::google::protobuf::internal::ArenaStringPtr escaped_bytes_;
::google::protobuf::uint64 large_uint64_;
::google::protobuf::uint32 large_uint32_;
::google::protobuf::int32 small_int32_;
::google::protobuf::int64 small_int64_;
::google::protobuf::int64 really_small_int64_;
::google::protobuf::int32 really_small_int32_;
float zero_float_;
static ::std::string* _default_utf8_string_;
::google::protobuf::internal::ArenaStringPtr utf8_string_;
float one_float_;
float small_float_;
float negative_one_float_;
float negative_float_;
float large_float_;
float small_negative_float_;
double inf_double_;
double neg_inf_double_;
double nan_double_;
float inf_float_;
float neg_inf_float_;
static ::std::string* _default_cpp_trigraph_;
::google::protobuf::internal::ArenaStringPtr cpp_trigraph_;
static ::std::string* _default_string_with_zero_;
::google::protobuf::internal::ArenaStringPtr string_with_zero_;
static ::std::string* _default_bytes_with_zero_;
::google::protobuf::internal::ArenaStringPtr bytes_with_zero_;
static ::std::string* _default_string_piece_with_zero_;
::google::protobuf::internal::ArenaStringPtr string_piece_with_zero_;
static ::std::string* _default_cord_with_zero_;
::google::protobuf::internal::ArenaStringPtr cord_with_zero_;
static ::std::string* _default_replacement_string_;
::google::protobuf::internal::ArenaStringPtr replacement_string_;
float nan_float_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestExtremeDefaultValues* default_instance_;
};
// -------------------------------------------------------------------
class SparseEnumMessage : public ::google::protobuf::Message {
public:
SparseEnumMessage();
virtual ~SparseEnumMessage();
SparseEnumMessage(const SparseEnumMessage& from);
inline SparseEnumMessage& operator=(const SparseEnumMessage& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const SparseEnumMessage& default_instance();
void UnsafeArenaSwap(SparseEnumMessage* other);
void Swap(SparseEnumMessage* other);
// implements Message ----------------------------------------------
inline SparseEnumMessage* New() const { return New(NULL); }
SparseEnumMessage* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const SparseEnumMessage& from);
void MergeFrom(const SparseEnumMessage& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(SparseEnumMessage* other);
protected:
explicit SparseEnumMessage(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional .protobuf_unittest.TestSparseEnum sparse_enum = 1;
bool has_sparse_enum() const;
void clear_sparse_enum();
static const int kSparseEnumFieldNumber = 1;
::protobuf_unittest::TestSparseEnum sparse_enum() const;
void set_sparse_enum(::protobuf_unittest::TestSparseEnum value);
// @@protoc_insertion_point(class_scope:protobuf_unittest.SparseEnumMessage)
private:
inline void set_has_sparse_enum();
inline void clear_has_sparse_enum();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
int sparse_enum_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static SparseEnumMessage* default_instance_;
};
// -------------------------------------------------------------------
class OneString : public ::google::protobuf::Message {
public:
OneString();
virtual ~OneString();
OneString(const OneString& from);
inline OneString& operator=(const OneString& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const OneString& default_instance();
void UnsafeArenaSwap(OneString* other);
void Swap(OneString* other);
// implements Message ----------------------------------------------
inline OneString* New() const { return New(NULL); }
OneString* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const OneString& from);
void MergeFrom(const OneString& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(OneString* other);
protected:
explicit OneString(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional string data = 1;
bool has_data() const;
void clear_data();
static const int kDataFieldNumber = 1;
const ::std::string& data() const;
void set_data(const ::std::string& value);
void set_data(const char* value);
void set_data(const char* value, size_t size);
::std::string* mutable_data();
::std::string* release_data();
void set_allocated_data(::std::string* data);
::std::string* unsafe_arena_release_data();
void unsafe_arena_set_allocated_data(
::std::string* data);
// @@protoc_insertion_point(class_scope:protobuf_unittest.OneString)
private:
inline void set_has_data();
inline void clear_has_data();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::internal::ArenaStringPtr data_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static OneString* default_instance_;
};
// -------------------------------------------------------------------
class MoreString : public ::google::protobuf::Message {
public:
MoreString();
virtual ~MoreString();
MoreString(const MoreString& from);
inline MoreString& operator=(const MoreString& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const MoreString& default_instance();
void UnsafeArenaSwap(MoreString* other);
void Swap(MoreString* other);
// implements Message ----------------------------------------------
inline MoreString* New() const { return New(NULL); }
MoreString* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const MoreString& from);
void MergeFrom(const MoreString& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(MoreString* other);
protected:
explicit MoreString(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// repeated string data = 1;
int data_size() const;
void clear_data();
static const int kDataFieldNumber = 1;
const ::std::string& data(int index) const;
::std::string* mutable_data(int index);
void set_data(int index, const ::std::string& value);
void set_data(int index, const char* value);
void set_data(int index, const char* value, size_t size);
::std::string* add_data();
void add_data(const ::std::string& value);
void add_data(const char* value);
void add_data(const char* value, size_t size);
const ::google::protobuf::RepeatedPtrField< ::std::string>& data() const;
::google::protobuf::RepeatedPtrField< ::std::string>* mutable_data();
// @@protoc_insertion_point(class_scope:protobuf_unittest.MoreString)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::RepeatedPtrField< ::std::string> data_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static MoreString* default_instance_;
};
// -------------------------------------------------------------------
class OneBytes : public ::google::protobuf::Message {
public:
OneBytes();
virtual ~OneBytes();
OneBytes(const OneBytes& from);
inline OneBytes& operator=(const OneBytes& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const OneBytes& default_instance();
void UnsafeArenaSwap(OneBytes* other);
void Swap(OneBytes* other);
// implements Message ----------------------------------------------
inline OneBytes* New() const { return New(NULL); }
OneBytes* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const OneBytes& from);
void MergeFrom(const OneBytes& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(OneBytes* other);
protected:
explicit OneBytes(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional bytes data = 1;
bool has_data() const;
void clear_data();
static const int kDataFieldNumber = 1;
const ::std::string& data() const;
void set_data(const ::std::string& value);
void set_data(const char* value);
void set_data(const void* value, size_t size);
::std::string* mutable_data();
::std::string* release_data();
void set_allocated_data(::std::string* data);
::std::string* unsafe_arena_release_data();
void unsafe_arena_set_allocated_data(
::std::string* data);
// @@protoc_insertion_point(class_scope:protobuf_unittest.OneBytes)
private:
inline void set_has_data();
inline void clear_has_data();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::internal::ArenaStringPtr data_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static OneBytes* default_instance_;
};
// -------------------------------------------------------------------
class MoreBytes : public ::google::protobuf::Message {
public:
MoreBytes();
virtual ~MoreBytes();
MoreBytes(const MoreBytes& from);
inline MoreBytes& operator=(const MoreBytes& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const MoreBytes& default_instance();
void UnsafeArenaSwap(MoreBytes* other);
void Swap(MoreBytes* other);
// implements Message ----------------------------------------------
inline MoreBytes* New() const { return New(NULL); }
MoreBytes* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const MoreBytes& from);
void MergeFrom(const MoreBytes& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(MoreBytes* other);
protected:
explicit MoreBytes(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// repeated bytes data = 1;
int data_size() const;
void clear_data();
static const int kDataFieldNumber = 1;
const ::std::string& data(int index) const;
::std::string* mutable_data(int index);
void set_data(int index, const ::std::string& value);
void set_data(int index, const char* value);
void set_data(int index, const void* value, size_t size);
::std::string* add_data();
void add_data(const ::std::string& value);
void add_data(const char* value);
void add_data(const void* value, size_t size);
const ::google::protobuf::RepeatedPtrField< ::std::string>& data() const;
::google::protobuf::RepeatedPtrField< ::std::string>* mutable_data();
// @@protoc_insertion_point(class_scope:protobuf_unittest.MoreBytes)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::RepeatedPtrField< ::std::string> data_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static MoreBytes* default_instance_;
};
// -------------------------------------------------------------------
class Int32Message : public ::google::protobuf::Message {
public:
Int32Message();
virtual ~Int32Message();
Int32Message(const Int32Message& from);
inline Int32Message& operator=(const Int32Message& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const Int32Message& default_instance();
void UnsafeArenaSwap(Int32Message* other);
void Swap(Int32Message* other);
// implements Message ----------------------------------------------
inline Int32Message* New() const { return New(NULL); }
Int32Message* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const Int32Message& from);
void MergeFrom(const Int32Message& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(Int32Message* other);
protected:
explicit Int32Message(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int32 data = 1;
bool has_data() const;
void clear_data();
static const int kDataFieldNumber = 1;
::google::protobuf::int32 data() const;
void set_data(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:protobuf_unittest.Int32Message)
private:
inline void set_has_data();
inline void clear_has_data();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::int32 data_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static Int32Message* default_instance_;
};
// -------------------------------------------------------------------
class Uint32Message : public ::google::protobuf::Message {
public:
Uint32Message();
virtual ~Uint32Message();
Uint32Message(const Uint32Message& from);
inline Uint32Message& operator=(const Uint32Message& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const Uint32Message& default_instance();
void UnsafeArenaSwap(Uint32Message* other);
void Swap(Uint32Message* other);
// implements Message ----------------------------------------------
inline Uint32Message* New() const { return New(NULL); }
Uint32Message* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const Uint32Message& from);
void MergeFrom(const Uint32Message& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(Uint32Message* other);
protected:
explicit Uint32Message(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional uint32 data = 1;
bool has_data() const;
void clear_data();
static const int kDataFieldNumber = 1;
::google::protobuf::uint32 data() const;
void set_data(::google::protobuf::uint32 value);
// @@protoc_insertion_point(class_scope:protobuf_unittest.Uint32Message)
private:
inline void set_has_data();
inline void clear_has_data();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::uint32 data_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static Uint32Message* default_instance_;
};
// -------------------------------------------------------------------
class Int64Message : public ::google::protobuf::Message {
public:
Int64Message();
virtual ~Int64Message();
Int64Message(const Int64Message& from);
inline Int64Message& operator=(const Int64Message& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const Int64Message& default_instance();
void UnsafeArenaSwap(Int64Message* other);
void Swap(Int64Message* other);
// implements Message ----------------------------------------------
inline Int64Message* New() const { return New(NULL); }
Int64Message* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const Int64Message& from);
void MergeFrom(const Int64Message& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(Int64Message* other);
protected:
explicit Int64Message(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int64 data = 1;
bool has_data() const;
void clear_data();
static const int kDataFieldNumber = 1;
::google::protobuf::int64 data() const;
void set_data(::google::protobuf::int64 value);
// @@protoc_insertion_point(class_scope:protobuf_unittest.Int64Message)
private:
inline void set_has_data();
inline void clear_has_data();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::int64 data_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static Int64Message* default_instance_;
};
// -------------------------------------------------------------------
class Uint64Message : public ::google::protobuf::Message {
public:
Uint64Message();
virtual ~Uint64Message();
Uint64Message(const Uint64Message& from);
inline Uint64Message& operator=(const Uint64Message& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const Uint64Message& default_instance();
void UnsafeArenaSwap(Uint64Message* other);
void Swap(Uint64Message* other);
// implements Message ----------------------------------------------
inline Uint64Message* New() const { return New(NULL); }
Uint64Message* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const Uint64Message& from);
void MergeFrom(const Uint64Message& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(Uint64Message* other);
protected:
explicit Uint64Message(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional uint64 data = 1;
bool has_data() const;
void clear_data();
static const int kDataFieldNumber = 1;
::google::protobuf::uint64 data() const;
void set_data(::google::protobuf::uint64 value);
// @@protoc_insertion_point(class_scope:protobuf_unittest.Uint64Message)
private:
inline void set_has_data();
inline void clear_has_data();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::uint64 data_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static Uint64Message* default_instance_;
};
// -------------------------------------------------------------------
class BoolMessage : public ::google::protobuf::Message {
public:
BoolMessage();
virtual ~BoolMessage();
BoolMessage(const BoolMessage& from);
inline BoolMessage& operator=(const BoolMessage& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const BoolMessage& default_instance();
void UnsafeArenaSwap(BoolMessage* other);
void Swap(BoolMessage* other);
// implements Message ----------------------------------------------
inline BoolMessage* New() const { return New(NULL); }
BoolMessage* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const BoolMessage& from);
void MergeFrom(const BoolMessage& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(BoolMessage* other);
protected:
explicit BoolMessage(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional bool data = 1;
bool has_data() const;
void clear_data();
static const int kDataFieldNumber = 1;
bool data() const;
void set_data(bool value);
// @@protoc_insertion_point(class_scope:protobuf_unittest.BoolMessage)
private:
inline void set_has_data();
inline void clear_has_data();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
bool data_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static BoolMessage* default_instance_;
};
// -------------------------------------------------------------------
class TestOneof_FooGroup : public ::google::protobuf::Message {
public:
TestOneof_FooGroup();
virtual ~TestOneof_FooGroup();
TestOneof_FooGroup(const TestOneof_FooGroup& from);
inline TestOneof_FooGroup& operator=(const TestOneof_FooGroup& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestOneof_FooGroup& default_instance();
void UnsafeArenaSwap(TestOneof_FooGroup* other);
void Swap(TestOneof_FooGroup* other);
// implements Message ----------------------------------------------
inline TestOneof_FooGroup* New() const { return New(NULL); }
TestOneof_FooGroup* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestOneof_FooGroup& from);
void MergeFrom(const TestOneof_FooGroup& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestOneof_FooGroup* other);
protected:
explicit TestOneof_FooGroup(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int32 a = 5;
bool has_a() const;
void clear_a();
static const int kAFieldNumber = 5;
::google::protobuf::int32 a() const;
void set_a(::google::protobuf::int32 value);
// optional string b = 6;
bool has_b() const;
void clear_b();
static const int kBFieldNumber = 6;
const ::std::string& b() const;
void set_b(const ::std::string& value);
void set_b(const char* value);
void set_b(const char* value, size_t size);
::std::string* mutable_b();
::std::string* release_b();
void set_allocated_b(::std::string* b);
::std::string* unsafe_arena_release_b();
void unsafe_arena_set_allocated_b(
::std::string* b);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestOneof.FooGroup)
private:
inline void set_has_a();
inline void clear_has_a();
inline void set_has_b();
inline void clear_has_b();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::internal::ArenaStringPtr b_;
::google::protobuf::int32 a_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestOneof_FooGroup* default_instance_;
};
// -------------------------------------------------------------------
class TestOneof : public ::google::protobuf::Message {
public:
TestOneof();
virtual ~TestOneof();
TestOneof(const TestOneof& from);
inline TestOneof& operator=(const TestOneof& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestOneof& default_instance();
enum FooCase {
kFooInt = 1,
kFooString = 2,
kFooMessage = 3,
kFoogroup = 4,
FOO_NOT_SET = 0,
};
void UnsafeArenaSwap(TestOneof* other);
void Swap(TestOneof* other);
// implements Message ----------------------------------------------
inline TestOneof* New() const { return New(NULL); }
TestOneof* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestOneof& from);
void MergeFrom(const TestOneof& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestOneof* other);
protected:
explicit TestOneof(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
typedef TestOneof_FooGroup FooGroup;
// accessors -------------------------------------------------------
// optional int32 foo_int = 1;
bool has_foo_int() const;
void clear_foo_int();
static const int kFooIntFieldNumber = 1;
::google::protobuf::int32 foo_int() const;
void set_foo_int(::google::protobuf::int32 value);
// optional string foo_string = 2;
bool has_foo_string() const;
void clear_foo_string();
static const int kFooStringFieldNumber = 2;
const ::std::string& foo_string() const;
void set_foo_string(const ::std::string& value);
void set_foo_string(const char* value);
void set_foo_string(const char* value, size_t size);
::std::string* mutable_foo_string();
::std::string* release_foo_string();
void set_allocated_foo_string(::std::string* foo_string);
::std::string* unsafe_arena_release_foo_string();
void unsafe_arena_set_allocated_foo_string(
::std::string* foo_string);
// optional .protobuf_unittest.TestAllTypes foo_message = 3;
bool has_foo_message() const;
void clear_foo_message();
static const int kFooMessageFieldNumber = 3;
private:
void _slow_mutable_foo_message();
void _slow_set_allocated_foo_message(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestAllTypes** foo_message);
::protobuf_unittest::TestAllTypes* _slow_release_foo_message();
public:
const ::protobuf_unittest::TestAllTypes& foo_message() const;
::protobuf_unittest::TestAllTypes* mutable_foo_message();
::protobuf_unittest::TestAllTypes* release_foo_message();
void set_allocated_foo_message(::protobuf_unittest::TestAllTypes* foo_message);
::protobuf_unittest::TestAllTypes* unsafe_arena_release_foo_message();
void unsafe_arena_set_allocated_foo_message(
::protobuf_unittest::TestAllTypes* foo_message);
// optional group FooGroup = 4 { ... };
bool has_foogroup() const;
void clear_foogroup();
static const int kFoogroupFieldNumber = 4;
private:
void _slow_mutable_foogroup();
void _slow_set_allocated_foogroup(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestOneof_FooGroup** foogroup);
::protobuf_unittest::TestOneof_FooGroup* _slow_release_foogroup();
public:
const ::protobuf_unittest::TestOneof_FooGroup& foogroup() const;
::protobuf_unittest::TestOneof_FooGroup* mutable_foogroup();
::protobuf_unittest::TestOneof_FooGroup* release_foogroup();
void set_allocated_foogroup(::protobuf_unittest::TestOneof_FooGroup* foogroup);
::protobuf_unittest::TestOneof_FooGroup* unsafe_arena_release_foogroup();
void unsafe_arena_set_allocated_foogroup(
::protobuf_unittest::TestOneof_FooGroup* foogroup);
FooCase foo_case() const;
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestOneof)
private:
inline void set_has_foo_int();
inline void set_has_foo_string();
inline void set_has_foo_message();
inline void set_has_foogroup();
inline bool has_foo() const;
void clear_foo();
inline void clear_has_foo();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
union FooUnion {
FooUnion() {}
::google::protobuf::int32 foo_int_;
::google::protobuf::internal::ArenaStringPtr foo_string_;
::protobuf_unittest::TestAllTypes* foo_message_;
::protobuf_unittest::TestOneof_FooGroup* foogroup_;
} foo_;
::google::protobuf::uint32 _oneof_case_[1];
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestOneof* default_instance_;
};
// -------------------------------------------------------------------
class TestOneofBackwardsCompatible_FooGroup : public ::google::protobuf::Message {
public:
TestOneofBackwardsCompatible_FooGroup();
virtual ~TestOneofBackwardsCompatible_FooGroup();
TestOneofBackwardsCompatible_FooGroup(const TestOneofBackwardsCompatible_FooGroup& from);
inline TestOneofBackwardsCompatible_FooGroup& operator=(const TestOneofBackwardsCompatible_FooGroup& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestOneofBackwardsCompatible_FooGroup& default_instance();
void UnsafeArenaSwap(TestOneofBackwardsCompatible_FooGroup* other);
void Swap(TestOneofBackwardsCompatible_FooGroup* other);
// implements Message ----------------------------------------------
inline TestOneofBackwardsCompatible_FooGroup* New() const { return New(NULL); }
TestOneofBackwardsCompatible_FooGroup* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestOneofBackwardsCompatible_FooGroup& from);
void MergeFrom(const TestOneofBackwardsCompatible_FooGroup& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestOneofBackwardsCompatible_FooGroup* other);
protected:
explicit TestOneofBackwardsCompatible_FooGroup(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int32 a = 5;
bool has_a() const;
void clear_a();
static const int kAFieldNumber = 5;
::google::protobuf::int32 a() const;
void set_a(::google::protobuf::int32 value);
// optional string b = 6;
bool has_b() const;
void clear_b();
static const int kBFieldNumber = 6;
const ::std::string& b() const;
void set_b(const ::std::string& value);
void set_b(const char* value);
void set_b(const char* value, size_t size);
::std::string* mutable_b();
::std::string* release_b();
void set_allocated_b(::std::string* b);
::std::string* unsafe_arena_release_b();
void unsafe_arena_set_allocated_b(
::std::string* b);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestOneofBackwardsCompatible.FooGroup)
private:
inline void set_has_a();
inline void clear_has_a();
inline void set_has_b();
inline void clear_has_b();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::internal::ArenaStringPtr b_;
::google::protobuf::int32 a_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestOneofBackwardsCompatible_FooGroup* default_instance_;
};
// -------------------------------------------------------------------
class TestOneofBackwardsCompatible : public ::google::protobuf::Message {
public:
TestOneofBackwardsCompatible();
virtual ~TestOneofBackwardsCompatible();
TestOneofBackwardsCompatible(const TestOneofBackwardsCompatible& from);
inline TestOneofBackwardsCompatible& operator=(const TestOneofBackwardsCompatible& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestOneofBackwardsCompatible& default_instance();
void UnsafeArenaSwap(TestOneofBackwardsCompatible* other);
void Swap(TestOneofBackwardsCompatible* other);
// implements Message ----------------------------------------------
inline TestOneofBackwardsCompatible* New() const { return New(NULL); }
TestOneofBackwardsCompatible* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestOneofBackwardsCompatible& from);
void MergeFrom(const TestOneofBackwardsCompatible& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestOneofBackwardsCompatible* other);
protected:
explicit TestOneofBackwardsCompatible(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
typedef TestOneofBackwardsCompatible_FooGroup FooGroup;
// accessors -------------------------------------------------------
// optional int32 foo_int = 1;
bool has_foo_int() const;
void clear_foo_int();
static const int kFooIntFieldNumber = 1;
::google::protobuf::int32 foo_int() const;
void set_foo_int(::google::protobuf::int32 value);
// optional string foo_string = 2;
bool has_foo_string() const;
void clear_foo_string();
static const int kFooStringFieldNumber = 2;
const ::std::string& foo_string() const;
void set_foo_string(const ::std::string& value);
void set_foo_string(const char* value);
void set_foo_string(const char* value, size_t size);
::std::string* mutable_foo_string();
::std::string* release_foo_string();
void set_allocated_foo_string(::std::string* foo_string);
::std::string* unsafe_arena_release_foo_string();
void unsafe_arena_set_allocated_foo_string(
::std::string* foo_string);
// optional .protobuf_unittest.TestAllTypes foo_message = 3;
bool has_foo_message() const;
void clear_foo_message();
static const int kFooMessageFieldNumber = 3;
private:
void _slow_mutable_foo_message();
void _slow_set_allocated_foo_message(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestAllTypes** foo_message);
::protobuf_unittest::TestAllTypes* _slow_release_foo_message();
public:
const ::protobuf_unittest::TestAllTypes& foo_message() const;
::protobuf_unittest::TestAllTypes* mutable_foo_message();
::protobuf_unittest::TestAllTypes* release_foo_message();
void set_allocated_foo_message(::protobuf_unittest::TestAllTypes* foo_message);
::protobuf_unittest::TestAllTypes* unsafe_arena_release_foo_message();
void unsafe_arena_set_allocated_foo_message(
::protobuf_unittest::TestAllTypes* foo_message);
// optional group FooGroup = 4 { ... };
bool has_foogroup() const;
void clear_foogroup();
static const int kFoogroupFieldNumber = 4;
private:
void _slow_mutable_foogroup();
void _slow_set_allocated_foogroup(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestOneofBackwardsCompatible_FooGroup** foogroup);
::protobuf_unittest::TestOneofBackwardsCompatible_FooGroup* _slow_release_foogroup();
public:
const ::protobuf_unittest::TestOneofBackwardsCompatible_FooGroup& foogroup() const;
::protobuf_unittest::TestOneofBackwardsCompatible_FooGroup* mutable_foogroup();
::protobuf_unittest::TestOneofBackwardsCompatible_FooGroup* release_foogroup();
void set_allocated_foogroup(::protobuf_unittest::TestOneofBackwardsCompatible_FooGroup* foogroup);
::protobuf_unittest::TestOneofBackwardsCompatible_FooGroup* unsafe_arena_release_foogroup();
void unsafe_arena_set_allocated_foogroup(
::protobuf_unittest::TestOneofBackwardsCompatible_FooGroup* foogroup);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestOneofBackwardsCompatible)
private:
inline void set_has_foo_int();
inline void clear_has_foo_int();
inline void set_has_foo_string();
inline void clear_has_foo_string();
inline void set_has_foo_message();
inline void clear_has_foo_message();
inline void set_has_foogroup();
inline void clear_has_foogroup();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::internal::ArenaStringPtr foo_string_;
::protobuf_unittest::TestAllTypes* foo_message_;
::protobuf_unittest::TestOneofBackwardsCompatible_FooGroup* foogroup_;
::google::protobuf::int32 foo_int_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestOneofBackwardsCompatible* default_instance_;
};
// -------------------------------------------------------------------
class TestOneof2_FooGroup : public ::google::protobuf::Message {
public:
TestOneof2_FooGroup();
virtual ~TestOneof2_FooGroup();
TestOneof2_FooGroup(const TestOneof2_FooGroup& from);
inline TestOneof2_FooGroup& operator=(const TestOneof2_FooGroup& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestOneof2_FooGroup& default_instance();
void UnsafeArenaSwap(TestOneof2_FooGroup* other);
void Swap(TestOneof2_FooGroup* other);
// implements Message ----------------------------------------------
inline TestOneof2_FooGroup* New() const { return New(NULL); }
TestOneof2_FooGroup* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestOneof2_FooGroup& from);
void MergeFrom(const TestOneof2_FooGroup& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestOneof2_FooGroup* other);
protected:
explicit TestOneof2_FooGroup(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int32 a = 9;
bool has_a() const;
void clear_a();
static const int kAFieldNumber = 9;
::google::protobuf::int32 a() const;
void set_a(::google::protobuf::int32 value);
// optional string b = 10;
bool has_b() const;
void clear_b();
static const int kBFieldNumber = 10;
const ::std::string& b() const;
void set_b(const ::std::string& value);
void set_b(const char* value);
void set_b(const char* value, size_t size);
::std::string* mutable_b();
::std::string* release_b();
void set_allocated_b(::std::string* b);
::std::string* unsafe_arena_release_b();
void unsafe_arena_set_allocated_b(
::std::string* b);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestOneof2.FooGroup)
private:
inline void set_has_a();
inline void clear_has_a();
inline void set_has_b();
inline void clear_has_b();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::internal::ArenaStringPtr b_;
::google::protobuf::int32 a_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestOneof2_FooGroup* default_instance_;
};
// -------------------------------------------------------------------
class TestOneof2_NestedMessage : public ::google::protobuf::Message {
public:
TestOneof2_NestedMessage();
virtual ~TestOneof2_NestedMessage();
TestOneof2_NestedMessage(const TestOneof2_NestedMessage& from);
inline TestOneof2_NestedMessage& operator=(const TestOneof2_NestedMessage& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestOneof2_NestedMessage& default_instance();
void UnsafeArenaSwap(TestOneof2_NestedMessage* other);
void Swap(TestOneof2_NestedMessage* other);
// implements Message ----------------------------------------------
inline TestOneof2_NestedMessage* New() const { return New(NULL); }
TestOneof2_NestedMessage* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestOneof2_NestedMessage& from);
void MergeFrom(const TestOneof2_NestedMessage& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestOneof2_NestedMessage* other);
protected:
explicit TestOneof2_NestedMessage(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int64 qux_int = 1;
bool has_qux_int() const;
void clear_qux_int();
static const int kQuxIntFieldNumber = 1;
::google::protobuf::int64 qux_int() const;
void set_qux_int(::google::protobuf::int64 value);
// repeated int32 corge_int = 2;
int corge_int_size() const;
void clear_corge_int();
static const int kCorgeIntFieldNumber = 2;
::google::protobuf::int32 corge_int(int index) const;
void set_corge_int(int index, ::google::protobuf::int32 value);
void add_corge_int(::google::protobuf::int32 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
corge_int() const;
::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
mutable_corge_int();
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestOneof2.NestedMessage)
private:
inline void set_has_qux_int();
inline void clear_has_qux_int();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::int64 qux_int_;
::google::protobuf::RepeatedField< ::google::protobuf::int32 > corge_int_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestOneof2_NestedMessage* default_instance_;
};
// -------------------------------------------------------------------
class TestOneof2 : public ::google::protobuf::Message {
public:
TestOneof2();
virtual ~TestOneof2();
TestOneof2(const TestOneof2& from);
inline TestOneof2& operator=(const TestOneof2& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestOneof2& default_instance();
enum FooCase {
kFooInt = 1,
kFooString = 2,
kFooCord = 3,
kFooStringPiece = 4,
kFooBytes = 5,
kFooEnum = 6,
kFooMessage = 7,
kFoogroup = 8,
kFooLazyMessage = 11,
FOO_NOT_SET = 0,
};
enum BarCase {
kBarInt = 12,
kBarString = 13,
kBarCord = 14,
kBarStringPiece = 15,
kBarBytes = 16,
kBarEnum = 17,
BAR_NOT_SET = 0,
};
void UnsafeArenaSwap(TestOneof2* other);
void Swap(TestOneof2* other);
// implements Message ----------------------------------------------
inline TestOneof2* New() const { return New(NULL); }
TestOneof2* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestOneof2& from);
void MergeFrom(const TestOneof2& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestOneof2* other);
protected:
explicit TestOneof2(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
typedef TestOneof2_FooGroup FooGroup;
typedef TestOneof2_NestedMessage NestedMessage;
typedef TestOneof2_NestedEnum NestedEnum;
static const NestedEnum FOO = TestOneof2_NestedEnum_FOO;
static const NestedEnum BAR = TestOneof2_NestedEnum_BAR;
static const NestedEnum BAZ = TestOneof2_NestedEnum_BAZ;
static inline bool NestedEnum_IsValid(int value) {
return TestOneof2_NestedEnum_IsValid(value);
}
static const NestedEnum NestedEnum_MIN =
TestOneof2_NestedEnum_NestedEnum_MIN;
static const NestedEnum NestedEnum_MAX =
TestOneof2_NestedEnum_NestedEnum_MAX;
static const int NestedEnum_ARRAYSIZE =
TestOneof2_NestedEnum_NestedEnum_ARRAYSIZE;
static inline const ::google::protobuf::EnumDescriptor*
NestedEnum_descriptor() {
return TestOneof2_NestedEnum_descriptor();
}
static inline const ::std::string& NestedEnum_Name(NestedEnum value) {
return TestOneof2_NestedEnum_Name(value);
}
static inline bool NestedEnum_Parse(const ::std::string& name,
NestedEnum* value) {
return TestOneof2_NestedEnum_Parse(name, value);
}
// accessors -------------------------------------------------------
// optional int32 foo_int = 1;
bool has_foo_int() const;
void clear_foo_int();
static const int kFooIntFieldNumber = 1;
::google::protobuf::int32 foo_int() const;
void set_foo_int(::google::protobuf::int32 value);
// optional string foo_string = 2;
bool has_foo_string() const;
void clear_foo_string();
static const int kFooStringFieldNumber = 2;
const ::std::string& foo_string() const;
void set_foo_string(const ::std::string& value);
void set_foo_string(const char* value);
void set_foo_string(const char* value, size_t size);
::std::string* mutable_foo_string();
::std::string* release_foo_string();
void set_allocated_foo_string(::std::string* foo_string);
::std::string* unsafe_arena_release_foo_string();
void unsafe_arena_set_allocated_foo_string(
::std::string* foo_string);
// optional string foo_cord = 3 [ctype = CORD];
bool has_foo_cord() const;
void clear_foo_cord();
static const int kFooCordFieldNumber = 3;
private:
// Hidden due to unknown ctype option.
const ::std::string& foo_cord() const;
void set_foo_cord(const ::std::string& value);
void set_foo_cord(const char* value);
void set_foo_cord(const char* value, size_t size);
::std::string* mutable_foo_cord();
::std::string* release_foo_cord();
void set_allocated_foo_cord(::std::string* foo_cord);
::std::string* unsafe_arena_release_foo_cord();
void unsafe_arena_set_allocated_foo_cord(
::std::string* foo_cord);
public:
// optional string foo_string_piece = 4 [ctype = STRING_PIECE];
bool has_foo_string_piece() const;
void clear_foo_string_piece();
static const int kFooStringPieceFieldNumber = 4;
private:
// Hidden due to unknown ctype option.
const ::std::string& foo_string_piece() const;
void set_foo_string_piece(const ::std::string& value);
void set_foo_string_piece(const char* value);
void set_foo_string_piece(const char* value, size_t size);
::std::string* mutable_foo_string_piece();
::std::string* release_foo_string_piece();
void set_allocated_foo_string_piece(::std::string* foo_string_piece);
::std::string* unsafe_arena_release_foo_string_piece();
void unsafe_arena_set_allocated_foo_string_piece(
::std::string* foo_string_piece);
public:
// optional bytes foo_bytes = 5;
bool has_foo_bytes() const;
void clear_foo_bytes();
static const int kFooBytesFieldNumber = 5;
const ::std::string& foo_bytes() const;
void set_foo_bytes(const ::std::string& value);
void set_foo_bytes(const char* value);
void set_foo_bytes(const void* value, size_t size);
::std::string* mutable_foo_bytes();
::std::string* release_foo_bytes();
void set_allocated_foo_bytes(::std::string* foo_bytes);
::std::string* unsafe_arena_release_foo_bytes();
void unsafe_arena_set_allocated_foo_bytes(
::std::string* foo_bytes);
// optional .protobuf_unittest.TestOneof2.NestedEnum foo_enum = 6;
bool has_foo_enum() const;
void clear_foo_enum();
static const int kFooEnumFieldNumber = 6;
::protobuf_unittest::TestOneof2_NestedEnum foo_enum() const;
void set_foo_enum(::protobuf_unittest::TestOneof2_NestedEnum value);
// optional .protobuf_unittest.TestOneof2.NestedMessage foo_message = 7;
bool has_foo_message() const;
void clear_foo_message();
static const int kFooMessageFieldNumber = 7;
private:
void _slow_mutable_foo_message();
void _slow_set_allocated_foo_message(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestOneof2_NestedMessage** foo_message);
::protobuf_unittest::TestOneof2_NestedMessage* _slow_release_foo_message();
public:
const ::protobuf_unittest::TestOneof2_NestedMessage& foo_message() const;
::protobuf_unittest::TestOneof2_NestedMessage* mutable_foo_message();
::protobuf_unittest::TestOneof2_NestedMessage* release_foo_message();
void set_allocated_foo_message(::protobuf_unittest::TestOneof2_NestedMessage* foo_message);
::protobuf_unittest::TestOneof2_NestedMessage* unsafe_arena_release_foo_message();
void unsafe_arena_set_allocated_foo_message(
::protobuf_unittest::TestOneof2_NestedMessage* foo_message);
// optional group FooGroup = 8 { ... };
bool has_foogroup() const;
void clear_foogroup();
static const int kFoogroupFieldNumber = 8;
private:
void _slow_mutable_foogroup();
void _slow_set_allocated_foogroup(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestOneof2_FooGroup** foogroup);
::protobuf_unittest::TestOneof2_FooGroup* _slow_release_foogroup();
public:
const ::protobuf_unittest::TestOneof2_FooGroup& foogroup() const;
::protobuf_unittest::TestOneof2_FooGroup* mutable_foogroup();
::protobuf_unittest::TestOneof2_FooGroup* release_foogroup();
void set_allocated_foogroup(::protobuf_unittest::TestOneof2_FooGroup* foogroup);
::protobuf_unittest::TestOneof2_FooGroup* unsafe_arena_release_foogroup();
void unsafe_arena_set_allocated_foogroup(
::protobuf_unittest::TestOneof2_FooGroup* foogroup);
// optional .protobuf_unittest.TestOneof2.NestedMessage foo_lazy_message = 11 [lazy = true];
bool has_foo_lazy_message() const;
void clear_foo_lazy_message();
static const int kFooLazyMessageFieldNumber = 11;
private:
void _slow_mutable_foo_lazy_message();
void _slow_set_allocated_foo_lazy_message(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestOneof2_NestedMessage** foo_lazy_message);
::protobuf_unittest::TestOneof2_NestedMessage* _slow_release_foo_lazy_message();
public:
const ::protobuf_unittest::TestOneof2_NestedMessage& foo_lazy_message() const;
::protobuf_unittest::TestOneof2_NestedMessage* mutable_foo_lazy_message();
::protobuf_unittest::TestOneof2_NestedMessage* release_foo_lazy_message();
void set_allocated_foo_lazy_message(::protobuf_unittest::TestOneof2_NestedMessage* foo_lazy_message);
::protobuf_unittest::TestOneof2_NestedMessage* unsafe_arena_release_foo_lazy_message();
void unsafe_arena_set_allocated_foo_lazy_message(
::protobuf_unittest::TestOneof2_NestedMessage* foo_lazy_message);
// optional int32 bar_int = 12 [default = 5];
bool has_bar_int() const;
void clear_bar_int();
static const int kBarIntFieldNumber = 12;
::google::protobuf::int32 bar_int() const;
void set_bar_int(::google::protobuf::int32 value);
// optional string bar_string = 13 [default = "STRING"];
bool has_bar_string() const;
void clear_bar_string();
static const int kBarStringFieldNumber = 13;
const ::std::string& bar_string() const;
void set_bar_string(const ::std::string& value);
void set_bar_string(const char* value);
void set_bar_string(const char* value, size_t size);
::std::string* mutable_bar_string();
::std::string* release_bar_string();
void set_allocated_bar_string(::std::string* bar_string);
::std::string* unsafe_arena_release_bar_string();
void unsafe_arena_set_allocated_bar_string(
::std::string* bar_string);
// optional string bar_cord = 14 [default = "CORD", ctype = CORD];
bool has_bar_cord() const;
void clear_bar_cord();
static const int kBarCordFieldNumber = 14;
private:
// Hidden due to unknown ctype option.
const ::std::string& bar_cord() const;
void set_bar_cord(const ::std::string& value);
void set_bar_cord(const char* value);
void set_bar_cord(const char* value, size_t size);
::std::string* mutable_bar_cord();
::std::string* release_bar_cord();
void set_allocated_bar_cord(::std::string* bar_cord);
::std::string* unsafe_arena_release_bar_cord();
void unsafe_arena_set_allocated_bar_cord(
::std::string* bar_cord);
public:
// optional string bar_string_piece = 15 [default = "SPIECE", ctype = STRING_PIECE];
bool has_bar_string_piece() const;
void clear_bar_string_piece();
static const int kBarStringPieceFieldNumber = 15;
private:
// Hidden due to unknown ctype option.
const ::std::string& bar_string_piece() const;
void set_bar_string_piece(const ::std::string& value);
void set_bar_string_piece(const char* value);
void set_bar_string_piece(const char* value, size_t size);
::std::string* mutable_bar_string_piece();
::std::string* release_bar_string_piece();
void set_allocated_bar_string_piece(::std::string* bar_string_piece);
::std::string* unsafe_arena_release_bar_string_piece();
void unsafe_arena_set_allocated_bar_string_piece(
::std::string* bar_string_piece);
public:
// optional bytes bar_bytes = 16 [default = "BYTES"];
bool has_bar_bytes() const;
void clear_bar_bytes();
static const int kBarBytesFieldNumber = 16;
const ::std::string& bar_bytes() const;
void set_bar_bytes(const ::std::string& value);
void set_bar_bytes(const char* value);
void set_bar_bytes(const void* value, size_t size);
::std::string* mutable_bar_bytes();
::std::string* release_bar_bytes();
void set_allocated_bar_bytes(::std::string* bar_bytes);
::std::string* unsafe_arena_release_bar_bytes();
void unsafe_arena_set_allocated_bar_bytes(
::std::string* bar_bytes);
// optional .protobuf_unittest.TestOneof2.NestedEnum bar_enum = 17 [default = BAR];
bool has_bar_enum() const;
void clear_bar_enum();
static const int kBarEnumFieldNumber = 17;
::protobuf_unittest::TestOneof2_NestedEnum bar_enum() const;
void set_bar_enum(::protobuf_unittest::TestOneof2_NestedEnum value);
// optional int32 baz_int = 18;
bool has_baz_int() const;
void clear_baz_int();
static const int kBazIntFieldNumber = 18;
::google::protobuf::int32 baz_int() const;
void set_baz_int(::google::protobuf::int32 value);
// optional string baz_string = 19 [default = "BAZ"];
bool has_baz_string() const;
void clear_baz_string();
static const int kBazStringFieldNumber = 19;
const ::std::string& baz_string() const;
void set_baz_string(const ::std::string& value);
void set_baz_string(const char* value);
void set_baz_string(const char* value, size_t size);
::std::string* mutable_baz_string();
::std::string* release_baz_string();
void set_allocated_baz_string(::std::string* baz_string);
::std::string* unsafe_arena_release_baz_string();
void unsafe_arena_set_allocated_baz_string(
::std::string* baz_string);
FooCase foo_case() const;
BarCase bar_case() const;
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestOneof2)
private:
inline void set_has_foo_int();
inline void set_has_foo_string();
inline void set_has_foo_cord();
inline void set_has_foo_string_piece();
inline void set_has_foo_bytes();
inline void set_has_foo_enum();
inline void set_has_foo_message();
inline void set_has_foogroup();
inline void set_has_foo_lazy_message();
inline void set_has_bar_int();
inline void set_has_bar_string();
inline void set_has_bar_cord();
inline void set_has_bar_string_piece();
inline void set_has_bar_bytes();
inline void set_has_bar_enum();
inline void set_has_baz_int();
inline void clear_has_baz_int();
inline void set_has_baz_string();
inline void clear_has_baz_string();
inline bool has_foo() const;
void clear_foo();
inline void clear_has_foo();
inline bool has_bar() const;
void clear_bar();
inline void clear_has_bar();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
static ::std::string* _default_baz_string_;
::google::protobuf::internal::ArenaStringPtr baz_string_;
::google::protobuf::int32 baz_int_;
union FooUnion {
FooUnion() {}
::google::protobuf::int32 foo_int_;
::google::protobuf::internal::ArenaStringPtr foo_string_;
::google::protobuf::internal::ArenaStringPtr foo_cord_;
::google::protobuf::internal::ArenaStringPtr foo_string_piece_;
::google::protobuf::internal::ArenaStringPtr foo_bytes_;
int foo_enum_;
::protobuf_unittest::TestOneof2_NestedMessage* foo_message_;
::protobuf_unittest::TestOneof2_FooGroup* foogroup_;
::protobuf_unittest::TestOneof2_NestedMessage* foo_lazy_message_;
} foo_;
union BarUnion {
BarUnion() {}
::google::protobuf::int32 bar_int_;
::google::protobuf::internal::ArenaStringPtr bar_string_;
::google::protobuf::internal::ArenaStringPtr bar_cord_;
::google::protobuf::internal::ArenaStringPtr bar_string_piece_;
::google::protobuf::internal::ArenaStringPtr bar_bytes_;
int bar_enum_;
} bar_;
static ::std::string* _default_bar_string_;
static ::std::string* _default_bar_cord_;
static ::std::string* _default_bar_string_piece_;
static ::std::string* _default_bar_bytes_;
::google::protobuf::uint32 _oneof_case_[2];
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestOneof2* default_instance_;
};
// -------------------------------------------------------------------
class TestRequiredOneof_NestedMessage : public ::google::protobuf::Message {
public:
TestRequiredOneof_NestedMessage();
virtual ~TestRequiredOneof_NestedMessage();
TestRequiredOneof_NestedMessage(const TestRequiredOneof_NestedMessage& from);
inline TestRequiredOneof_NestedMessage& operator=(const TestRequiredOneof_NestedMessage& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestRequiredOneof_NestedMessage& default_instance();
void UnsafeArenaSwap(TestRequiredOneof_NestedMessage* other);
void Swap(TestRequiredOneof_NestedMessage* other);
// implements Message ----------------------------------------------
inline TestRequiredOneof_NestedMessage* New() const { return New(NULL); }
TestRequiredOneof_NestedMessage* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestRequiredOneof_NestedMessage& from);
void MergeFrom(const TestRequiredOneof_NestedMessage& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestRequiredOneof_NestedMessage* other);
protected:
explicit TestRequiredOneof_NestedMessage(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// required double required_double = 1;
bool has_required_double() const;
void clear_required_double();
static const int kRequiredDoubleFieldNumber = 1;
double required_double() const;
void set_required_double(double value);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestRequiredOneof.NestedMessage)
private:
inline void set_has_required_double();
inline void clear_has_required_double();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
double required_double_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestRequiredOneof_NestedMessage* default_instance_;
};
// -------------------------------------------------------------------
class TestRequiredOneof : public ::google::protobuf::Message {
public:
TestRequiredOneof();
virtual ~TestRequiredOneof();
TestRequiredOneof(const TestRequiredOneof& from);
inline TestRequiredOneof& operator=(const TestRequiredOneof& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestRequiredOneof& default_instance();
enum FooCase {
kFooInt = 1,
kFooString = 2,
kFooMessage = 3,
FOO_NOT_SET = 0,
};
void UnsafeArenaSwap(TestRequiredOneof* other);
void Swap(TestRequiredOneof* other);
// implements Message ----------------------------------------------
inline TestRequiredOneof* New() const { return New(NULL); }
TestRequiredOneof* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestRequiredOneof& from);
void MergeFrom(const TestRequiredOneof& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestRequiredOneof* other);
protected:
explicit TestRequiredOneof(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
typedef TestRequiredOneof_NestedMessage NestedMessage;
// accessors -------------------------------------------------------
// optional int32 foo_int = 1;
bool has_foo_int() const;
void clear_foo_int();
static const int kFooIntFieldNumber = 1;
::google::protobuf::int32 foo_int() const;
void set_foo_int(::google::protobuf::int32 value);
// optional string foo_string = 2;
bool has_foo_string() const;
void clear_foo_string();
static const int kFooStringFieldNumber = 2;
const ::std::string& foo_string() const;
void set_foo_string(const ::std::string& value);
void set_foo_string(const char* value);
void set_foo_string(const char* value, size_t size);
::std::string* mutable_foo_string();
::std::string* release_foo_string();
void set_allocated_foo_string(::std::string* foo_string);
::std::string* unsafe_arena_release_foo_string();
void unsafe_arena_set_allocated_foo_string(
::std::string* foo_string);
// optional .protobuf_unittest.TestRequiredOneof.NestedMessage foo_message = 3;
bool has_foo_message() const;
void clear_foo_message();
static const int kFooMessageFieldNumber = 3;
private:
void _slow_mutable_foo_message();
void _slow_set_allocated_foo_message(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestRequiredOneof_NestedMessage** foo_message);
::protobuf_unittest::TestRequiredOneof_NestedMessage* _slow_release_foo_message();
public:
const ::protobuf_unittest::TestRequiredOneof_NestedMessage& foo_message() const;
::protobuf_unittest::TestRequiredOneof_NestedMessage* mutable_foo_message();
::protobuf_unittest::TestRequiredOneof_NestedMessage* release_foo_message();
void set_allocated_foo_message(::protobuf_unittest::TestRequiredOneof_NestedMessage* foo_message);
::protobuf_unittest::TestRequiredOneof_NestedMessage* unsafe_arena_release_foo_message();
void unsafe_arena_set_allocated_foo_message(
::protobuf_unittest::TestRequiredOneof_NestedMessage* foo_message);
FooCase foo_case() const;
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestRequiredOneof)
private:
inline void set_has_foo_int();
inline void set_has_foo_string();
inline void set_has_foo_message();
inline bool has_foo() const;
void clear_foo();
inline void clear_has_foo();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
union FooUnion {
FooUnion() {}
::google::protobuf::int32 foo_int_;
::google::protobuf::internal::ArenaStringPtr foo_string_;
::protobuf_unittest::TestRequiredOneof_NestedMessage* foo_message_;
} foo_;
::google::protobuf::uint32 _oneof_case_[1];
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestRequiredOneof* default_instance_;
};
// -------------------------------------------------------------------
class TestPackedTypes : public ::google::protobuf::Message {
public:
TestPackedTypes();
virtual ~TestPackedTypes();
TestPackedTypes(const TestPackedTypes& from);
inline TestPackedTypes& operator=(const TestPackedTypes& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestPackedTypes& default_instance();
void UnsafeArenaSwap(TestPackedTypes* other);
void Swap(TestPackedTypes* other);
// implements Message ----------------------------------------------
inline TestPackedTypes* New() const { return New(NULL); }
TestPackedTypes* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestPackedTypes& from);
void MergeFrom(const TestPackedTypes& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestPackedTypes* other);
protected:
explicit TestPackedTypes(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// repeated int32 packed_int32 = 90 [packed = true];
int packed_int32_size() const;
void clear_packed_int32();
static const int kPackedInt32FieldNumber = 90;
::google::protobuf::int32 packed_int32(int index) const;
void set_packed_int32(int index, ::google::protobuf::int32 value);
void add_packed_int32(::google::protobuf::int32 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
packed_int32() const;
::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
mutable_packed_int32();
// repeated int64 packed_int64 = 91 [packed = true];
int packed_int64_size() const;
void clear_packed_int64();
static const int kPackedInt64FieldNumber = 91;
::google::protobuf::int64 packed_int64(int index) const;
void set_packed_int64(int index, ::google::protobuf::int64 value);
void add_packed_int64(::google::protobuf::int64 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
packed_int64() const;
::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
mutable_packed_int64();
// repeated uint32 packed_uint32 = 92 [packed = true];
int packed_uint32_size() const;
void clear_packed_uint32();
static const int kPackedUint32FieldNumber = 92;
::google::protobuf::uint32 packed_uint32(int index) const;
void set_packed_uint32(int index, ::google::protobuf::uint32 value);
void add_packed_uint32(::google::protobuf::uint32 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
packed_uint32() const;
::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
mutable_packed_uint32();
// repeated uint64 packed_uint64 = 93 [packed = true];
int packed_uint64_size() const;
void clear_packed_uint64();
static const int kPackedUint64FieldNumber = 93;
::google::protobuf::uint64 packed_uint64(int index) const;
void set_packed_uint64(int index, ::google::protobuf::uint64 value);
void add_packed_uint64(::google::protobuf::uint64 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
packed_uint64() const;
::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
mutable_packed_uint64();
// repeated sint32 packed_sint32 = 94 [packed = true];
int packed_sint32_size() const;
void clear_packed_sint32();
static const int kPackedSint32FieldNumber = 94;
::google::protobuf::int32 packed_sint32(int index) const;
void set_packed_sint32(int index, ::google::protobuf::int32 value);
void add_packed_sint32(::google::protobuf::int32 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
packed_sint32() const;
::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
mutable_packed_sint32();
// repeated sint64 packed_sint64 = 95 [packed = true];
int packed_sint64_size() const;
void clear_packed_sint64();
static const int kPackedSint64FieldNumber = 95;
::google::protobuf::int64 packed_sint64(int index) const;
void set_packed_sint64(int index, ::google::protobuf::int64 value);
void add_packed_sint64(::google::protobuf::int64 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
packed_sint64() const;
::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
mutable_packed_sint64();
// repeated fixed32 packed_fixed32 = 96 [packed = true];
int packed_fixed32_size() const;
void clear_packed_fixed32();
static const int kPackedFixed32FieldNumber = 96;
::google::protobuf::uint32 packed_fixed32(int index) const;
void set_packed_fixed32(int index, ::google::protobuf::uint32 value);
void add_packed_fixed32(::google::protobuf::uint32 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
packed_fixed32() const;
::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
mutable_packed_fixed32();
// repeated fixed64 packed_fixed64 = 97 [packed = true];
int packed_fixed64_size() const;
void clear_packed_fixed64();
static const int kPackedFixed64FieldNumber = 97;
::google::protobuf::uint64 packed_fixed64(int index) const;
void set_packed_fixed64(int index, ::google::protobuf::uint64 value);
void add_packed_fixed64(::google::protobuf::uint64 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
packed_fixed64() const;
::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
mutable_packed_fixed64();
// repeated sfixed32 packed_sfixed32 = 98 [packed = true];
int packed_sfixed32_size() const;
void clear_packed_sfixed32();
static const int kPackedSfixed32FieldNumber = 98;
::google::protobuf::int32 packed_sfixed32(int index) const;
void set_packed_sfixed32(int index, ::google::protobuf::int32 value);
void add_packed_sfixed32(::google::protobuf::int32 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
packed_sfixed32() const;
::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
mutable_packed_sfixed32();
// repeated sfixed64 packed_sfixed64 = 99 [packed = true];
int packed_sfixed64_size() const;
void clear_packed_sfixed64();
static const int kPackedSfixed64FieldNumber = 99;
::google::protobuf::int64 packed_sfixed64(int index) const;
void set_packed_sfixed64(int index, ::google::protobuf::int64 value);
void add_packed_sfixed64(::google::protobuf::int64 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
packed_sfixed64() const;
::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
mutable_packed_sfixed64();
// repeated float packed_float = 100 [packed = true];
int packed_float_size() const;
void clear_packed_float();
static const int kPackedFloatFieldNumber = 100;
float packed_float(int index) const;
void set_packed_float(int index, float value);
void add_packed_float(float value);
const ::google::protobuf::RepeatedField< float >&
packed_float() const;
::google::protobuf::RepeatedField< float >*
mutable_packed_float();
// repeated double packed_double = 101 [packed = true];
int packed_double_size() const;
void clear_packed_double();
static const int kPackedDoubleFieldNumber = 101;
double packed_double(int index) const;
void set_packed_double(int index, double value);
void add_packed_double(double value);
const ::google::protobuf::RepeatedField< double >&
packed_double() const;
::google::protobuf::RepeatedField< double >*
mutable_packed_double();
// repeated bool packed_bool = 102 [packed = true];
int packed_bool_size() const;
void clear_packed_bool();
static const int kPackedBoolFieldNumber = 102;
bool packed_bool(int index) const;
void set_packed_bool(int index, bool value);
void add_packed_bool(bool value);
const ::google::protobuf::RepeatedField< bool >&
packed_bool() const;
::google::protobuf::RepeatedField< bool >*
mutable_packed_bool();
// repeated .protobuf_unittest.ForeignEnum packed_enum = 103 [packed = true];
int packed_enum_size() const;
void clear_packed_enum();
static const int kPackedEnumFieldNumber = 103;
::protobuf_unittest::ForeignEnum packed_enum(int index) const;
void set_packed_enum(int index, ::protobuf_unittest::ForeignEnum value);
void add_packed_enum(::protobuf_unittest::ForeignEnum value);
const ::google::protobuf::RepeatedField<int>& packed_enum() const;
::google::protobuf::RepeatedField<int>* mutable_packed_enum();
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestPackedTypes)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::RepeatedField< ::google::protobuf::int32 > packed_int32_;
mutable int _packed_int32_cached_byte_size_;
::google::protobuf::RepeatedField< ::google::protobuf::int64 > packed_int64_;
mutable int _packed_int64_cached_byte_size_;
::google::protobuf::RepeatedField< ::google::protobuf::uint32 > packed_uint32_;
mutable int _packed_uint32_cached_byte_size_;
::google::protobuf::RepeatedField< ::google::protobuf::uint64 > packed_uint64_;
mutable int _packed_uint64_cached_byte_size_;
::google::protobuf::RepeatedField< ::google::protobuf::int32 > packed_sint32_;
mutable int _packed_sint32_cached_byte_size_;
::google::protobuf::RepeatedField< ::google::protobuf::int64 > packed_sint64_;
mutable int _packed_sint64_cached_byte_size_;
::google::protobuf::RepeatedField< ::google::protobuf::uint32 > packed_fixed32_;
mutable int _packed_fixed32_cached_byte_size_;
::google::protobuf::RepeatedField< ::google::protobuf::uint64 > packed_fixed64_;
mutable int _packed_fixed64_cached_byte_size_;
::google::protobuf::RepeatedField< ::google::protobuf::int32 > packed_sfixed32_;
mutable int _packed_sfixed32_cached_byte_size_;
::google::protobuf::RepeatedField< ::google::protobuf::int64 > packed_sfixed64_;
mutable int _packed_sfixed64_cached_byte_size_;
::google::protobuf::RepeatedField< float > packed_float_;
mutable int _packed_float_cached_byte_size_;
::google::protobuf::RepeatedField< double > packed_double_;
mutable int _packed_double_cached_byte_size_;
::google::protobuf::RepeatedField< bool > packed_bool_;
mutable int _packed_bool_cached_byte_size_;
::google::protobuf::RepeatedField<int> packed_enum_;
mutable int _packed_enum_cached_byte_size_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestPackedTypes* default_instance_;
};
// -------------------------------------------------------------------
class TestUnpackedTypes : public ::google::protobuf::Message {
public:
TestUnpackedTypes();
virtual ~TestUnpackedTypes();
TestUnpackedTypes(const TestUnpackedTypes& from);
inline TestUnpackedTypes& operator=(const TestUnpackedTypes& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestUnpackedTypes& default_instance();
void UnsafeArenaSwap(TestUnpackedTypes* other);
void Swap(TestUnpackedTypes* other);
// implements Message ----------------------------------------------
inline TestUnpackedTypes* New() const { return New(NULL); }
TestUnpackedTypes* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestUnpackedTypes& from);
void MergeFrom(const TestUnpackedTypes& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestUnpackedTypes* other);
protected:
explicit TestUnpackedTypes(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// repeated int32 unpacked_int32 = 90 [packed = false];
int unpacked_int32_size() const;
void clear_unpacked_int32();
static const int kUnpackedInt32FieldNumber = 90;
::google::protobuf::int32 unpacked_int32(int index) const;
void set_unpacked_int32(int index, ::google::protobuf::int32 value);
void add_unpacked_int32(::google::protobuf::int32 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
unpacked_int32() const;
::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
mutable_unpacked_int32();
// repeated int64 unpacked_int64 = 91 [packed = false];
int unpacked_int64_size() const;
void clear_unpacked_int64();
static const int kUnpackedInt64FieldNumber = 91;
::google::protobuf::int64 unpacked_int64(int index) const;
void set_unpacked_int64(int index, ::google::protobuf::int64 value);
void add_unpacked_int64(::google::protobuf::int64 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
unpacked_int64() const;
::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
mutable_unpacked_int64();
// repeated uint32 unpacked_uint32 = 92 [packed = false];
int unpacked_uint32_size() const;
void clear_unpacked_uint32();
static const int kUnpackedUint32FieldNumber = 92;
::google::protobuf::uint32 unpacked_uint32(int index) const;
void set_unpacked_uint32(int index, ::google::protobuf::uint32 value);
void add_unpacked_uint32(::google::protobuf::uint32 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
unpacked_uint32() const;
::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
mutable_unpacked_uint32();
// repeated uint64 unpacked_uint64 = 93 [packed = false];
int unpacked_uint64_size() const;
void clear_unpacked_uint64();
static const int kUnpackedUint64FieldNumber = 93;
::google::protobuf::uint64 unpacked_uint64(int index) const;
void set_unpacked_uint64(int index, ::google::protobuf::uint64 value);
void add_unpacked_uint64(::google::protobuf::uint64 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
unpacked_uint64() const;
::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
mutable_unpacked_uint64();
// repeated sint32 unpacked_sint32 = 94 [packed = false];
int unpacked_sint32_size() const;
void clear_unpacked_sint32();
static const int kUnpackedSint32FieldNumber = 94;
::google::protobuf::int32 unpacked_sint32(int index) const;
void set_unpacked_sint32(int index, ::google::protobuf::int32 value);
void add_unpacked_sint32(::google::protobuf::int32 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
unpacked_sint32() const;
::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
mutable_unpacked_sint32();
// repeated sint64 unpacked_sint64 = 95 [packed = false];
int unpacked_sint64_size() const;
void clear_unpacked_sint64();
static const int kUnpackedSint64FieldNumber = 95;
::google::protobuf::int64 unpacked_sint64(int index) const;
void set_unpacked_sint64(int index, ::google::protobuf::int64 value);
void add_unpacked_sint64(::google::protobuf::int64 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
unpacked_sint64() const;
::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
mutable_unpacked_sint64();
// repeated fixed32 unpacked_fixed32 = 96 [packed = false];
int unpacked_fixed32_size() const;
void clear_unpacked_fixed32();
static const int kUnpackedFixed32FieldNumber = 96;
::google::protobuf::uint32 unpacked_fixed32(int index) const;
void set_unpacked_fixed32(int index, ::google::protobuf::uint32 value);
void add_unpacked_fixed32(::google::protobuf::uint32 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
unpacked_fixed32() const;
::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
mutable_unpacked_fixed32();
// repeated fixed64 unpacked_fixed64 = 97 [packed = false];
int unpacked_fixed64_size() const;
void clear_unpacked_fixed64();
static const int kUnpackedFixed64FieldNumber = 97;
::google::protobuf::uint64 unpacked_fixed64(int index) const;
void set_unpacked_fixed64(int index, ::google::protobuf::uint64 value);
void add_unpacked_fixed64(::google::protobuf::uint64 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
unpacked_fixed64() const;
::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
mutable_unpacked_fixed64();
// repeated sfixed32 unpacked_sfixed32 = 98 [packed = false];
int unpacked_sfixed32_size() const;
void clear_unpacked_sfixed32();
static const int kUnpackedSfixed32FieldNumber = 98;
::google::protobuf::int32 unpacked_sfixed32(int index) const;
void set_unpacked_sfixed32(int index, ::google::protobuf::int32 value);
void add_unpacked_sfixed32(::google::protobuf::int32 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
unpacked_sfixed32() const;
::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
mutable_unpacked_sfixed32();
// repeated sfixed64 unpacked_sfixed64 = 99 [packed = false];
int unpacked_sfixed64_size() const;
void clear_unpacked_sfixed64();
static const int kUnpackedSfixed64FieldNumber = 99;
::google::protobuf::int64 unpacked_sfixed64(int index) const;
void set_unpacked_sfixed64(int index, ::google::protobuf::int64 value);
void add_unpacked_sfixed64(::google::protobuf::int64 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
unpacked_sfixed64() const;
::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
mutable_unpacked_sfixed64();
// repeated float unpacked_float = 100 [packed = false];
int unpacked_float_size() const;
void clear_unpacked_float();
static const int kUnpackedFloatFieldNumber = 100;
float unpacked_float(int index) const;
void set_unpacked_float(int index, float value);
void add_unpacked_float(float value);
const ::google::protobuf::RepeatedField< float >&
unpacked_float() const;
::google::protobuf::RepeatedField< float >*
mutable_unpacked_float();
// repeated double unpacked_double = 101 [packed = false];
int unpacked_double_size() const;
void clear_unpacked_double();
static const int kUnpackedDoubleFieldNumber = 101;
double unpacked_double(int index) const;
void set_unpacked_double(int index, double value);
void add_unpacked_double(double value);
const ::google::protobuf::RepeatedField< double >&
unpacked_double() const;
::google::protobuf::RepeatedField< double >*
mutable_unpacked_double();
// repeated bool unpacked_bool = 102 [packed = false];
int unpacked_bool_size() const;
void clear_unpacked_bool();
static const int kUnpackedBoolFieldNumber = 102;
bool unpacked_bool(int index) const;
void set_unpacked_bool(int index, bool value);
void add_unpacked_bool(bool value);
const ::google::protobuf::RepeatedField< bool >&
unpacked_bool() const;
::google::protobuf::RepeatedField< bool >*
mutable_unpacked_bool();
// repeated .protobuf_unittest.ForeignEnum unpacked_enum = 103 [packed = false];
int unpacked_enum_size() const;
void clear_unpacked_enum();
static const int kUnpackedEnumFieldNumber = 103;
::protobuf_unittest::ForeignEnum unpacked_enum(int index) const;
void set_unpacked_enum(int index, ::protobuf_unittest::ForeignEnum value);
void add_unpacked_enum(::protobuf_unittest::ForeignEnum value);
const ::google::protobuf::RepeatedField<int>& unpacked_enum() const;
::google::protobuf::RepeatedField<int>* mutable_unpacked_enum();
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestUnpackedTypes)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::RepeatedField< ::google::protobuf::int32 > unpacked_int32_;
::google::protobuf::RepeatedField< ::google::protobuf::int64 > unpacked_int64_;
::google::protobuf::RepeatedField< ::google::protobuf::uint32 > unpacked_uint32_;
::google::protobuf::RepeatedField< ::google::protobuf::uint64 > unpacked_uint64_;
::google::protobuf::RepeatedField< ::google::protobuf::int32 > unpacked_sint32_;
::google::protobuf::RepeatedField< ::google::protobuf::int64 > unpacked_sint64_;
::google::protobuf::RepeatedField< ::google::protobuf::uint32 > unpacked_fixed32_;
::google::protobuf::RepeatedField< ::google::protobuf::uint64 > unpacked_fixed64_;
::google::protobuf::RepeatedField< ::google::protobuf::int32 > unpacked_sfixed32_;
::google::protobuf::RepeatedField< ::google::protobuf::int64 > unpacked_sfixed64_;
::google::protobuf::RepeatedField< float > unpacked_float_;
::google::protobuf::RepeatedField< double > unpacked_double_;
::google::protobuf::RepeatedField< bool > unpacked_bool_;
::google::protobuf::RepeatedField<int> unpacked_enum_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestUnpackedTypes* default_instance_;
};
// -------------------------------------------------------------------
class TestPackedExtensions : public ::google::protobuf::Message {
public:
TestPackedExtensions();
virtual ~TestPackedExtensions();
TestPackedExtensions(const TestPackedExtensions& from);
inline TestPackedExtensions& operator=(const TestPackedExtensions& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestPackedExtensions& default_instance();
void UnsafeArenaSwap(TestPackedExtensions* other);
void Swap(TestPackedExtensions* other);
// implements Message ----------------------------------------------
inline TestPackedExtensions* New() const { return New(NULL); }
TestPackedExtensions* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestPackedExtensions& from);
void MergeFrom(const TestPackedExtensions& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestPackedExtensions* other);
protected:
explicit TestPackedExtensions(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(TestPackedExtensions)
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestPackedExtensions)
private:
::google::protobuf::internal::ExtensionSet _extensions_;
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestPackedExtensions* default_instance_;
};
// -------------------------------------------------------------------
class TestUnpackedExtensions : public ::google::protobuf::Message {
public:
TestUnpackedExtensions();
virtual ~TestUnpackedExtensions();
TestUnpackedExtensions(const TestUnpackedExtensions& from);
inline TestUnpackedExtensions& operator=(const TestUnpackedExtensions& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestUnpackedExtensions& default_instance();
void UnsafeArenaSwap(TestUnpackedExtensions* other);
void Swap(TestUnpackedExtensions* other);
// implements Message ----------------------------------------------
inline TestUnpackedExtensions* New() const { return New(NULL); }
TestUnpackedExtensions* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestUnpackedExtensions& from);
void MergeFrom(const TestUnpackedExtensions& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestUnpackedExtensions* other);
protected:
explicit TestUnpackedExtensions(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(TestUnpackedExtensions)
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestUnpackedExtensions)
private:
::google::protobuf::internal::ExtensionSet _extensions_;
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestUnpackedExtensions* default_instance_;
};
// -------------------------------------------------------------------
class TestDynamicExtensions_DynamicMessageType : public ::google::protobuf::Message {
public:
TestDynamicExtensions_DynamicMessageType();
virtual ~TestDynamicExtensions_DynamicMessageType();
TestDynamicExtensions_DynamicMessageType(const TestDynamicExtensions_DynamicMessageType& from);
inline TestDynamicExtensions_DynamicMessageType& operator=(const TestDynamicExtensions_DynamicMessageType& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestDynamicExtensions_DynamicMessageType& default_instance();
void UnsafeArenaSwap(TestDynamicExtensions_DynamicMessageType* other);
void Swap(TestDynamicExtensions_DynamicMessageType* other);
// implements Message ----------------------------------------------
inline TestDynamicExtensions_DynamicMessageType* New() const { return New(NULL); }
TestDynamicExtensions_DynamicMessageType* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestDynamicExtensions_DynamicMessageType& from);
void MergeFrom(const TestDynamicExtensions_DynamicMessageType& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestDynamicExtensions_DynamicMessageType* other);
protected:
explicit TestDynamicExtensions_DynamicMessageType(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int32 dynamic_field = 2100;
bool has_dynamic_field() const;
void clear_dynamic_field();
static const int kDynamicFieldFieldNumber = 2100;
::google::protobuf::int32 dynamic_field() const;
void set_dynamic_field(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestDynamicExtensions.DynamicMessageType)
private:
inline void set_has_dynamic_field();
inline void clear_has_dynamic_field();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::int32 dynamic_field_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestDynamicExtensions_DynamicMessageType* default_instance_;
};
// -------------------------------------------------------------------
class TestDynamicExtensions : public ::google::protobuf::Message {
public:
TestDynamicExtensions();
virtual ~TestDynamicExtensions();
TestDynamicExtensions(const TestDynamicExtensions& from);
inline TestDynamicExtensions& operator=(const TestDynamicExtensions& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestDynamicExtensions& default_instance();
void UnsafeArenaSwap(TestDynamicExtensions* other);
void Swap(TestDynamicExtensions* other);
// implements Message ----------------------------------------------
inline TestDynamicExtensions* New() const { return New(NULL); }
TestDynamicExtensions* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestDynamicExtensions& from);
void MergeFrom(const TestDynamicExtensions& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestDynamicExtensions* other);
protected:
explicit TestDynamicExtensions(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
typedef TestDynamicExtensions_DynamicMessageType DynamicMessageType;
typedef TestDynamicExtensions_DynamicEnumType DynamicEnumType;
static const DynamicEnumType DYNAMIC_FOO = TestDynamicExtensions_DynamicEnumType_DYNAMIC_FOO;
static const DynamicEnumType DYNAMIC_BAR = TestDynamicExtensions_DynamicEnumType_DYNAMIC_BAR;
static const DynamicEnumType DYNAMIC_BAZ = TestDynamicExtensions_DynamicEnumType_DYNAMIC_BAZ;
static inline bool DynamicEnumType_IsValid(int value) {
return TestDynamicExtensions_DynamicEnumType_IsValid(value);
}
static const DynamicEnumType DynamicEnumType_MIN =
TestDynamicExtensions_DynamicEnumType_DynamicEnumType_MIN;
static const DynamicEnumType DynamicEnumType_MAX =
TestDynamicExtensions_DynamicEnumType_DynamicEnumType_MAX;
static const int DynamicEnumType_ARRAYSIZE =
TestDynamicExtensions_DynamicEnumType_DynamicEnumType_ARRAYSIZE;
static inline const ::google::protobuf::EnumDescriptor*
DynamicEnumType_descriptor() {
return TestDynamicExtensions_DynamicEnumType_descriptor();
}
static inline const ::std::string& DynamicEnumType_Name(DynamicEnumType value) {
return TestDynamicExtensions_DynamicEnumType_Name(value);
}
static inline bool DynamicEnumType_Parse(const ::std::string& name,
DynamicEnumType* value) {
return TestDynamicExtensions_DynamicEnumType_Parse(name, value);
}
// accessors -------------------------------------------------------
// optional fixed32 scalar_extension = 2000;
bool has_scalar_extension() const;
void clear_scalar_extension();
static const int kScalarExtensionFieldNumber = 2000;
::google::protobuf::uint32 scalar_extension() const;
void set_scalar_extension(::google::protobuf::uint32 value);
// optional .protobuf_unittest.ForeignEnum enum_extension = 2001;
bool has_enum_extension() const;
void clear_enum_extension();
static const int kEnumExtensionFieldNumber = 2001;
::protobuf_unittest::ForeignEnum enum_extension() const;
void set_enum_extension(::protobuf_unittest::ForeignEnum value);
// optional .protobuf_unittest.TestDynamicExtensions.DynamicEnumType dynamic_enum_extension = 2002;
bool has_dynamic_enum_extension() const;
void clear_dynamic_enum_extension();
static const int kDynamicEnumExtensionFieldNumber = 2002;
::protobuf_unittest::TestDynamicExtensions_DynamicEnumType dynamic_enum_extension() const;
void set_dynamic_enum_extension(::protobuf_unittest::TestDynamicExtensions_DynamicEnumType value);
// optional .protobuf_unittest.ForeignMessage message_extension = 2003;
bool has_message_extension() const;
void clear_message_extension();
static const int kMessageExtensionFieldNumber = 2003;
private:
void _slow_mutable_message_extension();
void _slow_set_allocated_message_extension(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::ForeignMessage** message_extension);
::protobuf_unittest::ForeignMessage* _slow_release_message_extension();
public:
const ::protobuf_unittest::ForeignMessage& message_extension() const;
::protobuf_unittest::ForeignMessage* mutable_message_extension();
::protobuf_unittest::ForeignMessage* release_message_extension();
void set_allocated_message_extension(::protobuf_unittest::ForeignMessage* message_extension);
::protobuf_unittest::ForeignMessage* unsafe_arena_release_message_extension();
void unsafe_arena_set_allocated_message_extension(
::protobuf_unittest::ForeignMessage* message_extension);
// optional .protobuf_unittest.TestDynamicExtensions.DynamicMessageType dynamic_message_extension = 2004;
bool has_dynamic_message_extension() const;
void clear_dynamic_message_extension();
static const int kDynamicMessageExtensionFieldNumber = 2004;
private:
void _slow_mutable_dynamic_message_extension();
void _slow_set_allocated_dynamic_message_extension(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestDynamicExtensions_DynamicMessageType** dynamic_message_extension);
::protobuf_unittest::TestDynamicExtensions_DynamicMessageType* _slow_release_dynamic_message_extension();
public:
const ::protobuf_unittest::TestDynamicExtensions_DynamicMessageType& dynamic_message_extension() const;
::protobuf_unittest::TestDynamicExtensions_DynamicMessageType* mutable_dynamic_message_extension();
::protobuf_unittest::TestDynamicExtensions_DynamicMessageType* release_dynamic_message_extension();
void set_allocated_dynamic_message_extension(::protobuf_unittest::TestDynamicExtensions_DynamicMessageType* dynamic_message_extension);
::protobuf_unittest::TestDynamicExtensions_DynamicMessageType* unsafe_arena_release_dynamic_message_extension();
void unsafe_arena_set_allocated_dynamic_message_extension(
::protobuf_unittest::TestDynamicExtensions_DynamicMessageType* dynamic_message_extension);
// repeated string repeated_extension = 2005;
int repeated_extension_size() const;
void clear_repeated_extension();
static const int kRepeatedExtensionFieldNumber = 2005;
const ::std::string& repeated_extension(int index) const;
::std::string* mutable_repeated_extension(int index);
void set_repeated_extension(int index, const ::std::string& value);
void set_repeated_extension(int index, const char* value);
void set_repeated_extension(int index, const char* value, size_t size);
::std::string* add_repeated_extension();
void add_repeated_extension(const ::std::string& value);
void add_repeated_extension(const char* value);
void add_repeated_extension(const char* value, size_t size);
const ::google::protobuf::RepeatedPtrField< ::std::string>& repeated_extension() const;
::google::protobuf::RepeatedPtrField< ::std::string>* mutable_repeated_extension();
// repeated sint32 packed_extension = 2006 [packed = true];
int packed_extension_size() const;
void clear_packed_extension();
static const int kPackedExtensionFieldNumber = 2006;
::google::protobuf::int32 packed_extension(int index) const;
void set_packed_extension(int index, ::google::protobuf::int32 value);
void add_packed_extension(::google::protobuf::int32 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
packed_extension() const;
::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
mutable_packed_extension();
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestDynamicExtensions)
private:
inline void set_has_scalar_extension();
inline void clear_has_scalar_extension();
inline void set_has_enum_extension();
inline void clear_has_enum_extension();
inline void set_has_dynamic_enum_extension();
inline void clear_has_dynamic_enum_extension();
inline void set_has_message_extension();
inline void clear_has_message_extension();
inline void set_has_dynamic_message_extension();
inline void clear_has_dynamic_message_extension();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::uint32 scalar_extension_;
int enum_extension_;
::protobuf_unittest::ForeignMessage* message_extension_;
::protobuf_unittest::TestDynamicExtensions_DynamicMessageType* dynamic_message_extension_;
::google::protobuf::RepeatedPtrField< ::std::string> repeated_extension_;
::google::protobuf::RepeatedField< ::google::protobuf::int32 > packed_extension_;
mutable int _packed_extension_cached_byte_size_;
int dynamic_enum_extension_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestDynamicExtensions* default_instance_;
};
// -------------------------------------------------------------------
class TestRepeatedScalarDifferentTagSizes : public ::google::protobuf::Message {
public:
TestRepeatedScalarDifferentTagSizes();
virtual ~TestRepeatedScalarDifferentTagSizes();
TestRepeatedScalarDifferentTagSizes(const TestRepeatedScalarDifferentTagSizes& from);
inline TestRepeatedScalarDifferentTagSizes& operator=(const TestRepeatedScalarDifferentTagSizes& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestRepeatedScalarDifferentTagSizes& default_instance();
void UnsafeArenaSwap(TestRepeatedScalarDifferentTagSizes* other);
void Swap(TestRepeatedScalarDifferentTagSizes* other);
// implements Message ----------------------------------------------
inline TestRepeatedScalarDifferentTagSizes* New() const { return New(NULL); }
TestRepeatedScalarDifferentTagSizes* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestRepeatedScalarDifferentTagSizes& from);
void MergeFrom(const TestRepeatedScalarDifferentTagSizes& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestRepeatedScalarDifferentTagSizes* other);
protected:
explicit TestRepeatedScalarDifferentTagSizes(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// repeated fixed32 repeated_fixed32 = 12;
int repeated_fixed32_size() const;
void clear_repeated_fixed32();
static const int kRepeatedFixed32FieldNumber = 12;
::google::protobuf::uint32 repeated_fixed32(int index) const;
void set_repeated_fixed32(int index, ::google::protobuf::uint32 value);
void add_repeated_fixed32(::google::protobuf::uint32 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
repeated_fixed32() const;
::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
mutable_repeated_fixed32();
// repeated int32 repeated_int32 = 13;
int repeated_int32_size() const;
void clear_repeated_int32();
static const int kRepeatedInt32FieldNumber = 13;
::google::protobuf::int32 repeated_int32(int index) const;
void set_repeated_int32(int index, ::google::protobuf::int32 value);
void add_repeated_int32(::google::protobuf::int32 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
repeated_int32() const;
::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
mutable_repeated_int32();
// repeated fixed64 repeated_fixed64 = 2046;
int repeated_fixed64_size() const;
void clear_repeated_fixed64();
static const int kRepeatedFixed64FieldNumber = 2046;
::google::protobuf::uint64 repeated_fixed64(int index) const;
void set_repeated_fixed64(int index, ::google::protobuf::uint64 value);
void add_repeated_fixed64(::google::protobuf::uint64 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
repeated_fixed64() const;
::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
mutable_repeated_fixed64();
// repeated int64 repeated_int64 = 2047;
int repeated_int64_size() const;
void clear_repeated_int64();
static const int kRepeatedInt64FieldNumber = 2047;
::google::protobuf::int64 repeated_int64(int index) const;
void set_repeated_int64(int index, ::google::protobuf::int64 value);
void add_repeated_int64(::google::protobuf::int64 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
repeated_int64() const;
::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
mutable_repeated_int64();
// repeated float repeated_float = 262142;
int repeated_float_size() const;
void clear_repeated_float();
static const int kRepeatedFloatFieldNumber = 262142;
float repeated_float(int index) const;
void set_repeated_float(int index, float value);
void add_repeated_float(float value);
const ::google::protobuf::RepeatedField< float >&
repeated_float() const;
::google::protobuf::RepeatedField< float >*
mutable_repeated_float();
// repeated uint64 repeated_uint64 = 262143;
int repeated_uint64_size() const;
void clear_repeated_uint64();
static const int kRepeatedUint64FieldNumber = 262143;
::google::protobuf::uint64 repeated_uint64(int index) const;
void set_repeated_uint64(int index, ::google::protobuf::uint64 value);
void add_repeated_uint64(::google::protobuf::uint64 value);
const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
repeated_uint64() const;
::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
mutable_repeated_uint64();
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestRepeatedScalarDifferentTagSizes)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::RepeatedField< ::google::protobuf::uint32 > repeated_fixed32_;
::google::protobuf::RepeatedField< ::google::protobuf::int32 > repeated_int32_;
::google::protobuf::RepeatedField< ::google::protobuf::uint64 > repeated_fixed64_;
::google::protobuf::RepeatedField< ::google::protobuf::int64 > repeated_int64_;
::google::protobuf::RepeatedField< float > repeated_float_;
::google::protobuf::RepeatedField< ::google::protobuf::uint64 > repeated_uint64_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestRepeatedScalarDifferentTagSizes* default_instance_;
};
// -------------------------------------------------------------------
class TestParsingMerge_RepeatedFieldsGenerator_Group1 : public ::google::protobuf::Message {
public:
TestParsingMerge_RepeatedFieldsGenerator_Group1();
virtual ~TestParsingMerge_RepeatedFieldsGenerator_Group1();
TestParsingMerge_RepeatedFieldsGenerator_Group1(const TestParsingMerge_RepeatedFieldsGenerator_Group1& from);
inline TestParsingMerge_RepeatedFieldsGenerator_Group1& operator=(const TestParsingMerge_RepeatedFieldsGenerator_Group1& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestParsingMerge_RepeatedFieldsGenerator_Group1& default_instance();
void UnsafeArenaSwap(TestParsingMerge_RepeatedFieldsGenerator_Group1* other);
void Swap(TestParsingMerge_RepeatedFieldsGenerator_Group1* other);
// implements Message ----------------------------------------------
inline TestParsingMerge_RepeatedFieldsGenerator_Group1* New() const { return New(NULL); }
TestParsingMerge_RepeatedFieldsGenerator_Group1* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestParsingMerge_RepeatedFieldsGenerator_Group1& from);
void MergeFrom(const TestParsingMerge_RepeatedFieldsGenerator_Group1& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestParsingMerge_RepeatedFieldsGenerator_Group1* other);
protected:
explicit TestParsingMerge_RepeatedFieldsGenerator_Group1(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional .protobuf_unittest.TestAllTypes field1 = 11;
bool has_field1() const;
void clear_field1();
static const int kField1FieldNumber = 11;
private:
void _slow_mutable_field1();
void _slow_set_allocated_field1(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestAllTypes** field1);
::protobuf_unittest::TestAllTypes* _slow_release_field1();
public:
const ::protobuf_unittest::TestAllTypes& field1() const;
::protobuf_unittest::TestAllTypes* mutable_field1();
::protobuf_unittest::TestAllTypes* release_field1();
void set_allocated_field1(::protobuf_unittest::TestAllTypes* field1);
::protobuf_unittest::TestAllTypes* unsafe_arena_release_field1();
void unsafe_arena_set_allocated_field1(
::protobuf_unittest::TestAllTypes* field1);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.Group1)
private:
inline void set_has_field1();
inline void clear_has_field1();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::protobuf_unittest::TestAllTypes* field1_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestParsingMerge_RepeatedFieldsGenerator_Group1* default_instance_;
};
// -------------------------------------------------------------------
class TestParsingMerge_RepeatedFieldsGenerator_Group2 : public ::google::protobuf::Message {
public:
TestParsingMerge_RepeatedFieldsGenerator_Group2();
virtual ~TestParsingMerge_RepeatedFieldsGenerator_Group2();
TestParsingMerge_RepeatedFieldsGenerator_Group2(const TestParsingMerge_RepeatedFieldsGenerator_Group2& from);
inline TestParsingMerge_RepeatedFieldsGenerator_Group2& operator=(const TestParsingMerge_RepeatedFieldsGenerator_Group2& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestParsingMerge_RepeatedFieldsGenerator_Group2& default_instance();
void UnsafeArenaSwap(TestParsingMerge_RepeatedFieldsGenerator_Group2* other);
void Swap(TestParsingMerge_RepeatedFieldsGenerator_Group2* other);
// implements Message ----------------------------------------------
inline TestParsingMerge_RepeatedFieldsGenerator_Group2* New() const { return New(NULL); }
TestParsingMerge_RepeatedFieldsGenerator_Group2* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestParsingMerge_RepeatedFieldsGenerator_Group2& from);
void MergeFrom(const TestParsingMerge_RepeatedFieldsGenerator_Group2& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestParsingMerge_RepeatedFieldsGenerator_Group2* other);
protected:
explicit TestParsingMerge_RepeatedFieldsGenerator_Group2(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional .protobuf_unittest.TestAllTypes field1 = 21;
bool has_field1() const;
void clear_field1();
static const int kField1FieldNumber = 21;
private:
void _slow_mutable_field1();
void _slow_set_allocated_field1(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestAllTypes** field1);
::protobuf_unittest::TestAllTypes* _slow_release_field1();
public:
const ::protobuf_unittest::TestAllTypes& field1() const;
::protobuf_unittest::TestAllTypes* mutable_field1();
::protobuf_unittest::TestAllTypes* release_field1();
void set_allocated_field1(::protobuf_unittest::TestAllTypes* field1);
::protobuf_unittest::TestAllTypes* unsafe_arena_release_field1();
void unsafe_arena_set_allocated_field1(
::protobuf_unittest::TestAllTypes* field1);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.Group2)
private:
inline void set_has_field1();
inline void clear_has_field1();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::protobuf_unittest::TestAllTypes* field1_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestParsingMerge_RepeatedFieldsGenerator_Group2* default_instance_;
};
// -------------------------------------------------------------------
class TestParsingMerge_RepeatedFieldsGenerator : public ::google::protobuf::Message {
public:
TestParsingMerge_RepeatedFieldsGenerator();
virtual ~TestParsingMerge_RepeatedFieldsGenerator();
TestParsingMerge_RepeatedFieldsGenerator(const TestParsingMerge_RepeatedFieldsGenerator& from);
inline TestParsingMerge_RepeatedFieldsGenerator& operator=(const TestParsingMerge_RepeatedFieldsGenerator& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestParsingMerge_RepeatedFieldsGenerator& default_instance();
void UnsafeArenaSwap(TestParsingMerge_RepeatedFieldsGenerator* other);
void Swap(TestParsingMerge_RepeatedFieldsGenerator* other);
// implements Message ----------------------------------------------
inline TestParsingMerge_RepeatedFieldsGenerator* New() const { return New(NULL); }
TestParsingMerge_RepeatedFieldsGenerator* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestParsingMerge_RepeatedFieldsGenerator& from);
void MergeFrom(const TestParsingMerge_RepeatedFieldsGenerator& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestParsingMerge_RepeatedFieldsGenerator* other);
protected:
explicit TestParsingMerge_RepeatedFieldsGenerator(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
typedef TestParsingMerge_RepeatedFieldsGenerator_Group1 Group1;
typedef TestParsingMerge_RepeatedFieldsGenerator_Group2 Group2;
// accessors -------------------------------------------------------
// repeated .protobuf_unittest.TestAllTypes field1 = 1;
int field1_size() const;
void clear_field1();
static const int kField1FieldNumber = 1;
const ::protobuf_unittest::TestAllTypes& field1(int index) const;
::protobuf_unittest::TestAllTypes* mutable_field1(int index);
::protobuf_unittest::TestAllTypes* add_field1();
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >*
mutable_field1();
const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >&
field1() const;
// repeated .protobuf_unittest.TestAllTypes field2 = 2;
int field2_size() const;
void clear_field2();
static const int kField2FieldNumber = 2;
const ::protobuf_unittest::TestAllTypes& field2(int index) const;
::protobuf_unittest::TestAllTypes* mutable_field2(int index);
::protobuf_unittest::TestAllTypes* add_field2();
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >*
mutable_field2();
const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >&
field2() const;
// repeated .protobuf_unittest.TestAllTypes field3 = 3;
int field3_size() const;
void clear_field3();
static const int kField3FieldNumber = 3;
const ::protobuf_unittest::TestAllTypes& field3(int index) const;
::protobuf_unittest::TestAllTypes* mutable_field3(int index);
::protobuf_unittest::TestAllTypes* add_field3();
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >*
mutable_field3();
const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >&
field3() const;
// repeated group Group1 = 10 { ... };
int group1_size() const;
void clear_group1();
static const int kGroup1FieldNumber = 10;
const ::protobuf_unittest::TestParsingMerge_RepeatedFieldsGenerator_Group1& group1(int index) const;
::protobuf_unittest::TestParsingMerge_RepeatedFieldsGenerator_Group1* mutable_group1(int index);
::protobuf_unittest::TestParsingMerge_RepeatedFieldsGenerator_Group1* add_group1();
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestParsingMerge_RepeatedFieldsGenerator_Group1 >*
mutable_group1();
const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestParsingMerge_RepeatedFieldsGenerator_Group1 >&
group1() const;
// repeated group Group2 = 20 { ... };
int group2_size() const;
void clear_group2();
static const int kGroup2FieldNumber = 20;
const ::protobuf_unittest::TestParsingMerge_RepeatedFieldsGenerator_Group2& group2(int index) const;
::protobuf_unittest::TestParsingMerge_RepeatedFieldsGenerator_Group2* mutable_group2(int index);
::protobuf_unittest::TestParsingMerge_RepeatedFieldsGenerator_Group2* add_group2();
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestParsingMerge_RepeatedFieldsGenerator_Group2 >*
mutable_group2();
const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestParsingMerge_RepeatedFieldsGenerator_Group2 >&
group2() const;
// repeated .protobuf_unittest.TestAllTypes ext1 = 1000;
int ext1_size() const;
void clear_ext1();
static const int kExt1FieldNumber = 1000;
const ::protobuf_unittest::TestAllTypes& ext1(int index) const;
::protobuf_unittest::TestAllTypes* mutable_ext1(int index);
::protobuf_unittest::TestAllTypes* add_ext1();
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >*
mutable_ext1();
const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >&
ext1() const;
// repeated .protobuf_unittest.TestAllTypes ext2 = 1001;
int ext2_size() const;
void clear_ext2();
static const int kExt2FieldNumber = 1001;
const ::protobuf_unittest::TestAllTypes& ext2(int index) const;
::protobuf_unittest::TestAllTypes* mutable_ext2(int index);
::protobuf_unittest::TestAllTypes* add_ext2();
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >*
mutable_ext2();
const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >&
ext2() const;
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes > field1_;
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes > field2_;
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes > field3_;
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestParsingMerge_RepeatedFieldsGenerator_Group1 > group1_;
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestParsingMerge_RepeatedFieldsGenerator_Group2 > group2_;
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes > ext1_;
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes > ext2_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestParsingMerge_RepeatedFieldsGenerator* default_instance_;
};
// -------------------------------------------------------------------
class TestParsingMerge_OptionalGroup : public ::google::protobuf::Message {
public:
TestParsingMerge_OptionalGroup();
virtual ~TestParsingMerge_OptionalGroup();
TestParsingMerge_OptionalGroup(const TestParsingMerge_OptionalGroup& from);
inline TestParsingMerge_OptionalGroup& operator=(const TestParsingMerge_OptionalGroup& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestParsingMerge_OptionalGroup& default_instance();
void UnsafeArenaSwap(TestParsingMerge_OptionalGroup* other);
void Swap(TestParsingMerge_OptionalGroup* other);
// implements Message ----------------------------------------------
inline TestParsingMerge_OptionalGroup* New() const { return New(NULL); }
TestParsingMerge_OptionalGroup* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestParsingMerge_OptionalGroup& from);
void MergeFrom(const TestParsingMerge_OptionalGroup& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestParsingMerge_OptionalGroup* other);
protected:
explicit TestParsingMerge_OptionalGroup(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional .protobuf_unittest.TestAllTypes optional_group_all_types = 11;
bool has_optional_group_all_types() const;
void clear_optional_group_all_types();
static const int kOptionalGroupAllTypesFieldNumber = 11;
private:
void _slow_mutable_optional_group_all_types();
void _slow_set_allocated_optional_group_all_types(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestAllTypes** optional_group_all_types);
::protobuf_unittest::TestAllTypes* _slow_release_optional_group_all_types();
public:
const ::protobuf_unittest::TestAllTypes& optional_group_all_types() const;
::protobuf_unittest::TestAllTypes* mutable_optional_group_all_types();
::protobuf_unittest::TestAllTypes* release_optional_group_all_types();
void set_allocated_optional_group_all_types(::protobuf_unittest::TestAllTypes* optional_group_all_types);
::protobuf_unittest::TestAllTypes* unsafe_arena_release_optional_group_all_types();
void unsafe_arena_set_allocated_optional_group_all_types(
::protobuf_unittest::TestAllTypes* optional_group_all_types);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestParsingMerge.OptionalGroup)
private:
inline void set_has_optional_group_all_types();
inline void clear_has_optional_group_all_types();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::protobuf_unittest::TestAllTypes* optional_group_all_types_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestParsingMerge_OptionalGroup* default_instance_;
};
// -------------------------------------------------------------------
class TestParsingMerge_RepeatedGroup : public ::google::protobuf::Message {
public:
TestParsingMerge_RepeatedGroup();
virtual ~TestParsingMerge_RepeatedGroup();
TestParsingMerge_RepeatedGroup(const TestParsingMerge_RepeatedGroup& from);
inline TestParsingMerge_RepeatedGroup& operator=(const TestParsingMerge_RepeatedGroup& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestParsingMerge_RepeatedGroup& default_instance();
void UnsafeArenaSwap(TestParsingMerge_RepeatedGroup* other);
void Swap(TestParsingMerge_RepeatedGroup* other);
// implements Message ----------------------------------------------
inline TestParsingMerge_RepeatedGroup* New() const { return New(NULL); }
TestParsingMerge_RepeatedGroup* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestParsingMerge_RepeatedGroup& from);
void MergeFrom(const TestParsingMerge_RepeatedGroup& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestParsingMerge_RepeatedGroup* other);
protected:
explicit TestParsingMerge_RepeatedGroup(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional .protobuf_unittest.TestAllTypes repeated_group_all_types = 21;
bool has_repeated_group_all_types() const;
void clear_repeated_group_all_types();
static const int kRepeatedGroupAllTypesFieldNumber = 21;
private:
void _slow_mutable_repeated_group_all_types();
void _slow_set_allocated_repeated_group_all_types(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestAllTypes** repeated_group_all_types);
::protobuf_unittest::TestAllTypes* _slow_release_repeated_group_all_types();
public:
const ::protobuf_unittest::TestAllTypes& repeated_group_all_types() const;
::protobuf_unittest::TestAllTypes* mutable_repeated_group_all_types();
::protobuf_unittest::TestAllTypes* release_repeated_group_all_types();
void set_allocated_repeated_group_all_types(::protobuf_unittest::TestAllTypes* repeated_group_all_types);
::protobuf_unittest::TestAllTypes* unsafe_arena_release_repeated_group_all_types();
void unsafe_arena_set_allocated_repeated_group_all_types(
::protobuf_unittest::TestAllTypes* repeated_group_all_types);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestParsingMerge.RepeatedGroup)
private:
inline void set_has_repeated_group_all_types();
inline void clear_has_repeated_group_all_types();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::protobuf_unittest::TestAllTypes* repeated_group_all_types_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestParsingMerge_RepeatedGroup* default_instance_;
};
// -------------------------------------------------------------------
class TestParsingMerge : public ::google::protobuf::Message {
public:
TestParsingMerge();
virtual ~TestParsingMerge();
TestParsingMerge(const TestParsingMerge& from);
inline TestParsingMerge& operator=(const TestParsingMerge& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestParsingMerge& default_instance();
void UnsafeArenaSwap(TestParsingMerge* other);
void Swap(TestParsingMerge* other);
// implements Message ----------------------------------------------
inline TestParsingMerge* New() const { return New(NULL); }
TestParsingMerge* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestParsingMerge& from);
void MergeFrom(const TestParsingMerge& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestParsingMerge* other);
protected:
explicit TestParsingMerge(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
typedef TestParsingMerge_RepeatedFieldsGenerator RepeatedFieldsGenerator;
typedef TestParsingMerge_OptionalGroup OptionalGroup;
typedef TestParsingMerge_RepeatedGroup RepeatedGroup;
// accessors -------------------------------------------------------
// required .protobuf_unittest.TestAllTypes required_all_types = 1;
bool has_required_all_types() const;
void clear_required_all_types();
static const int kRequiredAllTypesFieldNumber = 1;
private:
void _slow_mutable_required_all_types();
void _slow_set_allocated_required_all_types(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestAllTypes** required_all_types);
::protobuf_unittest::TestAllTypes* _slow_release_required_all_types();
public:
const ::protobuf_unittest::TestAllTypes& required_all_types() const;
::protobuf_unittest::TestAllTypes* mutable_required_all_types();
::protobuf_unittest::TestAllTypes* release_required_all_types();
void set_allocated_required_all_types(::protobuf_unittest::TestAllTypes* required_all_types);
::protobuf_unittest::TestAllTypes* unsafe_arena_release_required_all_types();
void unsafe_arena_set_allocated_required_all_types(
::protobuf_unittest::TestAllTypes* required_all_types);
// optional .protobuf_unittest.TestAllTypes optional_all_types = 2;
bool has_optional_all_types() const;
void clear_optional_all_types();
static const int kOptionalAllTypesFieldNumber = 2;
private:
void _slow_mutable_optional_all_types();
void _slow_set_allocated_optional_all_types(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestAllTypes** optional_all_types);
::protobuf_unittest::TestAllTypes* _slow_release_optional_all_types();
public:
const ::protobuf_unittest::TestAllTypes& optional_all_types() const;
::protobuf_unittest::TestAllTypes* mutable_optional_all_types();
::protobuf_unittest::TestAllTypes* release_optional_all_types();
void set_allocated_optional_all_types(::protobuf_unittest::TestAllTypes* optional_all_types);
::protobuf_unittest::TestAllTypes* unsafe_arena_release_optional_all_types();
void unsafe_arena_set_allocated_optional_all_types(
::protobuf_unittest::TestAllTypes* optional_all_types);
// repeated .protobuf_unittest.TestAllTypes repeated_all_types = 3;
int repeated_all_types_size() const;
void clear_repeated_all_types();
static const int kRepeatedAllTypesFieldNumber = 3;
const ::protobuf_unittest::TestAllTypes& repeated_all_types(int index) const;
::protobuf_unittest::TestAllTypes* mutable_repeated_all_types(int index);
::protobuf_unittest::TestAllTypes* add_repeated_all_types();
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >*
mutable_repeated_all_types();
const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >&
repeated_all_types() const;
// optional group OptionalGroup = 10 { ... };
bool has_optionalgroup() const;
void clear_optionalgroup();
static const int kOptionalgroupFieldNumber = 10;
private:
void _slow_mutable_optionalgroup();
void _slow_set_allocated_optionalgroup(
::google::protobuf::Arena* message_arena, ::protobuf_unittest::TestParsingMerge_OptionalGroup** optionalgroup);
::protobuf_unittest::TestParsingMerge_OptionalGroup* _slow_release_optionalgroup();
public:
const ::protobuf_unittest::TestParsingMerge_OptionalGroup& optionalgroup() const;
::protobuf_unittest::TestParsingMerge_OptionalGroup* mutable_optionalgroup();
::protobuf_unittest::TestParsingMerge_OptionalGroup* release_optionalgroup();
void set_allocated_optionalgroup(::protobuf_unittest::TestParsingMerge_OptionalGroup* optionalgroup);
::protobuf_unittest::TestParsingMerge_OptionalGroup* unsafe_arena_release_optionalgroup();
void unsafe_arena_set_allocated_optionalgroup(
::protobuf_unittest::TestParsingMerge_OptionalGroup* optionalgroup);
// repeated group RepeatedGroup = 20 { ... };
int repeatedgroup_size() const;
void clear_repeatedgroup();
static const int kRepeatedgroupFieldNumber = 20;
const ::protobuf_unittest::TestParsingMerge_RepeatedGroup& repeatedgroup(int index) const;
::protobuf_unittest::TestParsingMerge_RepeatedGroup* mutable_repeatedgroup(int index);
::protobuf_unittest::TestParsingMerge_RepeatedGroup* add_repeatedgroup();
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestParsingMerge_RepeatedGroup >*
mutable_repeatedgroup();
const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestParsingMerge_RepeatedGroup >&
repeatedgroup() const;
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(TestParsingMerge)
static const int kOptionalExtFieldNumber = 1000;
static ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestParsingMerge,
::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::TestAllTypes >, 11, false >
optional_ext;
static const int kRepeatedExtFieldNumber = 1001;
static ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestParsingMerge,
::google::protobuf::internal::RepeatedMessageTypeTraits< ::protobuf_unittest::TestAllTypes >, 11, false >
repeated_ext;
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestParsingMerge)
private:
inline void set_has_required_all_types();
inline void clear_has_required_all_types();
inline void set_has_optional_all_types();
inline void clear_has_optional_all_types();
inline void set_has_optionalgroup();
inline void clear_has_optionalgroup();
::google::protobuf::internal::ExtensionSet _extensions_;
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::protobuf_unittest::TestAllTypes* required_all_types_;
::protobuf_unittest::TestAllTypes* optional_all_types_;
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes > repeated_all_types_;
::protobuf_unittest::TestParsingMerge_OptionalGroup* optionalgroup_;
::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestParsingMerge_RepeatedGroup > repeatedgroup_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestParsingMerge* default_instance_;
};
// -------------------------------------------------------------------
class TestCommentInjectionMessage : public ::google::protobuf::Message {
public:
TestCommentInjectionMessage();
virtual ~TestCommentInjectionMessage();
TestCommentInjectionMessage(const TestCommentInjectionMessage& from);
inline TestCommentInjectionMessage& operator=(const TestCommentInjectionMessage& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const TestCommentInjectionMessage& default_instance();
void UnsafeArenaSwap(TestCommentInjectionMessage* other);
void Swap(TestCommentInjectionMessage* other);
// implements Message ----------------------------------------------
inline TestCommentInjectionMessage* New() const { return New(NULL); }
TestCommentInjectionMessage* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const TestCommentInjectionMessage& from);
void MergeFrom(const TestCommentInjectionMessage& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TestCommentInjectionMessage* other);
protected:
explicit TestCommentInjectionMessage(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional string a = 1 [default = "*/ <- Neither should this."];
bool has_a() const;
void clear_a();
static const int kAFieldNumber = 1;
const ::std::string& a() const;
void set_a(const ::std::string& value);
void set_a(const char* value);
void set_a(const char* value, size_t size);
::std::string* mutable_a();
::std::string* release_a();
void set_allocated_a(::std::string* a);
::std::string* unsafe_arena_release_a();
void unsafe_arena_set_allocated_a(
::std::string* a);
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestCommentInjectionMessage)
private:
inline void set_has_a();
inline void clear_has_a();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
static ::std::string* _default_a_;
::google::protobuf::internal::ArenaStringPtr a_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static TestCommentInjectionMessage* default_instance_;
};
// -------------------------------------------------------------------
class FooRequest : public ::google::protobuf::Message {
public:
FooRequest();
virtual ~FooRequest();
FooRequest(const FooRequest& from);
inline FooRequest& operator=(const FooRequest& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const FooRequest& default_instance();
void UnsafeArenaSwap(FooRequest* other);
void Swap(FooRequest* other);
// implements Message ----------------------------------------------
inline FooRequest* New() const { return New(NULL); }
FooRequest* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const FooRequest& from);
void MergeFrom(const FooRequest& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(FooRequest* other);
protected:
explicit FooRequest(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// @@protoc_insertion_point(class_scope:protobuf_unittest.FooRequest)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static FooRequest* default_instance_;
};
// -------------------------------------------------------------------
class FooResponse : public ::google::protobuf::Message {
public:
FooResponse();
virtual ~FooResponse();
FooResponse(const FooResponse& from);
inline FooResponse& operator=(const FooResponse& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const FooResponse& default_instance();
void UnsafeArenaSwap(FooResponse* other);
void Swap(FooResponse* other);
// implements Message ----------------------------------------------
inline FooResponse* New() const { return New(NULL); }
FooResponse* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const FooResponse& from);
void MergeFrom(const FooResponse& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(FooResponse* other);
protected:
explicit FooResponse(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// @@protoc_insertion_point(class_scope:protobuf_unittest.FooResponse)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static FooResponse* default_instance_;
};
// -------------------------------------------------------------------
class FooClientMessage : public ::google::protobuf::Message {
public:
FooClientMessage();
virtual ~FooClientMessage();
FooClientMessage(const FooClientMessage& from);
inline FooClientMessage& operator=(const FooClientMessage& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const FooClientMessage& default_instance();
void UnsafeArenaSwap(FooClientMessage* other);
void Swap(FooClientMessage* other);
// implements Message ----------------------------------------------
inline FooClientMessage* New() const { return New(NULL); }
FooClientMessage* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const FooClientMessage& from);
void MergeFrom(const FooClientMessage& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(FooClientMessage* other);
protected:
explicit FooClientMessage(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// @@protoc_insertion_point(class_scope:protobuf_unittest.FooClientMessage)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static FooClientMessage* default_instance_;
};
// -------------------------------------------------------------------
class FooServerMessage : public ::google::protobuf::Message {
public:
FooServerMessage();
virtual ~FooServerMessage();
FooServerMessage(const FooServerMessage& from);
inline FooServerMessage& operator=(const FooServerMessage& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const FooServerMessage& default_instance();
void UnsafeArenaSwap(FooServerMessage* other);
void Swap(FooServerMessage* other);
// implements Message ----------------------------------------------
inline FooServerMessage* New() const { return New(NULL); }
FooServerMessage* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const FooServerMessage& from);
void MergeFrom(const FooServerMessage& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(FooServerMessage* other);
protected:
explicit FooServerMessage(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// @@protoc_insertion_point(class_scope:protobuf_unittest.FooServerMessage)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static FooServerMessage* default_instance_;
};
// -------------------------------------------------------------------
class BarRequest : public ::google::protobuf::Message {
public:
BarRequest();
virtual ~BarRequest();
BarRequest(const BarRequest& from);
inline BarRequest& operator=(const BarRequest& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const BarRequest& default_instance();
void UnsafeArenaSwap(BarRequest* other);
void Swap(BarRequest* other);
// implements Message ----------------------------------------------
inline BarRequest* New() const { return New(NULL); }
BarRequest* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const BarRequest& from);
void MergeFrom(const BarRequest& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(BarRequest* other);
protected:
explicit BarRequest(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// @@protoc_insertion_point(class_scope:protobuf_unittest.BarRequest)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static BarRequest* default_instance_;
};
// -------------------------------------------------------------------
class BarResponse : public ::google::protobuf::Message {
public:
BarResponse();
virtual ~BarResponse();
BarResponse(const BarResponse& from);
inline BarResponse& operator=(const BarResponse& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); }
inline void* GetMaybeArenaPointer() const {
return MaybeArenaPtr();
}
static const ::google::protobuf::Descriptor* descriptor();
static const BarResponse& default_instance();
void UnsafeArenaSwap(BarResponse* other);
void Swap(BarResponse* other);
// implements Message ----------------------------------------------
inline BarResponse* New() const { return New(NULL); }
BarResponse* New(::google::protobuf::Arena* arena) const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const BarResponse& from);
void MergeFrom(const BarResponse& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(BarResponse* other);
protected:
explicit BarResponse(::google::protobuf::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return _internal_metadata_.arena();
}
inline void* MaybeArenaPtr() const {
return _internal_metadata_.raw_arena_ptr();
}
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// @@protoc_insertion_point(class_scope:protobuf_unittest.BarResponse)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
friend void protobuf_AddDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_AssignDesc_google_2fprotobuf_2funittest_2eproto();
friend void protobuf_ShutdownFile_google_2fprotobuf_2funittest_2eproto();
void InitAsDefaultInstance();
static BarResponse* default_instance_;
};
// ===================================================================
class TestService_Stub;
class TestService : public ::google::protobuf::Service {
protected:
// This class should be treated as an abstract interface.
inline TestService() {};
public:
virtual ~TestService();
typedef TestService_Stub Stub;
static const ::google::protobuf::ServiceDescriptor* descriptor();
virtual void Foo(::google::protobuf::RpcController* controller,
const ::protobuf_unittest::FooRequest* request,
::protobuf_unittest::FooResponse* response,
::google::protobuf::Closure* done);
virtual void Bar(::google::protobuf::RpcController* controller,
const ::protobuf_unittest::BarRequest* request,
::protobuf_unittest::BarResponse* response,
::google::protobuf::Closure* done);
// implements Service ----------------------------------------------
const ::google::protobuf::ServiceDescriptor* GetDescriptor();
void CallMethod(const ::google::protobuf::MethodDescriptor* method,
::google::protobuf::RpcController* controller,
const ::google::protobuf::Message* request,
::google::protobuf::Message* response,
::google::protobuf::Closure* done);
const ::google::protobuf::Message& GetRequestPrototype(
const ::google::protobuf::MethodDescriptor* method) const;
const ::google::protobuf::Message& GetResponsePrototype(
const ::google::protobuf::MethodDescriptor* method) const;
private:
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TestService);
};
class TestService_Stub : public TestService {
public:
TestService_Stub(::google::protobuf::RpcChannel* channel);
TestService_Stub(::google::protobuf::RpcChannel* channel,
::google::protobuf::Service::ChannelOwnership ownership);
~TestService_Stub();
inline ::google::protobuf::RpcChannel* channel() { return channel_; }
// implements TestService ------------------------------------------
void Foo(::google::protobuf::RpcController* controller,
const ::protobuf_unittest::FooRequest* request,
::protobuf_unittest::FooResponse* response,
::google::protobuf::Closure* done);
void Bar(::google::protobuf::RpcController* controller,
const ::protobuf_unittest::BarRequest* request,
::protobuf_unittest::BarResponse* response,
::google::protobuf::Closure* done);
private:
::google::protobuf::RpcChannel* channel_;
bool owns_channel_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TestService_Stub);
};
// ===================================================================
static const int kOptionalInt32ExtensionFieldNumber = 1;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int32 >, 5, false >
optional_int32_extension;
static const int kOptionalInt64ExtensionFieldNumber = 2;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int64 >, 3, false >
optional_int64_extension;
static const int kOptionalUint32ExtensionFieldNumber = 3;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::uint32 >, 13, false >
optional_uint32_extension;
static const int kOptionalUint64ExtensionFieldNumber = 4;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::uint64 >, 4, false >
optional_uint64_extension;
static const int kOptionalSint32ExtensionFieldNumber = 5;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int32 >, 17, false >
optional_sint32_extension;
static const int kOptionalSint64ExtensionFieldNumber = 6;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int64 >, 18, false >
optional_sint64_extension;
static const int kOptionalFixed32ExtensionFieldNumber = 7;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::uint32 >, 7, false >
optional_fixed32_extension;
static const int kOptionalFixed64ExtensionFieldNumber = 8;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::uint64 >, 6, false >
optional_fixed64_extension;
static const int kOptionalSfixed32ExtensionFieldNumber = 9;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int32 >, 15, false >
optional_sfixed32_extension;
static const int kOptionalSfixed64ExtensionFieldNumber = 10;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int64 >, 16, false >
optional_sfixed64_extension;
static const int kOptionalFloatExtensionFieldNumber = 11;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< float >, 2, false >
optional_float_extension;
static const int kOptionalDoubleExtensionFieldNumber = 12;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< double >, 1, false >
optional_double_extension;
static const int kOptionalBoolExtensionFieldNumber = 13;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< bool >, 8, false >
optional_bool_extension;
static const int kOptionalStringExtensionFieldNumber = 14;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::StringTypeTraits, 9, false >
optional_string_extension;
static const int kOptionalBytesExtensionFieldNumber = 15;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::StringTypeTraits, 12, false >
optional_bytes_extension;
static const int kOptionalgroupExtensionFieldNumber = 16;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::OptionalGroup_extension >, 10, false >
optionalgroup_extension;
static const int kOptionalNestedMessageExtensionFieldNumber = 18;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::TestAllTypes_NestedMessage >, 11, false >
optional_nested_message_extension;
static const int kOptionalForeignMessageExtensionFieldNumber = 19;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::ForeignMessage >, 11, false >
optional_foreign_message_extension;
static const int kOptionalImportMessageExtensionFieldNumber = 20;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest_import::ImportMessage >, 11, false >
optional_import_message_extension;
static const int kOptionalNestedEnumExtensionFieldNumber = 21;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::EnumTypeTraits< ::protobuf_unittest::TestAllTypes_NestedEnum, ::protobuf_unittest::TestAllTypes_NestedEnum_IsValid>, 14, false >
optional_nested_enum_extension;
static const int kOptionalForeignEnumExtensionFieldNumber = 22;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::EnumTypeTraits< ::protobuf_unittest::ForeignEnum, ::protobuf_unittest::ForeignEnum_IsValid>, 14, false >
optional_foreign_enum_extension;
static const int kOptionalImportEnumExtensionFieldNumber = 23;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::EnumTypeTraits< ::protobuf_unittest_import::ImportEnum, ::protobuf_unittest_import::ImportEnum_IsValid>, 14, false >
optional_import_enum_extension;
static const int kOptionalStringPieceExtensionFieldNumber = 24;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::StringTypeTraits, 9, false >
optional_string_piece_extension;
static const int kOptionalCordExtensionFieldNumber = 25;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::StringTypeTraits, 9, false >
optional_cord_extension;
static const int kOptionalPublicImportMessageExtensionFieldNumber = 26;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest_import::PublicImportMessage >, 11, false >
optional_public_import_message_extension;
static const int kOptionalLazyMessageExtensionFieldNumber = 27;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::TestAllTypes_NestedMessage >, 11, false >
optional_lazy_message_extension;
static const int kRepeatedInt32ExtensionFieldNumber = 31;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::int32 >, 5, false >
repeated_int32_extension;
static const int kRepeatedInt64ExtensionFieldNumber = 32;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::int64 >, 3, false >
repeated_int64_extension;
static const int kRepeatedUint32ExtensionFieldNumber = 33;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::uint32 >, 13, false >
repeated_uint32_extension;
static const int kRepeatedUint64ExtensionFieldNumber = 34;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::uint64 >, 4, false >
repeated_uint64_extension;
static const int kRepeatedSint32ExtensionFieldNumber = 35;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::int32 >, 17, false >
repeated_sint32_extension;
static const int kRepeatedSint64ExtensionFieldNumber = 36;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::int64 >, 18, false >
repeated_sint64_extension;
static const int kRepeatedFixed32ExtensionFieldNumber = 37;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::uint32 >, 7, false >
repeated_fixed32_extension;
static const int kRepeatedFixed64ExtensionFieldNumber = 38;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::uint64 >, 6, false >
repeated_fixed64_extension;
static const int kRepeatedSfixed32ExtensionFieldNumber = 39;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::int32 >, 15, false >
repeated_sfixed32_extension;
static const int kRepeatedSfixed64ExtensionFieldNumber = 40;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::int64 >, 16, false >
repeated_sfixed64_extension;
static const int kRepeatedFloatExtensionFieldNumber = 41;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< float >, 2, false >
repeated_float_extension;
static const int kRepeatedDoubleExtensionFieldNumber = 42;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< double >, 1, false >
repeated_double_extension;
static const int kRepeatedBoolExtensionFieldNumber = 43;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< bool >, 8, false >
repeated_bool_extension;
static const int kRepeatedStringExtensionFieldNumber = 44;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedStringTypeTraits, 9, false >
repeated_string_extension;
static const int kRepeatedBytesExtensionFieldNumber = 45;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedStringTypeTraits, 12, false >
repeated_bytes_extension;
static const int kRepeatedgroupExtensionFieldNumber = 46;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedMessageTypeTraits< ::protobuf_unittest::RepeatedGroup_extension >, 10, false >
repeatedgroup_extension;
static const int kRepeatedNestedMessageExtensionFieldNumber = 48;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedMessageTypeTraits< ::protobuf_unittest::TestAllTypes_NestedMessage >, 11, false >
repeated_nested_message_extension;
static const int kRepeatedForeignMessageExtensionFieldNumber = 49;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedMessageTypeTraits< ::protobuf_unittest::ForeignMessage >, 11, false >
repeated_foreign_message_extension;
static const int kRepeatedImportMessageExtensionFieldNumber = 50;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedMessageTypeTraits< ::protobuf_unittest_import::ImportMessage >, 11, false >
repeated_import_message_extension;
static const int kRepeatedNestedEnumExtensionFieldNumber = 51;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedEnumTypeTraits< ::protobuf_unittest::TestAllTypes_NestedEnum, ::protobuf_unittest::TestAllTypes_NestedEnum_IsValid>, 14, false >
repeated_nested_enum_extension;
static const int kRepeatedForeignEnumExtensionFieldNumber = 52;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedEnumTypeTraits< ::protobuf_unittest::ForeignEnum, ::protobuf_unittest::ForeignEnum_IsValid>, 14, false >
repeated_foreign_enum_extension;
static const int kRepeatedImportEnumExtensionFieldNumber = 53;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedEnumTypeTraits< ::protobuf_unittest_import::ImportEnum, ::protobuf_unittest_import::ImportEnum_IsValid>, 14, false >
repeated_import_enum_extension;
static const int kRepeatedStringPieceExtensionFieldNumber = 54;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedStringTypeTraits, 9, false >
repeated_string_piece_extension;
static const int kRepeatedCordExtensionFieldNumber = 55;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedStringTypeTraits, 9, false >
repeated_cord_extension;
static const int kRepeatedLazyMessageExtensionFieldNumber = 57;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::RepeatedMessageTypeTraits< ::protobuf_unittest::TestAllTypes_NestedMessage >, 11, false >
repeated_lazy_message_extension;
static const int kDefaultInt32ExtensionFieldNumber = 61;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int32 >, 5, false >
default_int32_extension;
static const int kDefaultInt64ExtensionFieldNumber = 62;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int64 >, 3, false >
default_int64_extension;
static const int kDefaultUint32ExtensionFieldNumber = 63;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::uint32 >, 13, false >
default_uint32_extension;
static const int kDefaultUint64ExtensionFieldNumber = 64;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::uint64 >, 4, false >
default_uint64_extension;
static const int kDefaultSint32ExtensionFieldNumber = 65;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int32 >, 17, false >
default_sint32_extension;
static const int kDefaultSint64ExtensionFieldNumber = 66;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int64 >, 18, false >
default_sint64_extension;
static const int kDefaultFixed32ExtensionFieldNumber = 67;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::uint32 >, 7, false >
default_fixed32_extension;
static const int kDefaultFixed64ExtensionFieldNumber = 68;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::uint64 >, 6, false >
default_fixed64_extension;
static const int kDefaultSfixed32ExtensionFieldNumber = 69;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int32 >, 15, false >
default_sfixed32_extension;
static const int kDefaultSfixed64ExtensionFieldNumber = 70;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int64 >, 16, false >
default_sfixed64_extension;
static const int kDefaultFloatExtensionFieldNumber = 71;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< float >, 2, false >
default_float_extension;
static const int kDefaultDoubleExtensionFieldNumber = 72;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< double >, 1, false >
default_double_extension;
static const int kDefaultBoolExtensionFieldNumber = 73;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< bool >, 8, false >
default_bool_extension;
static const int kDefaultStringExtensionFieldNumber = 74;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::StringTypeTraits, 9, false >
default_string_extension;
static const int kDefaultBytesExtensionFieldNumber = 75;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::StringTypeTraits, 12, false >
default_bytes_extension;
static const int kDefaultNestedEnumExtensionFieldNumber = 81;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::EnumTypeTraits< ::protobuf_unittest::TestAllTypes_NestedEnum, ::protobuf_unittest::TestAllTypes_NestedEnum_IsValid>, 14, false >
default_nested_enum_extension;
static const int kDefaultForeignEnumExtensionFieldNumber = 82;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::EnumTypeTraits< ::protobuf_unittest::ForeignEnum, ::protobuf_unittest::ForeignEnum_IsValid>, 14, false >
default_foreign_enum_extension;
static const int kDefaultImportEnumExtensionFieldNumber = 83;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::EnumTypeTraits< ::protobuf_unittest_import::ImportEnum, ::protobuf_unittest_import::ImportEnum_IsValid>, 14, false >
default_import_enum_extension;
static const int kDefaultStringPieceExtensionFieldNumber = 84;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::StringTypeTraits, 9, false >
default_string_piece_extension;
static const int kDefaultCordExtensionFieldNumber = 85;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::StringTypeTraits, 9, false >
default_cord_extension;
static const int kOneofUint32ExtensionFieldNumber = 111;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::uint32 >, 13, false >
oneof_uint32_extension;
static const int kOneofNestedMessageExtensionFieldNumber = 112;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::TestAllTypes_NestedMessage >, 11, false >
oneof_nested_message_extension;
static const int kOneofStringExtensionFieldNumber = 113;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::StringTypeTraits, 9, false >
oneof_string_extension;
static const int kOneofBytesExtensionFieldNumber = 114;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestAllExtensions,
::google::protobuf::internal::StringTypeTraits, 12, false >
oneof_bytes_extension;
static const int kMyExtensionStringFieldNumber = 50;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestFieldOrderings,
::google::protobuf::internal::StringTypeTraits, 9, false >
my_extension_string;
static const int kMyExtensionIntFieldNumber = 5;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestFieldOrderings,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int32 >, 5, false >
my_extension_int;
static const int kPackedInt32ExtensionFieldNumber = 90;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestPackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::int32 >, 5, true >
packed_int32_extension;
static const int kPackedInt64ExtensionFieldNumber = 91;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestPackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::int64 >, 3, true >
packed_int64_extension;
static const int kPackedUint32ExtensionFieldNumber = 92;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestPackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::uint32 >, 13, true >
packed_uint32_extension;
static const int kPackedUint64ExtensionFieldNumber = 93;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestPackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::uint64 >, 4, true >
packed_uint64_extension;
static const int kPackedSint32ExtensionFieldNumber = 94;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestPackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::int32 >, 17, true >
packed_sint32_extension;
static const int kPackedSint64ExtensionFieldNumber = 95;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestPackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::int64 >, 18, true >
packed_sint64_extension;
static const int kPackedFixed32ExtensionFieldNumber = 96;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestPackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::uint32 >, 7, true >
packed_fixed32_extension;
static const int kPackedFixed64ExtensionFieldNumber = 97;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestPackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::uint64 >, 6, true >
packed_fixed64_extension;
static const int kPackedSfixed32ExtensionFieldNumber = 98;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestPackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::int32 >, 15, true >
packed_sfixed32_extension;
static const int kPackedSfixed64ExtensionFieldNumber = 99;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestPackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::int64 >, 16, true >
packed_sfixed64_extension;
static const int kPackedFloatExtensionFieldNumber = 100;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestPackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< float >, 2, true >
packed_float_extension;
static const int kPackedDoubleExtensionFieldNumber = 101;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestPackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< double >, 1, true >
packed_double_extension;
static const int kPackedBoolExtensionFieldNumber = 102;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestPackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< bool >, 8, true >
packed_bool_extension;
static const int kPackedEnumExtensionFieldNumber = 103;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestPackedExtensions,
::google::protobuf::internal::RepeatedEnumTypeTraits< ::protobuf_unittest::ForeignEnum, ::protobuf_unittest::ForeignEnum_IsValid>, 14, true >
packed_enum_extension;
static const int kUnpackedInt32ExtensionFieldNumber = 90;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestUnpackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::int32 >, 5, false >
unpacked_int32_extension;
static const int kUnpackedInt64ExtensionFieldNumber = 91;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestUnpackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::int64 >, 3, false >
unpacked_int64_extension;
static const int kUnpackedUint32ExtensionFieldNumber = 92;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestUnpackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::uint32 >, 13, false >
unpacked_uint32_extension;
static const int kUnpackedUint64ExtensionFieldNumber = 93;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestUnpackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::uint64 >, 4, false >
unpacked_uint64_extension;
static const int kUnpackedSint32ExtensionFieldNumber = 94;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestUnpackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::int32 >, 17, false >
unpacked_sint32_extension;
static const int kUnpackedSint64ExtensionFieldNumber = 95;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestUnpackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::int64 >, 18, false >
unpacked_sint64_extension;
static const int kUnpackedFixed32ExtensionFieldNumber = 96;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestUnpackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::uint32 >, 7, false >
unpacked_fixed32_extension;
static const int kUnpackedFixed64ExtensionFieldNumber = 97;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestUnpackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::uint64 >, 6, false >
unpacked_fixed64_extension;
static const int kUnpackedSfixed32ExtensionFieldNumber = 98;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestUnpackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::int32 >, 15, false >
unpacked_sfixed32_extension;
static const int kUnpackedSfixed64ExtensionFieldNumber = 99;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestUnpackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< ::google::protobuf::int64 >, 16, false >
unpacked_sfixed64_extension;
static const int kUnpackedFloatExtensionFieldNumber = 100;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestUnpackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< float >, 2, false >
unpacked_float_extension;
static const int kUnpackedDoubleExtensionFieldNumber = 101;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestUnpackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< double >, 1, false >
unpacked_double_extension;
static const int kUnpackedBoolExtensionFieldNumber = 102;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestUnpackedExtensions,
::google::protobuf::internal::RepeatedPrimitiveTypeTraits< bool >, 8, false >
unpacked_bool_extension;
static const int kUnpackedEnumExtensionFieldNumber = 103;
extern ::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::TestUnpackedExtensions,
::google::protobuf::internal::RepeatedEnumTypeTraits< ::protobuf_unittest::ForeignEnum, ::protobuf_unittest::ForeignEnum_IsValid>, 14, false >
unpacked_enum_extension;
// ===================================================================
#if !PROTOBUF_INLINE_NOT_IN_HEADERS
// TestAllTypes_NestedMessage
// optional int32 bb = 1;
inline bool TestAllTypes_NestedMessage::has_bb() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestAllTypes_NestedMessage::set_has_bb() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestAllTypes_NestedMessage::clear_has_bb() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestAllTypes_NestedMessage::clear_bb() {
bb_ = 0;
clear_has_bb();
}
inline ::google::protobuf::int32 TestAllTypes_NestedMessage::bb() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.NestedMessage.bb)
return bb_;
}
inline void TestAllTypes_NestedMessage::set_bb(::google::protobuf::int32 value) {
set_has_bb();
bb_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.NestedMessage.bb)
}
// -------------------------------------------------------------------
// TestAllTypes_OptionalGroup
// optional int32 a = 17;
inline bool TestAllTypes_OptionalGroup::has_a() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestAllTypes_OptionalGroup::set_has_a() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestAllTypes_OptionalGroup::clear_has_a() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestAllTypes_OptionalGroup::clear_a() {
a_ = 0;
clear_has_a();
}
inline ::google::protobuf::int32 TestAllTypes_OptionalGroup::a() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.OptionalGroup.a)
return a_;
}
inline void TestAllTypes_OptionalGroup::set_a(::google::protobuf::int32 value) {
set_has_a();
a_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.OptionalGroup.a)
}
// -------------------------------------------------------------------
// TestAllTypes_RepeatedGroup
// optional int32 a = 47;
inline bool TestAllTypes_RepeatedGroup::has_a() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestAllTypes_RepeatedGroup::set_has_a() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestAllTypes_RepeatedGroup::clear_has_a() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestAllTypes_RepeatedGroup::clear_a() {
a_ = 0;
clear_has_a();
}
inline ::google::protobuf::int32 TestAllTypes_RepeatedGroup::a() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.RepeatedGroup.a)
return a_;
}
inline void TestAllTypes_RepeatedGroup::set_a(::google::protobuf::int32 value) {
set_has_a();
a_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.RepeatedGroup.a)
}
// -------------------------------------------------------------------
// TestAllTypes
// optional int32 optional_int32 = 1;
inline bool TestAllTypes::has_optional_int32() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestAllTypes::set_has_optional_int32() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestAllTypes::clear_has_optional_int32() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestAllTypes::clear_optional_int32() {
optional_int32_ = 0;
clear_has_optional_int32();
}
inline ::google::protobuf::int32 TestAllTypes::optional_int32() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_int32)
return optional_int32_;
}
inline void TestAllTypes::set_optional_int32(::google::protobuf::int32 value) {
set_has_optional_int32();
optional_int32_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.optional_int32)
}
// optional int64 optional_int64 = 2;
inline bool TestAllTypes::has_optional_int64() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void TestAllTypes::set_has_optional_int64() {
_has_bits_[0] |= 0x00000002u;
}
inline void TestAllTypes::clear_has_optional_int64() {
_has_bits_[0] &= ~0x00000002u;
}
inline void TestAllTypes::clear_optional_int64() {
optional_int64_ = GOOGLE_LONGLONG(0);
clear_has_optional_int64();
}
inline ::google::protobuf::int64 TestAllTypes::optional_int64() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_int64)
return optional_int64_;
}
inline void TestAllTypes::set_optional_int64(::google::protobuf::int64 value) {
set_has_optional_int64();
optional_int64_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.optional_int64)
}
// optional uint32 optional_uint32 = 3;
inline bool TestAllTypes::has_optional_uint32() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void TestAllTypes::set_has_optional_uint32() {
_has_bits_[0] |= 0x00000004u;
}
inline void TestAllTypes::clear_has_optional_uint32() {
_has_bits_[0] &= ~0x00000004u;
}
inline void TestAllTypes::clear_optional_uint32() {
optional_uint32_ = 0u;
clear_has_optional_uint32();
}
inline ::google::protobuf::uint32 TestAllTypes::optional_uint32() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_uint32)
return optional_uint32_;
}
inline void TestAllTypes::set_optional_uint32(::google::protobuf::uint32 value) {
set_has_optional_uint32();
optional_uint32_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.optional_uint32)
}
// optional uint64 optional_uint64 = 4;
inline bool TestAllTypes::has_optional_uint64() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void TestAllTypes::set_has_optional_uint64() {
_has_bits_[0] |= 0x00000008u;
}
inline void TestAllTypes::clear_has_optional_uint64() {
_has_bits_[0] &= ~0x00000008u;
}
inline void TestAllTypes::clear_optional_uint64() {
optional_uint64_ = GOOGLE_ULONGLONG(0);
clear_has_optional_uint64();
}
inline ::google::protobuf::uint64 TestAllTypes::optional_uint64() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_uint64)
return optional_uint64_;
}
inline void TestAllTypes::set_optional_uint64(::google::protobuf::uint64 value) {
set_has_optional_uint64();
optional_uint64_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.optional_uint64)
}
// optional sint32 optional_sint32 = 5;
inline bool TestAllTypes::has_optional_sint32() const {
return (_has_bits_[0] & 0x00000010u) != 0;
}
inline void TestAllTypes::set_has_optional_sint32() {
_has_bits_[0] |= 0x00000010u;
}
inline void TestAllTypes::clear_has_optional_sint32() {
_has_bits_[0] &= ~0x00000010u;
}
inline void TestAllTypes::clear_optional_sint32() {
optional_sint32_ = 0;
clear_has_optional_sint32();
}
inline ::google::protobuf::int32 TestAllTypes::optional_sint32() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_sint32)
return optional_sint32_;
}
inline void TestAllTypes::set_optional_sint32(::google::protobuf::int32 value) {
set_has_optional_sint32();
optional_sint32_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.optional_sint32)
}
// optional sint64 optional_sint64 = 6;
inline bool TestAllTypes::has_optional_sint64() const {
return (_has_bits_[0] & 0x00000020u) != 0;
}
inline void TestAllTypes::set_has_optional_sint64() {
_has_bits_[0] |= 0x00000020u;
}
inline void TestAllTypes::clear_has_optional_sint64() {
_has_bits_[0] &= ~0x00000020u;
}
inline void TestAllTypes::clear_optional_sint64() {
optional_sint64_ = GOOGLE_LONGLONG(0);
clear_has_optional_sint64();
}
inline ::google::protobuf::int64 TestAllTypes::optional_sint64() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_sint64)
return optional_sint64_;
}
inline void TestAllTypes::set_optional_sint64(::google::protobuf::int64 value) {
set_has_optional_sint64();
optional_sint64_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.optional_sint64)
}
// optional fixed32 optional_fixed32 = 7;
inline bool TestAllTypes::has_optional_fixed32() const {
return (_has_bits_[0] & 0x00000040u) != 0;
}
inline void TestAllTypes::set_has_optional_fixed32() {
_has_bits_[0] |= 0x00000040u;
}
inline void TestAllTypes::clear_has_optional_fixed32() {
_has_bits_[0] &= ~0x00000040u;
}
inline void TestAllTypes::clear_optional_fixed32() {
optional_fixed32_ = 0u;
clear_has_optional_fixed32();
}
inline ::google::protobuf::uint32 TestAllTypes::optional_fixed32() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_fixed32)
return optional_fixed32_;
}
inline void TestAllTypes::set_optional_fixed32(::google::protobuf::uint32 value) {
set_has_optional_fixed32();
optional_fixed32_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.optional_fixed32)
}
// optional fixed64 optional_fixed64 = 8;
inline bool TestAllTypes::has_optional_fixed64() const {
return (_has_bits_[0] & 0x00000080u) != 0;
}
inline void TestAllTypes::set_has_optional_fixed64() {
_has_bits_[0] |= 0x00000080u;
}
inline void TestAllTypes::clear_has_optional_fixed64() {
_has_bits_[0] &= ~0x00000080u;
}
inline void TestAllTypes::clear_optional_fixed64() {
optional_fixed64_ = GOOGLE_ULONGLONG(0);
clear_has_optional_fixed64();
}
inline ::google::protobuf::uint64 TestAllTypes::optional_fixed64() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_fixed64)
return optional_fixed64_;
}
inline void TestAllTypes::set_optional_fixed64(::google::protobuf::uint64 value) {
set_has_optional_fixed64();
optional_fixed64_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.optional_fixed64)
}
// optional sfixed32 optional_sfixed32 = 9;
inline bool TestAllTypes::has_optional_sfixed32() const {
return (_has_bits_[0] & 0x00000100u) != 0;
}
inline void TestAllTypes::set_has_optional_sfixed32() {
_has_bits_[0] |= 0x00000100u;
}
inline void TestAllTypes::clear_has_optional_sfixed32() {
_has_bits_[0] &= ~0x00000100u;
}
inline void TestAllTypes::clear_optional_sfixed32() {
optional_sfixed32_ = 0;
clear_has_optional_sfixed32();
}
inline ::google::protobuf::int32 TestAllTypes::optional_sfixed32() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_sfixed32)
return optional_sfixed32_;
}
inline void TestAllTypes::set_optional_sfixed32(::google::protobuf::int32 value) {
set_has_optional_sfixed32();
optional_sfixed32_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.optional_sfixed32)
}
// optional sfixed64 optional_sfixed64 = 10;
inline bool TestAllTypes::has_optional_sfixed64() const {
return (_has_bits_[0] & 0x00000200u) != 0;
}
inline void TestAllTypes::set_has_optional_sfixed64() {
_has_bits_[0] |= 0x00000200u;
}
inline void TestAllTypes::clear_has_optional_sfixed64() {
_has_bits_[0] &= ~0x00000200u;
}
inline void TestAllTypes::clear_optional_sfixed64() {
optional_sfixed64_ = GOOGLE_LONGLONG(0);
clear_has_optional_sfixed64();
}
inline ::google::protobuf::int64 TestAllTypes::optional_sfixed64() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_sfixed64)
return optional_sfixed64_;
}
inline void TestAllTypes::set_optional_sfixed64(::google::protobuf::int64 value) {
set_has_optional_sfixed64();
optional_sfixed64_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.optional_sfixed64)
}
// optional float optional_float = 11;
inline bool TestAllTypes::has_optional_float() const {
return (_has_bits_[0] & 0x00000400u) != 0;
}
inline void TestAllTypes::set_has_optional_float() {
_has_bits_[0] |= 0x00000400u;
}
inline void TestAllTypes::clear_has_optional_float() {
_has_bits_[0] &= ~0x00000400u;
}
inline void TestAllTypes::clear_optional_float() {
optional_float_ = 0;
clear_has_optional_float();
}
inline float TestAllTypes::optional_float() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_float)
return optional_float_;
}
inline void TestAllTypes::set_optional_float(float value) {
set_has_optional_float();
optional_float_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.optional_float)
}
// optional double optional_double = 12;
inline bool TestAllTypes::has_optional_double() const {
return (_has_bits_[0] & 0x00000800u) != 0;
}
inline void TestAllTypes::set_has_optional_double() {
_has_bits_[0] |= 0x00000800u;
}
inline void TestAllTypes::clear_has_optional_double() {
_has_bits_[0] &= ~0x00000800u;
}
inline void TestAllTypes::clear_optional_double() {
optional_double_ = 0;
clear_has_optional_double();
}
inline double TestAllTypes::optional_double() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_double)
return optional_double_;
}
inline void TestAllTypes::set_optional_double(double value) {
set_has_optional_double();
optional_double_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.optional_double)
}
// optional bool optional_bool = 13;
inline bool TestAllTypes::has_optional_bool() const {
return (_has_bits_[0] & 0x00001000u) != 0;
}
inline void TestAllTypes::set_has_optional_bool() {
_has_bits_[0] |= 0x00001000u;
}
inline void TestAllTypes::clear_has_optional_bool() {
_has_bits_[0] &= ~0x00001000u;
}
inline void TestAllTypes::clear_optional_bool() {
optional_bool_ = false;
clear_has_optional_bool();
}
inline bool TestAllTypes::optional_bool() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_bool)
return optional_bool_;
}
inline void TestAllTypes::set_optional_bool(bool value) {
set_has_optional_bool();
optional_bool_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.optional_bool)
}
// optional string optional_string = 14;
inline bool TestAllTypes::has_optional_string() const {
return (_has_bits_[0] & 0x00002000u) != 0;
}
inline void TestAllTypes::set_has_optional_string() {
_has_bits_[0] |= 0x00002000u;
}
inline void TestAllTypes::clear_has_optional_string() {
_has_bits_[0] &= ~0x00002000u;
}
inline void TestAllTypes::clear_optional_string() {
optional_string_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
clear_has_optional_string();
}
inline const ::std::string& TestAllTypes::optional_string() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_string)
return optional_string_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline void TestAllTypes::set_optional_string(const ::std::string& value) {
set_has_optional_string();
optional_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.optional_string)
}
inline void TestAllTypes::set_optional_string(const char* value) {
set_has_optional_string();
optional_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestAllTypes.optional_string)
}
inline void TestAllTypes::set_optional_string(const char* value,
size_t size) {
set_has_optional_string();
optional_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestAllTypes.optional_string)
}
inline ::std::string* TestAllTypes::mutable_optional_string() {
set_has_optional_string();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.optional_string)
return optional_string_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestAllTypes::release_optional_string() {
clear_has_optional_string();
return optional_string_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestAllTypes::unsafe_arena_release_optional_string() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_optional_string();
return optional_string_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
}
inline void TestAllTypes::set_allocated_optional_string(::std::string* optional_string) {
if (optional_string != NULL) {
set_has_optional_string();
} else {
clear_has_optional_string();
}
optional_string_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), optional_string,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.optional_string)
}
inline void TestAllTypes::unsafe_arena_set_allocated_optional_string(
::std::string* optional_string) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (optional_string != NULL) {
set_has_optional_string();
} else {
clear_has_optional_string();
}
optional_string_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
optional_string, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.optional_string)
}
// optional bytes optional_bytes = 15;
inline bool TestAllTypes::has_optional_bytes() const {
return (_has_bits_[0] & 0x00004000u) != 0;
}
inline void TestAllTypes::set_has_optional_bytes() {
_has_bits_[0] |= 0x00004000u;
}
inline void TestAllTypes::clear_has_optional_bytes() {
_has_bits_[0] &= ~0x00004000u;
}
inline void TestAllTypes::clear_optional_bytes() {
optional_bytes_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
clear_has_optional_bytes();
}
inline const ::std::string& TestAllTypes::optional_bytes() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_bytes)
return optional_bytes_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline void TestAllTypes::set_optional_bytes(const ::std::string& value) {
set_has_optional_bytes();
optional_bytes_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.optional_bytes)
}
inline void TestAllTypes::set_optional_bytes(const char* value) {
set_has_optional_bytes();
optional_bytes_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestAllTypes.optional_bytes)
}
inline void TestAllTypes::set_optional_bytes(const void* value,
size_t size) {
set_has_optional_bytes();
optional_bytes_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestAllTypes.optional_bytes)
}
inline ::std::string* TestAllTypes::mutable_optional_bytes() {
set_has_optional_bytes();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.optional_bytes)
return optional_bytes_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestAllTypes::release_optional_bytes() {
clear_has_optional_bytes();
return optional_bytes_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestAllTypes::unsafe_arena_release_optional_bytes() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_optional_bytes();
return optional_bytes_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
}
inline void TestAllTypes::set_allocated_optional_bytes(::std::string* optional_bytes) {
if (optional_bytes != NULL) {
set_has_optional_bytes();
} else {
clear_has_optional_bytes();
}
optional_bytes_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), optional_bytes,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.optional_bytes)
}
inline void TestAllTypes::unsafe_arena_set_allocated_optional_bytes(
::std::string* optional_bytes) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (optional_bytes != NULL) {
set_has_optional_bytes();
} else {
clear_has_optional_bytes();
}
optional_bytes_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
optional_bytes, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.optional_bytes)
}
// optional group OptionalGroup = 16 { ... };
inline bool TestAllTypes::has_optionalgroup() const {
return (_has_bits_[0] & 0x00008000u) != 0;
}
inline void TestAllTypes::set_has_optionalgroup() {
_has_bits_[0] |= 0x00008000u;
}
inline void TestAllTypes::clear_has_optionalgroup() {
_has_bits_[0] &= ~0x00008000u;
}
inline void TestAllTypes::clear_optionalgroup() {
if (optionalgroup_ != NULL) optionalgroup_->::protobuf_unittest::TestAllTypes_OptionalGroup::Clear();
clear_has_optionalgroup();
}
inline const ::protobuf_unittest::TestAllTypes_OptionalGroup& TestAllTypes::optionalgroup() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optionalgroup)
return optionalgroup_ != NULL ? *optionalgroup_ : *default_instance_->optionalgroup_;
}
inline ::protobuf_unittest::TestAllTypes_OptionalGroup* TestAllTypes::mutable_optionalgroup() {
set_has_optionalgroup();
if (optionalgroup_ == NULL) {
_slow_mutable_optionalgroup();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.optionalgroup)
return optionalgroup_;
}
inline ::protobuf_unittest::TestAllTypes_OptionalGroup* TestAllTypes::release_optionalgroup() {
clear_has_optionalgroup();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_optionalgroup();
} else {
::protobuf_unittest::TestAllTypes_OptionalGroup* temp = optionalgroup_;
optionalgroup_ = NULL;
return temp;
}
}
inline void TestAllTypes::set_allocated_optionalgroup(::protobuf_unittest::TestAllTypes_OptionalGroup* optionalgroup) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete optionalgroup_;
}
if (optionalgroup != NULL) {
_slow_set_allocated_optionalgroup(message_arena, &optionalgroup);
}
optionalgroup_ = optionalgroup;
if (optionalgroup) {
set_has_optionalgroup();
} else {
clear_has_optionalgroup();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.optionalgroup)
}
// optional .protobuf_unittest.TestAllTypes.NestedMessage optional_nested_message = 18;
inline bool TestAllTypes::has_optional_nested_message() const {
return (_has_bits_[0] & 0x00010000u) != 0;
}
inline void TestAllTypes::set_has_optional_nested_message() {
_has_bits_[0] |= 0x00010000u;
}
inline void TestAllTypes::clear_has_optional_nested_message() {
_has_bits_[0] &= ~0x00010000u;
}
inline void TestAllTypes::clear_optional_nested_message() {
if (optional_nested_message_ != NULL) optional_nested_message_->::protobuf_unittest::TestAllTypes_NestedMessage::Clear();
clear_has_optional_nested_message();
}
inline const ::protobuf_unittest::TestAllTypes_NestedMessage& TestAllTypes::optional_nested_message() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_nested_message)
return optional_nested_message_ != NULL ? *optional_nested_message_ : *default_instance_->optional_nested_message_;
}
inline ::protobuf_unittest::TestAllTypes_NestedMessage* TestAllTypes::mutable_optional_nested_message() {
set_has_optional_nested_message();
if (optional_nested_message_ == NULL) {
_slow_mutable_optional_nested_message();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.optional_nested_message)
return optional_nested_message_;
}
inline ::protobuf_unittest::TestAllTypes_NestedMessage* TestAllTypes::release_optional_nested_message() {
clear_has_optional_nested_message();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_optional_nested_message();
} else {
::protobuf_unittest::TestAllTypes_NestedMessage* temp = optional_nested_message_;
optional_nested_message_ = NULL;
return temp;
}
}
inline void TestAllTypes::set_allocated_optional_nested_message(::protobuf_unittest::TestAllTypes_NestedMessage* optional_nested_message) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete optional_nested_message_;
}
if (optional_nested_message != NULL) {
_slow_set_allocated_optional_nested_message(message_arena, &optional_nested_message);
}
optional_nested_message_ = optional_nested_message;
if (optional_nested_message) {
set_has_optional_nested_message();
} else {
clear_has_optional_nested_message();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.optional_nested_message)
}
// optional .protobuf_unittest.ForeignMessage optional_foreign_message = 19;
inline bool TestAllTypes::has_optional_foreign_message() const {
return (_has_bits_[0] & 0x00020000u) != 0;
}
inline void TestAllTypes::set_has_optional_foreign_message() {
_has_bits_[0] |= 0x00020000u;
}
inline void TestAllTypes::clear_has_optional_foreign_message() {
_has_bits_[0] &= ~0x00020000u;
}
inline void TestAllTypes::clear_optional_foreign_message() {
if (optional_foreign_message_ != NULL) optional_foreign_message_->::protobuf_unittest::ForeignMessage::Clear();
clear_has_optional_foreign_message();
}
inline const ::protobuf_unittest::ForeignMessage& TestAllTypes::optional_foreign_message() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_foreign_message)
return optional_foreign_message_ != NULL ? *optional_foreign_message_ : *default_instance_->optional_foreign_message_;
}
inline ::protobuf_unittest::ForeignMessage* TestAllTypes::mutable_optional_foreign_message() {
set_has_optional_foreign_message();
if (optional_foreign_message_ == NULL) {
_slow_mutable_optional_foreign_message();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.optional_foreign_message)
return optional_foreign_message_;
}
inline ::protobuf_unittest::ForeignMessage* TestAllTypes::release_optional_foreign_message() {
clear_has_optional_foreign_message();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_optional_foreign_message();
} else {
::protobuf_unittest::ForeignMessage* temp = optional_foreign_message_;
optional_foreign_message_ = NULL;
return temp;
}
}
inline void TestAllTypes::set_allocated_optional_foreign_message(::protobuf_unittest::ForeignMessage* optional_foreign_message) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete optional_foreign_message_;
}
if (optional_foreign_message != NULL) {
_slow_set_allocated_optional_foreign_message(message_arena, &optional_foreign_message);
}
optional_foreign_message_ = optional_foreign_message;
if (optional_foreign_message) {
set_has_optional_foreign_message();
} else {
clear_has_optional_foreign_message();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.optional_foreign_message)
}
// optional .protobuf_unittest_import.ImportMessage optional_import_message = 20;
inline bool TestAllTypes::has_optional_import_message() const {
return (_has_bits_[0] & 0x00040000u) != 0;
}
inline void TestAllTypes::set_has_optional_import_message() {
_has_bits_[0] |= 0x00040000u;
}
inline void TestAllTypes::clear_has_optional_import_message() {
_has_bits_[0] &= ~0x00040000u;
}
inline void TestAllTypes::clear_optional_import_message() {
if (optional_import_message_ != NULL) optional_import_message_->::protobuf_unittest_import::ImportMessage::Clear();
clear_has_optional_import_message();
}
inline const ::protobuf_unittest_import::ImportMessage& TestAllTypes::optional_import_message() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_import_message)
return optional_import_message_ != NULL ? *optional_import_message_ : *default_instance_->optional_import_message_;
}
inline ::protobuf_unittest_import::ImportMessage* TestAllTypes::mutable_optional_import_message() {
set_has_optional_import_message();
if (optional_import_message_ == NULL) {
_slow_mutable_optional_import_message();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.optional_import_message)
return optional_import_message_;
}
inline ::protobuf_unittest_import::ImportMessage* TestAllTypes::release_optional_import_message() {
clear_has_optional_import_message();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_optional_import_message();
} else {
::protobuf_unittest_import::ImportMessage* temp = optional_import_message_;
optional_import_message_ = NULL;
return temp;
}
}
inline void TestAllTypes::set_allocated_optional_import_message(::protobuf_unittest_import::ImportMessage* optional_import_message) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete optional_import_message_;
}
if (optional_import_message != NULL) {
_slow_set_allocated_optional_import_message(message_arena, &optional_import_message);
}
optional_import_message_ = optional_import_message;
if (optional_import_message) {
set_has_optional_import_message();
} else {
clear_has_optional_import_message();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.optional_import_message)
}
// optional .protobuf_unittest.TestAllTypes.NestedEnum optional_nested_enum = 21;
inline bool TestAllTypes::has_optional_nested_enum() const {
return (_has_bits_[0] & 0x00080000u) != 0;
}
inline void TestAllTypes::set_has_optional_nested_enum() {
_has_bits_[0] |= 0x00080000u;
}
inline void TestAllTypes::clear_has_optional_nested_enum() {
_has_bits_[0] &= ~0x00080000u;
}
inline void TestAllTypes::clear_optional_nested_enum() {
optional_nested_enum_ = 1;
clear_has_optional_nested_enum();
}
inline ::protobuf_unittest::TestAllTypes_NestedEnum TestAllTypes::optional_nested_enum() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_nested_enum)
return static_cast< ::protobuf_unittest::TestAllTypes_NestedEnum >(optional_nested_enum_);
}
inline void TestAllTypes::set_optional_nested_enum(::protobuf_unittest::TestAllTypes_NestedEnum value) {
assert(::protobuf_unittest::TestAllTypes_NestedEnum_IsValid(value));
set_has_optional_nested_enum();
optional_nested_enum_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.optional_nested_enum)
}
// optional .protobuf_unittest.ForeignEnum optional_foreign_enum = 22;
inline bool TestAllTypes::has_optional_foreign_enum() const {
return (_has_bits_[0] & 0x00100000u) != 0;
}
inline void TestAllTypes::set_has_optional_foreign_enum() {
_has_bits_[0] |= 0x00100000u;
}
inline void TestAllTypes::clear_has_optional_foreign_enum() {
_has_bits_[0] &= ~0x00100000u;
}
inline void TestAllTypes::clear_optional_foreign_enum() {
optional_foreign_enum_ = 4;
clear_has_optional_foreign_enum();
}
inline ::protobuf_unittest::ForeignEnum TestAllTypes::optional_foreign_enum() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_foreign_enum)
return static_cast< ::protobuf_unittest::ForeignEnum >(optional_foreign_enum_);
}
inline void TestAllTypes::set_optional_foreign_enum(::protobuf_unittest::ForeignEnum value) {
assert(::protobuf_unittest::ForeignEnum_IsValid(value));
set_has_optional_foreign_enum();
optional_foreign_enum_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.optional_foreign_enum)
}
// optional .protobuf_unittest_import.ImportEnum optional_import_enum = 23;
inline bool TestAllTypes::has_optional_import_enum() const {
return (_has_bits_[0] & 0x00200000u) != 0;
}
inline void TestAllTypes::set_has_optional_import_enum() {
_has_bits_[0] |= 0x00200000u;
}
inline void TestAllTypes::clear_has_optional_import_enum() {
_has_bits_[0] &= ~0x00200000u;
}
inline void TestAllTypes::clear_optional_import_enum() {
optional_import_enum_ = 7;
clear_has_optional_import_enum();
}
inline ::protobuf_unittest_import::ImportEnum TestAllTypes::optional_import_enum() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_import_enum)
return static_cast< ::protobuf_unittest_import::ImportEnum >(optional_import_enum_);
}
inline void TestAllTypes::set_optional_import_enum(::protobuf_unittest_import::ImportEnum value) {
assert(::protobuf_unittest_import::ImportEnum_IsValid(value));
set_has_optional_import_enum();
optional_import_enum_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.optional_import_enum)
}
// optional string optional_string_piece = 24 [ctype = STRING_PIECE];
inline bool TestAllTypes::has_optional_string_piece() const {
return (_has_bits_[0] & 0x00400000u) != 0;
}
inline void TestAllTypes::set_has_optional_string_piece() {
_has_bits_[0] |= 0x00400000u;
}
inline void TestAllTypes::clear_has_optional_string_piece() {
_has_bits_[0] &= ~0x00400000u;
}
inline void TestAllTypes::clear_optional_string_piece() {
optional_string_piece_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
clear_has_optional_string_piece();
}
inline const ::std::string& TestAllTypes::optional_string_piece() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_string_piece)
return optional_string_piece_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline void TestAllTypes::set_optional_string_piece(const ::std::string& value) {
set_has_optional_string_piece();
optional_string_piece_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.optional_string_piece)
}
inline void TestAllTypes::set_optional_string_piece(const char* value) {
set_has_optional_string_piece();
optional_string_piece_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestAllTypes.optional_string_piece)
}
inline void TestAllTypes::set_optional_string_piece(const char* value,
size_t size) {
set_has_optional_string_piece();
optional_string_piece_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestAllTypes.optional_string_piece)
}
inline ::std::string* TestAllTypes::mutable_optional_string_piece() {
set_has_optional_string_piece();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.optional_string_piece)
return optional_string_piece_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestAllTypes::release_optional_string_piece() {
clear_has_optional_string_piece();
return optional_string_piece_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestAllTypes::unsafe_arena_release_optional_string_piece() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_optional_string_piece();
return optional_string_piece_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
}
inline void TestAllTypes::set_allocated_optional_string_piece(::std::string* optional_string_piece) {
if (optional_string_piece != NULL) {
set_has_optional_string_piece();
} else {
clear_has_optional_string_piece();
}
optional_string_piece_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), optional_string_piece,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.optional_string_piece)
}
inline void TestAllTypes::unsafe_arena_set_allocated_optional_string_piece(
::std::string* optional_string_piece) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (optional_string_piece != NULL) {
set_has_optional_string_piece();
} else {
clear_has_optional_string_piece();
}
optional_string_piece_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
optional_string_piece, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.optional_string_piece)
}
// optional string optional_cord = 25 [ctype = CORD];
inline bool TestAllTypes::has_optional_cord() const {
return (_has_bits_[0] & 0x00800000u) != 0;
}
inline void TestAllTypes::set_has_optional_cord() {
_has_bits_[0] |= 0x00800000u;
}
inline void TestAllTypes::clear_has_optional_cord() {
_has_bits_[0] &= ~0x00800000u;
}
inline void TestAllTypes::clear_optional_cord() {
optional_cord_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
clear_has_optional_cord();
}
inline const ::std::string& TestAllTypes::optional_cord() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_cord)
return optional_cord_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline void TestAllTypes::set_optional_cord(const ::std::string& value) {
set_has_optional_cord();
optional_cord_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.optional_cord)
}
inline void TestAllTypes::set_optional_cord(const char* value) {
set_has_optional_cord();
optional_cord_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestAllTypes.optional_cord)
}
inline void TestAllTypes::set_optional_cord(const char* value,
size_t size) {
set_has_optional_cord();
optional_cord_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestAllTypes.optional_cord)
}
inline ::std::string* TestAllTypes::mutable_optional_cord() {
set_has_optional_cord();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.optional_cord)
return optional_cord_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestAllTypes::release_optional_cord() {
clear_has_optional_cord();
return optional_cord_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestAllTypes::unsafe_arena_release_optional_cord() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_optional_cord();
return optional_cord_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
}
inline void TestAllTypes::set_allocated_optional_cord(::std::string* optional_cord) {
if (optional_cord != NULL) {
set_has_optional_cord();
} else {
clear_has_optional_cord();
}
optional_cord_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), optional_cord,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.optional_cord)
}
inline void TestAllTypes::unsafe_arena_set_allocated_optional_cord(
::std::string* optional_cord) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (optional_cord != NULL) {
set_has_optional_cord();
} else {
clear_has_optional_cord();
}
optional_cord_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
optional_cord, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.optional_cord)
}
// optional .protobuf_unittest_import.PublicImportMessage optional_public_import_message = 26;
inline bool TestAllTypes::has_optional_public_import_message() const {
return (_has_bits_[0] & 0x01000000u) != 0;
}
inline void TestAllTypes::set_has_optional_public_import_message() {
_has_bits_[0] |= 0x01000000u;
}
inline void TestAllTypes::clear_has_optional_public_import_message() {
_has_bits_[0] &= ~0x01000000u;
}
inline void TestAllTypes::clear_optional_public_import_message() {
if (optional_public_import_message_ != NULL) optional_public_import_message_->::protobuf_unittest_import::PublicImportMessage::Clear();
clear_has_optional_public_import_message();
}
inline const ::protobuf_unittest_import::PublicImportMessage& TestAllTypes::optional_public_import_message() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_public_import_message)
return optional_public_import_message_ != NULL ? *optional_public_import_message_ : *default_instance_->optional_public_import_message_;
}
inline ::protobuf_unittest_import::PublicImportMessage* TestAllTypes::mutable_optional_public_import_message() {
set_has_optional_public_import_message();
if (optional_public_import_message_ == NULL) {
_slow_mutable_optional_public_import_message();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.optional_public_import_message)
return optional_public_import_message_;
}
inline ::protobuf_unittest_import::PublicImportMessage* TestAllTypes::release_optional_public_import_message() {
clear_has_optional_public_import_message();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_optional_public_import_message();
} else {
::protobuf_unittest_import::PublicImportMessage* temp = optional_public_import_message_;
optional_public_import_message_ = NULL;
return temp;
}
}
inline void TestAllTypes::set_allocated_optional_public_import_message(::protobuf_unittest_import::PublicImportMessage* optional_public_import_message) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete optional_public_import_message_;
}
if (optional_public_import_message != NULL) {
if (message_arena != NULL) {
message_arena->Own(optional_public_import_message);
}
}
optional_public_import_message_ = optional_public_import_message;
if (optional_public_import_message) {
set_has_optional_public_import_message();
} else {
clear_has_optional_public_import_message();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.optional_public_import_message)
}
// optional .protobuf_unittest.TestAllTypes.NestedMessage optional_lazy_message = 27 [lazy = true];
inline bool TestAllTypes::has_optional_lazy_message() const {
return (_has_bits_[0] & 0x02000000u) != 0;
}
inline void TestAllTypes::set_has_optional_lazy_message() {
_has_bits_[0] |= 0x02000000u;
}
inline void TestAllTypes::clear_has_optional_lazy_message() {
_has_bits_[0] &= ~0x02000000u;
}
inline void TestAllTypes::clear_optional_lazy_message() {
if (optional_lazy_message_ != NULL) optional_lazy_message_->::protobuf_unittest::TestAllTypes_NestedMessage::Clear();
clear_has_optional_lazy_message();
}
inline const ::protobuf_unittest::TestAllTypes_NestedMessage& TestAllTypes::optional_lazy_message() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.optional_lazy_message)
return optional_lazy_message_ != NULL ? *optional_lazy_message_ : *default_instance_->optional_lazy_message_;
}
inline ::protobuf_unittest::TestAllTypes_NestedMessage* TestAllTypes::mutable_optional_lazy_message() {
set_has_optional_lazy_message();
if (optional_lazy_message_ == NULL) {
_slow_mutable_optional_lazy_message();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.optional_lazy_message)
return optional_lazy_message_;
}
inline ::protobuf_unittest::TestAllTypes_NestedMessage* TestAllTypes::release_optional_lazy_message() {
clear_has_optional_lazy_message();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_optional_lazy_message();
} else {
::protobuf_unittest::TestAllTypes_NestedMessage* temp = optional_lazy_message_;
optional_lazy_message_ = NULL;
return temp;
}
}
inline void TestAllTypes::set_allocated_optional_lazy_message(::protobuf_unittest::TestAllTypes_NestedMessage* optional_lazy_message) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete optional_lazy_message_;
}
if (optional_lazy_message != NULL) {
_slow_set_allocated_optional_lazy_message(message_arena, &optional_lazy_message);
}
optional_lazy_message_ = optional_lazy_message;
if (optional_lazy_message) {
set_has_optional_lazy_message();
} else {
clear_has_optional_lazy_message();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.optional_lazy_message)
}
// repeated int32 repeated_int32 = 31;
inline int TestAllTypes::repeated_int32_size() const {
return repeated_int32_.size();
}
inline void TestAllTypes::clear_repeated_int32() {
repeated_int32_.Clear();
}
inline ::google::protobuf::int32 TestAllTypes::repeated_int32(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_int32)
return repeated_int32_.Get(index);
}
inline void TestAllTypes::set_repeated_int32(int index, ::google::protobuf::int32 value) {
repeated_int32_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.repeated_int32)
}
inline void TestAllTypes::add_repeated_int32(::google::protobuf::int32 value) {
repeated_int32_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_int32)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
TestAllTypes::repeated_int32() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_int32)
return repeated_int32_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
TestAllTypes::mutable_repeated_int32() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_int32)
return &repeated_int32_;
}
// repeated int64 repeated_int64 = 32;
inline int TestAllTypes::repeated_int64_size() const {
return repeated_int64_.size();
}
inline void TestAllTypes::clear_repeated_int64() {
repeated_int64_.Clear();
}
inline ::google::protobuf::int64 TestAllTypes::repeated_int64(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_int64)
return repeated_int64_.Get(index);
}
inline void TestAllTypes::set_repeated_int64(int index, ::google::protobuf::int64 value) {
repeated_int64_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.repeated_int64)
}
inline void TestAllTypes::add_repeated_int64(::google::protobuf::int64 value) {
repeated_int64_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_int64)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
TestAllTypes::repeated_int64() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_int64)
return repeated_int64_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
TestAllTypes::mutable_repeated_int64() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_int64)
return &repeated_int64_;
}
// repeated uint32 repeated_uint32 = 33;
inline int TestAllTypes::repeated_uint32_size() const {
return repeated_uint32_.size();
}
inline void TestAllTypes::clear_repeated_uint32() {
repeated_uint32_.Clear();
}
inline ::google::protobuf::uint32 TestAllTypes::repeated_uint32(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_uint32)
return repeated_uint32_.Get(index);
}
inline void TestAllTypes::set_repeated_uint32(int index, ::google::protobuf::uint32 value) {
repeated_uint32_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.repeated_uint32)
}
inline void TestAllTypes::add_repeated_uint32(::google::protobuf::uint32 value) {
repeated_uint32_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_uint32)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
TestAllTypes::repeated_uint32() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_uint32)
return repeated_uint32_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
TestAllTypes::mutable_repeated_uint32() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_uint32)
return &repeated_uint32_;
}
// repeated uint64 repeated_uint64 = 34;
inline int TestAllTypes::repeated_uint64_size() const {
return repeated_uint64_.size();
}
inline void TestAllTypes::clear_repeated_uint64() {
repeated_uint64_.Clear();
}
inline ::google::protobuf::uint64 TestAllTypes::repeated_uint64(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_uint64)
return repeated_uint64_.Get(index);
}
inline void TestAllTypes::set_repeated_uint64(int index, ::google::protobuf::uint64 value) {
repeated_uint64_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.repeated_uint64)
}
inline void TestAllTypes::add_repeated_uint64(::google::protobuf::uint64 value) {
repeated_uint64_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_uint64)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
TestAllTypes::repeated_uint64() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_uint64)
return repeated_uint64_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
TestAllTypes::mutable_repeated_uint64() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_uint64)
return &repeated_uint64_;
}
// repeated sint32 repeated_sint32 = 35;
inline int TestAllTypes::repeated_sint32_size() const {
return repeated_sint32_.size();
}
inline void TestAllTypes::clear_repeated_sint32() {
repeated_sint32_.Clear();
}
inline ::google::protobuf::int32 TestAllTypes::repeated_sint32(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_sint32)
return repeated_sint32_.Get(index);
}
inline void TestAllTypes::set_repeated_sint32(int index, ::google::protobuf::int32 value) {
repeated_sint32_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.repeated_sint32)
}
inline void TestAllTypes::add_repeated_sint32(::google::protobuf::int32 value) {
repeated_sint32_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_sint32)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
TestAllTypes::repeated_sint32() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_sint32)
return repeated_sint32_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
TestAllTypes::mutable_repeated_sint32() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_sint32)
return &repeated_sint32_;
}
// repeated sint64 repeated_sint64 = 36;
inline int TestAllTypes::repeated_sint64_size() const {
return repeated_sint64_.size();
}
inline void TestAllTypes::clear_repeated_sint64() {
repeated_sint64_.Clear();
}
inline ::google::protobuf::int64 TestAllTypes::repeated_sint64(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_sint64)
return repeated_sint64_.Get(index);
}
inline void TestAllTypes::set_repeated_sint64(int index, ::google::protobuf::int64 value) {
repeated_sint64_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.repeated_sint64)
}
inline void TestAllTypes::add_repeated_sint64(::google::protobuf::int64 value) {
repeated_sint64_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_sint64)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
TestAllTypes::repeated_sint64() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_sint64)
return repeated_sint64_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
TestAllTypes::mutable_repeated_sint64() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_sint64)
return &repeated_sint64_;
}
// repeated fixed32 repeated_fixed32 = 37;
inline int TestAllTypes::repeated_fixed32_size() const {
return repeated_fixed32_.size();
}
inline void TestAllTypes::clear_repeated_fixed32() {
repeated_fixed32_.Clear();
}
inline ::google::protobuf::uint32 TestAllTypes::repeated_fixed32(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_fixed32)
return repeated_fixed32_.Get(index);
}
inline void TestAllTypes::set_repeated_fixed32(int index, ::google::protobuf::uint32 value) {
repeated_fixed32_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.repeated_fixed32)
}
inline void TestAllTypes::add_repeated_fixed32(::google::protobuf::uint32 value) {
repeated_fixed32_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_fixed32)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
TestAllTypes::repeated_fixed32() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_fixed32)
return repeated_fixed32_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
TestAllTypes::mutable_repeated_fixed32() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_fixed32)
return &repeated_fixed32_;
}
// repeated fixed64 repeated_fixed64 = 38;
inline int TestAllTypes::repeated_fixed64_size() const {
return repeated_fixed64_.size();
}
inline void TestAllTypes::clear_repeated_fixed64() {
repeated_fixed64_.Clear();
}
inline ::google::protobuf::uint64 TestAllTypes::repeated_fixed64(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_fixed64)
return repeated_fixed64_.Get(index);
}
inline void TestAllTypes::set_repeated_fixed64(int index, ::google::protobuf::uint64 value) {
repeated_fixed64_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.repeated_fixed64)
}
inline void TestAllTypes::add_repeated_fixed64(::google::protobuf::uint64 value) {
repeated_fixed64_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_fixed64)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
TestAllTypes::repeated_fixed64() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_fixed64)
return repeated_fixed64_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
TestAllTypes::mutable_repeated_fixed64() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_fixed64)
return &repeated_fixed64_;
}
// repeated sfixed32 repeated_sfixed32 = 39;
inline int TestAllTypes::repeated_sfixed32_size() const {
return repeated_sfixed32_.size();
}
inline void TestAllTypes::clear_repeated_sfixed32() {
repeated_sfixed32_.Clear();
}
inline ::google::protobuf::int32 TestAllTypes::repeated_sfixed32(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_sfixed32)
return repeated_sfixed32_.Get(index);
}
inline void TestAllTypes::set_repeated_sfixed32(int index, ::google::protobuf::int32 value) {
repeated_sfixed32_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.repeated_sfixed32)
}
inline void TestAllTypes::add_repeated_sfixed32(::google::protobuf::int32 value) {
repeated_sfixed32_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_sfixed32)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
TestAllTypes::repeated_sfixed32() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_sfixed32)
return repeated_sfixed32_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
TestAllTypes::mutable_repeated_sfixed32() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_sfixed32)
return &repeated_sfixed32_;
}
// repeated sfixed64 repeated_sfixed64 = 40;
inline int TestAllTypes::repeated_sfixed64_size() const {
return repeated_sfixed64_.size();
}
inline void TestAllTypes::clear_repeated_sfixed64() {
repeated_sfixed64_.Clear();
}
inline ::google::protobuf::int64 TestAllTypes::repeated_sfixed64(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_sfixed64)
return repeated_sfixed64_.Get(index);
}
inline void TestAllTypes::set_repeated_sfixed64(int index, ::google::protobuf::int64 value) {
repeated_sfixed64_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.repeated_sfixed64)
}
inline void TestAllTypes::add_repeated_sfixed64(::google::protobuf::int64 value) {
repeated_sfixed64_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_sfixed64)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
TestAllTypes::repeated_sfixed64() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_sfixed64)
return repeated_sfixed64_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
TestAllTypes::mutable_repeated_sfixed64() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_sfixed64)
return &repeated_sfixed64_;
}
// repeated float repeated_float = 41;
inline int TestAllTypes::repeated_float_size() const {
return repeated_float_.size();
}
inline void TestAllTypes::clear_repeated_float() {
repeated_float_.Clear();
}
inline float TestAllTypes::repeated_float(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_float)
return repeated_float_.Get(index);
}
inline void TestAllTypes::set_repeated_float(int index, float value) {
repeated_float_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.repeated_float)
}
inline void TestAllTypes::add_repeated_float(float value) {
repeated_float_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_float)
}
inline const ::google::protobuf::RepeatedField< float >&
TestAllTypes::repeated_float() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_float)
return repeated_float_;
}
inline ::google::protobuf::RepeatedField< float >*
TestAllTypes::mutable_repeated_float() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_float)
return &repeated_float_;
}
// repeated double repeated_double = 42;
inline int TestAllTypes::repeated_double_size() const {
return repeated_double_.size();
}
inline void TestAllTypes::clear_repeated_double() {
repeated_double_.Clear();
}
inline double TestAllTypes::repeated_double(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_double)
return repeated_double_.Get(index);
}
inline void TestAllTypes::set_repeated_double(int index, double value) {
repeated_double_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.repeated_double)
}
inline void TestAllTypes::add_repeated_double(double value) {
repeated_double_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_double)
}
inline const ::google::protobuf::RepeatedField< double >&
TestAllTypes::repeated_double() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_double)
return repeated_double_;
}
inline ::google::protobuf::RepeatedField< double >*
TestAllTypes::mutable_repeated_double() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_double)
return &repeated_double_;
}
// repeated bool repeated_bool = 43;
inline int TestAllTypes::repeated_bool_size() const {
return repeated_bool_.size();
}
inline void TestAllTypes::clear_repeated_bool() {
repeated_bool_.Clear();
}
inline bool TestAllTypes::repeated_bool(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_bool)
return repeated_bool_.Get(index);
}
inline void TestAllTypes::set_repeated_bool(int index, bool value) {
repeated_bool_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.repeated_bool)
}
inline void TestAllTypes::add_repeated_bool(bool value) {
repeated_bool_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_bool)
}
inline const ::google::protobuf::RepeatedField< bool >&
TestAllTypes::repeated_bool() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_bool)
return repeated_bool_;
}
inline ::google::protobuf::RepeatedField< bool >*
TestAllTypes::mutable_repeated_bool() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_bool)
return &repeated_bool_;
}
// repeated string repeated_string = 44;
inline int TestAllTypes::repeated_string_size() const {
return repeated_string_.size();
}
inline void TestAllTypes::clear_repeated_string() {
repeated_string_.Clear();
}
inline const ::std::string& TestAllTypes::repeated_string(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_string)
return repeated_string_.Get(index);
}
inline ::std::string* TestAllTypes::mutable_repeated_string(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.repeated_string)
return repeated_string_.Mutable(index);
}
inline void TestAllTypes::set_repeated_string(int index, const ::std::string& value) {
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.repeated_string)
repeated_string_.Mutable(index)->assign(value);
}
inline void TestAllTypes::set_repeated_string(int index, const char* value) {
repeated_string_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestAllTypes.repeated_string)
}
inline void TestAllTypes::set_repeated_string(int index, const char* value, size_t size) {
repeated_string_.Mutable(index)->assign(
reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestAllTypes.repeated_string)
}
inline ::std::string* TestAllTypes::add_repeated_string() {
return repeated_string_.Add();
}
inline void TestAllTypes::add_repeated_string(const ::std::string& value) {
repeated_string_.Add()->assign(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_string)
}
inline void TestAllTypes::add_repeated_string(const char* value) {
repeated_string_.Add()->assign(value);
// @@protoc_insertion_point(field_add_char:protobuf_unittest.TestAllTypes.repeated_string)
}
inline void TestAllTypes::add_repeated_string(const char* value, size_t size) {
repeated_string_.Add()->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_add_pointer:protobuf_unittest.TestAllTypes.repeated_string)
}
inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
TestAllTypes::repeated_string() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_string)
return repeated_string_;
}
inline ::google::protobuf::RepeatedPtrField< ::std::string>*
TestAllTypes::mutable_repeated_string() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_string)
return &repeated_string_;
}
// repeated bytes repeated_bytes = 45;
inline int TestAllTypes::repeated_bytes_size() const {
return repeated_bytes_.size();
}
inline void TestAllTypes::clear_repeated_bytes() {
repeated_bytes_.Clear();
}
inline const ::std::string& TestAllTypes::repeated_bytes(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_bytes)
return repeated_bytes_.Get(index);
}
inline ::std::string* TestAllTypes::mutable_repeated_bytes(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.repeated_bytes)
return repeated_bytes_.Mutable(index);
}
inline void TestAllTypes::set_repeated_bytes(int index, const ::std::string& value) {
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.repeated_bytes)
repeated_bytes_.Mutable(index)->assign(value);
}
inline void TestAllTypes::set_repeated_bytes(int index, const char* value) {
repeated_bytes_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestAllTypes.repeated_bytes)
}
inline void TestAllTypes::set_repeated_bytes(int index, const void* value, size_t size) {
repeated_bytes_.Mutable(index)->assign(
reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestAllTypes.repeated_bytes)
}
inline ::std::string* TestAllTypes::add_repeated_bytes() {
return repeated_bytes_.Add();
}
inline void TestAllTypes::add_repeated_bytes(const ::std::string& value) {
repeated_bytes_.Add()->assign(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_bytes)
}
inline void TestAllTypes::add_repeated_bytes(const char* value) {
repeated_bytes_.Add()->assign(value);
// @@protoc_insertion_point(field_add_char:protobuf_unittest.TestAllTypes.repeated_bytes)
}
inline void TestAllTypes::add_repeated_bytes(const void* value, size_t size) {
repeated_bytes_.Add()->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_add_pointer:protobuf_unittest.TestAllTypes.repeated_bytes)
}
inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
TestAllTypes::repeated_bytes() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_bytes)
return repeated_bytes_;
}
inline ::google::protobuf::RepeatedPtrField< ::std::string>*
TestAllTypes::mutable_repeated_bytes() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_bytes)
return &repeated_bytes_;
}
// repeated group RepeatedGroup = 46 { ... };
inline int TestAllTypes::repeatedgroup_size() const {
return repeatedgroup_.size();
}
inline void TestAllTypes::clear_repeatedgroup() {
repeatedgroup_.Clear();
}
inline const ::protobuf_unittest::TestAllTypes_RepeatedGroup& TestAllTypes::repeatedgroup(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeatedgroup)
return repeatedgroup_.Get(index);
}
inline ::protobuf_unittest::TestAllTypes_RepeatedGroup* TestAllTypes::mutable_repeatedgroup(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.repeatedgroup)
return repeatedgroup_.Mutable(index);
}
inline ::protobuf_unittest::TestAllTypes_RepeatedGroup* TestAllTypes::add_repeatedgroup() {
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeatedgroup)
return repeatedgroup_.Add();
}
inline ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes_RepeatedGroup >*
TestAllTypes::mutable_repeatedgroup() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeatedgroup)
return &repeatedgroup_;
}
inline const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes_RepeatedGroup >&
TestAllTypes::repeatedgroup() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeatedgroup)
return repeatedgroup_;
}
// repeated .protobuf_unittest.TestAllTypes.NestedMessage repeated_nested_message = 48;
inline int TestAllTypes::repeated_nested_message_size() const {
return repeated_nested_message_.size();
}
inline void TestAllTypes::clear_repeated_nested_message() {
repeated_nested_message_.Clear();
}
inline const ::protobuf_unittest::TestAllTypes_NestedMessage& TestAllTypes::repeated_nested_message(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_nested_message)
return repeated_nested_message_.Get(index);
}
inline ::protobuf_unittest::TestAllTypes_NestedMessage* TestAllTypes::mutable_repeated_nested_message(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.repeated_nested_message)
return repeated_nested_message_.Mutable(index);
}
inline ::protobuf_unittest::TestAllTypes_NestedMessage* TestAllTypes::add_repeated_nested_message() {
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_nested_message)
return repeated_nested_message_.Add();
}
inline ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes_NestedMessage >*
TestAllTypes::mutable_repeated_nested_message() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_nested_message)
return &repeated_nested_message_;
}
inline const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes_NestedMessage >&
TestAllTypes::repeated_nested_message() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_nested_message)
return repeated_nested_message_;
}
// repeated .protobuf_unittest.ForeignMessage repeated_foreign_message = 49;
inline int TestAllTypes::repeated_foreign_message_size() const {
return repeated_foreign_message_.size();
}
inline void TestAllTypes::clear_repeated_foreign_message() {
repeated_foreign_message_.Clear();
}
inline const ::protobuf_unittest::ForeignMessage& TestAllTypes::repeated_foreign_message(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_foreign_message)
return repeated_foreign_message_.Get(index);
}
inline ::protobuf_unittest::ForeignMessage* TestAllTypes::mutable_repeated_foreign_message(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.repeated_foreign_message)
return repeated_foreign_message_.Mutable(index);
}
inline ::protobuf_unittest::ForeignMessage* TestAllTypes::add_repeated_foreign_message() {
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_foreign_message)
return repeated_foreign_message_.Add();
}
inline ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::ForeignMessage >*
TestAllTypes::mutable_repeated_foreign_message() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_foreign_message)
return &repeated_foreign_message_;
}
inline const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::ForeignMessage >&
TestAllTypes::repeated_foreign_message() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_foreign_message)
return repeated_foreign_message_;
}
// repeated .protobuf_unittest_import.ImportMessage repeated_import_message = 50;
inline int TestAllTypes::repeated_import_message_size() const {
return repeated_import_message_.size();
}
inline void TestAllTypes::clear_repeated_import_message() {
repeated_import_message_.Clear();
}
inline const ::protobuf_unittest_import::ImportMessage& TestAllTypes::repeated_import_message(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_import_message)
return repeated_import_message_.Get(index);
}
inline ::protobuf_unittest_import::ImportMessage* TestAllTypes::mutable_repeated_import_message(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.repeated_import_message)
return repeated_import_message_.Mutable(index);
}
inline ::protobuf_unittest_import::ImportMessage* TestAllTypes::add_repeated_import_message() {
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_import_message)
return repeated_import_message_.Add();
}
inline ::google::protobuf::RepeatedPtrField< ::protobuf_unittest_import::ImportMessage >*
TestAllTypes::mutable_repeated_import_message() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_import_message)
return &repeated_import_message_;
}
inline const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest_import::ImportMessage >&
TestAllTypes::repeated_import_message() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_import_message)
return repeated_import_message_;
}
// repeated .protobuf_unittest.TestAllTypes.NestedEnum repeated_nested_enum = 51;
inline int TestAllTypes::repeated_nested_enum_size() const {
return repeated_nested_enum_.size();
}
inline void TestAllTypes::clear_repeated_nested_enum() {
repeated_nested_enum_.Clear();
}
inline ::protobuf_unittest::TestAllTypes_NestedEnum TestAllTypes::repeated_nested_enum(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_nested_enum)
return static_cast< ::protobuf_unittest::TestAllTypes_NestedEnum >(repeated_nested_enum_.Get(index));
}
inline void TestAllTypes::set_repeated_nested_enum(int index, ::protobuf_unittest::TestAllTypes_NestedEnum value) {
assert(::protobuf_unittest::TestAllTypes_NestedEnum_IsValid(value));
repeated_nested_enum_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.repeated_nested_enum)
}
inline void TestAllTypes::add_repeated_nested_enum(::protobuf_unittest::TestAllTypes_NestedEnum value) {
assert(::protobuf_unittest::TestAllTypes_NestedEnum_IsValid(value));
repeated_nested_enum_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_nested_enum)
}
inline const ::google::protobuf::RepeatedField<int>&
TestAllTypes::repeated_nested_enum() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_nested_enum)
return repeated_nested_enum_;
}
inline ::google::protobuf::RepeatedField<int>*
TestAllTypes::mutable_repeated_nested_enum() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_nested_enum)
return &repeated_nested_enum_;
}
// repeated .protobuf_unittest.ForeignEnum repeated_foreign_enum = 52;
inline int TestAllTypes::repeated_foreign_enum_size() const {
return repeated_foreign_enum_.size();
}
inline void TestAllTypes::clear_repeated_foreign_enum() {
repeated_foreign_enum_.Clear();
}
inline ::protobuf_unittest::ForeignEnum TestAllTypes::repeated_foreign_enum(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_foreign_enum)
return static_cast< ::protobuf_unittest::ForeignEnum >(repeated_foreign_enum_.Get(index));
}
inline void TestAllTypes::set_repeated_foreign_enum(int index, ::protobuf_unittest::ForeignEnum value) {
assert(::protobuf_unittest::ForeignEnum_IsValid(value));
repeated_foreign_enum_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.repeated_foreign_enum)
}
inline void TestAllTypes::add_repeated_foreign_enum(::protobuf_unittest::ForeignEnum value) {
assert(::protobuf_unittest::ForeignEnum_IsValid(value));
repeated_foreign_enum_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_foreign_enum)
}
inline const ::google::protobuf::RepeatedField<int>&
TestAllTypes::repeated_foreign_enum() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_foreign_enum)
return repeated_foreign_enum_;
}
inline ::google::protobuf::RepeatedField<int>*
TestAllTypes::mutable_repeated_foreign_enum() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_foreign_enum)
return &repeated_foreign_enum_;
}
// repeated .protobuf_unittest_import.ImportEnum repeated_import_enum = 53;
inline int TestAllTypes::repeated_import_enum_size() const {
return repeated_import_enum_.size();
}
inline void TestAllTypes::clear_repeated_import_enum() {
repeated_import_enum_.Clear();
}
inline ::protobuf_unittest_import::ImportEnum TestAllTypes::repeated_import_enum(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_import_enum)
return static_cast< ::protobuf_unittest_import::ImportEnum >(repeated_import_enum_.Get(index));
}
inline void TestAllTypes::set_repeated_import_enum(int index, ::protobuf_unittest_import::ImportEnum value) {
assert(::protobuf_unittest_import::ImportEnum_IsValid(value));
repeated_import_enum_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.repeated_import_enum)
}
inline void TestAllTypes::add_repeated_import_enum(::protobuf_unittest_import::ImportEnum value) {
assert(::protobuf_unittest_import::ImportEnum_IsValid(value));
repeated_import_enum_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_import_enum)
}
inline const ::google::protobuf::RepeatedField<int>&
TestAllTypes::repeated_import_enum() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_import_enum)
return repeated_import_enum_;
}
inline ::google::protobuf::RepeatedField<int>*
TestAllTypes::mutable_repeated_import_enum() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_import_enum)
return &repeated_import_enum_;
}
// repeated string repeated_string_piece = 54 [ctype = STRING_PIECE];
inline int TestAllTypes::repeated_string_piece_size() const {
return repeated_string_piece_.size();
}
inline void TestAllTypes::clear_repeated_string_piece() {
repeated_string_piece_.Clear();
}
inline const ::std::string& TestAllTypes::repeated_string_piece(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_string_piece)
return repeated_string_piece_.Get(index);
}
inline ::std::string* TestAllTypes::mutable_repeated_string_piece(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.repeated_string_piece)
return repeated_string_piece_.Mutable(index);
}
inline void TestAllTypes::set_repeated_string_piece(int index, const ::std::string& value) {
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.repeated_string_piece)
repeated_string_piece_.Mutable(index)->assign(value);
}
inline void TestAllTypes::set_repeated_string_piece(int index, const char* value) {
repeated_string_piece_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestAllTypes.repeated_string_piece)
}
inline void TestAllTypes::set_repeated_string_piece(int index, const char* value, size_t size) {
repeated_string_piece_.Mutable(index)->assign(
reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestAllTypes.repeated_string_piece)
}
inline ::std::string* TestAllTypes::add_repeated_string_piece() {
return repeated_string_piece_.Add();
}
inline void TestAllTypes::add_repeated_string_piece(const ::std::string& value) {
repeated_string_piece_.Add()->assign(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_string_piece)
}
inline void TestAllTypes::add_repeated_string_piece(const char* value) {
repeated_string_piece_.Add()->assign(value);
// @@protoc_insertion_point(field_add_char:protobuf_unittest.TestAllTypes.repeated_string_piece)
}
inline void TestAllTypes::add_repeated_string_piece(const char* value, size_t size) {
repeated_string_piece_.Add()->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_add_pointer:protobuf_unittest.TestAllTypes.repeated_string_piece)
}
inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
TestAllTypes::repeated_string_piece() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_string_piece)
return repeated_string_piece_;
}
inline ::google::protobuf::RepeatedPtrField< ::std::string>*
TestAllTypes::mutable_repeated_string_piece() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_string_piece)
return &repeated_string_piece_;
}
// repeated string repeated_cord = 55 [ctype = CORD];
inline int TestAllTypes::repeated_cord_size() const {
return repeated_cord_.size();
}
inline void TestAllTypes::clear_repeated_cord() {
repeated_cord_.Clear();
}
inline const ::std::string& TestAllTypes::repeated_cord(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_cord)
return repeated_cord_.Get(index);
}
inline ::std::string* TestAllTypes::mutable_repeated_cord(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.repeated_cord)
return repeated_cord_.Mutable(index);
}
inline void TestAllTypes::set_repeated_cord(int index, const ::std::string& value) {
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.repeated_cord)
repeated_cord_.Mutable(index)->assign(value);
}
inline void TestAllTypes::set_repeated_cord(int index, const char* value) {
repeated_cord_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestAllTypes.repeated_cord)
}
inline void TestAllTypes::set_repeated_cord(int index, const char* value, size_t size) {
repeated_cord_.Mutable(index)->assign(
reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestAllTypes.repeated_cord)
}
inline ::std::string* TestAllTypes::add_repeated_cord() {
return repeated_cord_.Add();
}
inline void TestAllTypes::add_repeated_cord(const ::std::string& value) {
repeated_cord_.Add()->assign(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_cord)
}
inline void TestAllTypes::add_repeated_cord(const char* value) {
repeated_cord_.Add()->assign(value);
// @@protoc_insertion_point(field_add_char:protobuf_unittest.TestAllTypes.repeated_cord)
}
inline void TestAllTypes::add_repeated_cord(const char* value, size_t size) {
repeated_cord_.Add()->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_add_pointer:protobuf_unittest.TestAllTypes.repeated_cord)
}
inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
TestAllTypes::repeated_cord() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_cord)
return repeated_cord_;
}
inline ::google::protobuf::RepeatedPtrField< ::std::string>*
TestAllTypes::mutable_repeated_cord() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_cord)
return &repeated_cord_;
}
// repeated .protobuf_unittest.TestAllTypes.NestedMessage repeated_lazy_message = 57 [lazy = true];
inline int TestAllTypes::repeated_lazy_message_size() const {
return repeated_lazy_message_.size();
}
inline void TestAllTypes::clear_repeated_lazy_message() {
repeated_lazy_message_.Clear();
}
inline const ::protobuf_unittest::TestAllTypes_NestedMessage& TestAllTypes::repeated_lazy_message(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.repeated_lazy_message)
return repeated_lazy_message_.Get(index);
}
inline ::protobuf_unittest::TestAllTypes_NestedMessage* TestAllTypes::mutable_repeated_lazy_message(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.repeated_lazy_message)
return repeated_lazy_message_.Mutable(index);
}
inline ::protobuf_unittest::TestAllTypes_NestedMessage* TestAllTypes::add_repeated_lazy_message() {
// @@protoc_insertion_point(field_add:protobuf_unittest.TestAllTypes.repeated_lazy_message)
return repeated_lazy_message_.Add();
}
inline ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes_NestedMessage >*
TestAllTypes::mutable_repeated_lazy_message() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestAllTypes.repeated_lazy_message)
return &repeated_lazy_message_;
}
inline const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes_NestedMessage >&
TestAllTypes::repeated_lazy_message() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestAllTypes.repeated_lazy_message)
return repeated_lazy_message_;
}
// optional int32 default_int32 = 61 [default = 41];
inline bool TestAllTypes::has_default_int32() const {
return (_has_bits_[1] & 0x00080000u) != 0;
}
inline void TestAllTypes::set_has_default_int32() {
_has_bits_[1] |= 0x00080000u;
}
inline void TestAllTypes::clear_has_default_int32() {
_has_bits_[1] &= ~0x00080000u;
}
inline void TestAllTypes::clear_default_int32() {
default_int32_ = 41;
clear_has_default_int32();
}
inline ::google::protobuf::int32 TestAllTypes::default_int32() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.default_int32)
return default_int32_;
}
inline void TestAllTypes::set_default_int32(::google::protobuf::int32 value) {
set_has_default_int32();
default_int32_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.default_int32)
}
// optional int64 default_int64 = 62 [default = 42];
inline bool TestAllTypes::has_default_int64() const {
return (_has_bits_[1] & 0x00100000u) != 0;
}
inline void TestAllTypes::set_has_default_int64() {
_has_bits_[1] |= 0x00100000u;
}
inline void TestAllTypes::clear_has_default_int64() {
_has_bits_[1] &= ~0x00100000u;
}
inline void TestAllTypes::clear_default_int64() {
default_int64_ = GOOGLE_LONGLONG(42);
clear_has_default_int64();
}
inline ::google::protobuf::int64 TestAllTypes::default_int64() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.default_int64)
return default_int64_;
}
inline void TestAllTypes::set_default_int64(::google::protobuf::int64 value) {
set_has_default_int64();
default_int64_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.default_int64)
}
// optional uint32 default_uint32 = 63 [default = 43];
inline bool TestAllTypes::has_default_uint32() const {
return (_has_bits_[1] & 0x00200000u) != 0;
}
inline void TestAllTypes::set_has_default_uint32() {
_has_bits_[1] |= 0x00200000u;
}
inline void TestAllTypes::clear_has_default_uint32() {
_has_bits_[1] &= ~0x00200000u;
}
inline void TestAllTypes::clear_default_uint32() {
default_uint32_ = 43u;
clear_has_default_uint32();
}
inline ::google::protobuf::uint32 TestAllTypes::default_uint32() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.default_uint32)
return default_uint32_;
}
inline void TestAllTypes::set_default_uint32(::google::protobuf::uint32 value) {
set_has_default_uint32();
default_uint32_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.default_uint32)
}
// optional uint64 default_uint64 = 64 [default = 44];
inline bool TestAllTypes::has_default_uint64() const {
return (_has_bits_[1] & 0x00400000u) != 0;
}
inline void TestAllTypes::set_has_default_uint64() {
_has_bits_[1] |= 0x00400000u;
}
inline void TestAllTypes::clear_has_default_uint64() {
_has_bits_[1] &= ~0x00400000u;
}
inline void TestAllTypes::clear_default_uint64() {
default_uint64_ = GOOGLE_ULONGLONG(44);
clear_has_default_uint64();
}
inline ::google::protobuf::uint64 TestAllTypes::default_uint64() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.default_uint64)
return default_uint64_;
}
inline void TestAllTypes::set_default_uint64(::google::protobuf::uint64 value) {
set_has_default_uint64();
default_uint64_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.default_uint64)
}
// optional sint32 default_sint32 = 65 [default = -45];
inline bool TestAllTypes::has_default_sint32() const {
return (_has_bits_[1] & 0x00800000u) != 0;
}
inline void TestAllTypes::set_has_default_sint32() {
_has_bits_[1] |= 0x00800000u;
}
inline void TestAllTypes::clear_has_default_sint32() {
_has_bits_[1] &= ~0x00800000u;
}
inline void TestAllTypes::clear_default_sint32() {
default_sint32_ = -45;
clear_has_default_sint32();
}
inline ::google::protobuf::int32 TestAllTypes::default_sint32() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.default_sint32)
return default_sint32_;
}
inline void TestAllTypes::set_default_sint32(::google::protobuf::int32 value) {
set_has_default_sint32();
default_sint32_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.default_sint32)
}
// optional sint64 default_sint64 = 66 [default = 46];
inline bool TestAllTypes::has_default_sint64() const {
return (_has_bits_[1] & 0x01000000u) != 0;
}
inline void TestAllTypes::set_has_default_sint64() {
_has_bits_[1] |= 0x01000000u;
}
inline void TestAllTypes::clear_has_default_sint64() {
_has_bits_[1] &= ~0x01000000u;
}
inline void TestAllTypes::clear_default_sint64() {
default_sint64_ = GOOGLE_LONGLONG(46);
clear_has_default_sint64();
}
inline ::google::protobuf::int64 TestAllTypes::default_sint64() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.default_sint64)
return default_sint64_;
}
inline void TestAllTypes::set_default_sint64(::google::protobuf::int64 value) {
set_has_default_sint64();
default_sint64_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.default_sint64)
}
// optional fixed32 default_fixed32 = 67 [default = 47];
inline bool TestAllTypes::has_default_fixed32() const {
return (_has_bits_[1] & 0x02000000u) != 0;
}
inline void TestAllTypes::set_has_default_fixed32() {
_has_bits_[1] |= 0x02000000u;
}
inline void TestAllTypes::clear_has_default_fixed32() {
_has_bits_[1] &= ~0x02000000u;
}
inline void TestAllTypes::clear_default_fixed32() {
default_fixed32_ = 47u;
clear_has_default_fixed32();
}
inline ::google::protobuf::uint32 TestAllTypes::default_fixed32() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.default_fixed32)
return default_fixed32_;
}
inline void TestAllTypes::set_default_fixed32(::google::protobuf::uint32 value) {
set_has_default_fixed32();
default_fixed32_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.default_fixed32)
}
// optional fixed64 default_fixed64 = 68 [default = 48];
inline bool TestAllTypes::has_default_fixed64() const {
return (_has_bits_[1] & 0x04000000u) != 0;
}
inline void TestAllTypes::set_has_default_fixed64() {
_has_bits_[1] |= 0x04000000u;
}
inline void TestAllTypes::clear_has_default_fixed64() {
_has_bits_[1] &= ~0x04000000u;
}
inline void TestAllTypes::clear_default_fixed64() {
default_fixed64_ = GOOGLE_ULONGLONG(48);
clear_has_default_fixed64();
}
inline ::google::protobuf::uint64 TestAllTypes::default_fixed64() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.default_fixed64)
return default_fixed64_;
}
inline void TestAllTypes::set_default_fixed64(::google::protobuf::uint64 value) {
set_has_default_fixed64();
default_fixed64_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.default_fixed64)
}
// optional sfixed32 default_sfixed32 = 69 [default = 49];
inline bool TestAllTypes::has_default_sfixed32() const {
return (_has_bits_[1] & 0x08000000u) != 0;
}
inline void TestAllTypes::set_has_default_sfixed32() {
_has_bits_[1] |= 0x08000000u;
}
inline void TestAllTypes::clear_has_default_sfixed32() {
_has_bits_[1] &= ~0x08000000u;
}
inline void TestAllTypes::clear_default_sfixed32() {
default_sfixed32_ = 49;
clear_has_default_sfixed32();
}
inline ::google::protobuf::int32 TestAllTypes::default_sfixed32() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.default_sfixed32)
return default_sfixed32_;
}
inline void TestAllTypes::set_default_sfixed32(::google::protobuf::int32 value) {
set_has_default_sfixed32();
default_sfixed32_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.default_sfixed32)
}
// optional sfixed64 default_sfixed64 = 70 [default = -50];
inline bool TestAllTypes::has_default_sfixed64() const {
return (_has_bits_[1] & 0x10000000u) != 0;
}
inline void TestAllTypes::set_has_default_sfixed64() {
_has_bits_[1] |= 0x10000000u;
}
inline void TestAllTypes::clear_has_default_sfixed64() {
_has_bits_[1] &= ~0x10000000u;
}
inline void TestAllTypes::clear_default_sfixed64() {
default_sfixed64_ = GOOGLE_LONGLONG(-50);
clear_has_default_sfixed64();
}
inline ::google::protobuf::int64 TestAllTypes::default_sfixed64() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.default_sfixed64)
return default_sfixed64_;
}
inline void TestAllTypes::set_default_sfixed64(::google::protobuf::int64 value) {
set_has_default_sfixed64();
default_sfixed64_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.default_sfixed64)
}
// optional float default_float = 71 [default = 51.5];
inline bool TestAllTypes::has_default_float() const {
return (_has_bits_[1] & 0x20000000u) != 0;
}
inline void TestAllTypes::set_has_default_float() {
_has_bits_[1] |= 0x20000000u;
}
inline void TestAllTypes::clear_has_default_float() {
_has_bits_[1] &= ~0x20000000u;
}
inline void TestAllTypes::clear_default_float() {
default_float_ = 51.5f;
clear_has_default_float();
}
inline float TestAllTypes::default_float() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.default_float)
return default_float_;
}
inline void TestAllTypes::set_default_float(float value) {
set_has_default_float();
default_float_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.default_float)
}
// optional double default_double = 72 [default = 52000];
inline bool TestAllTypes::has_default_double() const {
return (_has_bits_[1] & 0x40000000u) != 0;
}
inline void TestAllTypes::set_has_default_double() {
_has_bits_[1] |= 0x40000000u;
}
inline void TestAllTypes::clear_has_default_double() {
_has_bits_[1] &= ~0x40000000u;
}
inline void TestAllTypes::clear_default_double() {
default_double_ = 52000;
clear_has_default_double();
}
inline double TestAllTypes::default_double() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.default_double)
return default_double_;
}
inline void TestAllTypes::set_default_double(double value) {
set_has_default_double();
default_double_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.default_double)
}
// optional bool default_bool = 73 [default = true];
inline bool TestAllTypes::has_default_bool() const {
return (_has_bits_[1] & 0x80000000u) != 0;
}
inline void TestAllTypes::set_has_default_bool() {
_has_bits_[1] |= 0x80000000u;
}
inline void TestAllTypes::clear_has_default_bool() {
_has_bits_[1] &= ~0x80000000u;
}
inline void TestAllTypes::clear_default_bool() {
default_bool_ = true;
clear_has_default_bool();
}
inline bool TestAllTypes::default_bool() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.default_bool)
return default_bool_;
}
inline void TestAllTypes::set_default_bool(bool value) {
set_has_default_bool();
default_bool_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.default_bool)
}
// optional string default_string = 74 [default = "hello"];
inline bool TestAllTypes::has_default_string() const {
return (_has_bits_[2] & 0x00000001u) != 0;
}
inline void TestAllTypes::set_has_default_string() {
_has_bits_[2] |= 0x00000001u;
}
inline void TestAllTypes::clear_has_default_string() {
_has_bits_[2] &= ~0x00000001u;
}
inline void TestAllTypes::clear_default_string() {
default_string_.ClearToDefault(_default_default_string_, GetArenaNoVirtual());
clear_has_default_string();
}
inline const ::std::string& TestAllTypes::default_string() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.default_string)
return default_string_.Get(_default_default_string_);
}
inline void TestAllTypes::set_default_string(const ::std::string& value) {
set_has_default_string();
default_string_.Set(_default_default_string_, value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.default_string)
}
inline void TestAllTypes::set_default_string(const char* value) {
set_has_default_string();
default_string_.Set(_default_default_string_, ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestAllTypes.default_string)
}
inline void TestAllTypes::set_default_string(const char* value,
size_t size) {
set_has_default_string();
default_string_.Set(_default_default_string_, ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestAllTypes.default_string)
}
inline ::std::string* TestAllTypes::mutable_default_string() {
set_has_default_string();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.default_string)
return default_string_.Mutable(_default_default_string_, GetArenaNoVirtual());
}
inline ::std::string* TestAllTypes::release_default_string() {
clear_has_default_string();
return default_string_.Release(_default_default_string_, GetArenaNoVirtual());
}
inline ::std::string* TestAllTypes::unsafe_arena_release_default_string() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_default_string();
return default_string_.UnsafeArenaRelease(_default_default_string_,
GetArenaNoVirtual());
}
inline void TestAllTypes::set_allocated_default_string(::std::string* default_string) {
if (default_string != NULL) {
set_has_default_string();
} else {
clear_has_default_string();
}
default_string_.SetAllocated(_default_default_string_, default_string,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.default_string)
}
inline void TestAllTypes::unsafe_arena_set_allocated_default_string(
::std::string* default_string) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (default_string != NULL) {
set_has_default_string();
} else {
clear_has_default_string();
}
default_string_.UnsafeArenaSetAllocated(_default_default_string_,
default_string, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.default_string)
}
// optional bytes default_bytes = 75 [default = "world"];
inline bool TestAllTypes::has_default_bytes() const {
return (_has_bits_[2] & 0x00000002u) != 0;
}
inline void TestAllTypes::set_has_default_bytes() {
_has_bits_[2] |= 0x00000002u;
}
inline void TestAllTypes::clear_has_default_bytes() {
_has_bits_[2] &= ~0x00000002u;
}
inline void TestAllTypes::clear_default_bytes() {
default_bytes_.ClearToDefault(_default_default_bytes_, GetArenaNoVirtual());
clear_has_default_bytes();
}
inline const ::std::string& TestAllTypes::default_bytes() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.default_bytes)
return default_bytes_.Get(_default_default_bytes_);
}
inline void TestAllTypes::set_default_bytes(const ::std::string& value) {
set_has_default_bytes();
default_bytes_.Set(_default_default_bytes_, value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.default_bytes)
}
inline void TestAllTypes::set_default_bytes(const char* value) {
set_has_default_bytes();
default_bytes_.Set(_default_default_bytes_, ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestAllTypes.default_bytes)
}
inline void TestAllTypes::set_default_bytes(const void* value,
size_t size) {
set_has_default_bytes();
default_bytes_.Set(_default_default_bytes_, ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestAllTypes.default_bytes)
}
inline ::std::string* TestAllTypes::mutable_default_bytes() {
set_has_default_bytes();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.default_bytes)
return default_bytes_.Mutable(_default_default_bytes_, GetArenaNoVirtual());
}
inline ::std::string* TestAllTypes::release_default_bytes() {
clear_has_default_bytes();
return default_bytes_.Release(_default_default_bytes_, GetArenaNoVirtual());
}
inline ::std::string* TestAllTypes::unsafe_arena_release_default_bytes() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_default_bytes();
return default_bytes_.UnsafeArenaRelease(_default_default_bytes_,
GetArenaNoVirtual());
}
inline void TestAllTypes::set_allocated_default_bytes(::std::string* default_bytes) {
if (default_bytes != NULL) {
set_has_default_bytes();
} else {
clear_has_default_bytes();
}
default_bytes_.SetAllocated(_default_default_bytes_, default_bytes,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.default_bytes)
}
inline void TestAllTypes::unsafe_arena_set_allocated_default_bytes(
::std::string* default_bytes) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (default_bytes != NULL) {
set_has_default_bytes();
} else {
clear_has_default_bytes();
}
default_bytes_.UnsafeArenaSetAllocated(_default_default_bytes_,
default_bytes, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.default_bytes)
}
// optional .protobuf_unittest.TestAllTypes.NestedEnum default_nested_enum = 81 [default = BAR];
inline bool TestAllTypes::has_default_nested_enum() const {
return (_has_bits_[2] & 0x00000004u) != 0;
}
inline void TestAllTypes::set_has_default_nested_enum() {
_has_bits_[2] |= 0x00000004u;
}
inline void TestAllTypes::clear_has_default_nested_enum() {
_has_bits_[2] &= ~0x00000004u;
}
inline void TestAllTypes::clear_default_nested_enum() {
default_nested_enum_ = 2;
clear_has_default_nested_enum();
}
inline ::protobuf_unittest::TestAllTypes_NestedEnum TestAllTypes::default_nested_enum() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.default_nested_enum)
return static_cast< ::protobuf_unittest::TestAllTypes_NestedEnum >(default_nested_enum_);
}
inline void TestAllTypes::set_default_nested_enum(::protobuf_unittest::TestAllTypes_NestedEnum value) {
assert(::protobuf_unittest::TestAllTypes_NestedEnum_IsValid(value));
set_has_default_nested_enum();
default_nested_enum_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.default_nested_enum)
}
// optional .protobuf_unittest.ForeignEnum default_foreign_enum = 82 [default = FOREIGN_BAR];
inline bool TestAllTypes::has_default_foreign_enum() const {
return (_has_bits_[2] & 0x00000008u) != 0;
}
inline void TestAllTypes::set_has_default_foreign_enum() {
_has_bits_[2] |= 0x00000008u;
}
inline void TestAllTypes::clear_has_default_foreign_enum() {
_has_bits_[2] &= ~0x00000008u;
}
inline void TestAllTypes::clear_default_foreign_enum() {
default_foreign_enum_ = 5;
clear_has_default_foreign_enum();
}
inline ::protobuf_unittest::ForeignEnum TestAllTypes::default_foreign_enum() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.default_foreign_enum)
return static_cast< ::protobuf_unittest::ForeignEnum >(default_foreign_enum_);
}
inline void TestAllTypes::set_default_foreign_enum(::protobuf_unittest::ForeignEnum value) {
assert(::protobuf_unittest::ForeignEnum_IsValid(value));
set_has_default_foreign_enum();
default_foreign_enum_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.default_foreign_enum)
}
// optional .protobuf_unittest_import.ImportEnum default_import_enum = 83 [default = IMPORT_BAR];
inline bool TestAllTypes::has_default_import_enum() const {
return (_has_bits_[2] & 0x00000010u) != 0;
}
inline void TestAllTypes::set_has_default_import_enum() {
_has_bits_[2] |= 0x00000010u;
}
inline void TestAllTypes::clear_has_default_import_enum() {
_has_bits_[2] &= ~0x00000010u;
}
inline void TestAllTypes::clear_default_import_enum() {
default_import_enum_ = 8;
clear_has_default_import_enum();
}
inline ::protobuf_unittest_import::ImportEnum TestAllTypes::default_import_enum() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.default_import_enum)
return static_cast< ::protobuf_unittest_import::ImportEnum >(default_import_enum_);
}
inline void TestAllTypes::set_default_import_enum(::protobuf_unittest_import::ImportEnum value) {
assert(::protobuf_unittest_import::ImportEnum_IsValid(value));
set_has_default_import_enum();
default_import_enum_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.default_import_enum)
}
// optional string default_string_piece = 84 [default = "abc", ctype = STRING_PIECE];
inline bool TestAllTypes::has_default_string_piece() const {
return (_has_bits_[2] & 0x00000020u) != 0;
}
inline void TestAllTypes::set_has_default_string_piece() {
_has_bits_[2] |= 0x00000020u;
}
inline void TestAllTypes::clear_has_default_string_piece() {
_has_bits_[2] &= ~0x00000020u;
}
inline void TestAllTypes::clear_default_string_piece() {
default_string_piece_.ClearToDefault(_default_default_string_piece_, GetArenaNoVirtual());
clear_has_default_string_piece();
}
inline const ::std::string& TestAllTypes::default_string_piece() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.default_string_piece)
return default_string_piece_.Get(_default_default_string_piece_);
}
inline void TestAllTypes::set_default_string_piece(const ::std::string& value) {
set_has_default_string_piece();
default_string_piece_.Set(_default_default_string_piece_, value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.default_string_piece)
}
inline void TestAllTypes::set_default_string_piece(const char* value) {
set_has_default_string_piece();
default_string_piece_.Set(_default_default_string_piece_, ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestAllTypes.default_string_piece)
}
inline void TestAllTypes::set_default_string_piece(const char* value,
size_t size) {
set_has_default_string_piece();
default_string_piece_.Set(_default_default_string_piece_, ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestAllTypes.default_string_piece)
}
inline ::std::string* TestAllTypes::mutable_default_string_piece() {
set_has_default_string_piece();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.default_string_piece)
return default_string_piece_.Mutable(_default_default_string_piece_, GetArenaNoVirtual());
}
inline ::std::string* TestAllTypes::release_default_string_piece() {
clear_has_default_string_piece();
return default_string_piece_.Release(_default_default_string_piece_, GetArenaNoVirtual());
}
inline ::std::string* TestAllTypes::unsafe_arena_release_default_string_piece() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_default_string_piece();
return default_string_piece_.UnsafeArenaRelease(_default_default_string_piece_,
GetArenaNoVirtual());
}
inline void TestAllTypes::set_allocated_default_string_piece(::std::string* default_string_piece) {
if (default_string_piece != NULL) {
set_has_default_string_piece();
} else {
clear_has_default_string_piece();
}
default_string_piece_.SetAllocated(_default_default_string_piece_, default_string_piece,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.default_string_piece)
}
inline void TestAllTypes::unsafe_arena_set_allocated_default_string_piece(
::std::string* default_string_piece) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (default_string_piece != NULL) {
set_has_default_string_piece();
} else {
clear_has_default_string_piece();
}
default_string_piece_.UnsafeArenaSetAllocated(_default_default_string_piece_,
default_string_piece, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.default_string_piece)
}
// optional string default_cord = 85 [default = "123", ctype = CORD];
inline bool TestAllTypes::has_default_cord() const {
return (_has_bits_[2] & 0x00000040u) != 0;
}
inline void TestAllTypes::set_has_default_cord() {
_has_bits_[2] |= 0x00000040u;
}
inline void TestAllTypes::clear_has_default_cord() {
_has_bits_[2] &= ~0x00000040u;
}
inline void TestAllTypes::clear_default_cord() {
default_cord_.ClearToDefault(_default_default_cord_, GetArenaNoVirtual());
clear_has_default_cord();
}
inline const ::std::string& TestAllTypes::default_cord() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.default_cord)
return default_cord_.Get(_default_default_cord_);
}
inline void TestAllTypes::set_default_cord(const ::std::string& value) {
set_has_default_cord();
default_cord_.Set(_default_default_cord_, value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.default_cord)
}
inline void TestAllTypes::set_default_cord(const char* value) {
set_has_default_cord();
default_cord_.Set(_default_default_cord_, ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestAllTypes.default_cord)
}
inline void TestAllTypes::set_default_cord(const char* value,
size_t size) {
set_has_default_cord();
default_cord_.Set(_default_default_cord_, ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestAllTypes.default_cord)
}
inline ::std::string* TestAllTypes::mutable_default_cord() {
set_has_default_cord();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.default_cord)
return default_cord_.Mutable(_default_default_cord_, GetArenaNoVirtual());
}
inline ::std::string* TestAllTypes::release_default_cord() {
clear_has_default_cord();
return default_cord_.Release(_default_default_cord_, GetArenaNoVirtual());
}
inline ::std::string* TestAllTypes::unsafe_arena_release_default_cord() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_default_cord();
return default_cord_.UnsafeArenaRelease(_default_default_cord_,
GetArenaNoVirtual());
}
inline void TestAllTypes::set_allocated_default_cord(::std::string* default_cord) {
if (default_cord != NULL) {
set_has_default_cord();
} else {
clear_has_default_cord();
}
default_cord_.SetAllocated(_default_default_cord_, default_cord,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.default_cord)
}
inline void TestAllTypes::unsafe_arena_set_allocated_default_cord(
::std::string* default_cord) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (default_cord != NULL) {
set_has_default_cord();
} else {
clear_has_default_cord();
}
default_cord_.UnsafeArenaSetAllocated(_default_default_cord_,
default_cord, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.default_cord)
}
// optional uint32 oneof_uint32 = 111;
inline bool TestAllTypes::has_oneof_uint32() const {
return oneof_field_case() == kOneofUint32;
}
inline void TestAllTypes::set_has_oneof_uint32() {
_oneof_case_[0] = kOneofUint32;
}
inline void TestAllTypes::clear_oneof_uint32() {
if (has_oneof_uint32()) {
oneof_field_.oneof_uint32_ = 0u;
clear_has_oneof_field();
}
}
inline ::google::protobuf::uint32 TestAllTypes::oneof_uint32() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.oneof_uint32)
if (has_oneof_uint32()) {
return oneof_field_.oneof_uint32_;
}
return 0u;
}
inline void TestAllTypes::set_oneof_uint32(::google::protobuf::uint32 value) {
if (!has_oneof_uint32()) {
clear_oneof_field();
set_has_oneof_uint32();
}
oneof_field_.oneof_uint32_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.oneof_uint32)
}
// optional .protobuf_unittest.TestAllTypes.NestedMessage oneof_nested_message = 112;
inline bool TestAllTypes::has_oneof_nested_message() const {
return oneof_field_case() == kOneofNestedMessage;
}
inline void TestAllTypes::set_has_oneof_nested_message() {
_oneof_case_[0] = kOneofNestedMessage;
}
inline void TestAllTypes::clear_oneof_nested_message() {
if (has_oneof_nested_message()) {
if (GetArenaNoVirtual() == NULL) {
delete oneof_field_.oneof_nested_message_;
}
clear_has_oneof_field();
}
}
inline const ::protobuf_unittest::TestAllTypes_NestedMessage& TestAllTypes::oneof_nested_message() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.oneof_nested_message)
return has_oneof_nested_message()
? *oneof_field_.oneof_nested_message_
: ::protobuf_unittest::TestAllTypes_NestedMessage::default_instance();
}
inline ::protobuf_unittest::TestAllTypes_NestedMessage* TestAllTypes::mutable_oneof_nested_message() {
if (!has_oneof_nested_message()) {
clear_oneof_field();
set_has_oneof_nested_message();
oneof_field_.oneof_nested_message_ =
::google::protobuf::Arena::CreateMessage< ::protobuf_unittest::TestAllTypes_NestedMessage >(
GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.oneof_nested_message)
return oneof_field_.oneof_nested_message_;
}
inline ::protobuf_unittest::TestAllTypes_NestedMessage* TestAllTypes::release_oneof_nested_message() {
if (has_oneof_nested_message()) {
clear_has_oneof_field();
if (GetArenaNoVirtual() != NULL) {
::protobuf_unittest::TestAllTypes_NestedMessage* temp = new ::protobuf_unittest::TestAllTypes_NestedMessage;
temp->MergeFrom(*oneof_field_.oneof_nested_message_);
oneof_field_.oneof_nested_message_ = NULL;
return temp;
} else {
::protobuf_unittest::TestAllTypes_NestedMessage* temp = oneof_field_.oneof_nested_message_;
oneof_field_.oneof_nested_message_ = NULL;
return temp;
}
} else {
return NULL;
}
}
inline void TestAllTypes::set_allocated_oneof_nested_message(::protobuf_unittest::TestAllTypes_NestedMessage* oneof_nested_message) {
clear_oneof_field();
if (oneof_nested_message) {
if (GetArenaNoVirtual() != NULL &&
::google::protobuf::Arena::GetArena(oneof_nested_message) == NULL) {
GetArenaNoVirtual()->Own(oneof_nested_message);
} else if (GetArenaNoVirtual() !=
::google::protobuf::Arena::GetArena(oneof_nested_message)) {
::protobuf_unittest::TestAllTypes_NestedMessage* new_oneof_nested_message =
::google::protobuf::Arena::CreateMessage< ::protobuf_unittest::TestAllTypes_NestedMessage >(
GetArenaNoVirtual());
new_oneof_nested_message->CopyFrom(*oneof_nested_message);
oneof_nested_message = new_oneof_nested_message;
}
set_has_oneof_nested_message();
oneof_field_.oneof_nested_message_ = oneof_nested_message;
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.oneof_nested_message)
}
inline ::protobuf_unittest::TestAllTypes_NestedMessage* TestAllTypes::unsafe_arena_release_oneof_nested_message() {
if (has_oneof_nested_message()) {
clear_has_oneof_field();
::protobuf_unittest::TestAllTypes_NestedMessage* temp = oneof_field_.oneof_nested_message_;
oneof_field_.oneof_nested_message_ = NULL;
return temp;
} else {
return NULL;
}
}
inline void TestAllTypes::unsafe_arena_set_allocated_oneof_nested_message(::protobuf_unittest::TestAllTypes_NestedMessage* oneof_nested_message) {
clear_oneof_field();
if (oneof_nested_message) {
set_has_oneof_nested_message();
oneof_field_.oneof_nested_message_ = oneof_nested_message;
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf_unittest.TestAllTypes.oneof_nested_message)
}
// optional string oneof_string = 113;
inline bool TestAllTypes::has_oneof_string() const {
return oneof_field_case() == kOneofString;
}
inline void TestAllTypes::set_has_oneof_string() {
_oneof_case_[0] = kOneofString;
}
inline void TestAllTypes::clear_oneof_string() {
if (has_oneof_string()) {
oneof_field_.oneof_string_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
clear_has_oneof_field();
}
}
inline const ::std::string& TestAllTypes::oneof_string() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.oneof_string)
if (has_oneof_string()) {
return oneof_field_.oneof_string_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
return *&::google::protobuf::internal::GetEmptyStringAlreadyInited();
}
inline void TestAllTypes::set_oneof_string(const ::std::string& value) {
if (!has_oneof_string()) {
clear_oneof_field();
set_has_oneof_string();
oneof_field_.oneof_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
oneof_field_.oneof_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.oneof_string)
}
inline void TestAllTypes::set_oneof_string(const char* value) {
if (!has_oneof_string()) {
clear_oneof_field();
set_has_oneof_string();
oneof_field_.oneof_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
oneof_field_.oneof_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
::std::string(value), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestAllTypes.oneof_string)
}
inline void TestAllTypes::set_oneof_string(const char* value,
size_t size) {
if (!has_oneof_string()) {
clear_oneof_field();
set_has_oneof_string();
oneof_field_.oneof_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
oneof_field_.oneof_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestAllTypes.oneof_string)
}
inline ::std::string* TestAllTypes::mutable_oneof_string() {
if (!has_oneof_string()) {
clear_oneof_field();
set_has_oneof_string();
oneof_field_.oneof_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
return oneof_field_.oneof_string_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.oneof_string)
}
inline ::std::string* TestAllTypes::release_oneof_string() {
if (has_oneof_string()) {
clear_has_oneof_field();
return oneof_field_.oneof_string_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
} else {
return NULL;
}
}
inline ::std::string* TestAllTypes::unsafe_arena_release_oneof_string() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (has_oneof_string()) {
clear_has_oneof_field();
return oneof_field_.oneof_string_.UnsafeArenaRelease(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
} else {
return NULL;
}
}
inline void TestAllTypes::set_allocated_oneof_string(::std::string* oneof_string) {
if (!has_oneof_string()) {
oneof_field_.oneof_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
clear_oneof_field();
if (oneof_string != NULL) {
set_has_oneof_string();
oneof_field_.oneof_string_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), oneof_string,
GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.oneof_string)
}
inline void TestAllTypes::unsafe_arena_set_allocated_oneof_string(::std::string* oneof_string) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (!has_oneof_string()) {
oneof_field_.oneof_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
clear_oneof_field();
if (oneof_string) {
set_has_oneof_string();
oneof_field_.oneof_string_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), oneof_string, GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.oneof_string)
}
// optional bytes oneof_bytes = 114;
inline bool TestAllTypes::has_oneof_bytes() const {
return oneof_field_case() == kOneofBytes;
}
inline void TestAllTypes::set_has_oneof_bytes() {
_oneof_case_[0] = kOneofBytes;
}
inline void TestAllTypes::clear_oneof_bytes() {
if (has_oneof_bytes()) {
oneof_field_.oneof_bytes_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
clear_has_oneof_field();
}
}
inline const ::std::string& TestAllTypes::oneof_bytes() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestAllTypes.oneof_bytes)
if (has_oneof_bytes()) {
return oneof_field_.oneof_bytes_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
return *&::google::protobuf::internal::GetEmptyStringAlreadyInited();
}
inline void TestAllTypes::set_oneof_bytes(const ::std::string& value) {
if (!has_oneof_bytes()) {
clear_oneof_field();
set_has_oneof_bytes();
oneof_field_.oneof_bytes_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
oneof_field_.oneof_bytes_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestAllTypes.oneof_bytes)
}
inline void TestAllTypes::set_oneof_bytes(const char* value) {
if (!has_oneof_bytes()) {
clear_oneof_field();
set_has_oneof_bytes();
oneof_field_.oneof_bytes_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
oneof_field_.oneof_bytes_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
::std::string(value), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestAllTypes.oneof_bytes)
}
inline void TestAllTypes::set_oneof_bytes(const void* value,
size_t size) {
if (!has_oneof_bytes()) {
clear_oneof_field();
set_has_oneof_bytes();
oneof_field_.oneof_bytes_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
oneof_field_.oneof_bytes_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestAllTypes.oneof_bytes)
}
inline ::std::string* TestAllTypes::mutable_oneof_bytes() {
if (!has_oneof_bytes()) {
clear_oneof_field();
set_has_oneof_bytes();
oneof_field_.oneof_bytes_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
return oneof_field_.oneof_bytes_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestAllTypes.oneof_bytes)
}
inline ::std::string* TestAllTypes::release_oneof_bytes() {
if (has_oneof_bytes()) {
clear_has_oneof_field();
return oneof_field_.oneof_bytes_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
} else {
return NULL;
}
}
inline ::std::string* TestAllTypes::unsafe_arena_release_oneof_bytes() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (has_oneof_bytes()) {
clear_has_oneof_field();
return oneof_field_.oneof_bytes_.UnsafeArenaRelease(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
} else {
return NULL;
}
}
inline void TestAllTypes::set_allocated_oneof_bytes(::std::string* oneof_bytes) {
if (!has_oneof_bytes()) {
oneof_field_.oneof_bytes_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
clear_oneof_field();
if (oneof_bytes != NULL) {
set_has_oneof_bytes();
oneof_field_.oneof_bytes_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), oneof_bytes,
GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.oneof_bytes)
}
inline void TestAllTypes::unsafe_arena_set_allocated_oneof_bytes(::std::string* oneof_bytes) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (!has_oneof_bytes()) {
oneof_field_.oneof_bytes_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
clear_oneof_field();
if (oneof_bytes) {
set_has_oneof_bytes();
oneof_field_.oneof_bytes_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), oneof_bytes, GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestAllTypes.oneof_bytes)
}
inline bool TestAllTypes::has_oneof_field() const {
return oneof_field_case() != ONEOF_FIELD_NOT_SET;
}
inline void TestAllTypes::clear_has_oneof_field() {
_oneof_case_[0] = ONEOF_FIELD_NOT_SET;
}
inline TestAllTypes::OneofFieldCase TestAllTypes::oneof_field_case() const {
return TestAllTypes::OneofFieldCase(_oneof_case_[0]);
}
// -------------------------------------------------------------------
// NestedTestAllTypes
// optional .protobuf_unittest.NestedTestAllTypes child = 1;
inline bool NestedTestAllTypes::has_child() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void NestedTestAllTypes::set_has_child() {
_has_bits_[0] |= 0x00000001u;
}
inline void NestedTestAllTypes::clear_has_child() {
_has_bits_[0] &= ~0x00000001u;
}
inline void NestedTestAllTypes::clear_child() {
if (child_ != NULL) child_->::protobuf_unittest::NestedTestAllTypes::Clear();
clear_has_child();
}
inline const ::protobuf_unittest::NestedTestAllTypes& NestedTestAllTypes::child() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.NestedTestAllTypes.child)
return child_ != NULL ? *child_ : *default_instance_->child_;
}
inline ::protobuf_unittest::NestedTestAllTypes* NestedTestAllTypes::mutable_child() {
set_has_child();
if (child_ == NULL) {
_slow_mutable_child();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.NestedTestAllTypes.child)
return child_;
}
inline ::protobuf_unittest::NestedTestAllTypes* NestedTestAllTypes::release_child() {
clear_has_child();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_child();
} else {
::protobuf_unittest::NestedTestAllTypes* temp = child_;
child_ = NULL;
return temp;
}
}
inline void NestedTestAllTypes::set_allocated_child(::protobuf_unittest::NestedTestAllTypes* child) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete child_;
}
if (child != NULL) {
_slow_set_allocated_child(message_arena, &child);
}
child_ = child;
if (child) {
set_has_child();
} else {
clear_has_child();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.NestedTestAllTypes.child)
}
// optional .protobuf_unittest.TestAllTypes payload = 2;
inline bool NestedTestAllTypes::has_payload() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void NestedTestAllTypes::set_has_payload() {
_has_bits_[0] |= 0x00000002u;
}
inline void NestedTestAllTypes::clear_has_payload() {
_has_bits_[0] &= ~0x00000002u;
}
inline void NestedTestAllTypes::clear_payload() {
if (payload_ != NULL) payload_->::protobuf_unittest::TestAllTypes::Clear();
clear_has_payload();
}
inline const ::protobuf_unittest::TestAllTypes& NestedTestAllTypes::payload() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.NestedTestAllTypes.payload)
return payload_ != NULL ? *payload_ : *default_instance_->payload_;
}
inline ::protobuf_unittest::TestAllTypes* NestedTestAllTypes::mutable_payload() {
set_has_payload();
if (payload_ == NULL) {
_slow_mutable_payload();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.NestedTestAllTypes.payload)
return payload_;
}
inline ::protobuf_unittest::TestAllTypes* NestedTestAllTypes::release_payload() {
clear_has_payload();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_payload();
} else {
::protobuf_unittest::TestAllTypes* temp = payload_;
payload_ = NULL;
return temp;
}
}
inline void NestedTestAllTypes::set_allocated_payload(::protobuf_unittest::TestAllTypes* payload) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete payload_;
}
if (payload != NULL) {
_slow_set_allocated_payload(message_arena, &payload);
}
payload_ = payload;
if (payload) {
set_has_payload();
} else {
clear_has_payload();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.NestedTestAllTypes.payload)
}
// repeated .protobuf_unittest.NestedTestAllTypes repeated_child = 3;
inline int NestedTestAllTypes::repeated_child_size() const {
return repeated_child_.size();
}
inline void NestedTestAllTypes::clear_repeated_child() {
repeated_child_.Clear();
}
inline const ::protobuf_unittest::NestedTestAllTypes& NestedTestAllTypes::repeated_child(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.NestedTestAllTypes.repeated_child)
return repeated_child_.Get(index);
}
inline ::protobuf_unittest::NestedTestAllTypes* NestedTestAllTypes::mutable_repeated_child(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.NestedTestAllTypes.repeated_child)
return repeated_child_.Mutable(index);
}
inline ::protobuf_unittest::NestedTestAllTypes* NestedTestAllTypes::add_repeated_child() {
// @@protoc_insertion_point(field_add:protobuf_unittest.NestedTestAllTypes.repeated_child)
return repeated_child_.Add();
}
inline ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::NestedTestAllTypes >*
NestedTestAllTypes::mutable_repeated_child() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.NestedTestAllTypes.repeated_child)
return &repeated_child_;
}
inline const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::NestedTestAllTypes >&
NestedTestAllTypes::repeated_child() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.NestedTestAllTypes.repeated_child)
return repeated_child_;
}
// -------------------------------------------------------------------
// TestDeprecatedFields
// optional int32 deprecated_int32 = 1 [deprecated = true];
inline bool TestDeprecatedFields::has_deprecated_int32() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestDeprecatedFields::set_has_deprecated_int32() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestDeprecatedFields::clear_has_deprecated_int32() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestDeprecatedFields::clear_deprecated_int32() {
deprecated_int32_ = 0;
clear_has_deprecated_int32();
}
inline ::google::protobuf::int32 TestDeprecatedFields::deprecated_int32() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestDeprecatedFields.deprecated_int32)
return deprecated_int32_;
}
inline void TestDeprecatedFields::set_deprecated_int32(::google::protobuf::int32 value) {
set_has_deprecated_int32();
deprecated_int32_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestDeprecatedFields.deprecated_int32)
}
// -------------------------------------------------------------------
// ForeignMessage
// optional int32 c = 1;
inline bool ForeignMessage::has_c() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void ForeignMessage::set_has_c() {
_has_bits_[0] |= 0x00000001u;
}
inline void ForeignMessage::clear_has_c() {
_has_bits_[0] &= ~0x00000001u;
}
inline void ForeignMessage::clear_c() {
c_ = 0;
clear_has_c();
}
inline ::google::protobuf::int32 ForeignMessage::c() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.ForeignMessage.c)
return c_;
}
inline void ForeignMessage::set_c(::google::protobuf::int32 value) {
set_has_c();
c_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.ForeignMessage.c)
}
// -------------------------------------------------------------------
// TestReservedFields
// -------------------------------------------------------------------
// TestAllExtensions
// -------------------------------------------------------------------
// OptionalGroup_extension
// optional int32 a = 17;
inline bool OptionalGroup_extension::has_a() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void OptionalGroup_extension::set_has_a() {
_has_bits_[0] |= 0x00000001u;
}
inline void OptionalGroup_extension::clear_has_a() {
_has_bits_[0] &= ~0x00000001u;
}
inline void OptionalGroup_extension::clear_a() {
a_ = 0;
clear_has_a();
}
inline ::google::protobuf::int32 OptionalGroup_extension::a() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.OptionalGroup_extension.a)
return a_;
}
inline void OptionalGroup_extension::set_a(::google::protobuf::int32 value) {
set_has_a();
a_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.OptionalGroup_extension.a)
}
// -------------------------------------------------------------------
// RepeatedGroup_extension
// optional int32 a = 47;
inline bool RepeatedGroup_extension::has_a() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void RepeatedGroup_extension::set_has_a() {
_has_bits_[0] |= 0x00000001u;
}
inline void RepeatedGroup_extension::clear_has_a() {
_has_bits_[0] &= ~0x00000001u;
}
inline void RepeatedGroup_extension::clear_a() {
a_ = 0;
clear_has_a();
}
inline ::google::protobuf::int32 RepeatedGroup_extension::a() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.RepeatedGroup_extension.a)
return a_;
}
inline void RepeatedGroup_extension::set_a(::google::protobuf::int32 value) {
set_has_a();
a_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.RepeatedGroup_extension.a)
}
// -------------------------------------------------------------------
// TestNestedExtension
// -------------------------------------------------------------------
// TestRequired
// required int32 a = 1;
inline bool TestRequired::has_a() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestRequired::set_has_a() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestRequired::clear_has_a() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestRequired::clear_a() {
a_ = 0;
clear_has_a();
}
inline ::google::protobuf::int32 TestRequired::a() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.a)
return a_;
}
inline void TestRequired::set_a(::google::protobuf::int32 value) {
set_has_a();
a_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.a)
}
// optional int32 dummy2 = 2;
inline bool TestRequired::has_dummy2() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void TestRequired::set_has_dummy2() {
_has_bits_[0] |= 0x00000002u;
}
inline void TestRequired::clear_has_dummy2() {
_has_bits_[0] &= ~0x00000002u;
}
inline void TestRequired::clear_dummy2() {
dummy2_ = 0;
clear_has_dummy2();
}
inline ::google::protobuf::int32 TestRequired::dummy2() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy2)
return dummy2_;
}
inline void TestRequired::set_dummy2(::google::protobuf::int32 value) {
set_has_dummy2();
dummy2_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy2)
}
// required int32 b = 3;
inline bool TestRequired::has_b() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void TestRequired::set_has_b() {
_has_bits_[0] |= 0x00000004u;
}
inline void TestRequired::clear_has_b() {
_has_bits_[0] &= ~0x00000004u;
}
inline void TestRequired::clear_b() {
b_ = 0;
clear_has_b();
}
inline ::google::protobuf::int32 TestRequired::b() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.b)
return b_;
}
inline void TestRequired::set_b(::google::protobuf::int32 value) {
set_has_b();
b_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.b)
}
// optional int32 dummy4 = 4;
inline bool TestRequired::has_dummy4() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void TestRequired::set_has_dummy4() {
_has_bits_[0] |= 0x00000008u;
}
inline void TestRequired::clear_has_dummy4() {
_has_bits_[0] &= ~0x00000008u;
}
inline void TestRequired::clear_dummy4() {
dummy4_ = 0;
clear_has_dummy4();
}
inline ::google::protobuf::int32 TestRequired::dummy4() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy4)
return dummy4_;
}
inline void TestRequired::set_dummy4(::google::protobuf::int32 value) {
set_has_dummy4();
dummy4_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy4)
}
// optional int32 dummy5 = 5;
inline bool TestRequired::has_dummy5() const {
return (_has_bits_[0] & 0x00000010u) != 0;
}
inline void TestRequired::set_has_dummy5() {
_has_bits_[0] |= 0x00000010u;
}
inline void TestRequired::clear_has_dummy5() {
_has_bits_[0] &= ~0x00000010u;
}
inline void TestRequired::clear_dummy5() {
dummy5_ = 0;
clear_has_dummy5();
}
inline ::google::protobuf::int32 TestRequired::dummy5() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy5)
return dummy5_;
}
inline void TestRequired::set_dummy5(::google::protobuf::int32 value) {
set_has_dummy5();
dummy5_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy5)
}
// optional int32 dummy6 = 6;
inline bool TestRequired::has_dummy6() const {
return (_has_bits_[0] & 0x00000020u) != 0;
}
inline void TestRequired::set_has_dummy6() {
_has_bits_[0] |= 0x00000020u;
}
inline void TestRequired::clear_has_dummy6() {
_has_bits_[0] &= ~0x00000020u;
}
inline void TestRequired::clear_dummy6() {
dummy6_ = 0;
clear_has_dummy6();
}
inline ::google::protobuf::int32 TestRequired::dummy6() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy6)
return dummy6_;
}
inline void TestRequired::set_dummy6(::google::protobuf::int32 value) {
set_has_dummy6();
dummy6_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy6)
}
// optional int32 dummy7 = 7;
inline bool TestRequired::has_dummy7() const {
return (_has_bits_[0] & 0x00000040u) != 0;
}
inline void TestRequired::set_has_dummy7() {
_has_bits_[0] |= 0x00000040u;
}
inline void TestRequired::clear_has_dummy7() {
_has_bits_[0] &= ~0x00000040u;
}
inline void TestRequired::clear_dummy7() {
dummy7_ = 0;
clear_has_dummy7();
}
inline ::google::protobuf::int32 TestRequired::dummy7() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy7)
return dummy7_;
}
inline void TestRequired::set_dummy7(::google::protobuf::int32 value) {
set_has_dummy7();
dummy7_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy7)
}
// optional int32 dummy8 = 8;
inline bool TestRequired::has_dummy8() const {
return (_has_bits_[0] & 0x00000080u) != 0;
}
inline void TestRequired::set_has_dummy8() {
_has_bits_[0] |= 0x00000080u;
}
inline void TestRequired::clear_has_dummy8() {
_has_bits_[0] &= ~0x00000080u;
}
inline void TestRequired::clear_dummy8() {
dummy8_ = 0;
clear_has_dummy8();
}
inline ::google::protobuf::int32 TestRequired::dummy8() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy8)
return dummy8_;
}
inline void TestRequired::set_dummy8(::google::protobuf::int32 value) {
set_has_dummy8();
dummy8_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy8)
}
// optional int32 dummy9 = 9;
inline bool TestRequired::has_dummy9() const {
return (_has_bits_[0] & 0x00000100u) != 0;
}
inline void TestRequired::set_has_dummy9() {
_has_bits_[0] |= 0x00000100u;
}
inline void TestRequired::clear_has_dummy9() {
_has_bits_[0] &= ~0x00000100u;
}
inline void TestRequired::clear_dummy9() {
dummy9_ = 0;
clear_has_dummy9();
}
inline ::google::protobuf::int32 TestRequired::dummy9() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy9)
return dummy9_;
}
inline void TestRequired::set_dummy9(::google::protobuf::int32 value) {
set_has_dummy9();
dummy9_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy9)
}
// optional int32 dummy10 = 10;
inline bool TestRequired::has_dummy10() const {
return (_has_bits_[0] & 0x00000200u) != 0;
}
inline void TestRequired::set_has_dummy10() {
_has_bits_[0] |= 0x00000200u;
}
inline void TestRequired::clear_has_dummy10() {
_has_bits_[0] &= ~0x00000200u;
}
inline void TestRequired::clear_dummy10() {
dummy10_ = 0;
clear_has_dummy10();
}
inline ::google::protobuf::int32 TestRequired::dummy10() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy10)
return dummy10_;
}
inline void TestRequired::set_dummy10(::google::protobuf::int32 value) {
set_has_dummy10();
dummy10_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy10)
}
// optional int32 dummy11 = 11;
inline bool TestRequired::has_dummy11() const {
return (_has_bits_[0] & 0x00000400u) != 0;
}
inline void TestRequired::set_has_dummy11() {
_has_bits_[0] |= 0x00000400u;
}
inline void TestRequired::clear_has_dummy11() {
_has_bits_[0] &= ~0x00000400u;
}
inline void TestRequired::clear_dummy11() {
dummy11_ = 0;
clear_has_dummy11();
}
inline ::google::protobuf::int32 TestRequired::dummy11() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy11)
return dummy11_;
}
inline void TestRequired::set_dummy11(::google::protobuf::int32 value) {
set_has_dummy11();
dummy11_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy11)
}
// optional int32 dummy12 = 12;
inline bool TestRequired::has_dummy12() const {
return (_has_bits_[0] & 0x00000800u) != 0;
}
inline void TestRequired::set_has_dummy12() {
_has_bits_[0] |= 0x00000800u;
}
inline void TestRequired::clear_has_dummy12() {
_has_bits_[0] &= ~0x00000800u;
}
inline void TestRequired::clear_dummy12() {
dummy12_ = 0;
clear_has_dummy12();
}
inline ::google::protobuf::int32 TestRequired::dummy12() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy12)
return dummy12_;
}
inline void TestRequired::set_dummy12(::google::protobuf::int32 value) {
set_has_dummy12();
dummy12_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy12)
}
// optional int32 dummy13 = 13;
inline bool TestRequired::has_dummy13() const {
return (_has_bits_[0] & 0x00001000u) != 0;
}
inline void TestRequired::set_has_dummy13() {
_has_bits_[0] |= 0x00001000u;
}
inline void TestRequired::clear_has_dummy13() {
_has_bits_[0] &= ~0x00001000u;
}
inline void TestRequired::clear_dummy13() {
dummy13_ = 0;
clear_has_dummy13();
}
inline ::google::protobuf::int32 TestRequired::dummy13() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy13)
return dummy13_;
}
inline void TestRequired::set_dummy13(::google::protobuf::int32 value) {
set_has_dummy13();
dummy13_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy13)
}
// optional int32 dummy14 = 14;
inline bool TestRequired::has_dummy14() const {
return (_has_bits_[0] & 0x00002000u) != 0;
}
inline void TestRequired::set_has_dummy14() {
_has_bits_[0] |= 0x00002000u;
}
inline void TestRequired::clear_has_dummy14() {
_has_bits_[0] &= ~0x00002000u;
}
inline void TestRequired::clear_dummy14() {
dummy14_ = 0;
clear_has_dummy14();
}
inline ::google::protobuf::int32 TestRequired::dummy14() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy14)
return dummy14_;
}
inline void TestRequired::set_dummy14(::google::protobuf::int32 value) {
set_has_dummy14();
dummy14_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy14)
}
// optional int32 dummy15 = 15;
inline bool TestRequired::has_dummy15() const {
return (_has_bits_[0] & 0x00004000u) != 0;
}
inline void TestRequired::set_has_dummy15() {
_has_bits_[0] |= 0x00004000u;
}
inline void TestRequired::clear_has_dummy15() {
_has_bits_[0] &= ~0x00004000u;
}
inline void TestRequired::clear_dummy15() {
dummy15_ = 0;
clear_has_dummy15();
}
inline ::google::protobuf::int32 TestRequired::dummy15() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy15)
return dummy15_;
}
inline void TestRequired::set_dummy15(::google::protobuf::int32 value) {
set_has_dummy15();
dummy15_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy15)
}
// optional int32 dummy16 = 16;
inline bool TestRequired::has_dummy16() const {
return (_has_bits_[0] & 0x00008000u) != 0;
}
inline void TestRequired::set_has_dummy16() {
_has_bits_[0] |= 0x00008000u;
}
inline void TestRequired::clear_has_dummy16() {
_has_bits_[0] &= ~0x00008000u;
}
inline void TestRequired::clear_dummy16() {
dummy16_ = 0;
clear_has_dummy16();
}
inline ::google::protobuf::int32 TestRequired::dummy16() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy16)
return dummy16_;
}
inline void TestRequired::set_dummy16(::google::protobuf::int32 value) {
set_has_dummy16();
dummy16_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy16)
}
// optional int32 dummy17 = 17;
inline bool TestRequired::has_dummy17() const {
return (_has_bits_[0] & 0x00010000u) != 0;
}
inline void TestRequired::set_has_dummy17() {
_has_bits_[0] |= 0x00010000u;
}
inline void TestRequired::clear_has_dummy17() {
_has_bits_[0] &= ~0x00010000u;
}
inline void TestRequired::clear_dummy17() {
dummy17_ = 0;
clear_has_dummy17();
}
inline ::google::protobuf::int32 TestRequired::dummy17() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy17)
return dummy17_;
}
inline void TestRequired::set_dummy17(::google::protobuf::int32 value) {
set_has_dummy17();
dummy17_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy17)
}
// optional int32 dummy18 = 18;
inline bool TestRequired::has_dummy18() const {
return (_has_bits_[0] & 0x00020000u) != 0;
}
inline void TestRequired::set_has_dummy18() {
_has_bits_[0] |= 0x00020000u;
}
inline void TestRequired::clear_has_dummy18() {
_has_bits_[0] &= ~0x00020000u;
}
inline void TestRequired::clear_dummy18() {
dummy18_ = 0;
clear_has_dummy18();
}
inline ::google::protobuf::int32 TestRequired::dummy18() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy18)
return dummy18_;
}
inline void TestRequired::set_dummy18(::google::protobuf::int32 value) {
set_has_dummy18();
dummy18_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy18)
}
// optional int32 dummy19 = 19;
inline bool TestRequired::has_dummy19() const {
return (_has_bits_[0] & 0x00040000u) != 0;
}
inline void TestRequired::set_has_dummy19() {
_has_bits_[0] |= 0x00040000u;
}
inline void TestRequired::clear_has_dummy19() {
_has_bits_[0] &= ~0x00040000u;
}
inline void TestRequired::clear_dummy19() {
dummy19_ = 0;
clear_has_dummy19();
}
inline ::google::protobuf::int32 TestRequired::dummy19() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy19)
return dummy19_;
}
inline void TestRequired::set_dummy19(::google::protobuf::int32 value) {
set_has_dummy19();
dummy19_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy19)
}
// optional int32 dummy20 = 20;
inline bool TestRequired::has_dummy20() const {
return (_has_bits_[0] & 0x00080000u) != 0;
}
inline void TestRequired::set_has_dummy20() {
_has_bits_[0] |= 0x00080000u;
}
inline void TestRequired::clear_has_dummy20() {
_has_bits_[0] &= ~0x00080000u;
}
inline void TestRequired::clear_dummy20() {
dummy20_ = 0;
clear_has_dummy20();
}
inline ::google::protobuf::int32 TestRequired::dummy20() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy20)
return dummy20_;
}
inline void TestRequired::set_dummy20(::google::protobuf::int32 value) {
set_has_dummy20();
dummy20_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy20)
}
// optional int32 dummy21 = 21;
inline bool TestRequired::has_dummy21() const {
return (_has_bits_[0] & 0x00100000u) != 0;
}
inline void TestRequired::set_has_dummy21() {
_has_bits_[0] |= 0x00100000u;
}
inline void TestRequired::clear_has_dummy21() {
_has_bits_[0] &= ~0x00100000u;
}
inline void TestRequired::clear_dummy21() {
dummy21_ = 0;
clear_has_dummy21();
}
inline ::google::protobuf::int32 TestRequired::dummy21() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy21)
return dummy21_;
}
inline void TestRequired::set_dummy21(::google::protobuf::int32 value) {
set_has_dummy21();
dummy21_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy21)
}
// optional int32 dummy22 = 22;
inline bool TestRequired::has_dummy22() const {
return (_has_bits_[0] & 0x00200000u) != 0;
}
inline void TestRequired::set_has_dummy22() {
_has_bits_[0] |= 0x00200000u;
}
inline void TestRequired::clear_has_dummy22() {
_has_bits_[0] &= ~0x00200000u;
}
inline void TestRequired::clear_dummy22() {
dummy22_ = 0;
clear_has_dummy22();
}
inline ::google::protobuf::int32 TestRequired::dummy22() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy22)
return dummy22_;
}
inline void TestRequired::set_dummy22(::google::protobuf::int32 value) {
set_has_dummy22();
dummy22_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy22)
}
// optional int32 dummy23 = 23;
inline bool TestRequired::has_dummy23() const {
return (_has_bits_[0] & 0x00400000u) != 0;
}
inline void TestRequired::set_has_dummy23() {
_has_bits_[0] |= 0x00400000u;
}
inline void TestRequired::clear_has_dummy23() {
_has_bits_[0] &= ~0x00400000u;
}
inline void TestRequired::clear_dummy23() {
dummy23_ = 0;
clear_has_dummy23();
}
inline ::google::protobuf::int32 TestRequired::dummy23() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy23)
return dummy23_;
}
inline void TestRequired::set_dummy23(::google::protobuf::int32 value) {
set_has_dummy23();
dummy23_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy23)
}
// optional int32 dummy24 = 24;
inline bool TestRequired::has_dummy24() const {
return (_has_bits_[0] & 0x00800000u) != 0;
}
inline void TestRequired::set_has_dummy24() {
_has_bits_[0] |= 0x00800000u;
}
inline void TestRequired::clear_has_dummy24() {
_has_bits_[0] &= ~0x00800000u;
}
inline void TestRequired::clear_dummy24() {
dummy24_ = 0;
clear_has_dummy24();
}
inline ::google::protobuf::int32 TestRequired::dummy24() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy24)
return dummy24_;
}
inline void TestRequired::set_dummy24(::google::protobuf::int32 value) {
set_has_dummy24();
dummy24_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy24)
}
// optional int32 dummy25 = 25;
inline bool TestRequired::has_dummy25() const {
return (_has_bits_[0] & 0x01000000u) != 0;
}
inline void TestRequired::set_has_dummy25() {
_has_bits_[0] |= 0x01000000u;
}
inline void TestRequired::clear_has_dummy25() {
_has_bits_[0] &= ~0x01000000u;
}
inline void TestRequired::clear_dummy25() {
dummy25_ = 0;
clear_has_dummy25();
}
inline ::google::protobuf::int32 TestRequired::dummy25() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy25)
return dummy25_;
}
inline void TestRequired::set_dummy25(::google::protobuf::int32 value) {
set_has_dummy25();
dummy25_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy25)
}
// optional int32 dummy26 = 26;
inline bool TestRequired::has_dummy26() const {
return (_has_bits_[0] & 0x02000000u) != 0;
}
inline void TestRequired::set_has_dummy26() {
_has_bits_[0] |= 0x02000000u;
}
inline void TestRequired::clear_has_dummy26() {
_has_bits_[0] &= ~0x02000000u;
}
inline void TestRequired::clear_dummy26() {
dummy26_ = 0;
clear_has_dummy26();
}
inline ::google::protobuf::int32 TestRequired::dummy26() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy26)
return dummy26_;
}
inline void TestRequired::set_dummy26(::google::protobuf::int32 value) {
set_has_dummy26();
dummy26_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy26)
}
// optional int32 dummy27 = 27;
inline bool TestRequired::has_dummy27() const {
return (_has_bits_[0] & 0x04000000u) != 0;
}
inline void TestRequired::set_has_dummy27() {
_has_bits_[0] |= 0x04000000u;
}
inline void TestRequired::clear_has_dummy27() {
_has_bits_[0] &= ~0x04000000u;
}
inline void TestRequired::clear_dummy27() {
dummy27_ = 0;
clear_has_dummy27();
}
inline ::google::protobuf::int32 TestRequired::dummy27() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy27)
return dummy27_;
}
inline void TestRequired::set_dummy27(::google::protobuf::int32 value) {
set_has_dummy27();
dummy27_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy27)
}
// optional int32 dummy28 = 28;
inline bool TestRequired::has_dummy28() const {
return (_has_bits_[0] & 0x08000000u) != 0;
}
inline void TestRequired::set_has_dummy28() {
_has_bits_[0] |= 0x08000000u;
}
inline void TestRequired::clear_has_dummy28() {
_has_bits_[0] &= ~0x08000000u;
}
inline void TestRequired::clear_dummy28() {
dummy28_ = 0;
clear_has_dummy28();
}
inline ::google::protobuf::int32 TestRequired::dummy28() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy28)
return dummy28_;
}
inline void TestRequired::set_dummy28(::google::protobuf::int32 value) {
set_has_dummy28();
dummy28_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy28)
}
// optional int32 dummy29 = 29;
inline bool TestRequired::has_dummy29() const {
return (_has_bits_[0] & 0x10000000u) != 0;
}
inline void TestRequired::set_has_dummy29() {
_has_bits_[0] |= 0x10000000u;
}
inline void TestRequired::clear_has_dummy29() {
_has_bits_[0] &= ~0x10000000u;
}
inline void TestRequired::clear_dummy29() {
dummy29_ = 0;
clear_has_dummy29();
}
inline ::google::protobuf::int32 TestRequired::dummy29() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy29)
return dummy29_;
}
inline void TestRequired::set_dummy29(::google::protobuf::int32 value) {
set_has_dummy29();
dummy29_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy29)
}
// optional int32 dummy30 = 30;
inline bool TestRequired::has_dummy30() const {
return (_has_bits_[0] & 0x20000000u) != 0;
}
inline void TestRequired::set_has_dummy30() {
_has_bits_[0] |= 0x20000000u;
}
inline void TestRequired::clear_has_dummy30() {
_has_bits_[0] &= ~0x20000000u;
}
inline void TestRequired::clear_dummy30() {
dummy30_ = 0;
clear_has_dummy30();
}
inline ::google::protobuf::int32 TestRequired::dummy30() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy30)
return dummy30_;
}
inline void TestRequired::set_dummy30(::google::protobuf::int32 value) {
set_has_dummy30();
dummy30_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy30)
}
// optional int32 dummy31 = 31;
inline bool TestRequired::has_dummy31() const {
return (_has_bits_[0] & 0x40000000u) != 0;
}
inline void TestRequired::set_has_dummy31() {
_has_bits_[0] |= 0x40000000u;
}
inline void TestRequired::clear_has_dummy31() {
_has_bits_[0] &= ~0x40000000u;
}
inline void TestRequired::clear_dummy31() {
dummy31_ = 0;
clear_has_dummy31();
}
inline ::google::protobuf::int32 TestRequired::dummy31() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy31)
return dummy31_;
}
inline void TestRequired::set_dummy31(::google::protobuf::int32 value) {
set_has_dummy31();
dummy31_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy31)
}
// optional int32 dummy32 = 32;
inline bool TestRequired::has_dummy32() const {
return (_has_bits_[0] & 0x80000000u) != 0;
}
inline void TestRequired::set_has_dummy32() {
_has_bits_[0] |= 0x80000000u;
}
inline void TestRequired::clear_has_dummy32() {
_has_bits_[0] &= ~0x80000000u;
}
inline void TestRequired::clear_dummy32() {
dummy32_ = 0;
clear_has_dummy32();
}
inline ::google::protobuf::int32 TestRequired::dummy32() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.dummy32)
return dummy32_;
}
inline void TestRequired::set_dummy32(::google::protobuf::int32 value) {
set_has_dummy32();
dummy32_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.dummy32)
}
// required int32 c = 33;
inline bool TestRequired::has_c() const {
return (_has_bits_[1] & 0x00000001u) != 0;
}
inline void TestRequired::set_has_c() {
_has_bits_[1] |= 0x00000001u;
}
inline void TestRequired::clear_has_c() {
_has_bits_[1] &= ~0x00000001u;
}
inline void TestRequired::clear_c() {
c_ = 0;
clear_has_c();
}
inline ::google::protobuf::int32 TestRequired::c() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequired.c)
return c_;
}
inline void TestRequired::set_c(::google::protobuf::int32 value) {
set_has_c();
c_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequired.c)
}
// -------------------------------------------------------------------
// TestRequiredForeign
// optional .protobuf_unittest.TestRequired optional_message = 1;
inline bool TestRequiredForeign::has_optional_message() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestRequiredForeign::set_has_optional_message() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestRequiredForeign::clear_has_optional_message() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestRequiredForeign::clear_optional_message() {
if (optional_message_ != NULL) optional_message_->::protobuf_unittest::TestRequired::Clear();
clear_has_optional_message();
}
inline const ::protobuf_unittest::TestRequired& TestRequiredForeign::optional_message() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequiredForeign.optional_message)
return optional_message_ != NULL ? *optional_message_ : *default_instance_->optional_message_;
}
inline ::protobuf_unittest::TestRequired* TestRequiredForeign::mutable_optional_message() {
set_has_optional_message();
if (optional_message_ == NULL) {
_slow_mutable_optional_message();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestRequiredForeign.optional_message)
return optional_message_;
}
inline ::protobuf_unittest::TestRequired* TestRequiredForeign::release_optional_message() {
clear_has_optional_message();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_optional_message();
} else {
::protobuf_unittest::TestRequired* temp = optional_message_;
optional_message_ = NULL;
return temp;
}
}
inline void TestRequiredForeign::set_allocated_optional_message(::protobuf_unittest::TestRequired* optional_message) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete optional_message_;
}
if (optional_message != NULL) {
_slow_set_allocated_optional_message(message_arena, &optional_message);
}
optional_message_ = optional_message;
if (optional_message) {
set_has_optional_message();
} else {
clear_has_optional_message();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestRequiredForeign.optional_message)
}
// repeated .protobuf_unittest.TestRequired repeated_message = 2;
inline int TestRequiredForeign::repeated_message_size() const {
return repeated_message_.size();
}
inline void TestRequiredForeign::clear_repeated_message() {
repeated_message_.Clear();
}
inline const ::protobuf_unittest::TestRequired& TestRequiredForeign::repeated_message(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequiredForeign.repeated_message)
return repeated_message_.Get(index);
}
inline ::protobuf_unittest::TestRequired* TestRequiredForeign::mutable_repeated_message(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestRequiredForeign.repeated_message)
return repeated_message_.Mutable(index);
}
inline ::protobuf_unittest::TestRequired* TestRequiredForeign::add_repeated_message() {
// @@protoc_insertion_point(field_add:protobuf_unittest.TestRequiredForeign.repeated_message)
return repeated_message_.Add();
}
inline ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestRequired >*
TestRequiredForeign::mutable_repeated_message() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestRequiredForeign.repeated_message)
return &repeated_message_;
}
inline const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestRequired >&
TestRequiredForeign::repeated_message() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestRequiredForeign.repeated_message)
return repeated_message_;
}
// optional int32 dummy = 3;
inline bool TestRequiredForeign::has_dummy() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void TestRequiredForeign::set_has_dummy() {
_has_bits_[0] |= 0x00000004u;
}
inline void TestRequiredForeign::clear_has_dummy() {
_has_bits_[0] &= ~0x00000004u;
}
inline void TestRequiredForeign::clear_dummy() {
dummy_ = 0;
clear_has_dummy();
}
inline ::google::protobuf::int32 TestRequiredForeign::dummy() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequiredForeign.dummy)
return dummy_;
}
inline void TestRequiredForeign::set_dummy(::google::protobuf::int32 value) {
set_has_dummy();
dummy_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequiredForeign.dummy)
}
// -------------------------------------------------------------------
// TestForeignNested
// optional .protobuf_unittest.TestAllTypes.NestedMessage foreign_nested = 1;
inline bool TestForeignNested::has_foreign_nested() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestForeignNested::set_has_foreign_nested() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestForeignNested::clear_has_foreign_nested() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestForeignNested::clear_foreign_nested() {
if (foreign_nested_ != NULL) foreign_nested_->::protobuf_unittest::TestAllTypes_NestedMessage::Clear();
clear_has_foreign_nested();
}
inline const ::protobuf_unittest::TestAllTypes_NestedMessage& TestForeignNested::foreign_nested() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestForeignNested.foreign_nested)
return foreign_nested_ != NULL ? *foreign_nested_ : *default_instance_->foreign_nested_;
}
inline ::protobuf_unittest::TestAllTypes_NestedMessage* TestForeignNested::mutable_foreign_nested() {
set_has_foreign_nested();
if (foreign_nested_ == NULL) {
_slow_mutable_foreign_nested();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestForeignNested.foreign_nested)
return foreign_nested_;
}
inline ::protobuf_unittest::TestAllTypes_NestedMessage* TestForeignNested::release_foreign_nested() {
clear_has_foreign_nested();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_foreign_nested();
} else {
::protobuf_unittest::TestAllTypes_NestedMessage* temp = foreign_nested_;
foreign_nested_ = NULL;
return temp;
}
}
inline void TestForeignNested::set_allocated_foreign_nested(::protobuf_unittest::TestAllTypes_NestedMessage* foreign_nested) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete foreign_nested_;
}
if (foreign_nested != NULL) {
_slow_set_allocated_foreign_nested(message_arena, &foreign_nested);
}
foreign_nested_ = foreign_nested;
if (foreign_nested) {
set_has_foreign_nested();
} else {
clear_has_foreign_nested();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestForeignNested.foreign_nested)
}
// -------------------------------------------------------------------
// TestEmptyMessage
// -------------------------------------------------------------------
// TestEmptyMessageWithExtensions
// -------------------------------------------------------------------
// TestMultipleExtensionRanges
// -------------------------------------------------------------------
// TestReallyLargeTagNumber
// optional int32 a = 1;
inline bool TestReallyLargeTagNumber::has_a() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestReallyLargeTagNumber::set_has_a() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestReallyLargeTagNumber::clear_has_a() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestReallyLargeTagNumber::clear_a() {
a_ = 0;
clear_has_a();
}
inline ::google::protobuf::int32 TestReallyLargeTagNumber::a() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestReallyLargeTagNumber.a)
return a_;
}
inline void TestReallyLargeTagNumber::set_a(::google::protobuf::int32 value) {
set_has_a();
a_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestReallyLargeTagNumber.a)
}
// optional int32 bb = 268435455;
inline bool TestReallyLargeTagNumber::has_bb() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void TestReallyLargeTagNumber::set_has_bb() {
_has_bits_[0] |= 0x00000002u;
}
inline void TestReallyLargeTagNumber::clear_has_bb() {
_has_bits_[0] &= ~0x00000002u;
}
inline void TestReallyLargeTagNumber::clear_bb() {
bb_ = 0;
clear_has_bb();
}
inline ::google::protobuf::int32 TestReallyLargeTagNumber::bb() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestReallyLargeTagNumber.bb)
return bb_;
}
inline void TestReallyLargeTagNumber::set_bb(::google::protobuf::int32 value) {
set_has_bb();
bb_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestReallyLargeTagNumber.bb)
}
// -------------------------------------------------------------------
// TestRecursiveMessage
// optional .protobuf_unittest.TestRecursiveMessage a = 1;
inline bool TestRecursiveMessage::has_a() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestRecursiveMessage::set_has_a() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestRecursiveMessage::clear_has_a() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestRecursiveMessage::clear_a() {
if (a_ != NULL) a_->::protobuf_unittest::TestRecursiveMessage::Clear();
clear_has_a();
}
inline const ::protobuf_unittest::TestRecursiveMessage& TestRecursiveMessage::a() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRecursiveMessage.a)
return a_ != NULL ? *a_ : *default_instance_->a_;
}
inline ::protobuf_unittest::TestRecursiveMessage* TestRecursiveMessage::mutable_a() {
set_has_a();
if (a_ == NULL) {
_slow_mutable_a();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestRecursiveMessage.a)
return a_;
}
inline ::protobuf_unittest::TestRecursiveMessage* TestRecursiveMessage::release_a() {
clear_has_a();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_a();
} else {
::protobuf_unittest::TestRecursiveMessage* temp = a_;
a_ = NULL;
return temp;
}
}
inline void TestRecursiveMessage::set_allocated_a(::protobuf_unittest::TestRecursiveMessage* a) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete a_;
}
if (a != NULL) {
_slow_set_allocated_a(message_arena, &a);
}
a_ = a;
if (a) {
set_has_a();
} else {
clear_has_a();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestRecursiveMessage.a)
}
// optional int32 i = 2;
inline bool TestRecursiveMessage::has_i() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void TestRecursiveMessage::set_has_i() {
_has_bits_[0] |= 0x00000002u;
}
inline void TestRecursiveMessage::clear_has_i() {
_has_bits_[0] &= ~0x00000002u;
}
inline void TestRecursiveMessage::clear_i() {
i_ = 0;
clear_has_i();
}
inline ::google::protobuf::int32 TestRecursiveMessage::i() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRecursiveMessage.i)
return i_;
}
inline void TestRecursiveMessage::set_i(::google::protobuf::int32 value) {
set_has_i();
i_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRecursiveMessage.i)
}
// -------------------------------------------------------------------
// TestMutualRecursionA
// optional .protobuf_unittest.TestMutualRecursionB bb = 1;
inline bool TestMutualRecursionA::has_bb() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestMutualRecursionA::set_has_bb() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestMutualRecursionA::clear_has_bb() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestMutualRecursionA::clear_bb() {
if (bb_ != NULL) bb_->::protobuf_unittest::TestMutualRecursionB::Clear();
clear_has_bb();
}
inline const ::protobuf_unittest::TestMutualRecursionB& TestMutualRecursionA::bb() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestMutualRecursionA.bb)
return bb_ != NULL ? *bb_ : *default_instance_->bb_;
}
inline ::protobuf_unittest::TestMutualRecursionB* TestMutualRecursionA::mutable_bb() {
set_has_bb();
if (bb_ == NULL) {
_slow_mutable_bb();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestMutualRecursionA.bb)
return bb_;
}
inline ::protobuf_unittest::TestMutualRecursionB* TestMutualRecursionA::release_bb() {
clear_has_bb();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_bb();
} else {
::protobuf_unittest::TestMutualRecursionB* temp = bb_;
bb_ = NULL;
return temp;
}
}
inline void TestMutualRecursionA::set_allocated_bb(::protobuf_unittest::TestMutualRecursionB* bb) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete bb_;
}
if (bb != NULL) {
_slow_set_allocated_bb(message_arena, &bb);
}
bb_ = bb;
if (bb) {
set_has_bb();
} else {
clear_has_bb();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestMutualRecursionA.bb)
}
// -------------------------------------------------------------------
// TestMutualRecursionB
// optional .protobuf_unittest.TestMutualRecursionA a = 1;
inline bool TestMutualRecursionB::has_a() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestMutualRecursionB::set_has_a() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestMutualRecursionB::clear_has_a() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestMutualRecursionB::clear_a() {
if (a_ != NULL) a_->::protobuf_unittest::TestMutualRecursionA::Clear();
clear_has_a();
}
inline const ::protobuf_unittest::TestMutualRecursionA& TestMutualRecursionB::a() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestMutualRecursionB.a)
return a_ != NULL ? *a_ : *default_instance_->a_;
}
inline ::protobuf_unittest::TestMutualRecursionA* TestMutualRecursionB::mutable_a() {
set_has_a();
if (a_ == NULL) {
_slow_mutable_a();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestMutualRecursionB.a)
return a_;
}
inline ::protobuf_unittest::TestMutualRecursionA* TestMutualRecursionB::release_a() {
clear_has_a();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_a();
} else {
::protobuf_unittest::TestMutualRecursionA* temp = a_;
a_ = NULL;
return temp;
}
}
inline void TestMutualRecursionB::set_allocated_a(::protobuf_unittest::TestMutualRecursionA* a) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete a_;
}
if (a != NULL) {
_slow_set_allocated_a(message_arena, &a);
}
a_ = a;
if (a) {
set_has_a();
} else {
clear_has_a();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestMutualRecursionB.a)
}
// optional int32 optional_int32 = 2;
inline bool TestMutualRecursionB::has_optional_int32() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void TestMutualRecursionB::set_has_optional_int32() {
_has_bits_[0] |= 0x00000002u;
}
inline void TestMutualRecursionB::clear_has_optional_int32() {
_has_bits_[0] &= ~0x00000002u;
}
inline void TestMutualRecursionB::clear_optional_int32() {
optional_int32_ = 0;
clear_has_optional_int32();
}
inline ::google::protobuf::int32 TestMutualRecursionB::optional_int32() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestMutualRecursionB.optional_int32)
return optional_int32_;
}
inline void TestMutualRecursionB::set_optional_int32(::google::protobuf::int32 value) {
set_has_optional_int32();
optional_int32_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestMutualRecursionB.optional_int32)
}
// -------------------------------------------------------------------
// TestDupFieldNumber_Foo
// optional int32 a = 1;
inline bool TestDupFieldNumber_Foo::has_a() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestDupFieldNumber_Foo::set_has_a() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestDupFieldNumber_Foo::clear_has_a() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestDupFieldNumber_Foo::clear_a() {
a_ = 0;
clear_has_a();
}
inline ::google::protobuf::int32 TestDupFieldNumber_Foo::a() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestDupFieldNumber.Foo.a)
return a_;
}
inline void TestDupFieldNumber_Foo::set_a(::google::protobuf::int32 value) {
set_has_a();
a_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestDupFieldNumber.Foo.a)
}
// -------------------------------------------------------------------
// TestDupFieldNumber_Bar
// optional int32 a = 1;
inline bool TestDupFieldNumber_Bar::has_a() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestDupFieldNumber_Bar::set_has_a() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestDupFieldNumber_Bar::clear_has_a() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestDupFieldNumber_Bar::clear_a() {
a_ = 0;
clear_has_a();
}
inline ::google::protobuf::int32 TestDupFieldNumber_Bar::a() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestDupFieldNumber.Bar.a)
return a_;
}
inline void TestDupFieldNumber_Bar::set_a(::google::protobuf::int32 value) {
set_has_a();
a_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestDupFieldNumber.Bar.a)
}
// -------------------------------------------------------------------
// TestDupFieldNumber
// optional int32 a = 1;
inline bool TestDupFieldNumber::has_a() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestDupFieldNumber::set_has_a() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestDupFieldNumber::clear_has_a() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestDupFieldNumber::clear_a() {
a_ = 0;
clear_has_a();
}
inline ::google::protobuf::int32 TestDupFieldNumber::a() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestDupFieldNumber.a)
return a_;
}
inline void TestDupFieldNumber::set_a(::google::protobuf::int32 value) {
set_has_a();
a_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestDupFieldNumber.a)
}
// optional group Foo = 2 { ... };
inline bool TestDupFieldNumber::has_foo() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void TestDupFieldNumber::set_has_foo() {
_has_bits_[0] |= 0x00000002u;
}
inline void TestDupFieldNumber::clear_has_foo() {
_has_bits_[0] &= ~0x00000002u;
}
inline void TestDupFieldNumber::clear_foo() {
if (foo_ != NULL) foo_->::protobuf_unittest::TestDupFieldNumber_Foo::Clear();
clear_has_foo();
}
inline const ::protobuf_unittest::TestDupFieldNumber_Foo& TestDupFieldNumber::foo() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestDupFieldNumber.foo)
return foo_ != NULL ? *foo_ : *default_instance_->foo_;
}
inline ::protobuf_unittest::TestDupFieldNumber_Foo* TestDupFieldNumber::mutable_foo() {
set_has_foo();
if (foo_ == NULL) {
_slow_mutable_foo();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestDupFieldNumber.foo)
return foo_;
}
inline ::protobuf_unittest::TestDupFieldNumber_Foo* TestDupFieldNumber::release_foo() {
clear_has_foo();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_foo();
} else {
::protobuf_unittest::TestDupFieldNumber_Foo* temp = foo_;
foo_ = NULL;
return temp;
}
}
inline void TestDupFieldNumber::set_allocated_foo(::protobuf_unittest::TestDupFieldNumber_Foo* foo) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete foo_;
}
if (foo != NULL) {
_slow_set_allocated_foo(message_arena, &foo);
}
foo_ = foo;
if (foo) {
set_has_foo();
} else {
clear_has_foo();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestDupFieldNumber.foo)
}
// optional group Bar = 3 { ... };
inline bool TestDupFieldNumber::has_bar() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void TestDupFieldNumber::set_has_bar() {
_has_bits_[0] |= 0x00000004u;
}
inline void TestDupFieldNumber::clear_has_bar() {
_has_bits_[0] &= ~0x00000004u;
}
inline void TestDupFieldNumber::clear_bar() {
if (bar_ != NULL) bar_->::protobuf_unittest::TestDupFieldNumber_Bar::Clear();
clear_has_bar();
}
inline const ::protobuf_unittest::TestDupFieldNumber_Bar& TestDupFieldNumber::bar() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestDupFieldNumber.bar)
return bar_ != NULL ? *bar_ : *default_instance_->bar_;
}
inline ::protobuf_unittest::TestDupFieldNumber_Bar* TestDupFieldNumber::mutable_bar() {
set_has_bar();
if (bar_ == NULL) {
_slow_mutable_bar();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestDupFieldNumber.bar)
return bar_;
}
inline ::protobuf_unittest::TestDupFieldNumber_Bar* TestDupFieldNumber::release_bar() {
clear_has_bar();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_bar();
} else {
::protobuf_unittest::TestDupFieldNumber_Bar* temp = bar_;
bar_ = NULL;
return temp;
}
}
inline void TestDupFieldNumber::set_allocated_bar(::protobuf_unittest::TestDupFieldNumber_Bar* bar) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete bar_;
}
if (bar != NULL) {
_slow_set_allocated_bar(message_arena, &bar);
}
bar_ = bar;
if (bar) {
set_has_bar();
} else {
clear_has_bar();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestDupFieldNumber.bar)
}
// -------------------------------------------------------------------
// TestEagerMessage
// optional .protobuf_unittest.TestAllTypes sub_message = 1 [lazy = false];
inline bool TestEagerMessage::has_sub_message() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestEagerMessage::set_has_sub_message() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestEagerMessage::clear_has_sub_message() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestEagerMessage::clear_sub_message() {
if (sub_message_ != NULL) sub_message_->::protobuf_unittest::TestAllTypes::Clear();
clear_has_sub_message();
}
inline const ::protobuf_unittest::TestAllTypes& TestEagerMessage::sub_message() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestEagerMessage.sub_message)
return sub_message_ != NULL ? *sub_message_ : *default_instance_->sub_message_;
}
inline ::protobuf_unittest::TestAllTypes* TestEagerMessage::mutable_sub_message() {
set_has_sub_message();
if (sub_message_ == NULL) {
_slow_mutable_sub_message();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestEagerMessage.sub_message)
return sub_message_;
}
inline ::protobuf_unittest::TestAllTypes* TestEagerMessage::release_sub_message() {
clear_has_sub_message();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_sub_message();
} else {
::protobuf_unittest::TestAllTypes* temp = sub_message_;
sub_message_ = NULL;
return temp;
}
}
inline void TestEagerMessage::set_allocated_sub_message(::protobuf_unittest::TestAllTypes* sub_message) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete sub_message_;
}
if (sub_message != NULL) {
_slow_set_allocated_sub_message(message_arena, &sub_message);
}
sub_message_ = sub_message;
if (sub_message) {
set_has_sub_message();
} else {
clear_has_sub_message();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestEagerMessage.sub_message)
}
// -------------------------------------------------------------------
// TestLazyMessage
// optional .protobuf_unittest.TestAllTypes sub_message = 1 [lazy = true];
inline bool TestLazyMessage::has_sub_message() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestLazyMessage::set_has_sub_message() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestLazyMessage::clear_has_sub_message() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestLazyMessage::clear_sub_message() {
if (sub_message_ != NULL) sub_message_->::protobuf_unittest::TestAllTypes::Clear();
clear_has_sub_message();
}
inline const ::protobuf_unittest::TestAllTypes& TestLazyMessage::sub_message() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestLazyMessage.sub_message)
return sub_message_ != NULL ? *sub_message_ : *default_instance_->sub_message_;
}
inline ::protobuf_unittest::TestAllTypes* TestLazyMessage::mutable_sub_message() {
set_has_sub_message();
if (sub_message_ == NULL) {
_slow_mutable_sub_message();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestLazyMessage.sub_message)
return sub_message_;
}
inline ::protobuf_unittest::TestAllTypes* TestLazyMessage::release_sub_message() {
clear_has_sub_message();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_sub_message();
} else {
::protobuf_unittest::TestAllTypes* temp = sub_message_;
sub_message_ = NULL;
return temp;
}
}
inline void TestLazyMessage::set_allocated_sub_message(::protobuf_unittest::TestAllTypes* sub_message) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete sub_message_;
}
if (sub_message != NULL) {
_slow_set_allocated_sub_message(message_arena, &sub_message);
}
sub_message_ = sub_message;
if (sub_message) {
set_has_sub_message();
} else {
clear_has_sub_message();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestLazyMessage.sub_message)
}
// -------------------------------------------------------------------
// TestNestedMessageHasBits_NestedMessage
// repeated int32 nestedmessage_repeated_int32 = 1;
inline int TestNestedMessageHasBits_NestedMessage::nestedmessage_repeated_int32_size() const {
return nestedmessage_repeated_int32_.size();
}
inline void TestNestedMessageHasBits_NestedMessage::clear_nestedmessage_repeated_int32() {
nestedmessage_repeated_int32_.Clear();
}
inline ::google::protobuf::int32 TestNestedMessageHasBits_NestedMessage::nestedmessage_repeated_int32(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestNestedMessageHasBits.NestedMessage.nestedmessage_repeated_int32)
return nestedmessage_repeated_int32_.Get(index);
}
inline void TestNestedMessageHasBits_NestedMessage::set_nestedmessage_repeated_int32(int index, ::google::protobuf::int32 value) {
nestedmessage_repeated_int32_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestNestedMessageHasBits.NestedMessage.nestedmessage_repeated_int32)
}
inline void TestNestedMessageHasBits_NestedMessage::add_nestedmessage_repeated_int32(::google::protobuf::int32 value) {
nestedmessage_repeated_int32_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestNestedMessageHasBits.NestedMessage.nestedmessage_repeated_int32)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
TestNestedMessageHasBits_NestedMessage::nestedmessage_repeated_int32() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestNestedMessageHasBits.NestedMessage.nestedmessage_repeated_int32)
return nestedmessage_repeated_int32_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
TestNestedMessageHasBits_NestedMessage::mutable_nestedmessage_repeated_int32() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestNestedMessageHasBits.NestedMessage.nestedmessage_repeated_int32)
return &nestedmessage_repeated_int32_;
}
// repeated .protobuf_unittest.ForeignMessage nestedmessage_repeated_foreignmessage = 2;
inline int TestNestedMessageHasBits_NestedMessage::nestedmessage_repeated_foreignmessage_size() const {
return nestedmessage_repeated_foreignmessage_.size();
}
inline void TestNestedMessageHasBits_NestedMessage::clear_nestedmessage_repeated_foreignmessage() {
nestedmessage_repeated_foreignmessage_.Clear();
}
inline const ::protobuf_unittest::ForeignMessage& TestNestedMessageHasBits_NestedMessage::nestedmessage_repeated_foreignmessage(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestNestedMessageHasBits.NestedMessage.nestedmessage_repeated_foreignmessage)
return nestedmessage_repeated_foreignmessage_.Get(index);
}
inline ::protobuf_unittest::ForeignMessage* TestNestedMessageHasBits_NestedMessage::mutable_nestedmessage_repeated_foreignmessage(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestNestedMessageHasBits.NestedMessage.nestedmessage_repeated_foreignmessage)
return nestedmessage_repeated_foreignmessage_.Mutable(index);
}
inline ::protobuf_unittest::ForeignMessage* TestNestedMessageHasBits_NestedMessage::add_nestedmessage_repeated_foreignmessage() {
// @@protoc_insertion_point(field_add:protobuf_unittest.TestNestedMessageHasBits.NestedMessage.nestedmessage_repeated_foreignmessage)
return nestedmessage_repeated_foreignmessage_.Add();
}
inline ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::ForeignMessage >*
TestNestedMessageHasBits_NestedMessage::mutable_nestedmessage_repeated_foreignmessage() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestNestedMessageHasBits.NestedMessage.nestedmessage_repeated_foreignmessage)
return &nestedmessage_repeated_foreignmessage_;
}
inline const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::ForeignMessage >&
TestNestedMessageHasBits_NestedMessage::nestedmessage_repeated_foreignmessage() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestNestedMessageHasBits.NestedMessage.nestedmessage_repeated_foreignmessage)
return nestedmessage_repeated_foreignmessage_;
}
// -------------------------------------------------------------------
// TestNestedMessageHasBits
// optional .protobuf_unittest.TestNestedMessageHasBits.NestedMessage optional_nested_message = 1;
inline bool TestNestedMessageHasBits::has_optional_nested_message() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestNestedMessageHasBits::set_has_optional_nested_message() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestNestedMessageHasBits::clear_has_optional_nested_message() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestNestedMessageHasBits::clear_optional_nested_message() {
if (optional_nested_message_ != NULL) optional_nested_message_->::protobuf_unittest::TestNestedMessageHasBits_NestedMessage::Clear();
clear_has_optional_nested_message();
}
inline const ::protobuf_unittest::TestNestedMessageHasBits_NestedMessage& TestNestedMessageHasBits::optional_nested_message() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestNestedMessageHasBits.optional_nested_message)
return optional_nested_message_ != NULL ? *optional_nested_message_ : *default_instance_->optional_nested_message_;
}
inline ::protobuf_unittest::TestNestedMessageHasBits_NestedMessage* TestNestedMessageHasBits::mutable_optional_nested_message() {
set_has_optional_nested_message();
if (optional_nested_message_ == NULL) {
_slow_mutable_optional_nested_message();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestNestedMessageHasBits.optional_nested_message)
return optional_nested_message_;
}
inline ::protobuf_unittest::TestNestedMessageHasBits_NestedMessage* TestNestedMessageHasBits::release_optional_nested_message() {
clear_has_optional_nested_message();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_optional_nested_message();
} else {
::protobuf_unittest::TestNestedMessageHasBits_NestedMessage* temp = optional_nested_message_;
optional_nested_message_ = NULL;
return temp;
}
}
inline void TestNestedMessageHasBits::set_allocated_optional_nested_message(::protobuf_unittest::TestNestedMessageHasBits_NestedMessage* optional_nested_message) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete optional_nested_message_;
}
if (optional_nested_message != NULL) {
_slow_set_allocated_optional_nested_message(message_arena, &optional_nested_message);
}
optional_nested_message_ = optional_nested_message;
if (optional_nested_message) {
set_has_optional_nested_message();
} else {
clear_has_optional_nested_message();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestNestedMessageHasBits.optional_nested_message)
}
// -------------------------------------------------------------------
// TestCamelCaseFieldNames
// optional int32 PrimitiveField = 1;
inline bool TestCamelCaseFieldNames::has_primitivefield() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestCamelCaseFieldNames::set_has_primitivefield() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestCamelCaseFieldNames::clear_has_primitivefield() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestCamelCaseFieldNames::clear_primitivefield() {
primitivefield_ = 0;
clear_has_primitivefield();
}
inline ::google::protobuf::int32 TestCamelCaseFieldNames::primitivefield() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestCamelCaseFieldNames.PrimitiveField)
return primitivefield_;
}
inline void TestCamelCaseFieldNames::set_primitivefield(::google::protobuf::int32 value) {
set_has_primitivefield();
primitivefield_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestCamelCaseFieldNames.PrimitiveField)
}
// optional string StringField = 2;
inline bool TestCamelCaseFieldNames::has_stringfield() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void TestCamelCaseFieldNames::set_has_stringfield() {
_has_bits_[0] |= 0x00000002u;
}
inline void TestCamelCaseFieldNames::clear_has_stringfield() {
_has_bits_[0] &= ~0x00000002u;
}
inline void TestCamelCaseFieldNames::clear_stringfield() {
stringfield_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
clear_has_stringfield();
}
inline const ::std::string& TestCamelCaseFieldNames::stringfield() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestCamelCaseFieldNames.StringField)
return stringfield_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline void TestCamelCaseFieldNames::set_stringfield(const ::std::string& value) {
set_has_stringfield();
stringfield_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestCamelCaseFieldNames.StringField)
}
inline void TestCamelCaseFieldNames::set_stringfield(const char* value) {
set_has_stringfield();
stringfield_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestCamelCaseFieldNames.StringField)
}
inline void TestCamelCaseFieldNames::set_stringfield(const char* value,
size_t size) {
set_has_stringfield();
stringfield_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestCamelCaseFieldNames.StringField)
}
inline ::std::string* TestCamelCaseFieldNames::mutable_stringfield() {
set_has_stringfield();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestCamelCaseFieldNames.StringField)
return stringfield_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestCamelCaseFieldNames::release_stringfield() {
clear_has_stringfield();
return stringfield_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestCamelCaseFieldNames::unsafe_arena_release_stringfield() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_stringfield();
return stringfield_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
}
inline void TestCamelCaseFieldNames::set_allocated_stringfield(::std::string* stringfield) {
if (stringfield != NULL) {
set_has_stringfield();
} else {
clear_has_stringfield();
}
stringfield_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), stringfield,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestCamelCaseFieldNames.StringField)
}
inline void TestCamelCaseFieldNames::unsafe_arena_set_allocated_stringfield(
::std::string* stringfield) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (stringfield != NULL) {
set_has_stringfield();
} else {
clear_has_stringfield();
}
stringfield_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
stringfield, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestCamelCaseFieldNames.StringField)
}
// optional .protobuf_unittest.ForeignEnum EnumField = 3;
inline bool TestCamelCaseFieldNames::has_enumfield() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void TestCamelCaseFieldNames::set_has_enumfield() {
_has_bits_[0] |= 0x00000004u;
}
inline void TestCamelCaseFieldNames::clear_has_enumfield() {
_has_bits_[0] &= ~0x00000004u;
}
inline void TestCamelCaseFieldNames::clear_enumfield() {
enumfield_ = 4;
clear_has_enumfield();
}
inline ::protobuf_unittest::ForeignEnum TestCamelCaseFieldNames::enumfield() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestCamelCaseFieldNames.EnumField)
return static_cast< ::protobuf_unittest::ForeignEnum >(enumfield_);
}
inline void TestCamelCaseFieldNames::set_enumfield(::protobuf_unittest::ForeignEnum value) {
assert(::protobuf_unittest::ForeignEnum_IsValid(value));
set_has_enumfield();
enumfield_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestCamelCaseFieldNames.EnumField)
}
// optional .protobuf_unittest.ForeignMessage MessageField = 4;
inline bool TestCamelCaseFieldNames::has_messagefield() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void TestCamelCaseFieldNames::set_has_messagefield() {
_has_bits_[0] |= 0x00000008u;
}
inline void TestCamelCaseFieldNames::clear_has_messagefield() {
_has_bits_[0] &= ~0x00000008u;
}
inline void TestCamelCaseFieldNames::clear_messagefield() {
if (messagefield_ != NULL) messagefield_->::protobuf_unittest::ForeignMessage::Clear();
clear_has_messagefield();
}
inline const ::protobuf_unittest::ForeignMessage& TestCamelCaseFieldNames::messagefield() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestCamelCaseFieldNames.MessageField)
return messagefield_ != NULL ? *messagefield_ : *default_instance_->messagefield_;
}
inline ::protobuf_unittest::ForeignMessage* TestCamelCaseFieldNames::mutable_messagefield() {
set_has_messagefield();
if (messagefield_ == NULL) {
_slow_mutable_messagefield();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestCamelCaseFieldNames.MessageField)
return messagefield_;
}
inline ::protobuf_unittest::ForeignMessage* TestCamelCaseFieldNames::release_messagefield() {
clear_has_messagefield();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_messagefield();
} else {
::protobuf_unittest::ForeignMessage* temp = messagefield_;
messagefield_ = NULL;
return temp;
}
}
inline void TestCamelCaseFieldNames::set_allocated_messagefield(::protobuf_unittest::ForeignMessage* messagefield) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete messagefield_;
}
if (messagefield != NULL) {
_slow_set_allocated_messagefield(message_arena, &messagefield);
}
messagefield_ = messagefield;
if (messagefield) {
set_has_messagefield();
} else {
clear_has_messagefield();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestCamelCaseFieldNames.MessageField)
}
// optional string StringPieceField = 5 [ctype = STRING_PIECE];
inline bool TestCamelCaseFieldNames::has_stringpiecefield() const {
return (_has_bits_[0] & 0x00000010u) != 0;
}
inline void TestCamelCaseFieldNames::set_has_stringpiecefield() {
_has_bits_[0] |= 0x00000010u;
}
inline void TestCamelCaseFieldNames::clear_has_stringpiecefield() {
_has_bits_[0] &= ~0x00000010u;
}
inline void TestCamelCaseFieldNames::clear_stringpiecefield() {
stringpiecefield_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
clear_has_stringpiecefield();
}
inline const ::std::string& TestCamelCaseFieldNames::stringpiecefield() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestCamelCaseFieldNames.StringPieceField)
return stringpiecefield_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline void TestCamelCaseFieldNames::set_stringpiecefield(const ::std::string& value) {
set_has_stringpiecefield();
stringpiecefield_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestCamelCaseFieldNames.StringPieceField)
}
inline void TestCamelCaseFieldNames::set_stringpiecefield(const char* value) {
set_has_stringpiecefield();
stringpiecefield_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestCamelCaseFieldNames.StringPieceField)
}
inline void TestCamelCaseFieldNames::set_stringpiecefield(const char* value,
size_t size) {
set_has_stringpiecefield();
stringpiecefield_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestCamelCaseFieldNames.StringPieceField)
}
inline ::std::string* TestCamelCaseFieldNames::mutable_stringpiecefield() {
set_has_stringpiecefield();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestCamelCaseFieldNames.StringPieceField)
return stringpiecefield_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestCamelCaseFieldNames::release_stringpiecefield() {
clear_has_stringpiecefield();
return stringpiecefield_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestCamelCaseFieldNames::unsafe_arena_release_stringpiecefield() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_stringpiecefield();
return stringpiecefield_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
}
inline void TestCamelCaseFieldNames::set_allocated_stringpiecefield(::std::string* stringpiecefield) {
if (stringpiecefield != NULL) {
set_has_stringpiecefield();
} else {
clear_has_stringpiecefield();
}
stringpiecefield_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), stringpiecefield,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestCamelCaseFieldNames.StringPieceField)
}
inline void TestCamelCaseFieldNames::unsafe_arena_set_allocated_stringpiecefield(
::std::string* stringpiecefield) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (stringpiecefield != NULL) {
set_has_stringpiecefield();
} else {
clear_has_stringpiecefield();
}
stringpiecefield_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
stringpiecefield, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestCamelCaseFieldNames.StringPieceField)
}
// optional string CordField = 6 [ctype = CORD];
inline bool TestCamelCaseFieldNames::has_cordfield() const {
return (_has_bits_[0] & 0x00000020u) != 0;
}
inline void TestCamelCaseFieldNames::set_has_cordfield() {
_has_bits_[0] |= 0x00000020u;
}
inline void TestCamelCaseFieldNames::clear_has_cordfield() {
_has_bits_[0] &= ~0x00000020u;
}
inline void TestCamelCaseFieldNames::clear_cordfield() {
cordfield_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
clear_has_cordfield();
}
inline const ::std::string& TestCamelCaseFieldNames::cordfield() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestCamelCaseFieldNames.CordField)
return cordfield_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline void TestCamelCaseFieldNames::set_cordfield(const ::std::string& value) {
set_has_cordfield();
cordfield_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestCamelCaseFieldNames.CordField)
}
inline void TestCamelCaseFieldNames::set_cordfield(const char* value) {
set_has_cordfield();
cordfield_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestCamelCaseFieldNames.CordField)
}
inline void TestCamelCaseFieldNames::set_cordfield(const char* value,
size_t size) {
set_has_cordfield();
cordfield_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestCamelCaseFieldNames.CordField)
}
inline ::std::string* TestCamelCaseFieldNames::mutable_cordfield() {
set_has_cordfield();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestCamelCaseFieldNames.CordField)
return cordfield_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestCamelCaseFieldNames::release_cordfield() {
clear_has_cordfield();
return cordfield_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestCamelCaseFieldNames::unsafe_arena_release_cordfield() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_cordfield();
return cordfield_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
}
inline void TestCamelCaseFieldNames::set_allocated_cordfield(::std::string* cordfield) {
if (cordfield != NULL) {
set_has_cordfield();
} else {
clear_has_cordfield();
}
cordfield_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), cordfield,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestCamelCaseFieldNames.CordField)
}
inline void TestCamelCaseFieldNames::unsafe_arena_set_allocated_cordfield(
::std::string* cordfield) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (cordfield != NULL) {
set_has_cordfield();
} else {
clear_has_cordfield();
}
cordfield_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
cordfield, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestCamelCaseFieldNames.CordField)
}
// repeated int32 RepeatedPrimitiveField = 7;
inline int TestCamelCaseFieldNames::repeatedprimitivefield_size() const {
return repeatedprimitivefield_.size();
}
inline void TestCamelCaseFieldNames::clear_repeatedprimitivefield() {
repeatedprimitivefield_.Clear();
}
inline ::google::protobuf::int32 TestCamelCaseFieldNames::repeatedprimitivefield(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestCamelCaseFieldNames.RepeatedPrimitiveField)
return repeatedprimitivefield_.Get(index);
}
inline void TestCamelCaseFieldNames::set_repeatedprimitivefield(int index, ::google::protobuf::int32 value) {
repeatedprimitivefield_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestCamelCaseFieldNames.RepeatedPrimitiveField)
}
inline void TestCamelCaseFieldNames::add_repeatedprimitivefield(::google::protobuf::int32 value) {
repeatedprimitivefield_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestCamelCaseFieldNames.RepeatedPrimitiveField)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
TestCamelCaseFieldNames::repeatedprimitivefield() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestCamelCaseFieldNames.RepeatedPrimitiveField)
return repeatedprimitivefield_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
TestCamelCaseFieldNames::mutable_repeatedprimitivefield() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestCamelCaseFieldNames.RepeatedPrimitiveField)
return &repeatedprimitivefield_;
}
// repeated string RepeatedStringField = 8;
inline int TestCamelCaseFieldNames::repeatedstringfield_size() const {
return repeatedstringfield_.size();
}
inline void TestCamelCaseFieldNames::clear_repeatedstringfield() {
repeatedstringfield_.Clear();
}
inline const ::std::string& TestCamelCaseFieldNames::repeatedstringfield(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestCamelCaseFieldNames.RepeatedStringField)
return repeatedstringfield_.Get(index);
}
inline ::std::string* TestCamelCaseFieldNames::mutable_repeatedstringfield(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestCamelCaseFieldNames.RepeatedStringField)
return repeatedstringfield_.Mutable(index);
}
inline void TestCamelCaseFieldNames::set_repeatedstringfield(int index, const ::std::string& value) {
// @@protoc_insertion_point(field_set:protobuf_unittest.TestCamelCaseFieldNames.RepeatedStringField)
repeatedstringfield_.Mutable(index)->assign(value);
}
inline void TestCamelCaseFieldNames::set_repeatedstringfield(int index, const char* value) {
repeatedstringfield_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestCamelCaseFieldNames.RepeatedStringField)
}
inline void TestCamelCaseFieldNames::set_repeatedstringfield(int index, const char* value, size_t size) {
repeatedstringfield_.Mutable(index)->assign(
reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestCamelCaseFieldNames.RepeatedStringField)
}
inline ::std::string* TestCamelCaseFieldNames::add_repeatedstringfield() {
return repeatedstringfield_.Add();
}
inline void TestCamelCaseFieldNames::add_repeatedstringfield(const ::std::string& value) {
repeatedstringfield_.Add()->assign(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestCamelCaseFieldNames.RepeatedStringField)
}
inline void TestCamelCaseFieldNames::add_repeatedstringfield(const char* value) {
repeatedstringfield_.Add()->assign(value);
// @@protoc_insertion_point(field_add_char:protobuf_unittest.TestCamelCaseFieldNames.RepeatedStringField)
}
inline void TestCamelCaseFieldNames::add_repeatedstringfield(const char* value, size_t size) {
repeatedstringfield_.Add()->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_add_pointer:protobuf_unittest.TestCamelCaseFieldNames.RepeatedStringField)
}
inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
TestCamelCaseFieldNames::repeatedstringfield() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestCamelCaseFieldNames.RepeatedStringField)
return repeatedstringfield_;
}
inline ::google::protobuf::RepeatedPtrField< ::std::string>*
TestCamelCaseFieldNames::mutable_repeatedstringfield() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestCamelCaseFieldNames.RepeatedStringField)
return &repeatedstringfield_;
}
// repeated .protobuf_unittest.ForeignEnum RepeatedEnumField = 9;
inline int TestCamelCaseFieldNames::repeatedenumfield_size() const {
return repeatedenumfield_.size();
}
inline void TestCamelCaseFieldNames::clear_repeatedenumfield() {
repeatedenumfield_.Clear();
}
inline ::protobuf_unittest::ForeignEnum TestCamelCaseFieldNames::repeatedenumfield(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestCamelCaseFieldNames.RepeatedEnumField)
return static_cast< ::protobuf_unittest::ForeignEnum >(repeatedenumfield_.Get(index));
}
inline void TestCamelCaseFieldNames::set_repeatedenumfield(int index, ::protobuf_unittest::ForeignEnum value) {
assert(::protobuf_unittest::ForeignEnum_IsValid(value));
repeatedenumfield_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestCamelCaseFieldNames.RepeatedEnumField)
}
inline void TestCamelCaseFieldNames::add_repeatedenumfield(::protobuf_unittest::ForeignEnum value) {
assert(::protobuf_unittest::ForeignEnum_IsValid(value));
repeatedenumfield_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestCamelCaseFieldNames.RepeatedEnumField)
}
inline const ::google::protobuf::RepeatedField<int>&
TestCamelCaseFieldNames::repeatedenumfield() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestCamelCaseFieldNames.RepeatedEnumField)
return repeatedenumfield_;
}
inline ::google::protobuf::RepeatedField<int>*
TestCamelCaseFieldNames::mutable_repeatedenumfield() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestCamelCaseFieldNames.RepeatedEnumField)
return &repeatedenumfield_;
}
// repeated .protobuf_unittest.ForeignMessage RepeatedMessageField = 10;
inline int TestCamelCaseFieldNames::repeatedmessagefield_size() const {
return repeatedmessagefield_.size();
}
inline void TestCamelCaseFieldNames::clear_repeatedmessagefield() {
repeatedmessagefield_.Clear();
}
inline const ::protobuf_unittest::ForeignMessage& TestCamelCaseFieldNames::repeatedmessagefield(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestCamelCaseFieldNames.RepeatedMessageField)
return repeatedmessagefield_.Get(index);
}
inline ::protobuf_unittest::ForeignMessage* TestCamelCaseFieldNames::mutable_repeatedmessagefield(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestCamelCaseFieldNames.RepeatedMessageField)
return repeatedmessagefield_.Mutable(index);
}
inline ::protobuf_unittest::ForeignMessage* TestCamelCaseFieldNames::add_repeatedmessagefield() {
// @@protoc_insertion_point(field_add:protobuf_unittest.TestCamelCaseFieldNames.RepeatedMessageField)
return repeatedmessagefield_.Add();
}
inline ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::ForeignMessage >*
TestCamelCaseFieldNames::mutable_repeatedmessagefield() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestCamelCaseFieldNames.RepeatedMessageField)
return &repeatedmessagefield_;
}
inline const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::ForeignMessage >&
TestCamelCaseFieldNames::repeatedmessagefield() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestCamelCaseFieldNames.RepeatedMessageField)
return repeatedmessagefield_;
}
// repeated string RepeatedStringPieceField = 11 [ctype = STRING_PIECE];
inline int TestCamelCaseFieldNames::repeatedstringpiecefield_size() const {
return repeatedstringpiecefield_.size();
}
inline void TestCamelCaseFieldNames::clear_repeatedstringpiecefield() {
repeatedstringpiecefield_.Clear();
}
inline const ::std::string& TestCamelCaseFieldNames::repeatedstringpiecefield(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestCamelCaseFieldNames.RepeatedStringPieceField)
return repeatedstringpiecefield_.Get(index);
}
inline ::std::string* TestCamelCaseFieldNames::mutable_repeatedstringpiecefield(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestCamelCaseFieldNames.RepeatedStringPieceField)
return repeatedstringpiecefield_.Mutable(index);
}
inline void TestCamelCaseFieldNames::set_repeatedstringpiecefield(int index, const ::std::string& value) {
// @@protoc_insertion_point(field_set:protobuf_unittest.TestCamelCaseFieldNames.RepeatedStringPieceField)
repeatedstringpiecefield_.Mutable(index)->assign(value);
}
inline void TestCamelCaseFieldNames::set_repeatedstringpiecefield(int index, const char* value) {
repeatedstringpiecefield_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestCamelCaseFieldNames.RepeatedStringPieceField)
}
inline void TestCamelCaseFieldNames::set_repeatedstringpiecefield(int index, const char* value, size_t size) {
repeatedstringpiecefield_.Mutable(index)->assign(
reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestCamelCaseFieldNames.RepeatedStringPieceField)
}
inline ::std::string* TestCamelCaseFieldNames::add_repeatedstringpiecefield() {
return repeatedstringpiecefield_.Add();
}
inline void TestCamelCaseFieldNames::add_repeatedstringpiecefield(const ::std::string& value) {
repeatedstringpiecefield_.Add()->assign(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestCamelCaseFieldNames.RepeatedStringPieceField)
}
inline void TestCamelCaseFieldNames::add_repeatedstringpiecefield(const char* value) {
repeatedstringpiecefield_.Add()->assign(value);
// @@protoc_insertion_point(field_add_char:protobuf_unittest.TestCamelCaseFieldNames.RepeatedStringPieceField)
}
inline void TestCamelCaseFieldNames::add_repeatedstringpiecefield(const char* value, size_t size) {
repeatedstringpiecefield_.Add()->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_add_pointer:protobuf_unittest.TestCamelCaseFieldNames.RepeatedStringPieceField)
}
inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
TestCamelCaseFieldNames::repeatedstringpiecefield() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestCamelCaseFieldNames.RepeatedStringPieceField)
return repeatedstringpiecefield_;
}
inline ::google::protobuf::RepeatedPtrField< ::std::string>*
TestCamelCaseFieldNames::mutable_repeatedstringpiecefield() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestCamelCaseFieldNames.RepeatedStringPieceField)
return &repeatedstringpiecefield_;
}
// repeated string RepeatedCordField = 12 [ctype = CORD];
inline int TestCamelCaseFieldNames::repeatedcordfield_size() const {
return repeatedcordfield_.size();
}
inline void TestCamelCaseFieldNames::clear_repeatedcordfield() {
repeatedcordfield_.Clear();
}
inline const ::std::string& TestCamelCaseFieldNames::repeatedcordfield(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestCamelCaseFieldNames.RepeatedCordField)
return repeatedcordfield_.Get(index);
}
inline ::std::string* TestCamelCaseFieldNames::mutable_repeatedcordfield(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestCamelCaseFieldNames.RepeatedCordField)
return repeatedcordfield_.Mutable(index);
}
inline void TestCamelCaseFieldNames::set_repeatedcordfield(int index, const ::std::string& value) {
// @@protoc_insertion_point(field_set:protobuf_unittest.TestCamelCaseFieldNames.RepeatedCordField)
repeatedcordfield_.Mutable(index)->assign(value);
}
inline void TestCamelCaseFieldNames::set_repeatedcordfield(int index, const char* value) {
repeatedcordfield_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestCamelCaseFieldNames.RepeatedCordField)
}
inline void TestCamelCaseFieldNames::set_repeatedcordfield(int index, const char* value, size_t size) {
repeatedcordfield_.Mutable(index)->assign(
reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestCamelCaseFieldNames.RepeatedCordField)
}
inline ::std::string* TestCamelCaseFieldNames::add_repeatedcordfield() {
return repeatedcordfield_.Add();
}
inline void TestCamelCaseFieldNames::add_repeatedcordfield(const ::std::string& value) {
repeatedcordfield_.Add()->assign(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestCamelCaseFieldNames.RepeatedCordField)
}
inline void TestCamelCaseFieldNames::add_repeatedcordfield(const char* value) {
repeatedcordfield_.Add()->assign(value);
// @@protoc_insertion_point(field_add_char:protobuf_unittest.TestCamelCaseFieldNames.RepeatedCordField)
}
inline void TestCamelCaseFieldNames::add_repeatedcordfield(const char* value, size_t size) {
repeatedcordfield_.Add()->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_add_pointer:protobuf_unittest.TestCamelCaseFieldNames.RepeatedCordField)
}
inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
TestCamelCaseFieldNames::repeatedcordfield() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestCamelCaseFieldNames.RepeatedCordField)
return repeatedcordfield_;
}
inline ::google::protobuf::RepeatedPtrField< ::std::string>*
TestCamelCaseFieldNames::mutable_repeatedcordfield() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestCamelCaseFieldNames.RepeatedCordField)
return &repeatedcordfield_;
}
// -------------------------------------------------------------------
// TestFieldOrderings_NestedMessage
// optional int64 oo = 2;
inline bool TestFieldOrderings_NestedMessage::has_oo() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestFieldOrderings_NestedMessage::set_has_oo() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestFieldOrderings_NestedMessage::clear_has_oo() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestFieldOrderings_NestedMessage::clear_oo() {
oo_ = GOOGLE_LONGLONG(0);
clear_has_oo();
}
inline ::google::protobuf::int64 TestFieldOrderings_NestedMessage::oo() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestFieldOrderings.NestedMessage.oo)
return oo_;
}
inline void TestFieldOrderings_NestedMessage::set_oo(::google::protobuf::int64 value) {
set_has_oo();
oo_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestFieldOrderings.NestedMessage.oo)
}
// optional int32 bb = 1;
inline bool TestFieldOrderings_NestedMessage::has_bb() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void TestFieldOrderings_NestedMessage::set_has_bb() {
_has_bits_[0] |= 0x00000002u;
}
inline void TestFieldOrderings_NestedMessage::clear_has_bb() {
_has_bits_[0] &= ~0x00000002u;
}
inline void TestFieldOrderings_NestedMessage::clear_bb() {
bb_ = 0;
clear_has_bb();
}
inline ::google::protobuf::int32 TestFieldOrderings_NestedMessage::bb() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestFieldOrderings.NestedMessage.bb)
return bb_;
}
inline void TestFieldOrderings_NestedMessage::set_bb(::google::protobuf::int32 value) {
set_has_bb();
bb_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestFieldOrderings.NestedMessage.bb)
}
// -------------------------------------------------------------------
// TestFieldOrderings
// optional string my_string = 11;
inline bool TestFieldOrderings::has_my_string() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestFieldOrderings::set_has_my_string() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestFieldOrderings::clear_has_my_string() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestFieldOrderings::clear_my_string() {
my_string_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
clear_has_my_string();
}
inline const ::std::string& TestFieldOrderings::my_string() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestFieldOrderings.my_string)
return my_string_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline void TestFieldOrderings::set_my_string(const ::std::string& value) {
set_has_my_string();
my_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestFieldOrderings.my_string)
}
inline void TestFieldOrderings::set_my_string(const char* value) {
set_has_my_string();
my_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestFieldOrderings.my_string)
}
inline void TestFieldOrderings::set_my_string(const char* value,
size_t size) {
set_has_my_string();
my_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestFieldOrderings.my_string)
}
inline ::std::string* TestFieldOrderings::mutable_my_string() {
set_has_my_string();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestFieldOrderings.my_string)
return my_string_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestFieldOrderings::release_my_string() {
clear_has_my_string();
return my_string_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestFieldOrderings::unsafe_arena_release_my_string() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_my_string();
return my_string_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
}
inline void TestFieldOrderings::set_allocated_my_string(::std::string* my_string) {
if (my_string != NULL) {
set_has_my_string();
} else {
clear_has_my_string();
}
my_string_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), my_string,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestFieldOrderings.my_string)
}
inline void TestFieldOrderings::unsafe_arena_set_allocated_my_string(
::std::string* my_string) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (my_string != NULL) {
set_has_my_string();
} else {
clear_has_my_string();
}
my_string_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
my_string, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestFieldOrderings.my_string)
}
// optional int64 my_int = 1;
inline bool TestFieldOrderings::has_my_int() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void TestFieldOrderings::set_has_my_int() {
_has_bits_[0] |= 0x00000002u;
}
inline void TestFieldOrderings::clear_has_my_int() {
_has_bits_[0] &= ~0x00000002u;
}
inline void TestFieldOrderings::clear_my_int() {
my_int_ = GOOGLE_LONGLONG(0);
clear_has_my_int();
}
inline ::google::protobuf::int64 TestFieldOrderings::my_int() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestFieldOrderings.my_int)
return my_int_;
}
inline void TestFieldOrderings::set_my_int(::google::protobuf::int64 value) {
set_has_my_int();
my_int_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestFieldOrderings.my_int)
}
// optional float my_float = 101;
inline bool TestFieldOrderings::has_my_float() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void TestFieldOrderings::set_has_my_float() {
_has_bits_[0] |= 0x00000004u;
}
inline void TestFieldOrderings::clear_has_my_float() {
_has_bits_[0] &= ~0x00000004u;
}
inline void TestFieldOrderings::clear_my_float() {
my_float_ = 0;
clear_has_my_float();
}
inline float TestFieldOrderings::my_float() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestFieldOrderings.my_float)
return my_float_;
}
inline void TestFieldOrderings::set_my_float(float value) {
set_has_my_float();
my_float_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestFieldOrderings.my_float)
}
// optional .protobuf_unittest.TestFieldOrderings.NestedMessage optional_nested_message = 200;
inline bool TestFieldOrderings::has_optional_nested_message() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void TestFieldOrderings::set_has_optional_nested_message() {
_has_bits_[0] |= 0x00000008u;
}
inline void TestFieldOrderings::clear_has_optional_nested_message() {
_has_bits_[0] &= ~0x00000008u;
}
inline void TestFieldOrderings::clear_optional_nested_message() {
if (optional_nested_message_ != NULL) optional_nested_message_->::protobuf_unittest::TestFieldOrderings_NestedMessage::Clear();
clear_has_optional_nested_message();
}
inline const ::protobuf_unittest::TestFieldOrderings_NestedMessage& TestFieldOrderings::optional_nested_message() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestFieldOrderings.optional_nested_message)
return optional_nested_message_ != NULL ? *optional_nested_message_ : *default_instance_->optional_nested_message_;
}
inline ::protobuf_unittest::TestFieldOrderings_NestedMessage* TestFieldOrderings::mutable_optional_nested_message() {
set_has_optional_nested_message();
if (optional_nested_message_ == NULL) {
_slow_mutable_optional_nested_message();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestFieldOrderings.optional_nested_message)
return optional_nested_message_;
}
inline ::protobuf_unittest::TestFieldOrderings_NestedMessage* TestFieldOrderings::release_optional_nested_message() {
clear_has_optional_nested_message();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_optional_nested_message();
} else {
::protobuf_unittest::TestFieldOrderings_NestedMessage* temp = optional_nested_message_;
optional_nested_message_ = NULL;
return temp;
}
}
inline void TestFieldOrderings::set_allocated_optional_nested_message(::protobuf_unittest::TestFieldOrderings_NestedMessage* optional_nested_message) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete optional_nested_message_;
}
if (optional_nested_message != NULL) {
_slow_set_allocated_optional_nested_message(message_arena, &optional_nested_message);
}
optional_nested_message_ = optional_nested_message;
if (optional_nested_message) {
set_has_optional_nested_message();
} else {
clear_has_optional_nested_message();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestFieldOrderings.optional_nested_message)
}
// -------------------------------------------------------------------
// TestExtremeDefaultValues
// optional bytes escaped_bytes = 1 [default = "\000\001\007\010\014\n\r\t\013\\\'\"\376"];
inline bool TestExtremeDefaultValues::has_escaped_bytes() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestExtremeDefaultValues::set_has_escaped_bytes() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestExtremeDefaultValues::clear_has_escaped_bytes() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestExtremeDefaultValues::clear_escaped_bytes() {
escaped_bytes_.ClearToDefault(_default_escaped_bytes_, GetArenaNoVirtual());
clear_has_escaped_bytes();
}
inline const ::std::string& TestExtremeDefaultValues::escaped_bytes() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.escaped_bytes)
return escaped_bytes_.Get(_default_escaped_bytes_);
}
inline void TestExtremeDefaultValues::set_escaped_bytes(const ::std::string& value) {
set_has_escaped_bytes();
escaped_bytes_.Set(_default_escaped_bytes_, value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.escaped_bytes)
}
inline void TestExtremeDefaultValues::set_escaped_bytes(const char* value) {
set_has_escaped_bytes();
escaped_bytes_.Set(_default_escaped_bytes_, ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestExtremeDefaultValues.escaped_bytes)
}
inline void TestExtremeDefaultValues::set_escaped_bytes(const void* value,
size_t size) {
set_has_escaped_bytes();
escaped_bytes_.Set(_default_escaped_bytes_, ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestExtremeDefaultValues.escaped_bytes)
}
inline ::std::string* TestExtremeDefaultValues::mutable_escaped_bytes() {
set_has_escaped_bytes();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestExtremeDefaultValues.escaped_bytes)
return escaped_bytes_.Mutable(_default_escaped_bytes_, GetArenaNoVirtual());
}
inline ::std::string* TestExtremeDefaultValues::release_escaped_bytes() {
clear_has_escaped_bytes();
return escaped_bytes_.Release(_default_escaped_bytes_, GetArenaNoVirtual());
}
inline ::std::string* TestExtremeDefaultValues::unsafe_arena_release_escaped_bytes() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_escaped_bytes();
return escaped_bytes_.UnsafeArenaRelease(_default_escaped_bytes_,
GetArenaNoVirtual());
}
inline void TestExtremeDefaultValues::set_allocated_escaped_bytes(::std::string* escaped_bytes) {
if (escaped_bytes != NULL) {
set_has_escaped_bytes();
} else {
clear_has_escaped_bytes();
}
escaped_bytes_.SetAllocated(_default_escaped_bytes_, escaped_bytes,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestExtremeDefaultValues.escaped_bytes)
}
inline void TestExtremeDefaultValues::unsafe_arena_set_allocated_escaped_bytes(
::std::string* escaped_bytes) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (escaped_bytes != NULL) {
set_has_escaped_bytes();
} else {
clear_has_escaped_bytes();
}
escaped_bytes_.UnsafeArenaSetAllocated(_default_escaped_bytes_,
escaped_bytes, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestExtremeDefaultValues.escaped_bytes)
}
// optional uint32 large_uint32 = 2 [default = 4294967295];
inline bool TestExtremeDefaultValues::has_large_uint32() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void TestExtremeDefaultValues::set_has_large_uint32() {
_has_bits_[0] |= 0x00000002u;
}
inline void TestExtremeDefaultValues::clear_has_large_uint32() {
_has_bits_[0] &= ~0x00000002u;
}
inline void TestExtremeDefaultValues::clear_large_uint32() {
large_uint32_ = 4294967295u;
clear_has_large_uint32();
}
inline ::google::protobuf::uint32 TestExtremeDefaultValues::large_uint32() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.large_uint32)
return large_uint32_;
}
inline void TestExtremeDefaultValues::set_large_uint32(::google::protobuf::uint32 value) {
set_has_large_uint32();
large_uint32_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.large_uint32)
}
// optional uint64 large_uint64 = 3 [default = 18446744073709551615];
inline bool TestExtremeDefaultValues::has_large_uint64() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void TestExtremeDefaultValues::set_has_large_uint64() {
_has_bits_[0] |= 0x00000004u;
}
inline void TestExtremeDefaultValues::clear_has_large_uint64() {
_has_bits_[0] &= ~0x00000004u;
}
inline void TestExtremeDefaultValues::clear_large_uint64() {
large_uint64_ = GOOGLE_ULONGLONG(18446744073709551615);
clear_has_large_uint64();
}
inline ::google::protobuf::uint64 TestExtremeDefaultValues::large_uint64() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.large_uint64)
return large_uint64_;
}
inline void TestExtremeDefaultValues::set_large_uint64(::google::protobuf::uint64 value) {
set_has_large_uint64();
large_uint64_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.large_uint64)
}
// optional int32 small_int32 = 4 [default = -2147483647];
inline bool TestExtremeDefaultValues::has_small_int32() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void TestExtremeDefaultValues::set_has_small_int32() {
_has_bits_[0] |= 0x00000008u;
}
inline void TestExtremeDefaultValues::clear_has_small_int32() {
_has_bits_[0] &= ~0x00000008u;
}
inline void TestExtremeDefaultValues::clear_small_int32() {
small_int32_ = -2147483647;
clear_has_small_int32();
}
inline ::google::protobuf::int32 TestExtremeDefaultValues::small_int32() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.small_int32)
return small_int32_;
}
inline void TestExtremeDefaultValues::set_small_int32(::google::protobuf::int32 value) {
set_has_small_int32();
small_int32_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.small_int32)
}
// optional int64 small_int64 = 5 [default = -9223372036854775807];
inline bool TestExtremeDefaultValues::has_small_int64() const {
return (_has_bits_[0] & 0x00000010u) != 0;
}
inline void TestExtremeDefaultValues::set_has_small_int64() {
_has_bits_[0] |= 0x00000010u;
}
inline void TestExtremeDefaultValues::clear_has_small_int64() {
_has_bits_[0] &= ~0x00000010u;
}
inline void TestExtremeDefaultValues::clear_small_int64() {
small_int64_ = GOOGLE_LONGLONG(-9223372036854775807);
clear_has_small_int64();
}
inline ::google::protobuf::int64 TestExtremeDefaultValues::small_int64() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.small_int64)
return small_int64_;
}
inline void TestExtremeDefaultValues::set_small_int64(::google::protobuf::int64 value) {
set_has_small_int64();
small_int64_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.small_int64)
}
// optional int32 really_small_int32 = 21 [default = -2147483648];
inline bool TestExtremeDefaultValues::has_really_small_int32() const {
return (_has_bits_[0] & 0x00000020u) != 0;
}
inline void TestExtremeDefaultValues::set_has_really_small_int32() {
_has_bits_[0] |= 0x00000020u;
}
inline void TestExtremeDefaultValues::clear_has_really_small_int32() {
_has_bits_[0] &= ~0x00000020u;
}
inline void TestExtremeDefaultValues::clear_really_small_int32() {
really_small_int32_ = (~0x7fffffff);
clear_has_really_small_int32();
}
inline ::google::protobuf::int32 TestExtremeDefaultValues::really_small_int32() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.really_small_int32)
return really_small_int32_;
}
inline void TestExtremeDefaultValues::set_really_small_int32(::google::protobuf::int32 value) {
set_has_really_small_int32();
really_small_int32_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.really_small_int32)
}
// optional int64 really_small_int64 = 22 [default = -9223372036854775808];
inline bool TestExtremeDefaultValues::has_really_small_int64() const {
return (_has_bits_[0] & 0x00000040u) != 0;
}
inline void TestExtremeDefaultValues::set_has_really_small_int64() {
_has_bits_[0] |= 0x00000040u;
}
inline void TestExtremeDefaultValues::clear_has_really_small_int64() {
_has_bits_[0] &= ~0x00000040u;
}
inline void TestExtremeDefaultValues::clear_really_small_int64() {
really_small_int64_ = GOOGLE_LONGLONG(~0x7fffffffffffffff);
clear_has_really_small_int64();
}
inline ::google::protobuf::int64 TestExtremeDefaultValues::really_small_int64() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.really_small_int64)
return really_small_int64_;
}
inline void TestExtremeDefaultValues::set_really_small_int64(::google::protobuf::int64 value) {
set_has_really_small_int64();
really_small_int64_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.really_small_int64)
}
// optional string utf8_string = 6 [default = "\341\210\264"];
inline bool TestExtremeDefaultValues::has_utf8_string() const {
return (_has_bits_[0] & 0x00000080u) != 0;
}
inline void TestExtremeDefaultValues::set_has_utf8_string() {
_has_bits_[0] |= 0x00000080u;
}
inline void TestExtremeDefaultValues::clear_has_utf8_string() {
_has_bits_[0] &= ~0x00000080u;
}
inline void TestExtremeDefaultValues::clear_utf8_string() {
utf8_string_.ClearToDefault(_default_utf8_string_, GetArenaNoVirtual());
clear_has_utf8_string();
}
inline const ::std::string& TestExtremeDefaultValues::utf8_string() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.utf8_string)
return utf8_string_.Get(_default_utf8_string_);
}
inline void TestExtremeDefaultValues::set_utf8_string(const ::std::string& value) {
set_has_utf8_string();
utf8_string_.Set(_default_utf8_string_, value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.utf8_string)
}
inline void TestExtremeDefaultValues::set_utf8_string(const char* value) {
set_has_utf8_string();
utf8_string_.Set(_default_utf8_string_, ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestExtremeDefaultValues.utf8_string)
}
inline void TestExtremeDefaultValues::set_utf8_string(const char* value,
size_t size) {
set_has_utf8_string();
utf8_string_.Set(_default_utf8_string_, ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestExtremeDefaultValues.utf8_string)
}
inline ::std::string* TestExtremeDefaultValues::mutable_utf8_string() {
set_has_utf8_string();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestExtremeDefaultValues.utf8_string)
return utf8_string_.Mutable(_default_utf8_string_, GetArenaNoVirtual());
}
inline ::std::string* TestExtremeDefaultValues::release_utf8_string() {
clear_has_utf8_string();
return utf8_string_.Release(_default_utf8_string_, GetArenaNoVirtual());
}
inline ::std::string* TestExtremeDefaultValues::unsafe_arena_release_utf8_string() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_utf8_string();
return utf8_string_.UnsafeArenaRelease(_default_utf8_string_,
GetArenaNoVirtual());
}
inline void TestExtremeDefaultValues::set_allocated_utf8_string(::std::string* utf8_string) {
if (utf8_string != NULL) {
set_has_utf8_string();
} else {
clear_has_utf8_string();
}
utf8_string_.SetAllocated(_default_utf8_string_, utf8_string,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestExtremeDefaultValues.utf8_string)
}
inline void TestExtremeDefaultValues::unsafe_arena_set_allocated_utf8_string(
::std::string* utf8_string) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (utf8_string != NULL) {
set_has_utf8_string();
} else {
clear_has_utf8_string();
}
utf8_string_.UnsafeArenaSetAllocated(_default_utf8_string_,
utf8_string, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestExtremeDefaultValues.utf8_string)
}
// optional float zero_float = 7 [default = 0];
inline bool TestExtremeDefaultValues::has_zero_float() const {
return (_has_bits_[0] & 0x00000100u) != 0;
}
inline void TestExtremeDefaultValues::set_has_zero_float() {
_has_bits_[0] |= 0x00000100u;
}
inline void TestExtremeDefaultValues::clear_has_zero_float() {
_has_bits_[0] &= ~0x00000100u;
}
inline void TestExtremeDefaultValues::clear_zero_float() {
zero_float_ = 0;
clear_has_zero_float();
}
inline float TestExtremeDefaultValues::zero_float() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.zero_float)
return zero_float_;
}
inline void TestExtremeDefaultValues::set_zero_float(float value) {
set_has_zero_float();
zero_float_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.zero_float)
}
// optional float one_float = 8 [default = 1];
inline bool TestExtremeDefaultValues::has_one_float() const {
return (_has_bits_[0] & 0x00000200u) != 0;
}
inline void TestExtremeDefaultValues::set_has_one_float() {
_has_bits_[0] |= 0x00000200u;
}
inline void TestExtremeDefaultValues::clear_has_one_float() {
_has_bits_[0] &= ~0x00000200u;
}
inline void TestExtremeDefaultValues::clear_one_float() {
one_float_ = 1;
clear_has_one_float();
}
inline float TestExtremeDefaultValues::one_float() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.one_float)
return one_float_;
}
inline void TestExtremeDefaultValues::set_one_float(float value) {
set_has_one_float();
one_float_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.one_float)
}
// optional float small_float = 9 [default = 1.5];
inline bool TestExtremeDefaultValues::has_small_float() const {
return (_has_bits_[0] & 0x00000400u) != 0;
}
inline void TestExtremeDefaultValues::set_has_small_float() {
_has_bits_[0] |= 0x00000400u;
}
inline void TestExtremeDefaultValues::clear_has_small_float() {
_has_bits_[0] &= ~0x00000400u;
}
inline void TestExtremeDefaultValues::clear_small_float() {
small_float_ = 1.5f;
clear_has_small_float();
}
inline float TestExtremeDefaultValues::small_float() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.small_float)
return small_float_;
}
inline void TestExtremeDefaultValues::set_small_float(float value) {
set_has_small_float();
small_float_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.small_float)
}
// optional float negative_one_float = 10 [default = -1];
inline bool TestExtremeDefaultValues::has_negative_one_float() const {
return (_has_bits_[0] & 0x00000800u) != 0;
}
inline void TestExtremeDefaultValues::set_has_negative_one_float() {
_has_bits_[0] |= 0x00000800u;
}
inline void TestExtremeDefaultValues::clear_has_negative_one_float() {
_has_bits_[0] &= ~0x00000800u;
}
inline void TestExtremeDefaultValues::clear_negative_one_float() {
negative_one_float_ = -1;
clear_has_negative_one_float();
}
inline float TestExtremeDefaultValues::negative_one_float() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.negative_one_float)
return negative_one_float_;
}
inline void TestExtremeDefaultValues::set_negative_one_float(float value) {
set_has_negative_one_float();
negative_one_float_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.negative_one_float)
}
// optional float negative_float = 11 [default = -1.5];
inline bool TestExtremeDefaultValues::has_negative_float() const {
return (_has_bits_[0] & 0x00001000u) != 0;
}
inline void TestExtremeDefaultValues::set_has_negative_float() {
_has_bits_[0] |= 0x00001000u;
}
inline void TestExtremeDefaultValues::clear_has_negative_float() {
_has_bits_[0] &= ~0x00001000u;
}
inline void TestExtremeDefaultValues::clear_negative_float() {
negative_float_ = -1.5f;
clear_has_negative_float();
}
inline float TestExtremeDefaultValues::negative_float() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.negative_float)
return negative_float_;
}
inline void TestExtremeDefaultValues::set_negative_float(float value) {
set_has_negative_float();
negative_float_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.negative_float)
}
// optional float large_float = 12 [default = 2e+08];
inline bool TestExtremeDefaultValues::has_large_float() const {
return (_has_bits_[0] & 0x00002000u) != 0;
}
inline void TestExtremeDefaultValues::set_has_large_float() {
_has_bits_[0] |= 0x00002000u;
}
inline void TestExtremeDefaultValues::clear_has_large_float() {
_has_bits_[0] &= ~0x00002000u;
}
inline void TestExtremeDefaultValues::clear_large_float() {
large_float_ = 2e+08f;
clear_has_large_float();
}
inline float TestExtremeDefaultValues::large_float() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.large_float)
return large_float_;
}
inline void TestExtremeDefaultValues::set_large_float(float value) {
set_has_large_float();
large_float_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.large_float)
}
// optional float small_negative_float = 13 [default = -8e-28];
inline bool TestExtremeDefaultValues::has_small_negative_float() const {
return (_has_bits_[0] & 0x00004000u) != 0;
}
inline void TestExtremeDefaultValues::set_has_small_negative_float() {
_has_bits_[0] |= 0x00004000u;
}
inline void TestExtremeDefaultValues::clear_has_small_negative_float() {
_has_bits_[0] &= ~0x00004000u;
}
inline void TestExtremeDefaultValues::clear_small_negative_float() {
small_negative_float_ = -8e-28f;
clear_has_small_negative_float();
}
inline float TestExtremeDefaultValues::small_negative_float() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.small_negative_float)
return small_negative_float_;
}
inline void TestExtremeDefaultValues::set_small_negative_float(float value) {
set_has_small_negative_float();
small_negative_float_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.small_negative_float)
}
// optional double inf_double = 14 [default = inf];
inline bool TestExtremeDefaultValues::has_inf_double() const {
return (_has_bits_[0] & 0x00008000u) != 0;
}
inline void TestExtremeDefaultValues::set_has_inf_double() {
_has_bits_[0] |= 0x00008000u;
}
inline void TestExtremeDefaultValues::clear_has_inf_double() {
_has_bits_[0] &= ~0x00008000u;
}
inline void TestExtremeDefaultValues::clear_inf_double() {
inf_double_ = ::google::protobuf::internal::Infinity();
clear_has_inf_double();
}
inline double TestExtremeDefaultValues::inf_double() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.inf_double)
return inf_double_;
}
inline void TestExtremeDefaultValues::set_inf_double(double value) {
set_has_inf_double();
inf_double_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.inf_double)
}
// optional double neg_inf_double = 15 [default = -inf];
inline bool TestExtremeDefaultValues::has_neg_inf_double() const {
return (_has_bits_[0] & 0x00010000u) != 0;
}
inline void TestExtremeDefaultValues::set_has_neg_inf_double() {
_has_bits_[0] |= 0x00010000u;
}
inline void TestExtremeDefaultValues::clear_has_neg_inf_double() {
_has_bits_[0] &= ~0x00010000u;
}
inline void TestExtremeDefaultValues::clear_neg_inf_double() {
neg_inf_double_ = -::google::protobuf::internal::Infinity();
clear_has_neg_inf_double();
}
inline double TestExtremeDefaultValues::neg_inf_double() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.neg_inf_double)
return neg_inf_double_;
}
inline void TestExtremeDefaultValues::set_neg_inf_double(double value) {
set_has_neg_inf_double();
neg_inf_double_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.neg_inf_double)
}
// optional double nan_double = 16 [default = nan];
inline bool TestExtremeDefaultValues::has_nan_double() const {
return (_has_bits_[0] & 0x00020000u) != 0;
}
inline void TestExtremeDefaultValues::set_has_nan_double() {
_has_bits_[0] |= 0x00020000u;
}
inline void TestExtremeDefaultValues::clear_has_nan_double() {
_has_bits_[0] &= ~0x00020000u;
}
inline void TestExtremeDefaultValues::clear_nan_double() {
nan_double_ = ::google::protobuf::internal::NaN();
clear_has_nan_double();
}
inline double TestExtremeDefaultValues::nan_double() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.nan_double)
return nan_double_;
}
inline void TestExtremeDefaultValues::set_nan_double(double value) {
set_has_nan_double();
nan_double_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.nan_double)
}
// optional float inf_float = 17 [default = inf];
inline bool TestExtremeDefaultValues::has_inf_float() const {
return (_has_bits_[0] & 0x00040000u) != 0;
}
inline void TestExtremeDefaultValues::set_has_inf_float() {
_has_bits_[0] |= 0x00040000u;
}
inline void TestExtremeDefaultValues::clear_has_inf_float() {
_has_bits_[0] &= ~0x00040000u;
}
inline void TestExtremeDefaultValues::clear_inf_float() {
inf_float_ = static_cast<float>(::google::protobuf::internal::Infinity());
clear_has_inf_float();
}
inline float TestExtremeDefaultValues::inf_float() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.inf_float)
return inf_float_;
}
inline void TestExtremeDefaultValues::set_inf_float(float value) {
set_has_inf_float();
inf_float_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.inf_float)
}
// optional float neg_inf_float = 18 [default = -inf];
inline bool TestExtremeDefaultValues::has_neg_inf_float() const {
return (_has_bits_[0] & 0x00080000u) != 0;
}
inline void TestExtremeDefaultValues::set_has_neg_inf_float() {
_has_bits_[0] |= 0x00080000u;
}
inline void TestExtremeDefaultValues::clear_has_neg_inf_float() {
_has_bits_[0] &= ~0x00080000u;
}
inline void TestExtremeDefaultValues::clear_neg_inf_float() {
neg_inf_float_ = static_cast<float>(-::google::protobuf::internal::Infinity());
clear_has_neg_inf_float();
}
inline float TestExtremeDefaultValues::neg_inf_float() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.neg_inf_float)
return neg_inf_float_;
}
inline void TestExtremeDefaultValues::set_neg_inf_float(float value) {
set_has_neg_inf_float();
neg_inf_float_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.neg_inf_float)
}
// optional float nan_float = 19 [default = nan];
inline bool TestExtremeDefaultValues::has_nan_float() const {
return (_has_bits_[0] & 0x00100000u) != 0;
}
inline void TestExtremeDefaultValues::set_has_nan_float() {
_has_bits_[0] |= 0x00100000u;
}
inline void TestExtremeDefaultValues::clear_has_nan_float() {
_has_bits_[0] &= ~0x00100000u;
}
inline void TestExtremeDefaultValues::clear_nan_float() {
nan_float_ = static_cast<float>(::google::protobuf::internal::NaN());
clear_has_nan_float();
}
inline float TestExtremeDefaultValues::nan_float() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.nan_float)
return nan_float_;
}
inline void TestExtremeDefaultValues::set_nan_float(float value) {
set_has_nan_float();
nan_float_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.nan_float)
}
// optional string cpp_trigraph = 20 [default = "? ? ?? ?? ??? ??/ ??-"];
inline bool TestExtremeDefaultValues::has_cpp_trigraph() const {
return (_has_bits_[0] & 0x00200000u) != 0;
}
inline void TestExtremeDefaultValues::set_has_cpp_trigraph() {
_has_bits_[0] |= 0x00200000u;
}
inline void TestExtremeDefaultValues::clear_has_cpp_trigraph() {
_has_bits_[0] &= ~0x00200000u;
}
inline void TestExtremeDefaultValues::clear_cpp_trigraph() {
cpp_trigraph_.ClearToDefault(_default_cpp_trigraph_, GetArenaNoVirtual());
clear_has_cpp_trigraph();
}
inline const ::std::string& TestExtremeDefaultValues::cpp_trigraph() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.cpp_trigraph)
return cpp_trigraph_.Get(_default_cpp_trigraph_);
}
inline void TestExtremeDefaultValues::set_cpp_trigraph(const ::std::string& value) {
set_has_cpp_trigraph();
cpp_trigraph_.Set(_default_cpp_trigraph_, value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.cpp_trigraph)
}
inline void TestExtremeDefaultValues::set_cpp_trigraph(const char* value) {
set_has_cpp_trigraph();
cpp_trigraph_.Set(_default_cpp_trigraph_, ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestExtremeDefaultValues.cpp_trigraph)
}
inline void TestExtremeDefaultValues::set_cpp_trigraph(const char* value,
size_t size) {
set_has_cpp_trigraph();
cpp_trigraph_.Set(_default_cpp_trigraph_, ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestExtremeDefaultValues.cpp_trigraph)
}
inline ::std::string* TestExtremeDefaultValues::mutable_cpp_trigraph() {
set_has_cpp_trigraph();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestExtremeDefaultValues.cpp_trigraph)
return cpp_trigraph_.Mutable(_default_cpp_trigraph_, GetArenaNoVirtual());
}
inline ::std::string* TestExtremeDefaultValues::release_cpp_trigraph() {
clear_has_cpp_trigraph();
return cpp_trigraph_.Release(_default_cpp_trigraph_, GetArenaNoVirtual());
}
inline ::std::string* TestExtremeDefaultValues::unsafe_arena_release_cpp_trigraph() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_cpp_trigraph();
return cpp_trigraph_.UnsafeArenaRelease(_default_cpp_trigraph_,
GetArenaNoVirtual());
}
inline void TestExtremeDefaultValues::set_allocated_cpp_trigraph(::std::string* cpp_trigraph) {
if (cpp_trigraph != NULL) {
set_has_cpp_trigraph();
} else {
clear_has_cpp_trigraph();
}
cpp_trigraph_.SetAllocated(_default_cpp_trigraph_, cpp_trigraph,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestExtremeDefaultValues.cpp_trigraph)
}
inline void TestExtremeDefaultValues::unsafe_arena_set_allocated_cpp_trigraph(
::std::string* cpp_trigraph) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (cpp_trigraph != NULL) {
set_has_cpp_trigraph();
} else {
clear_has_cpp_trigraph();
}
cpp_trigraph_.UnsafeArenaSetAllocated(_default_cpp_trigraph_,
cpp_trigraph, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestExtremeDefaultValues.cpp_trigraph)
}
// optional string string_with_zero = 23 [default = "hel\000lo"];
inline bool TestExtremeDefaultValues::has_string_with_zero() const {
return (_has_bits_[0] & 0x00400000u) != 0;
}
inline void TestExtremeDefaultValues::set_has_string_with_zero() {
_has_bits_[0] |= 0x00400000u;
}
inline void TestExtremeDefaultValues::clear_has_string_with_zero() {
_has_bits_[0] &= ~0x00400000u;
}
inline void TestExtremeDefaultValues::clear_string_with_zero() {
string_with_zero_.ClearToDefault(_default_string_with_zero_, GetArenaNoVirtual());
clear_has_string_with_zero();
}
inline const ::std::string& TestExtremeDefaultValues::string_with_zero() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.string_with_zero)
return string_with_zero_.Get(_default_string_with_zero_);
}
inline void TestExtremeDefaultValues::set_string_with_zero(const ::std::string& value) {
set_has_string_with_zero();
string_with_zero_.Set(_default_string_with_zero_, value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.string_with_zero)
}
inline void TestExtremeDefaultValues::set_string_with_zero(const char* value) {
set_has_string_with_zero();
string_with_zero_.Set(_default_string_with_zero_, ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestExtremeDefaultValues.string_with_zero)
}
inline void TestExtremeDefaultValues::set_string_with_zero(const char* value,
size_t size) {
set_has_string_with_zero();
string_with_zero_.Set(_default_string_with_zero_, ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestExtremeDefaultValues.string_with_zero)
}
inline ::std::string* TestExtremeDefaultValues::mutable_string_with_zero() {
set_has_string_with_zero();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestExtremeDefaultValues.string_with_zero)
return string_with_zero_.Mutable(_default_string_with_zero_, GetArenaNoVirtual());
}
inline ::std::string* TestExtremeDefaultValues::release_string_with_zero() {
clear_has_string_with_zero();
return string_with_zero_.Release(_default_string_with_zero_, GetArenaNoVirtual());
}
inline ::std::string* TestExtremeDefaultValues::unsafe_arena_release_string_with_zero() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_string_with_zero();
return string_with_zero_.UnsafeArenaRelease(_default_string_with_zero_,
GetArenaNoVirtual());
}
inline void TestExtremeDefaultValues::set_allocated_string_with_zero(::std::string* string_with_zero) {
if (string_with_zero != NULL) {
set_has_string_with_zero();
} else {
clear_has_string_with_zero();
}
string_with_zero_.SetAllocated(_default_string_with_zero_, string_with_zero,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestExtremeDefaultValues.string_with_zero)
}
inline void TestExtremeDefaultValues::unsafe_arena_set_allocated_string_with_zero(
::std::string* string_with_zero) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (string_with_zero != NULL) {
set_has_string_with_zero();
} else {
clear_has_string_with_zero();
}
string_with_zero_.UnsafeArenaSetAllocated(_default_string_with_zero_,
string_with_zero, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestExtremeDefaultValues.string_with_zero)
}
// optional bytes bytes_with_zero = 24 [default = "wor\000ld"];
inline bool TestExtremeDefaultValues::has_bytes_with_zero() const {
return (_has_bits_[0] & 0x00800000u) != 0;
}
inline void TestExtremeDefaultValues::set_has_bytes_with_zero() {
_has_bits_[0] |= 0x00800000u;
}
inline void TestExtremeDefaultValues::clear_has_bytes_with_zero() {
_has_bits_[0] &= ~0x00800000u;
}
inline void TestExtremeDefaultValues::clear_bytes_with_zero() {
bytes_with_zero_.ClearToDefault(_default_bytes_with_zero_, GetArenaNoVirtual());
clear_has_bytes_with_zero();
}
inline const ::std::string& TestExtremeDefaultValues::bytes_with_zero() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.bytes_with_zero)
return bytes_with_zero_.Get(_default_bytes_with_zero_);
}
inline void TestExtremeDefaultValues::set_bytes_with_zero(const ::std::string& value) {
set_has_bytes_with_zero();
bytes_with_zero_.Set(_default_bytes_with_zero_, value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.bytes_with_zero)
}
inline void TestExtremeDefaultValues::set_bytes_with_zero(const char* value) {
set_has_bytes_with_zero();
bytes_with_zero_.Set(_default_bytes_with_zero_, ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestExtremeDefaultValues.bytes_with_zero)
}
inline void TestExtremeDefaultValues::set_bytes_with_zero(const void* value,
size_t size) {
set_has_bytes_with_zero();
bytes_with_zero_.Set(_default_bytes_with_zero_, ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestExtremeDefaultValues.bytes_with_zero)
}
inline ::std::string* TestExtremeDefaultValues::mutable_bytes_with_zero() {
set_has_bytes_with_zero();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestExtremeDefaultValues.bytes_with_zero)
return bytes_with_zero_.Mutable(_default_bytes_with_zero_, GetArenaNoVirtual());
}
inline ::std::string* TestExtremeDefaultValues::release_bytes_with_zero() {
clear_has_bytes_with_zero();
return bytes_with_zero_.Release(_default_bytes_with_zero_, GetArenaNoVirtual());
}
inline ::std::string* TestExtremeDefaultValues::unsafe_arena_release_bytes_with_zero() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_bytes_with_zero();
return bytes_with_zero_.UnsafeArenaRelease(_default_bytes_with_zero_,
GetArenaNoVirtual());
}
inline void TestExtremeDefaultValues::set_allocated_bytes_with_zero(::std::string* bytes_with_zero) {
if (bytes_with_zero != NULL) {
set_has_bytes_with_zero();
} else {
clear_has_bytes_with_zero();
}
bytes_with_zero_.SetAllocated(_default_bytes_with_zero_, bytes_with_zero,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestExtremeDefaultValues.bytes_with_zero)
}
inline void TestExtremeDefaultValues::unsafe_arena_set_allocated_bytes_with_zero(
::std::string* bytes_with_zero) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (bytes_with_zero != NULL) {
set_has_bytes_with_zero();
} else {
clear_has_bytes_with_zero();
}
bytes_with_zero_.UnsafeArenaSetAllocated(_default_bytes_with_zero_,
bytes_with_zero, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestExtremeDefaultValues.bytes_with_zero)
}
// optional string string_piece_with_zero = 25 [default = "ab\000c", ctype = STRING_PIECE];
inline bool TestExtremeDefaultValues::has_string_piece_with_zero() const {
return (_has_bits_[0] & 0x01000000u) != 0;
}
inline void TestExtremeDefaultValues::set_has_string_piece_with_zero() {
_has_bits_[0] |= 0x01000000u;
}
inline void TestExtremeDefaultValues::clear_has_string_piece_with_zero() {
_has_bits_[0] &= ~0x01000000u;
}
inline void TestExtremeDefaultValues::clear_string_piece_with_zero() {
string_piece_with_zero_.ClearToDefault(_default_string_piece_with_zero_, GetArenaNoVirtual());
clear_has_string_piece_with_zero();
}
inline const ::std::string& TestExtremeDefaultValues::string_piece_with_zero() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.string_piece_with_zero)
return string_piece_with_zero_.Get(_default_string_piece_with_zero_);
}
inline void TestExtremeDefaultValues::set_string_piece_with_zero(const ::std::string& value) {
set_has_string_piece_with_zero();
string_piece_with_zero_.Set(_default_string_piece_with_zero_, value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.string_piece_with_zero)
}
inline void TestExtremeDefaultValues::set_string_piece_with_zero(const char* value) {
set_has_string_piece_with_zero();
string_piece_with_zero_.Set(_default_string_piece_with_zero_, ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestExtremeDefaultValues.string_piece_with_zero)
}
inline void TestExtremeDefaultValues::set_string_piece_with_zero(const char* value,
size_t size) {
set_has_string_piece_with_zero();
string_piece_with_zero_.Set(_default_string_piece_with_zero_, ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestExtremeDefaultValues.string_piece_with_zero)
}
inline ::std::string* TestExtremeDefaultValues::mutable_string_piece_with_zero() {
set_has_string_piece_with_zero();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestExtremeDefaultValues.string_piece_with_zero)
return string_piece_with_zero_.Mutable(_default_string_piece_with_zero_, GetArenaNoVirtual());
}
inline ::std::string* TestExtremeDefaultValues::release_string_piece_with_zero() {
clear_has_string_piece_with_zero();
return string_piece_with_zero_.Release(_default_string_piece_with_zero_, GetArenaNoVirtual());
}
inline ::std::string* TestExtremeDefaultValues::unsafe_arena_release_string_piece_with_zero() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_string_piece_with_zero();
return string_piece_with_zero_.UnsafeArenaRelease(_default_string_piece_with_zero_,
GetArenaNoVirtual());
}
inline void TestExtremeDefaultValues::set_allocated_string_piece_with_zero(::std::string* string_piece_with_zero) {
if (string_piece_with_zero != NULL) {
set_has_string_piece_with_zero();
} else {
clear_has_string_piece_with_zero();
}
string_piece_with_zero_.SetAllocated(_default_string_piece_with_zero_, string_piece_with_zero,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestExtremeDefaultValues.string_piece_with_zero)
}
inline void TestExtremeDefaultValues::unsafe_arena_set_allocated_string_piece_with_zero(
::std::string* string_piece_with_zero) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (string_piece_with_zero != NULL) {
set_has_string_piece_with_zero();
} else {
clear_has_string_piece_with_zero();
}
string_piece_with_zero_.UnsafeArenaSetAllocated(_default_string_piece_with_zero_,
string_piece_with_zero, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestExtremeDefaultValues.string_piece_with_zero)
}
// optional string cord_with_zero = 26 [default = "12\0003", ctype = CORD];
inline bool TestExtremeDefaultValues::has_cord_with_zero() const {
return (_has_bits_[0] & 0x02000000u) != 0;
}
inline void TestExtremeDefaultValues::set_has_cord_with_zero() {
_has_bits_[0] |= 0x02000000u;
}
inline void TestExtremeDefaultValues::clear_has_cord_with_zero() {
_has_bits_[0] &= ~0x02000000u;
}
inline void TestExtremeDefaultValues::clear_cord_with_zero() {
cord_with_zero_.ClearToDefault(_default_cord_with_zero_, GetArenaNoVirtual());
clear_has_cord_with_zero();
}
inline const ::std::string& TestExtremeDefaultValues::cord_with_zero() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.cord_with_zero)
return cord_with_zero_.Get(_default_cord_with_zero_);
}
inline void TestExtremeDefaultValues::set_cord_with_zero(const ::std::string& value) {
set_has_cord_with_zero();
cord_with_zero_.Set(_default_cord_with_zero_, value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.cord_with_zero)
}
inline void TestExtremeDefaultValues::set_cord_with_zero(const char* value) {
set_has_cord_with_zero();
cord_with_zero_.Set(_default_cord_with_zero_, ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestExtremeDefaultValues.cord_with_zero)
}
inline void TestExtremeDefaultValues::set_cord_with_zero(const char* value,
size_t size) {
set_has_cord_with_zero();
cord_with_zero_.Set(_default_cord_with_zero_, ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestExtremeDefaultValues.cord_with_zero)
}
inline ::std::string* TestExtremeDefaultValues::mutable_cord_with_zero() {
set_has_cord_with_zero();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestExtremeDefaultValues.cord_with_zero)
return cord_with_zero_.Mutable(_default_cord_with_zero_, GetArenaNoVirtual());
}
inline ::std::string* TestExtremeDefaultValues::release_cord_with_zero() {
clear_has_cord_with_zero();
return cord_with_zero_.Release(_default_cord_with_zero_, GetArenaNoVirtual());
}
inline ::std::string* TestExtremeDefaultValues::unsafe_arena_release_cord_with_zero() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_cord_with_zero();
return cord_with_zero_.UnsafeArenaRelease(_default_cord_with_zero_,
GetArenaNoVirtual());
}
inline void TestExtremeDefaultValues::set_allocated_cord_with_zero(::std::string* cord_with_zero) {
if (cord_with_zero != NULL) {
set_has_cord_with_zero();
} else {
clear_has_cord_with_zero();
}
cord_with_zero_.SetAllocated(_default_cord_with_zero_, cord_with_zero,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestExtremeDefaultValues.cord_with_zero)
}
inline void TestExtremeDefaultValues::unsafe_arena_set_allocated_cord_with_zero(
::std::string* cord_with_zero) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (cord_with_zero != NULL) {
set_has_cord_with_zero();
} else {
clear_has_cord_with_zero();
}
cord_with_zero_.UnsafeArenaSetAllocated(_default_cord_with_zero_,
cord_with_zero, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestExtremeDefaultValues.cord_with_zero)
}
// optional string replacement_string = 27 [default = "${unknown}"];
inline bool TestExtremeDefaultValues::has_replacement_string() const {
return (_has_bits_[0] & 0x04000000u) != 0;
}
inline void TestExtremeDefaultValues::set_has_replacement_string() {
_has_bits_[0] |= 0x04000000u;
}
inline void TestExtremeDefaultValues::clear_has_replacement_string() {
_has_bits_[0] &= ~0x04000000u;
}
inline void TestExtremeDefaultValues::clear_replacement_string() {
replacement_string_.ClearToDefault(_default_replacement_string_, GetArenaNoVirtual());
clear_has_replacement_string();
}
inline const ::std::string& TestExtremeDefaultValues::replacement_string() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestExtremeDefaultValues.replacement_string)
return replacement_string_.Get(_default_replacement_string_);
}
inline void TestExtremeDefaultValues::set_replacement_string(const ::std::string& value) {
set_has_replacement_string();
replacement_string_.Set(_default_replacement_string_, value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestExtremeDefaultValues.replacement_string)
}
inline void TestExtremeDefaultValues::set_replacement_string(const char* value) {
set_has_replacement_string();
replacement_string_.Set(_default_replacement_string_, ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestExtremeDefaultValues.replacement_string)
}
inline void TestExtremeDefaultValues::set_replacement_string(const char* value,
size_t size) {
set_has_replacement_string();
replacement_string_.Set(_default_replacement_string_, ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestExtremeDefaultValues.replacement_string)
}
inline ::std::string* TestExtremeDefaultValues::mutable_replacement_string() {
set_has_replacement_string();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestExtremeDefaultValues.replacement_string)
return replacement_string_.Mutable(_default_replacement_string_, GetArenaNoVirtual());
}
inline ::std::string* TestExtremeDefaultValues::release_replacement_string() {
clear_has_replacement_string();
return replacement_string_.Release(_default_replacement_string_, GetArenaNoVirtual());
}
inline ::std::string* TestExtremeDefaultValues::unsafe_arena_release_replacement_string() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_replacement_string();
return replacement_string_.UnsafeArenaRelease(_default_replacement_string_,
GetArenaNoVirtual());
}
inline void TestExtremeDefaultValues::set_allocated_replacement_string(::std::string* replacement_string) {
if (replacement_string != NULL) {
set_has_replacement_string();
} else {
clear_has_replacement_string();
}
replacement_string_.SetAllocated(_default_replacement_string_, replacement_string,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestExtremeDefaultValues.replacement_string)
}
inline void TestExtremeDefaultValues::unsafe_arena_set_allocated_replacement_string(
::std::string* replacement_string) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (replacement_string != NULL) {
set_has_replacement_string();
} else {
clear_has_replacement_string();
}
replacement_string_.UnsafeArenaSetAllocated(_default_replacement_string_,
replacement_string, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestExtremeDefaultValues.replacement_string)
}
// -------------------------------------------------------------------
// SparseEnumMessage
// optional .protobuf_unittest.TestSparseEnum sparse_enum = 1;
inline bool SparseEnumMessage::has_sparse_enum() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void SparseEnumMessage::set_has_sparse_enum() {
_has_bits_[0] |= 0x00000001u;
}
inline void SparseEnumMessage::clear_has_sparse_enum() {
_has_bits_[0] &= ~0x00000001u;
}
inline void SparseEnumMessage::clear_sparse_enum() {
sparse_enum_ = 123;
clear_has_sparse_enum();
}
inline ::protobuf_unittest::TestSparseEnum SparseEnumMessage::sparse_enum() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.SparseEnumMessage.sparse_enum)
return static_cast< ::protobuf_unittest::TestSparseEnum >(sparse_enum_);
}
inline void SparseEnumMessage::set_sparse_enum(::protobuf_unittest::TestSparseEnum value) {
assert(::protobuf_unittest::TestSparseEnum_IsValid(value));
set_has_sparse_enum();
sparse_enum_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.SparseEnumMessage.sparse_enum)
}
// -------------------------------------------------------------------
// OneString
// optional string data = 1;
inline bool OneString::has_data() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void OneString::set_has_data() {
_has_bits_[0] |= 0x00000001u;
}
inline void OneString::clear_has_data() {
_has_bits_[0] &= ~0x00000001u;
}
inline void OneString::clear_data() {
data_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
clear_has_data();
}
inline const ::std::string& OneString::data() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.OneString.data)
return data_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline void OneString::set_data(const ::std::string& value) {
set_has_data();
data_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.OneString.data)
}
inline void OneString::set_data(const char* value) {
set_has_data();
data_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.OneString.data)
}
inline void OneString::set_data(const char* value,
size_t size) {
set_has_data();
data_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.OneString.data)
}
inline ::std::string* OneString::mutable_data() {
set_has_data();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.OneString.data)
return data_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* OneString::release_data() {
clear_has_data();
return data_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* OneString::unsafe_arena_release_data() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_data();
return data_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
}
inline void OneString::set_allocated_data(::std::string* data) {
if (data != NULL) {
set_has_data();
} else {
clear_has_data();
}
data_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), data,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.OneString.data)
}
inline void OneString::unsafe_arena_set_allocated_data(
::std::string* data) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (data != NULL) {
set_has_data();
} else {
clear_has_data();
}
data_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
data, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.OneString.data)
}
// -------------------------------------------------------------------
// MoreString
// repeated string data = 1;
inline int MoreString::data_size() const {
return data_.size();
}
inline void MoreString::clear_data() {
data_.Clear();
}
inline const ::std::string& MoreString::data(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.MoreString.data)
return data_.Get(index);
}
inline ::std::string* MoreString::mutable_data(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.MoreString.data)
return data_.Mutable(index);
}
inline void MoreString::set_data(int index, const ::std::string& value) {
// @@protoc_insertion_point(field_set:protobuf_unittest.MoreString.data)
data_.Mutable(index)->assign(value);
}
inline void MoreString::set_data(int index, const char* value) {
data_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set_char:protobuf_unittest.MoreString.data)
}
inline void MoreString::set_data(int index, const char* value, size_t size) {
data_.Mutable(index)->assign(
reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.MoreString.data)
}
inline ::std::string* MoreString::add_data() {
return data_.Add();
}
inline void MoreString::add_data(const ::std::string& value) {
data_.Add()->assign(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.MoreString.data)
}
inline void MoreString::add_data(const char* value) {
data_.Add()->assign(value);
// @@protoc_insertion_point(field_add_char:protobuf_unittest.MoreString.data)
}
inline void MoreString::add_data(const char* value, size_t size) {
data_.Add()->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_add_pointer:protobuf_unittest.MoreString.data)
}
inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
MoreString::data() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.MoreString.data)
return data_;
}
inline ::google::protobuf::RepeatedPtrField< ::std::string>*
MoreString::mutable_data() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.MoreString.data)
return &data_;
}
// -------------------------------------------------------------------
// OneBytes
// optional bytes data = 1;
inline bool OneBytes::has_data() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void OneBytes::set_has_data() {
_has_bits_[0] |= 0x00000001u;
}
inline void OneBytes::clear_has_data() {
_has_bits_[0] &= ~0x00000001u;
}
inline void OneBytes::clear_data() {
data_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
clear_has_data();
}
inline const ::std::string& OneBytes::data() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.OneBytes.data)
return data_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline void OneBytes::set_data(const ::std::string& value) {
set_has_data();
data_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.OneBytes.data)
}
inline void OneBytes::set_data(const char* value) {
set_has_data();
data_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.OneBytes.data)
}
inline void OneBytes::set_data(const void* value,
size_t size) {
set_has_data();
data_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.OneBytes.data)
}
inline ::std::string* OneBytes::mutable_data() {
set_has_data();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.OneBytes.data)
return data_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* OneBytes::release_data() {
clear_has_data();
return data_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* OneBytes::unsafe_arena_release_data() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_data();
return data_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
}
inline void OneBytes::set_allocated_data(::std::string* data) {
if (data != NULL) {
set_has_data();
} else {
clear_has_data();
}
data_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), data,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.OneBytes.data)
}
inline void OneBytes::unsafe_arena_set_allocated_data(
::std::string* data) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (data != NULL) {
set_has_data();
} else {
clear_has_data();
}
data_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
data, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.OneBytes.data)
}
// -------------------------------------------------------------------
// MoreBytes
// repeated bytes data = 1;
inline int MoreBytes::data_size() const {
return data_.size();
}
inline void MoreBytes::clear_data() {
data_.Clear();
}
inline const ::std::string& MoreBytes::data(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.MoreBytes.data)
return data_.Get(index);
}
inline ::std::string* MoreBytes::mutable_data(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.MoreBytes.data)
return data_.Mutable(index);
}
inline void MoreBytes::set_data(int index, const ::std::string& value) {
// @@protoc_insertion_point(field_set:protobuf_unittest.MoreBytes.data)
data_.Mutable(index)->assign(value);
}
inline void MoreBytes::set_data(int index, const char* value) {
data_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set_char:protobuf_unittest.MoreBytes.data)
}
inline void MoreBytes::set_data(int index, const void* value, size_t size) {
data_.Mutable(index)->assign(
reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.MoreBytes.data)
}
inline ::std::string* MoreBytes::add_data() {
return data_.Add();
}
inline void MoreBytes::add_data(const ::std::string& value) {
data_.Add()->assign(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.MoreBytes.data)
}
inline void MoreBytes::add_data(const char* value) {
data_.Add()->assign(value);
// @@protoc_insertion_point(field_add_char:protobuf_unittest.MoreBytes.data)
}
inline void MoreBytes::add_data(const void* value, size_t size) {
data_.Add()->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_add_pointer:protobuf_unittest.MoreBytes.data)
}
inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
MoreBytes::data() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.MoreBytes.data)
return data_;
}
inline ::google::protobuf::RepeatedPtrField< ::std::string>*
MoreBytes::mutable_data() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.MoreBytes.data)
return &data_;
}
// -------------------------------------------------------------------
// Int32Message
// optional int32 data = 1;
inline bool Int32Message::has_data() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Int32Message::set_has_data() {
_has_bits_[0] |= 0x00000001u;
}
inline void Int32Message::clear_has_data() {
_has_bits_[0] &= ~0x00000001u;
}
inline void Int32Message::clear_data() {
data_ = 0;
clear_has_data();
}
inline ::google::protobuf::int32 Int32Message::data() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.Int32Message.data)
return data_;
}
inline void Int32Message::set_data(::google::protobuf::int32 value) {
set_has_data();
data_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.Int32Message.data)
}
// -------------------------------------------------------------------
// Uint32Message
// optional uint32 data = 1;
inline bool Uint32Message::has_data() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Uint32Message::set_has_data() {
_has_bits_[0] |= 0x00000001u;
}
inline void Uint32Message::clear_has_data() {
_has_bits_[0] &= ~0x00000001u;
}
inline void Uint32Message::clear_data() {
data_ = 0u;
clear_has_data();
}
inline ::google::protobuf::uint32 Uint32Message::data() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.Uint32Message.data)
return data_;
}
inline void Uint32Message::set_data(::google::protobuf::uint32 value) {
set_has_data();
data_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.Uint32Message.data)
}
// -------------------------------------------------------------------
// Int64Message
// optional int64 data = 1;
inline bool Int64Message::has_data() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Int64Message::set_has_data() {
_has_bits_[0] |= 0x00000001u;
}
inline void Int64Message::clear_has_data() {
_has_bits_[0] &= ~0x00000001u;
}
inline void Int64Message::clear_data() {
data_ = GOOGLE_LONGLONG(0);
clear_has_data();
}
inline ::google::protobuf::int64 Int64Message::data() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.Int64Message.data)
return data_;
}
inline void Int64Message::set_data(::google::protobuf::int64 value) {
set_has_data();
data_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.Int64Message.data)
}
// -------------------------------------------------------------------
// Uint64Message
// optional uint64 data = 1;
inline bool Uint64Message::has_data() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Uint64Message::set_has_data() {
_has_bits_[0] |= 0x00000001u;
}
inline void Uint64Message::clear_has_data() {
_has_bits_[0] &= ~0x00000001u;
}
inline void Uint64Message::clear_data() {
data_ = GOOGLE_ULONGLONG(0);
clear_has_data();
}
inline ::google::protobuf::uint64 Uint64Message::data() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.Uint64Message.data)
return data_;
}
inline void Uint64Message::set_data(::google::protobuf::uint64 value) {
set_has_data();
data_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.Uint64Message.data)
}
// -------------------------------------------------------------------
// BoolMessage
// optional bool data = 1;
inline bool BoolMessage::has_data() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void BoolMessage::set_has_data() {
_has_bits_[0] |= 0x00000001u;
}
inline void BoolMessage::clear_has_data() {
_has_bits_[0] &= ~0x00000001u;
}
inline void BoolMessage::clear_data() {
data_ = false;
clear_has_data();
}
inline bool BoolMessage::data() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.BoolMessage.data)
return data_;
}
inline void BoolMessage::set_data(bool value) {
set_has_data();
data_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.BoolMessage.data)
}
// -------------------------------------------------------------------
// TestOneof_FooGroup
// optional int32 a = 5;
inline bool TestOneof_FooGroup::has_a() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestOneof_FooGroup::set_has_a() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestOneof_FooGroup::clear_has_a() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestOneof_FooGroup::clear_a() {
a_ = 0;
clear_has_a();
}
inline ::google::protobuf::int32 TestOneof_FooGroup::a() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof.FooGroup.a)
return a_;
}
inline void TestOneof_FooGroup::set_a(::google::protobuf::int32 value) {
set_has_a();
a_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneof.FooGroup.a)
}
// optional string b = 6;
inline bool TestOneof_FooGroup::has_b() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void TestOneof_FooGroup::set_has_b() {
_has_bits_[0] |= 0x00000002u;
}
inline void TestOneof_FooGroup::clear_has_b() {
_has_bits_[0] &= ~0x00000002u;
}
inline void TestOneof_FooGroup::clear_b() {
b_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
clear_has_b();
}
inline const ::std::string& TestOneof_FooGroup::b() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof.FooGroup.b)
return b_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline void TestOneof_FooGroup::set_b(const ::std::string& value) {
set_has_b();
b_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneof.FooGroup.b)
}
inline void TestOneof_FooGroup::set_b(const char* value) {
set_has_b();
b_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestOneof.FooGroup.b)
}
inline void TestOneof_FooGroup::set_b(const char* value,
size_t size) {
set_has_b();
b_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestOneof.FooGroup.b)
}
inline ::std::string* TestOneof_FooGroup::mutable_b() {
set_has_b();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestOneof.FooGroup.b)
return b_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestOneof_FooGroup::release_b() {
clear_has_b();
return b_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestOneof_FooGroup::unsafe_arena_release_b() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_b();
return b_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
}
inline void TestOneof_FooGroup::set_allocated_b(::std::string* b) {
if (b != NULL) {
set_has_b();
} else {
clear_has_b();
}
b_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), b,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof.FooGroup.b)
}
inline void TestOneof_FooGroup::unsafe_arena_set_allocated_b(
::std::string* b) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (b != NULL) {
set_has_b();
} else {
clear_has_b();
}
b_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
b, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof.FooGroup.b)
}
// -------------------------------------------------------------------
// TestOneof
// optional int32 foo_int = 1;
inline bool TestOneof::has_foo_int() const {
return foo_case() == kFooInt;
}
inline void TestOneof::set_has_foo_int() {
_oneof_case_[0] = kFooInt;
}
inline void TestOneof::clear_foo_int() {
if (has_foo_int()) {
foo_.foo_int_ = 0;
clear_has_foo();
}
}
inline ::google::protobuf::int32 TestOneof::foo_int() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof.foo_int)
if (has_foo_int()) {
return foo_.foo_int_;
}
return 0;
}
inline void TestOneof::set_foo_int(::google::protobuf::int32 value) {
if (!has_foo_int()) {
clear_foo();
set_has_foo_int();
}
foo_.foo_int_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneof.foo_int)
}
// optional string foo_string = 2;
inline bool TestOneof::has_foo_string() const {
return foo_case() == kFooString;
}
inline void TestOneof::set_has_foo_string() {
_oneof_case_[0] = kFooString;
}
inline void TestOneof::clear_foo_string() {
if (has_foo_string()) {
foo_.foo_string_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
clear_has_foo();
}
}
inline const ::std::string& TestOneof::foo_string() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof.foo_string)
if (has_foo_string()) {
return foo_.foo_string_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
return *&::google::protobuf::internal::GetEmptyStringAlreadyInited();
}
inline void TestOneof::set_foo_string(const ::std::string& value) {
if (!has_foo_string()) {
clear_foo();
set_has_foo_string();
foo_.foo_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
foo_.foo_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneof.foo_string)
}
inline void TestOneof::set_foo_string(const char* value) {
if (!has_foo_string()) {
clear_foo();
set_has_foo_string();
foo_.foo_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
foo_.foo_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
::std::string(value), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestOneof.foo_string)
}
inline void TestOneof::set_foo_string(const char* value,
size_t size) {
if (!has_foo_string()) {
clear_foo();
set_has_foo_string();
foo_.foo_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
foo_.foo_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestOneof.foo_string)
}
inline ::std::string* TestOneof::mutable_foo_string() {
if (!has_foo_string()) {
clear_foo();
set_has_foo_string();
foo_.foo_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
return foo_.foo_string_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestOneof.foo_string)
}
inline ::std::string* TestOneof::release_foo_string() {
if (has_foo_string()) {
clear_has_foo();
return foo_.foo_string_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
} else {
return NULL;
}
}
inline ::std::string* TestOneof::unsafe_arena_release_foo_string() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (has_foo_string()) {
clear_has_foo();
return foo_.foo_string_.UnsafeArenaRelease(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
} else {
return NULL;
}
}
inline void TestOneof::set_allocated_foo_string(::std::string* foo_string) {
if (!has_foo_string()) {
foo_.foo_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
clear_foo();
if (foo_string != NULL) {
set_has_foo_string();
foo_.foo_string_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), foo_string,
GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof.foo_string)
}
inline void TestOneof::unsafe_arena_set_allocated_foo_string(::std::string* foo_string) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (!has_foo_string()) {
foo_.foo_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
clear_foo();
if (foo_string) {
set_has_foo_string();
foo_.foo_string_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), foo_string, GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof.foo_string)
}
// optional .protobuf_unittest.TestAllTypes foo_message = 3;
inline bool TestOneof::has_foo_message() const {
return foo_case() == kFooMessage;
}
inline void TestOneof::set_has_foo_message() {
_oneof_case_[0] = kFooMessage;
}
inline void TestOneof::clear_foo_message() {
if (has_foo_message()) {
if (GetArenaNoVirtual() == NULL) {
delete foo_.foo_message_;
}
clear_has_foo();
}
}
inline const ::protobuf_unittest::TestAllTypes& TestOneof::foo_message() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof.foo_message)
return has_foo_message()
? *foo_.foo_message_
: ::protobuf_unittest::TestAllTypes::default_instance();
}
inline ::protobuf_unittest::TestAllTypes* TestOneof::mutable_foo_message() {
if (!has_foo_message()) {
clear_foo();
set_has_foo_message();
foo_.foo_message_ =
::google::protobuf::Arena::CreateMessage< ::protobuf_unittest::TestAllTypes >(
GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestOneof.foo_message)
return foo_.foo_message_;
}
inline ::protobuf_unittest::TestAllTypes* TestOneof::release_foo_message() {
if (has_foo_message()) {
clear_has_foo();
if (GetArenaNoVirtual() != NULL) {
::protobuf_unittest::TestAllTypes* temp = new ::protobuf_unittest::TestAllTypes;
temp->MergeFrom(*foo_.foo_message_);
foo_.foo_message_ = NULL;
return temp;
} else {
::protobuf_unittest::TestAllTypes* temp = foo_.foo_message_;
foo_.foo_message_ = NULL;
return temp;
}
} else {
return NULL;
}
}
inline void TestOneof::set_allocated_foo_message(::protobuf_unittest::TestAllTypes* foo_message) {
clear_foo();
if (foo_message) {
if (GetArenaNoVirtual() != NULL &&
::google::protobuf::Arena::GetArena(foo_message) == NULL) {
GetArenaNoVirtual()->Own(foo_message);
} else if (GetArenaNoVirtual() !=
::google::protobuf::Arena::GetArena(foo_message)) {
::protobuf_unittest::TestAllTypes* new_foo_message =
::google::protobuf::Arena::CreateMessage< ::protobuf_unittest::TestAllTypes >(
GetArenaNoVirtual());
new_foo_message->CopyFrom(*foo_message);
foo_message = new_foo_message;
}
set_has_foo_message();
foo_.foo_message_ = foo_message;
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof.foo_message)
}
inline ::protobuf_unittest::TestAllTypes* TestOneof::unsafe_arena_release_foo_message() {
if (has_foo_message()) {
clear_has_foo();
::protobuf_unittest::TestAllTypes* temp = foo_.foo_message_;
foo_.foo_message_ = NULL;
return temp;
} else {
return NULL;
}
}
inline void TestOneof::unsafe_arena_set_allocated_foo_message(::protobuf_unittest::TestAllTypes* foo_message) {
clear_foo();
if (foo_message) {
set_has_foo_message();
foo_.foo_message_ = foo_message;
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf_unittest.TestOneof.foo_message)
}
// optional group FooGroup = 4 { ... };
inline bool TestOneof::has_foogroup() const {
return foo_case() == kFoogroup;
}
inline void TestOneof::set_has_foogroup() {
_oneof_case_[0] = kFoogroup;
}
inline void TestOneof::clear_foogroup() {
if (has_foogroup()) {
if (GetArenaNoVirtual() == NULL) {
delete foo_.foogroup_;
}
clear_has_foo();
}
}
inline const ::protobuf_unittest::TestOneof_FooGroup& TestOneof::foogroup() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof.foogroup)
return has_foogroup()
? *foo_.foogroup_
: ::protobuf_unittest::TestOneof_FooGroup::default_instance();
}
inline ::protobuf_unittest::TestOneof_FooGroup* TestOneof::mutable_foogroup() {
if (!has_foogroup()) {
clear_foo();
set_has_foogroup();
foo_.foogroup_ =
::google::protobuf::Arena::CreateMessage< ::protobuf_unittest::TestOneof_FooGroup >(
GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestOneof.foogroup)
return foo_.foogroup_;
}
inline ::protobuf_unittest::TestOneof_FooGroup* TestOneof::release_foogroup() {
if (has_foogroup()) {
clear_has_foo();
if (GetArenaNoVirtual() != NULL) {
::protobuf_unittest::TestOneof_FooGroup* temp = new ::protobuf_unittest::TestOneof_FooGroup;
temp->MergeFrom(*foo_.foogroup_);
foo_.foogroup_ = NULL;
return temp;
} else {
::protobuf_unittest::TestOneof_FooGroup* temp = foo_.foogroup_;
foo_.foogroup_ = NULL;
return temp;
}
} else {
return NULL;
}
}
inline void TestOneof::set_allocated_foogroup(::protobuf_unittest::TestOneof_FooGroup* foogroup) {
clear_foo();
if (foogroup) {
if (GetArenaNoVirtual() != NULL &&
::google::protobuf::Arena::GetArena(foogroup) == NULL) {
GetArenaNoVirtual()->Own(foogroup);
} else if (GetArenaNoVirtual() !=
::google::protobuf::Arena::GetArena(foogroup)) {
::protobuf_unittest::TestOneof_FooGroup* new_foogroup =
::google::protobuf::Arena::CreateMessage< ::protobuf_unittest::TestOneof_FooGroup >(
GetArenaNoVirtual());
new_foogroup->CopyFrom(*foogroup);
foogroup = new_foogroup;
}
set_has_foogroup();
foo_.foogroup_ = foogroup;
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof.foogroup)
}
inline ::protobuf_unittest::TestOneof_FooGroup* TestOneof::unsafe_arena_release_foogroup() {
if (has_foogroup()) {
clear_has_foo();
::protobuf_unittest::TestOneof_FooGroup* temp = foo_.foogroup_;
foo_.foogroup_ = NULL;
return temp;
} else {
return NULL;
}
}
inline void TestOneof::unsafe_arena_set_allocated_foogroup(::protobuf_unittest::TestOneof_FooGroup* foogroup) {
clear_foo();
if (foogroup) {
set_has_foogroup();
foo_.foogroup_ = foogroup;
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf_unittest.TestOneof.foogroup)
}
inline bool TestOneof::has_foo() const {
return foo_case() != FOO_NOT_SET;
}
inline void TestOneof::clear_has_foo() {
_oneof_case_[0] = FOO_NOT_SET;
}
inline TestOneof::FooCase TestOneof::foo_case() const {
return TestOneof::FooCase(_oneof_case_[0]);
}
// -------------------------------------------------------------------
// TestOneofBackwardsCompatible_FooGroup
// optional int32 a = 5;
inline bool TestOneofBackwardsCompatible_FooGroup::has_a() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestOneofBackwardsCompatible_FooGroup::set_has_a() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestOneofBackwardsCompatible_FooGroup::clear_has_a() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestOneofBackwardsCompatible_FooGroup::clear_a() {
a_ = 0;
clear_has_a();
}
inline ::google::protobuf::int32 TestOneofBackwardsCompatible_FooGroup::a() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneofBackwardsCompatible.FooGroup.a)
return a_;
}
inline void TestOneofBackwardsCompatible_FooGroup::set_a(::google::protobuf::int32 value) {
set_has_a();
a_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneofBackwardsCompatible.FooGroup.a)
}
// optional string b = 6;
inline bool TestOneofBackwardsCompatible_FooGroup::has_b() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void TestOneofBackwardsCompatible_FooGroup::set_has_b() {
_has_bits_[0] |= 0x00000002u;
}
inline void TestOneofBackwardsCompatible_FooGroup::clear_has_b() {
_has_bits_[0] &= ~0x00000002u;
}
inline void TestOneofBackwardsCompatible_FooGroup::clear_b() {
b_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
clear_has_b();
}
inline const ::std::string& TestOneofBackwardsCompatible_FooGroup::b() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneofBackwardsCompatible.FooGroup.b)
return b_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline void TestOneofBackwardsCompatible_FooGroup::set_b(const ::std::string& value) {
set_has_b();
b_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneofBackwardsCompatible.FooGroup.b)
}
inline void TestOneofBackwardsCompatible_FooGroup::set_b(const char* value) {
set_has_b();
b_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestOneofBackwardsCompatible.FooGroup.b)
}
inline void TestOneofBackwardsCompatible_FooGroup::set_b(const char* value,
size_t size) {
set_has_b();
b_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestOneofBackwardsCompatible.FooGroup.b)
}
inline ::std::string* TestOneofBackwardsCompatible_FooGroup::mutable_b() {
set_has_b();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestOneofBackwardsCompatible.FooGroup.b)
return b_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestOneofBackwardsCompatible_FooGroup::release_b() {
clear_has_b();
return b_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestOneofBackwardsCompatible_FooGroup::unsafe_arena_release_b() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_b();
return b_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
}
inline void TestOneofBackwardsCompatible_FooGroup::set_allocated_b(::std::string* b) {
if (b != NULL) {
set_has_b();
} else {
clear_has_b();
}
b_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), b,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneofBackwardsCompatible.FooGroup.b)
}
inline void TestOneofBackwardsCompatible_FooGroup::unsafe_arena_set_allocated_b(
::std::string* b) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (b != NULL) {
set_has_b();
} else {
clear_has_b();
}
b_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
b, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneofBackwardsCompatible.FooGroup.b)
}
// -------------------------------------------------------------------
// TestOneofBackwardsCompatible
// optional int32 foo_int = 1;
inline bool TestOneofBackwardsCompatible::has_foo_int() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestOneofBackwardsCompatible::set_has_foo_int() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestOneofBackwardsCompatible::clear_has_foo_int() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestOneofBackwardsCompatible::clear_foo_int() {
foo_int_ = 0;
clear_has_foo_int();
}
inline ::google::protobuf::int32 TestOneofBackwardsCompatible::foo_int() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneofBackwardsCompatible.foo_int)
return foo_int_;
}
inline void TestOneofBackwardsCompatible::set_foo_int(::google::protobuf::int32 value) {
set_has_foo_int();
foo_int_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneofBackwardsCompatible.foo_int)
}
// optional string foo_string = 2;
inline bool TestOneofBackwardsCompatible::has_foo_string() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void TestOneofBackwardsCompatible::set_has_foo_string() {
_has_bits_[0] |= 0x00000002u;
}
inline void TestOneofBackwardsCompatible::clear_has_foo_string() {
_has_bits_[0] &= ~0x00000002u;
}
inline void TestOneofBackwardsCompatible::clear_foo_string() {
foo_string_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
clear_has_foo_string();
}
inline const ::std::string& TestOneofBackwardsCompatible::foo_string() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneofBackwardsCompatible.foo_string)
return foo_string_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline void TestOneofBackwardsCompatible::set_foo_string(const ::std::string& value) {
set_has_foo_string();
foo_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneofBackwardsCompatible.foo_string)
}
inline void TestOneofBackwardsCompatible::set_foo_string(const char* value) {
set_has_foo_string();
foo_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestOneofBackwardsCompatible.foo_string)
}
inline void TestOneofBackwardsCompatible::set_foo_string(const char* value,
size_t size) {
set_has_foo_string();
foo_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestOneofBackwardsCompatible.foo_string)
}
inline ::std::string* TestOneofBackwardsCompatible::mutable_foo_string() {
set_has_foo_string();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestOneofBackwardsCompatible.foo_string)
return foo_string_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestOneofBackwardsCompatible::release_foo_string() {
clear_has_foo_string();
return foo_string_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestOneofBackwardsCompatible::unsafe_arena_release_foo_string() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_foo_string();
return foo_string_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
}
inline void TestOneofBackwardsCompatible::set_allocated_foo_string(::std::string* foo_string) {
if (foo_string != NULL) {
set_has_foo_string();
} else {
clear_has_foo_string();
}
foo_string_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), foo_string,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneofBackwardsCompatible.foo_string)
}
inline void TestOneofBackwardsCompatible::unsafe_arena_set_allocated_foo_string(
::std::string* foo_string) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (foo_string != NULL) {
set_has_foo_string();
} else {
clear_has_foo_string();
}
foo_string_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
foo_string, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneofBackwardsCompatible.foo_string)
}
// optional .protobuf_unittest.TestAllTypes foo_message = 3;
inline bool TestOneofBackwardsCompatible::has_foo_message() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void TestOneofBackwardsCompatible::set_has_foo_message() {
_has_bits_[0] |= 0x00000004u;
}
inline void TestOneofBackwardsCompatible::clear_has_foo_message() {
_has_bits_[0] &= ~0x00000004u;
}
inline void TestOneofBackwardsCompatible::clear_foo_message() {
if (foo_message_ != NULL) foo_message_->::protobuf_unittest::TestAllTypes::Clear();
clear_has_foo_message();
}
inline const ::protobuf_unittest::TestAllTypes& TestOneofBackwardsCompatible::foo_message() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneofBackwardsCompatible.foo_message)
return foo_message_ != NULL ? *foo_message_ : *default_instance_->foo_message_;
}
inline ::protobuf_unittest::TestAllTypes* TestOneofBackwardsCompatible::mutable_foo_message() {
set_has_foo_message();
if (foo_message_ == NULL) {
_slow_mutable_foo_message();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestOneofBackwardsCompatible.foo_message)
return foo_message_;
}
inline ::protobuf_unittest::TestAllTypes* TestOneofBackwardsCompatible::release_foo_message() {
clear_has_foo_message();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_foo_message();
} else {
::protobuf_unittest::TestAllTypes* temp = foo_message_;
foo_message_ = NULL;
return temp;
}
}
inline void TestOneofBackwardsCompatible::set_allocated_foo_message(::protobuf_unittest::TestAllTypes* foo_message) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete foo_message_;
}
if (foo_message != NULL) {
_slow_set_allocated_foo_message(message_arena, &foo_message);
}
foo_message_ = foo_message;
if (foo_message) {
set_has_foo_message();
} else {
clear_has_foo_message();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneofBackwardsCompatible.foo_message)
}
// optional group FooGroup = 4 { ... };
inline bool TestOneofBackwardsCompatible::has_foogroup() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void TestOneofBackwardsCompatible::set_has_foogroup() {
_has_bits_[0] |= 0x00000008u;
}
inline void TestOneofBackwardsCompatible::clear_has_foogroup() {
_has_bits_[0] &= ~0x00000008u;
}
inline void TestOneofBackwardsCompatible::clear_foogroup() {
if (foogroup_ != NULL) foogroup_->::protobuf_unittest::TestOneofBackwardsCompatible_FooGroup::Clear();
clear_has_foogroup();
}
inline const ::protobuf_unittest::TestOneofBackwardsCompatible_FooGroup& TestOneofBackwardsCompatible::foogroup() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneofBackwardsCompatible.foogroup)
return foogroup_ != NULL ? *foogroup_ : *default_instance_->foogroup_;
}
inline ::protobuf_unittest::TestOneofBackwardsCompatible_FooGroup* TestOneofBackwardsCompatible::mutable_foogroup() {
set_has_foogroup();
if (foogroup_ == NULL) {
_slow_mutable_foogroup();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestOneofBackwardsCompatible.foogroup)
return foogroup_;
}
inline ::protobuf_unittest::TestOneofBackwardsCompatible_FooGroup* TestOneofBackwardsCompatible::release_foogroup() {
clear_has_foogroup();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_foogroup();
} else {
::protobuf_unittest::TestOneofBackwardsCompatible_FooGroup* temp = foogroup_;
foogroup_ = NULL;
return temp;
}
}
inline void TestOneofBackwardsCompatible::set_allocated_foogroup(::protobuf_unittest::TestOneofBackwardsCompatible_FooGroup* foogroup) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete foogroup_;
}
if (foogroup != NULL) {
_slow_set_allocated_foogroup(message_arena, &foogroup);
}
foogroup_ = foogroup;
if (foogroup) {
set_has_foogroup();
} else {
clear_has_foogroup();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneofBackwardsCompatible.foogroup)
}
// -------------------------------------------------------------------
// TestOneof2_FooGroup
// optional int32 a = 9;
inline bool TestOneof2_FooGroup::has_a() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestOneof2_FooGroup::set_has_a() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestOneof2_FooGroup::clear_has_a() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestOneof2_FooGroup::clear_a() {
a_ = 0;
clear_has_a();
}
inline ::google::protobuf::int32 TestOneof2_FooGroup::a() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof2.FooGroup.a)
return a_;
}
inline void TestOneof2_FooGroup::set_a(::google::protobuf::int32 value) {
set_has_a();
a_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneof2.FooGroup.a)
}
// optional string b = 10;
inline bool TestOneof2_FooGroup::has_b() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void TestOneof2_FooGroup::set_has_b() {
_has_bits_[0] |= 0x00000002u;
}
inline void TestOneof2_FooGroup::clear_has_b() {
_has_bits_[0] &= ~0x00000002u;
}
inline void TestOneof2_FooGroup::clear_b() {
b_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
clear_has_b();
}
inline const ::std::string& TestOneof2_FooGroup::b() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof2.FooGroup.b)
return b_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline void TestOneof2_FooGroup::set_b(const ::std::string& value) {
set_has_b();
b_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneof2.FooGroup.b)
}
inline void TestOneof2_FooGroup::set_b(const char* value) {
set_has_b();
b_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestOneof2.FooGroup.b)
}
inline void TestOneof2_FooGroup::set_b(const char* value,
size_t size) {
set_has_b();
b_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestOneof2.FooGroup.b)
}
inline ::std::string* TestOneof2_FooGroup::mutable_b() {
set_has_b();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestOneof2.FooGroup.b)
return b_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestOneof2_FooGroup::release_b() {
clear_has_b();
return b_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TestOneof2_FooGroup::unsafe_arena_release_b() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_b();
return b_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
}
inline void TestOneof2_FooGroup::set_allocated_b(::std::string* b) {
if (b != NULL) {
set_has_b();
} else {
clear_has_b();
}
b_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), b,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof2.FooGroup.b)
}
inline void TestOneof2_FooGroup::unsafe_arena_set_allocated_b(
::std::string* b) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (b != NULL) {
set_has_b();
} else {
clear_has_b();
}
b_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
b, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof2.FooGroup.b)
}
// -------------------------------------------------------------------
// TestOneof2_NestedMessage
// optional int64 qux_int = 1;
inline bool TestOneof2_NestedMessage::has_qux_int() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestOneof2_NestedMessage::set_has_qux_int() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestOneof2_NestedMessage::clear_has_qux_int() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestOneof2_NestedMessage::clear_qux_int() {
qux_int_ = GOOGLE_LONGLONG(0);
clear_has_qux_int();
}
inline ::google::protobuf::int64 TestOneof2_NestedMessage::qux_int() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof2.NestedMessage.qux_int)
return qux_int_;
}
inline void TestOneof2_NestedMessage::set_qux_int(::google::protobuf::int64 value) {
set_has_qux_int();
qux_int_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneof2.NestedMessage.qux_int)
}
// repeated int32 corge_int = 2;
inline int TestOneof2_NestedMessage::corge_int_size() const {
return corge_int_.size();
}
inline void TestOneof2_NestedMessage::clear_corge_int() {
corge_int_.Clear();
}
inline ::google::protobuf::int32 TestOneof2_NestedMessage::corge_int(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof2.NestedMessage.corge_int)
return corge_int_.Get(index);
}
inline void TestOneof2_NestedMessage::set_corge_int(int index, ::google::protobuf::int32 value) {
corge_int_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneof2.NestedMessage.corge_int)
}
inline void TestOneof2_NestedMessage::add_corge_int(::google::protobuf::int32 value) {
corge_int_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestOneof2.NestedMessage.corge_int)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
TestOneof2_NestedMessage::corge_int() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestOneof2.NestedMessage.corge_int)
return corge_int_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
TestOneof2_NestedMessage::mutable_corge_int() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestOneof2.NestedMessage.corge_int)
return &corge_int_;
}
// -------------------------------------------------------------------
// TestOneof2
// optional int32 foo_int = 1;
inline bool TestOneof2::has_foo_int() const {
return foo_case() == kFooInt;
}
inline void TestOneof2::set_has_foo_int() {
_oneof_case_[0] = kFooInt;
}
inline void TestOneof2::clear_foo_int() {
if (has_foo_int()) {
foo_.foo_int_ = 0;
clear_has_foo();
}
}
inline ::google::protobuf::int32 TestOneof2::foo_int() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof2.foo_int)
if (has_foo_int()) {
return foo_.foo_int_;
}
return 0;
}
inline void TestOneof2::set_foo_int(::google::protobuf::int32 value) {
if (!has_foo_int()) {
clear_foo();
set_has_foo_int();
}
foo_.foo_int_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneof2.foo_int)
}
// optional string foo_string = 2;
inline bool TestOneof2::has_foo_string() const {
return foo_case() == kFooString;
}
inline void TestOneof2::set_has_foo_string() {
_oneof_case_[0] = kFooString;
}
inline void TestOneof2::clear_foo_string() {
if (has_foo_string()) {
foo_.foo_string_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
clear_has_foo();
}
}
inline const ::std::string& TestOneof2::foo_string() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof2.foo_string)
if (has_foo_string()) {
return foo_.foo_string_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
return *&::google::protobuf::internal::GetEmptyStringAlreadyInited();
}
inline void TestOneof2::set_foo_string(const ::std::string& value) {
if (!has_foo_string()) {
clear_foo();
set_has_foo_string();
foo_.foo_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
foo_.foo_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneof2.foo_string)
}
inline void TestOneof2::set_foo_string(const char* value) {
if (!has_foo_string()) {
clear_foo();
set_has_foo_string();
foo_.foo_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
foo_.foo_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
::std::string(value), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestOneof2.foo_string)
}
inline void TestOneof2::set_foo_string(const char* value,
size_t size) {
if (!has_foo_string()) {
clear_foo();
set_has_foo_string();
foo_.foo_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
foo_.foo_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestOneof2.foo_string)
}
inline ::std::string* TestOneof2::mutable_foo_string() {
if (!has_foo_string()) {
clear_foo();
set_has_foo_string();
foo_.foo_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
return foo_.foo_string_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestOneof2.foo_string)
}
inline ::std::string* TestOneof2::release_foo_string() {
if (has_foo_string()) {
clear_has_foo();
return foo_.foo_string_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
} else {
return NULL;
}
}
inline ::std::string* TestOneof2::unsafe_arena_release_foo_string() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (has_foo_string()) {
clear_has_foo();
return foo_.foo_string_.UnsafeArenaRelease(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
} else {
return NULL;
}
}
inline void TestOneof2::set_allocated_foo_string(::std::string* foo_string) {
if (!has_foo_string()) {
foo_.foo_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
clear_foo();
if (foo_string != NULL) {
set_has_foo_string();
foo_.foo_string_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), foo_string,
GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof2.foo_string)
}
inline void TestOneof2::unsafe_arena_set_allocated_foo_string(::std::string* foo_string) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (!has_foo_string()) {
foo_.foo_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
clear_foo();
if (foo_string) {
set_has_foo_string();
foo_.foo_string_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), foo_string, GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof2.foo_string)
}
// optional string foo_cord = 3 [ctype = CORD];
inline bool TestOneof2::has_foo_cord() const {
return foo_case() == kFooCord;
}
inline void TestOneof2::set_has_foo_cord() {
_oneof_case_[0] = kFooCord;
}
inline void TestOneof2::clear_foo_cord() {
if (has_foo_cord()) {
foo_.foo_cord_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
clear_has_foo();
}
}
inline const ::std::string& TestOneof2::foo_cord() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof2.foo_cord)
if (has_foo_cord()) {
return foo_.foo_cord_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
return *&::google::protobuf::internal::GetEmptyStringAlreadyInited();
}
inline void TestOneof2::set_foo_cord(const ::std::string& value) {
if (!has_foo_cord()) {
clear_foo();
set_has_foo_cord();
foo_.foo_cord_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
foo_.foo_cord_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneof2.foo_cord)
}
inline void TestOneof2::set_foo_cord(const char* value) {
if (!has_foo_cord()) {
clear_foo();
set_has_foo_cord();
foo_.foo_cord_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
foo_.foo_cord_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
::std::string(value), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestOneof2.foo_cord)
}
inline void TestOneof2::set_foo_cord(const char* value,
size_t size) {
if (!has_foo_cord()) {
clear_foo();
set_has_foo_cord();
foo_.foo_cord_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
foo_.foo_cord_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestOneof2.foo_cord)
}
inline ::std::string* TestOneof2::mutable_foo_cord() {
if (!has_foo_cord()) {
clear_foo();
set_has_foo_cord();
foo_.foo_cord_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
return foo_.foo_cord_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestOneof2.foo_cord)
}
inline ::std::string* TestOneof2::release_foo_cord() {
if (has_foo_cord()) {
clear_has_foo();
return foo_.foo_cord_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
} else {
return NULL;
}
}
inline ::std::string* TestOneof2::unsafe_arena_release_foo_cord() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (has_foo_cord()) {
clear_has_foo();
return foo_.foo_cord_.UnsafeArenaRelease(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
} else {
return NULL;
}
}
inline void TestOneof2::set_allocated_foo_cord(::std::string* foo_cord) {
if (!has_foo_cord()) {
foo_.foo_cord_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
clear_foo();
if (foo_cord != NULL) {
set_has_foo_cord();
foo_.foo_cord_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), foo_cord,
GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof2.foo_cord)
}
inline void TestOneof2::unsafe_arena_set_allocated_foo_cord(::std::string* foo_cord) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (!has_foo_cord()) {
foo_.foo_cord_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
clear_foo();
if (foo_cord) {
set_has_foo_cord();
foo_.foo_cord_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), foo_cord, GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof2.foo_cord)
}
// optional string foo_string_piece = 4 [ctype = STRING_PIECE];
inline bool TestOneof2::has_foo_string_piece() const {
return foo_case() == kFooStringPiece;
}
inline void TestOneof2::set_has_foo_string_piece() {
_oneof_case_[0] = kFooStringPiece;
}
inline void TestOneof2::clear_foo_string_piece() {
if (has_foo_string_piece()) {
foo_.foo_string_piece_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
clear_has_foo();
}
}
inline const ::std::string& TestOneof2::foo_string_piece() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof2.foo_string_piece)
if (has_foo_string_piece()) {
return foo_.foo_string_piece_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
return *&::google::protobuf::internal::GetEmptyStringAlreadyInited();
}
inline void TestOneof2::set_foo_string_piece(const ::std::string& value) {
if (!has_foo_string_piece()) {
clear_foo();
set_has_foo_string_piece();
foo_.foo_string_piece_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
foo_.foo_string_piece_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneof2.foo_string_piece)
}
inline void TestOneof2::set_foo_string_piece(const char* value) {
if (!has_foo_string_piece()) {
clear_foo();
set_has_foo_string_piece();
foo_.foo_string_piece_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
foo_.foo_string_piece_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
::std::string(value), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestOneof2.foo_string_piece)
}
inline void TestOneof2::set_foo_string_piece(const char* value,
size_t size) {
if (!has_foo_string_piece()) {
clear_foo();
set_has_foo_string_piece();
foo_.foo_string_piece_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
foo_.foo_string_piece_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestOneof2.foo_string_piece)
}
inline ::std::string* TestOneof2::mutable_foo_string_piece() {
if (!has_foo_string_piece()) {
clear_foo();
set_has_foo_string_piece();
foo_.foo_string_piece_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
return foo_.foo_string_piece_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestOneof2.foo_string_piece)
}
inline ::std::string* TestOneof2::release_foo_string_piece() {
if (has_foo_string_piece()) {
clear_has_foo();
return foo_.foo_string_piece_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
} else {
return NULL;
}
}
inline ::std::string* TestOneof2::unsafe_arena_release_foo_string_piece() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (has_foo_string_piece()) {
clear_has_foo();
return foo_.foo_string_piece_.UnsafeArenaRelease(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
} else {
return NULL;
}
}
inline void TestOneof2::set_allocated_foo_string_piece(::std::string* foo_string_piece) {
if (!has_foo_string_piece()) {
foo_.foo_string_piece_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
clear_foo();
if (foo_string_piece != NULL) {
set_has_foo_string_piece();
foo_.foo_string_piece_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), foo_string_piece,
GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof2.foo_string_piece)
}
inline void TestOneof2::unsafe_arena_set_allocated_foo_string_piece(::std::string* foo_string_piece) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (!has_foo_string_piece()) {
foo_.foo_string_piece_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
clear_foo();
if (foo_string_piece) {
set_has_foo_string_piece();
foo_.foo_string_piece_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), foo_string_piece, GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof2.foo_string_piece)
}
// optional bytes foo_bytes = 5;
inline bool TestOneof2::has_foo_bytes() const {
return foo_case() == kFooBytes;
}
inline void TestOneof2::set_has_foo_bytes() {
_oneof_case_[0] = kFooBytes;
}
inline void TestOneof2::clear_foo_bytes() {
if (has_foo_bytes()) {
foo_.foo_bytes_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
clear_has_foo();
}
}
inline const ::std::string& TestOneof2::foo_bytes() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof2.foo_bytes)
if (has_foo_bytes()) {
return foo_.foo_bytes_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
return *&::google::protobuf::internal::GetEmptyStringAlreadyInited();
}
inline void TestOneof2::set_foo_bytes(const ::std::string& value) {
if (!has_foo_bytes()) {
clear_foo();
set_has_foo_bytes();
foo_.foo_bytes_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
foo_.foo_bytes_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneof2.foo_bytes)
}
inline void TestOneof2::set_foo_bytes(const char* value) {
if (!has_foo_bytes()) {
clear_foo();
set_has_foo_bytes();
foo_.foo_bytes_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
foo_.foo_bytes_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
::std::string(value), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestOneof2.foo_bytes)
}
inline void TestOneof2::set_foo_bytes(const void* value,
size_t size) {
if (!has_foo_bytes()) {
clear_foo();
set_has_foo_bytes();
foo_.foo_bytes_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
foo_.foo_bytes_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestOneof2.foo_bytes)
}
inline ::std::string* TestOneof2::mutable_foo_bytes() {
if (!has_foo_bytes()) {
clear_foo();
set_has_foo_bytes();
foo_.foo_bytes_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
return foo_.foo_bytes_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestOneof2.foo_bytes)
}
inline ::std::string* TestOneof2::release_foo_bytes() {
if (has_foo_bytes()) {
clear_has_foo();
return foo_.foo_bytes_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
} else {
return NULL;
}
}
inline ::std::string* TestOneof2::unsafe_arena_release_foo_bytes() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (has_foo_bytes()) {
clear_has_foo();
return foo_.foo_bytes_.UnsafeArenaRelease(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
} else {
return NULL;
}
}
inline void TestOneof2::set_allocated_foo_bytes(::std::string* foo_bytes) {
if (!has_foo_bytes()) {
foo_.foo_bytes_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
clear_foo();
if (foo_bytes != NULL) {
set_has_foo_bytes();
foo_.foo_bytes_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), foo_bytes,
GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof2.foo_bytes)
}
inline void TestOneof2::unsafe_arena_set_allocated_foo_bytes(::std::string* foo_bytes) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (!has_foo_bytes()) {
foo_.foo_bytes_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
clear_foo();
if (foo_bytes) {
set_has_foo_bytes();
foo_.foo_bytes_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), foo_bytes, GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof2.foo_bytes)
}
// optional .protobuf_unittest.TestOneof2.NestedEnum foo_enum = 6;
inline bool TestOneof2::has_foo_enum() const {
return foo_case() == kFooEnum;
}
inline void TestOneof2::set_has_foo_enum() {
_oneof_case_[0] = kFooEnum;
}
inline void TestOneof2::clear_foo_enum() {
if (has_foo_enum()) {
foo_.foo_enum_ = 1;
clear_has_foo();
}
}
inline ::protobuf_unittest::TestOneof2_NestedEnum TestOneof2::foo_enum() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof2.foo_enum)
if (has_foo_enum()) {
return static_cast< ::protobuf_unittest::TestOneof2_NestedEnum >(foo_.foo_enum_);
}
return static_cast< ::protobuf_unittest::TestOneof2_NestedEnum >(1);
}
inline void TestOneof2::set_foo_enum(::protobuf_unittest::TestOneof2_NestedEnum value) {
assert(::protobuf_unittest::TestOneof2_NestedEnum_IsValid(value));
if (!has_foo_enum()) {
clear_foo();
set_has_foo_enum();
}
foo_.foo_enum_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneof2.foo_enum)
}
// optional .protobuf_unittest.TestOneof2.NestedMessage foo_message = 7;
inline bool TestOneof2::has_foo_message() const {
return foo_case() == kFooMessage;
}
inline void TestOneof2::set_has_foo_message() {
_oneof_case_[0] = kFooMessage;
}
inline void TestOneof2::clear_foo_message() {
if (has_foo_message()) {
if (GetArenaNoVirtual() == NULL) {
delete foo_.foo_message_;
}
clear_has_foo();
}
}
inline const ::protobuf_unittest::TestOneof2_NestedMessage& TestOneof2::foo_message() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof2.foo_message)
return has_foo_message()
? *foo_.foo_message_
: ::protobuf_unittest::TestOneof2_NestedMessage::default_instance();
}
inline ::protobuf_unittest::TestOneof2_NestedMessage* TestOneof2::mutable_foo_message() {
if (!has_foo_message()) {
clear_foo();
set_has_foo_message();
foo_.foo_message_ =
::google::protobuf::Arena::CreateMessage< ::protobuf_unittest::TestOneof2_NestedMessage >(
GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestOneof2.foo_message)
return foo_.foo_message_;
}
inline ::protobuf_unittest::TestOneof2_NestedMessage* TestOneof2::release_foo_message() {
if (has_foo_message()) {
clear_has_foo();
if (GetArenaNoVirtual() != NULL) {
::protobuf_unittest::TestOneof2_NestedMessage* temp = new ::protobuf_unittest::TestOneof2_NestedMessage;
temp->MergeFrom(*foo_.foo_message_);
foo_.foo_message_ = NULL;
return temp;
} else {
::protobuf_unittest::TestOneof2_NestedMessage* temp = foo_.foo_message_;
foo_.foo_message_ = NULL;
return temp;
}
} else {
return NULL;
}
}
inline void TestOneof2::set_allocated_foo_message(::protobuf_unittest::TestOneof2_NestedMessage* foo_message) {
clear_foo();
if (foo_message) {
if (GetArenaNoVirtual() != NULL &&
::google::protobuf::Arena::GetArena(foo_message) == NULL) {
GetArenaNoVirtual()->Own(foo_message);
} else if (GetArenaNoVirtual() !=
::google::protobuf::Arena::GetArena(foo_message)) {
::protobuf_unittest::TestOneof2_NestedMessage* new_foo_message =
::google::protobuf::Arena::CreateMessage< ::protobuf_unittest::TestOneof2_NestedMessage >(
GetArenaNoVirtual());
new_foo_message->CopyFrom(*foo_message);
foo_message = new_foo_message;
}
set_has_foo_message();
foo_.foo_message_ = foo_message;
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof2.foo_message)
}
inline ::protobuf_unittest::TestOneof2_NestedMessage* TestOneof2::unsafe_arena_release_foo_message() {
if (has_foo_message()) {
clear_has_foo();
::protobuf_unittest::TestOneof2_NestedMessage* temp = foo_.foo_message_;
foo_.foo_message_ = NULL;
return temp;
} else {
return NULL;
}
}
inline void TestOneof2::unsafe_arena_set_allocated_foo_message(::protobuf_unittest::TestOneof2_NestedMessage* foo_message) {
clear_foo();
if (foo_message) {
set_has_foo_message();
foo_.foo_message_ = foo_message;
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf_unittest.TestOneof2.foo_message)
}
// optional group FooGroup = 8 { ... };
inline bool TestOneof2::has_foogroup() const {
return foo_case() == kFoogroup;
}
inline void TestOneof2::set_has_foogroup() {
_oneof_case_[0] = kFoogroup;
}
inline void TestOneof2::clear_foogroup() {
if (has_foogroup()) {
if (GetArenaNoVirtual() == NULL) {
delete foo_.foogroup_;
}
clear_has_foo();
}
}
inline const ::protobuf_unittest::TestOneof2_FooGroup& TestOneof2::foogroup() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof2.foogroup)
return has_foogroup()
? *foo_.foogroup_
: ::protobuf_unittest::TestOneof2_FooGroup::default_instance();
}
inline ::protobuf_unittest::TestOneof2_FooGroup* TestOneof2::mutable_foogroup() {
if (!has_foogroup()) {
clear_foo();
set_has_foogroup();
foo_.foogroup_ =
::google::protobuf::Arena::CreateMessage< ::protobuf_unittest::TestOneof2_FooGroup >(
GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestOneof2.foogroup)
return foo_.foogroup_;
}
inline ::protobuf_unittest::TestOneof2_FooGroup* TestOneof2::release_foogroup() {
if (has_foogroup()) {
clear_has_foo();
if (GetArenaNoVirtual() != NULL) {
::protobuf_unittest::TestOneof2_FooGroup* temp = new ::protobuf_unittest::TestOneof2_FooGroup;
temp->MergeFrom(*foo_.foogroup_);
foo_.foogroup_ = NULL;
return temp;
} else {
::protobuf_unittest::TestOneof2_FooGroup* temp = foo_.foogroup_;
foo_.foogroup_ = NULL;
return temp;
}
} else {
return NULL;
}
}
inline void TestOneof2::set_allocated_foogroup(::protobuf_unittest::TestOneof2_FooGroup* foogroup) {
clear_foo();
if (foogroup) {
if (GetArenaNoVirtual() != NULL &&
::google::protobuf::Arena::GetArena(foogroup) == NULL) {
GetArenaNoVirtual()->Own(foogroup);
} else if (GetArenaNoVirtual() !=
::google::protobuf::Arena::GetArena(foogroup)) {
::protobuf_unittest::TestOneof2_FooGroup* new_foogroup =
::google::protobuf::Arena::CreateMessage< ::protobuf_unittest::TestOneof2_FooGroup >(
GetArenaNoVirtual());
new_foogroup->CopyFrom(*foogroup);
foogroup = new_foogroup;
}
set_has_foogroup();
foo_.foogroup_ = foogroup;
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof2.foogroup)
}
inline ::protobuf_unittest::TestOneof2_FooGroup* TestOneof2::unsafe_arena_release_foogroup() {
if (has_foogroup()) {
clear_has_foo();
::protobuf_unittest::TestOneof2_FooGroup* temp = foo_.foogroup_;
foo_.foogroup_ = NULL;
return temp;
} else {
return NULL;
}
}
inline void TestOneof2::unsafe_arena_set_allocated_foogroup(::protobuf_unittest::TestOneof2_FooGroup* foogroup) {
clear_foo();
if (foogroup) {
set_has_foogroup();
foo_.foogroup_ = foogroup;
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf_unittest.TestOneof2.foogroup)
}
// optional .protobuf_unittest.TestOneof2.NestedMessage foo_lazy_message = 11 [lazy = true];
inline bool TestOneof2::has_foo_lazy_message() const {
return foo_case() == kFooLazyMessage;
}
inline void TestOneof2::set_has_foo_lazy_message() {
_oneof_case_[0] = kFooLazyMessage;
}
inline void TestOneof2::clear_foo_lazy_message() {
if (has_foo_lazy_message()) {
if (GetArenaNoVirtual() == NULL) {
delete foo_.foo_lazy_message_;
}
clear_has_foo();
}
}
inline const ::protobuf_unittest::TestOneof2_NestedMessage& TestOneof2::foo_lazy_message() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof2.foo_lazy_message)
return has_foo_lazy_message()
? *foo_.foo_lazy_message_
: ::protobuf_unittest::TestOneof2_NestedMessage::default_instance();
}
inline ::protobuf_unittest::TestOneof2_NestedMessage* TestOneof2::mutable_foo_lazy_message() {
if (!has_foo_lazy_message()) {
clear_foo();
set_has_foo_lazy_message();
foo_.foo_lazy_message_ =
::google::protobuf::Arena::CreateMessage< ::protobuf_unittest::TestOneof2_NestedMessage >(
GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestOneof2.foo_lazy_message)
return foo_.foo_lazy_message_;
}
inline ::protobuf_unittest::TestOneof2_NestedMessage* TestOneof2::release_foo_lazy_message() {
if (has_foo_lazy_message()) {
clear_has_foo();
if (GetArenaNoVirtual() != NULL) {
::protobuf_unittest::TestOneof2_NestedMessage* temp = new ::protobuf_unittest::TestOneof2_NestedMessage;
temp->MergeFrom(*foo_.foo_lazy_message_);
foo_.foo_lazy_message_ = NULL;
return temp;
} else {
::protobuf_unittest::TestOneof2_NestedMessage* temp = foo_.foo_lazy_message_;
foo_.foo_lazy_message_ = NULL;
return temp;
}
} else {
return NULL;
}
}
inline void TestOneof2::set_allocated_foo_lazy_message(::protobuf_unittest::TestOneof2_NestedMessage* foo_lazy_message) {
clear_foo();
if (foo_lazy_message) {
if (GetArenaNoVirtual() != NULL &&
::google::protobuf::Arena::GetArena(foo_lazy_message) == NULL) {
GetArenaNoVirtual()->Own(foo_lazy_message);
} else if (GetArenaNoVirtual() !=
::google::protobuf::Arena::GetArena(foo_lazy_message)) {
::protobuf_unittest::TestOneof2_NestedMessage* new_foo_lazy_message =
::google::protobuf::Arena::CreateMessage< ::protobuf_unittest::TestOneof2_NestedMessage >(
GetArenaNoVirtual());
new_foo_lazy_message->CopyFrom(*foo_lazy_message);
foo_lazy_message = new_foo_lazy_message;
}
set_has_foo_lazy_message();
foo_.foo_lazy_message_ = foo_lazy_message;
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof2.foo_lazy_message)
}
inline ::protobuf_unittest::TestOneof2_NestedMessage* TestOneof2::unsafe_arena_release_foo_lazy_message() {
if (has_foo_lazy_message()) {
clear_has_foo();
::protobuf_unittest::TestOneof2_NestedMessage* temp = foo_.foo_lazy_message_;
foo_.foo_lazy_message_ = NULL;
return temp;
} else {
return NULL;
}
}
inline void TestOneof2::unsafe_arena_set_allocated_foo_lazy_message(::protobuf_unittest::TestOneof2_NestedMessage* foo_lazy_message) {
clear_foo();
if (foo_lazy_message) {
set_has_foo_lazy_message();
foo_.foo_lazy_message_ = foo_lazy_message;
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf_unittest.TestOneof2.foo_lazy_message)
}
// optional int32 bar_int = 12 [default = 5];
inline bool TestOneof2::has_bar_int() const {
return bar_case() == kBarInt;
}
inline void TestOneof2::set_has_bar_int() {
_oneof_case_[1] = kBarInt;
}
inline void TestOneof2::clear_bar_int() {
if (has_bar_int()) {
bar_.bar_int_ = 5;
clear_has_bar();
}
}
inline ::google::protobuf::int32 TestOneof2::bar_int() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof2.bar_int)
if (has_bar_int()) {
return bar_.bar_int_;
}
return 5;
}
inline void TestOneof2::set_bar_int(::google::protobuf::int32 value) {
if (!has_bar_int()) {
clear_bar();
set_has_bar_int();
}
bar_.bar_int_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneof2.bar_int)
}
// optional string bar_string = 13 [default = "STRING"];
inline bool TestOneof2::has_bar_string() const {
return bar_case() == kBarString;
}
inline void TestOneof2::set_has_bar_string() {
_oneof_case_[1] = kBarString;
}
inline void TestOneof2::clear_bar_string() {
if (has_bar_string()) {
bar_.bar_string_.Destroy(_default_bar_string_,
GetArenaNoVirtual());
clear_has_bar();
}
}
inline const ::std::string& TestOneof2::bar_string() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof2.bar_string)
if (has_bar_string()) {
return bar_.bar_string_.Get(_default_bar_string_);
}
return *_default_bar_string_;
}
inline void TestOneof2::set_bar_string(const ::std::string& value) {
if (!has_bar_string()) {
clear_bar();
set_has_bar_string();
bar_.bar_string_.UnsafeSetDefault(_default_bar_string_);
}
bar_.bar_string_.Set(_default_bar_string_, value,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneof2.bar_string)
}
inline void TestOneof2::set_bar_string(const char* value) {
if (!has_bar_string()) {
clear_bar();
set_has_bar_string();
bar_.bar_string_.UnsafeSetDefault(_default_bar_string_);
}
bar_.bar_string_.Set(_default_bar_string_,
::std::string(value), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestOneof2.bar_string)
}
inline void TestOneof2::set_bar_string(const char* value,
size_t size) {
if (!has_bar_string()) {
clear_bar();
set_has_bar_string();
bar_.bar_string_.UnsafeSetDefault(_default_bar_string_);
}
bar_.bar_string_.Set(_default_bar_string_, ::std::string(
reinterpret_cast<const char*>(value), size),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestOneof2.bar_string)
}
inline ::std::string* TestOneof2::mutable_bar_string() {
if (!has_bar_string()) {
clear_bar();
set_has_bar_string();
bar_.bar_string_.UnsafeSetDefault(_default_bar_string_);
}
return bar_.bar_string_.Mutable(_default_bar_string_,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestOneof2.bar_string)
}
inline ::std::string* TestOneof2::release_bar_string() {
if (has_bar_string()) {
clear_has_bar();
return bar_.bar_string_.Release(_default_bar_string_,
GetArenaNoVirtual());
} else {
return NULL;
}
}
inline ::std::string* TestOneof2::unsafe_arena_release_bar_string() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (has_bar_string()) {
clear_has_bar();
return bar_.bar_string_.UnsafeArenaRelease(
_default_bar_string_, GetArenaNoVirtual());
} else {
return NULL;
}
}
inline void TestOneof2::set_allocated_bar_string(::std::string* bar_string) {
if (!has_bar_string()) {
bar_.bar_string_.UnsafeSetDefault(_default_bar_string_);
}
clear_bar();
if (bar_string != NULL) {
set_has_bar_string();
bar_.bar_string_.SetAllocated(_default_bar_string_, bar_string,
GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof2.bar_string)
}
inline void TestOneof2::unsafe_arena_set_allocated_bar_string(::std::string* bar_string) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (!has_bar_string()) {
bar_.bar_string_.UnsafeSetDefault(_default_bar_string_);
}
clear_bar();
if (bar_string) {
set_has_bar_string();
bar_.bar_string_.UnsafeArenaSetAllocated(_default_bar_string_, bar_string, GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof2.bar_string)
}
// optional string bar_cord = 14 [default = "CORD", ctype = CORD];
inline bool TestOneof2::has_bar_cord() const {
return bar_case() == kBarCord;
}
inline void TestOneof2::set_has_bar_cord() {
_oneof_case_[1] = kBarCord;
}
inline void TestOneof2::clear_bar_cord() {
if (has_bar_cord()) {
bar_.bar_cord_.Destroy(_default_bar_cord_,
GetArenaNoVirtual());
clear_has_bar();
}
}
inline const ::std::string& TestOneof2::bar_cord() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof2.bar_cord)
if (has_bar_cord()) {
return bar_.bar_cord_.Get(_default_bar_cord_);
}
return *_default_bar_cord_;
}
inline void TestOneof2::set_bar_cord(const ::std::string& value) {
if (!has_bar_cord()) {
clear_bar();
set_has_bar_cord();
bar_.bar_cord_.UnsafeSetDefault(_default_bar_cord_);
}
bar_.bar_cord_.Set(_default_bar_cord_, value,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneof2.bar_cord)
}
inline void TestOneof2::set_bar_cord(const char* value) {
if (!has_bar_cord()) {
clear_bar();
set_has_bar_cord();
bar_.bar_cord_.UnsafeSetDefault(_default_bar_cord_);
}
bar_.bar_cord_.Set(_default_bar_cord_,
::std::string(value), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestOneof2.bar_cord)
}
inline void TestOneof2::set_bar_cord(const char* value,
size_t size) {
if (!has_bar_cord()) {
clear_bar();
set_has_bar_cord();
bar_.bar_cord_.UnsafeSetDefault(_default_bar_cord_);
}
bar_.bar_cord_.Set(_default_bar_cord_, ::std::string(
reinterpret_cast<const char*>(value), size),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestOneof2.bar_cord)
}
inline ::std::string* TestOneof2::mutable_bar_cord() {
if (!has_bar_cord()) {
clear_bar();
set_has_bar_cord();
bar_.bar_cord_.UnsafeSetDefault(_default_bar_cord_);
}
return bar_.bar_cord_.Mutable(_default_bar_cord_,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestOneof2.bar_cord)
}
inline ::std::string* TestOneof2::release_bar_cord() {
if (has_bar_cord()) {
clear_has_bar();
return bar_.bar_cord_.Release(_default_bar_cord_,
GetArenaNoVirtual());
} else {
return NULL;
}
}
inline ::std::string* TestOneof2::unsafe_arena_release_bar_cord() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (has_bar_cord()) {
clear_has_bar();
return bar_.bar_cord_.UnsafeArenaRelease(
_default_bar_cord_, GetArenaNoVirtual());
} else {
return NULL;
}
}
inline void TestOneof2::set_allocated_bar_cord(::std::string* bar_cord) {
if (!has_bar_cord()) {
bar_.bar_cord_.UnsafeSetDefault(_default_bar_cord_);
}
clear_bar();
if (bar_cord != NULL) {
set_has_bar_cord();
bar_.bar_cord_.SetAllocated(_default_bar_cord_, bar_cord,
GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof2.bar_cord)
}
inline void TestOneof2::unsafe_arena_set_allocated_bar_cord(::std::string* bar_cord) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (!has_bar_cord()) {
bar_.bar_cord_.UnsafeSetDefault(_default_bar_cord_);
}
clear_bar();
if (bar_cord) {
set_has_bar_cord();
bar_.bar_cord_.UnsafeArenaSetAllocated(_default_bar_cord_, bar_cord, GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof2.bar_cord)
}
// optional string bar_string_piece = 15 [default = "SPIECE", ctype = STRING_PIECE];
inline bool TestOneof2::has_bar_string_piece() const {
return bar_case() == kBarStringPiece;
}
inline void TestOneof2::set_has_bar_string_piece() {
_oneof_case_[1] = kBarStringPiece;
}
inline void TestOneof2::clear_bar_string_piece() {
if (has_bar_string_piece()) {
bar_.bar_string_piece_.Destroy(_default_bar_string_piece_,
GetArenaNoVirtual());
clear_has_bar();
}
}
inline const ::std::string& TestOneof2::bar_string_piece() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof2.bar_string_piece)
if (has_bar_string_piece()) {
return bar_.bar_string_piece_.Get(_default_bar_string_piece_);
}
return *_default_bar_string_piece_;
}
inline void TestOneof2::set_bar_string_piece(const ::std::string& value) {
if (!has_bar_string_piece()) {
clear_bar();
set_has_bar_string_piece();
bar_.bar_string_piece_.UnsafeSetDefault(_default_bar_string_piece_);
}
bar_.bar_string_piece_.Set(_default_bar_string_piece_, value,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneof2.bar_string_piece)
}
inline void TestOneof2::set_bar_string_piece(const char* value) {
if (!has_bar_string_piece()) {
clear_bar();
set_has_bar_string_piece();
bar_.bar_string_piece_.UnsafeSetDefault(_default_bar_string_piece_);
}
bar_.bar_string_piece_.Set(_default_bar_string_piece_,
::std::string(value), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestOneof2.bar_string_piece)
}
inline void TestOneof2::set_bar_string_piece(const char* value,
size_t size) {
if (!has_bar_string_piece()) {
clear_bar();
set_has_bar_string_piece();
bar_.bar_string_piece_.UnsafeSetDefault(_default_bar_string_piece_);
}
bar_.bar_string_piece_.Set(_default_bar_string_piece_, ::std::string(
reinterpret_cast<const char*>(value), size),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestOneof2.bar_string_piece)
}
inline ::std::string* TestOneof2::mutable_bar_string_piece() {
if (!has_bar_string_piece()) {
clear_bar();
set_has_bar_string_piece();
bar_.bar_string_piece_.UnsafeSetDefault(_default_bar_string_piece_);
}
return bar_.bar_string_piece_.Mutable(_default_bar_string_piece_,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestOneof2.bar_string_piece)
}
inline ::std::string* TestOneof2::release_bar_string_piece() {
if (has_bar_string_piece()) {
clear_has_bar();
return bar_.bar_string_piece_.Release(_default_bar_string_piece_,
GetArenaNoVirtual());
} else {
return NULL;
}
}
inline ::std::string* TestOneof2::unsafe_arena_release_bar_string_piece() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (has_bar_string_piece()) {
clear_has_bar();
return bar_.bar_string_piece_.UnsafeArenaRelease(
_default_bar_string_piece_, GetArenaNoVirtual());
} else {
return NULL;
}
}
inline void TestOneof2::set_allocated_bar_string_piece(::std::string* bar_string_piece) {
if (!has_bar_string_piece()) {
bar_.bar_string_piece_.UnsafeSetDefault(_default_bar_string_piece_);
}
clear_bar();
if (bar_string_piece != NULL) {
set_has_bar_string_piece();
bar_.bar_string_piece_.SetAllocated(_default_bar_string_piece_, bar_string_piece,
GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof2.bar_string_piece)
}
inline void TestOneof2::unsafe_arena_set_allocated_bar_string_piece(::std::string* bar_string_piece) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (!has_bar_string_piece()) {
bar_.bar_string_piece_.UnsafeSetDefault(_default_bar_string_piece_);
}
clear_bar();
if (bar_string_piece) {
set_has_bar_string_piece();
bar_.bar_string_piece_.UnsafeArenaSetAllocated(_default_bar_string_piece_, bar_string_piece, GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof2.bar_string_piece)
}
// optional bytes bar_bytes = 16 [default = "BYTES"];
inline bool TestOneof2::has_bar_bytes() const {
return bar_case() == kBarBytes;
}
inline void TestOneof2::set_has_bar_bytes() {
_oneof_case_[1] = kBarBytes;
}
inline void TestOneof2::clear_bar_bytes() {
if (has_bar_bytes()) {
bar_.bar_bytes_.Destroy(_default_bar_bytes_,
GetArenaNoVirtual());
clear_has_bar();
}
}
inline const ::std::string& TestOneof2::bar_bytes() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof2.bar_bytes)
if (has_bar_bytes()) {
return bar_.bar_bytes_.Get(_default_bar_bytes_);
}
return *_default_bar_bytes_;
}
inline void TestOneof2::set_bar_bytes(const ::std::string& value) {
if (!has_bar_bytes()) {
clear_bar();
set_has_bar_bytes();
bar_.bar_bytes_.UnsafeSetDefault(_default_bar_bytes_);
}
bar_.bar_bytes_.Set(_default_bar_bytes_, value,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneof2.bar_bytes)
}
inline void TestOneof2::set_bar_bytes(const char* value) {
if (!has_bar_bytes()) {
clear_bar();
set_has_bar_bytes();
bar_.bar_bytes_.UnsafeSetDefault(_default_bar_bytes_);
}
bar_.bar_bytes_.Set(_default_bar_bytes_,
::std::string(value), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestOneof2.bar_bytes)
}
inline void TestOneof2::set_bar_bytes(const void* value,
size_t size) {
if (!has_bar_bytes()) {
clear_bar();
set_has_bar_bytes();
bar_.bar_bytes_.UnsafeSetDefault(_default_bar_bytes_);
}
bar_.bar_bytes_.Set(_default_bar_bytes_, ::std::string(
reinterpret_cast<const char*>(value), size),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestOneof2.bar_bytes)
}
inline ::std::string* TestOneof2::mutable_bar_bytes() {
if (!has_bar_bytes()) {
clear_bar();
set_has_bar_bytes();
bar_.bar_bytes_.UnsafeSetDefault(_default_bar_bytes_);
}
return bar_.bar_bytes_.Mutable(_default_bar_bytes_,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestOneof2.bar_bytes)
}
inline ::std::string* TestOneof2::release_bar_bytes() {
if (has_bar_bytes()) {
clear_has_bar();
return bar_.bar_bytes_.Release(_default_bar_bytes_,
GetArenaNoVirtual());
} else {
return NULL;
}
}
inline ::std::string* TestOneof2::unsafe_arena_release_bar_bytes() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (has_bar_bytes()) {
clear_has_bar();
return bar_.bar_bytes_.UnsafeArenaRelease(
_default_bar_bytes_, GetArenaNoVirtual());
} else {
return NULL;
}
}
inline void TestOneof2::set_allocated_bar_bytes(::std::string* bar_bytes) {
if (!has_bar_bytes()) {
bar_.bar_bytes_.UnsafeSetDefault(_default_bar_bytes_);
}
clear_bar();
if (bar_bytes != NULL) {
set_has_bar_bytes();
bar_.bar_bytes_.SetAllocated(_default_bar_bytes_, bar_bytes,
GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof2.bar_bytes)
}
inline void TestOneof2::unsafe_arena_set_allocated_bar_bytes(::std::string* bar_bytes) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (!has_bar_bytes()) {
bar_.bar_bytes_.UnsafeSetDefault(_default_bar_bytes_);
}
clear_bar();
if (bar_bytes) {
set_has_bar_bytes();
bar_.bar_bytes_.UnsafeArenaSetAllocated(_default_bar_bytes_, bar_bytes, GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof2.bar_bytes)
}
// optional .protobuf_unittest.TestOneof2.NestedEnum bar_enum = 17 [default = BAR];
inline bool TestOneof2::has_bar_enum() const {
return bar_case() == kBarEnum;
}
inline void TestOneof2::set_has_bar_enum() {
_oneof_case_[1] = kBarEnum;
}
inline void TestOneof2::clear_bar_enum() {
if (has_bar_enum()) {
bar_.bar_enum_ = 2;
clear_has_bar();
}
}
inline ::protobuf_unittest::TestOneof2_NestedEnum TestOneof2::bar_enum() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof2.bar_enum)
if (has_bar_enum()) {
return static_cast< ::protobuf_unittest::TestOneof2_NestedEnum >(bar_.bar_enum_);
}
return static_cast< ::protobuf_unittest::TestOneof2_NestedEnum >(2);
}
inline void TestOneof2::set_bar_enum(::protobuf_unittest::TestOneof2_NestedEnum value) {
assert(::protobuf_unittest::TestOneof2_NestedEnum_IsValid(value));
if (!has_bar_enum()) {
clear_bar();
set_has_bar_enum();
}
bar_.bar_enum_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneof2.bar_enum)
}
// optional int32 baz_int = 18;
inline bool TestOneof2::has_baz_int() const {
return (_has_bits_[0] & 0x00008000u) != 0;
}
inline void TestOneof2::set_has_baz_int() {
_has_bits_[0] |= 0x00008000u;
}
inline void TestOneof2::clear_has_baz_int() {
_has_bits_[0] &= ~0x00008000u;
}
inline void TestOneof2::clear_baz_int() {
baz_int_ = 0;
clear_has_baz_int();
}
inline ::google::protobuf::int32 TestOneof2::baz_int() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof2.baz_int)
return baz_int_;
}
inline void TestOneof2::set_baz_int(::google::protobuf::int32 value) {
set_has_baz_int();
baz_int_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneof2.baz_int)
}
// optional string baz_string = 19 [default = "BAZ"];
inline bool TestOneof2::has_baz_string() const {
return (_has_bits_[0] & 0x00010000u) != 0;
}
inline void TestOneof2::set_has_baz_string() {
_has_bits_[0] |= 0x00010000u;
}
inline void TestOneof2::clear_has_baz_string() {
_has_bits_[0] &= ~0x00010000u;
}
inline void TestOneof2::clear_baz_string() {
baz_string_.ClearToDefault(_default_baz_string_, GetArenaNoVirtual());
clear_has_baz_string();
}
inline const ::std::string& TestOneof2::baz_string() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestOneof2.baz_string)
return baz_string_.Get(_default_baz_string_);
}
inline void TestOneof2::set_baz_string(const ::std::string& value) {
set_has_baz_string();
baz_string_.Set(_default_baz_string_, value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestOneof2.baz_string)
}
inline void TestOneof2::set_baz_string(const char* value) {
set_has_baz_string();
baz_string_.Set(_default_baz_string_, ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestOneof2.baz_string)
}
inline void TestOneof2::set_baz_string(const char* value,
size_t size) {
set_has_baz_string();
baz_string_.Set(_default_baz_string_, ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestOneof2.baz_string)
}
inline ::std::string* TestOneof2::mutable_baz_string() {
set_has_baz_string();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestOneof2.baz_string)
return baz_string_.Mutable(_default_baz_string_, GetArenaNoVirtual());
}
inline ::std::string* TestOneof2::release_baz_string() {
clear_has_baz_string();
return baz_string_.Release(_default_baz_string_, GetArenaNoVirtual());
}
inline ::std::string* TestOneof2::unsafe_arena_release_baz_string() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_baz_string();
return baz_string_.UnsafeArenaRelease(_default_baz_string_,
GetArenaNoVirtual());
}
inline void TestOneof2::set_allocated_baz_string(::std::string* baz_string) {
if (baz_string != NULL) {
set_has_baz_string();
} else {
clear_has_baz_string();
}
baz_string_.SetAllocated(_default_baz_string_, baz_string,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof2.baz_string)
}
inline void TestOneof2::unsafe_arena_set_allocated_baz_string(
::std::string* baz_string) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (baz_string != NULL) {
set_has_baz_string();
} else {
clear_has_baz_string();
}
baz_string_.UnsafeArenaSetAllocated(_default_baz_string_,
baz_string, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestOneof2.baz_string)
}
inline bool TestOneof2::has_foo() const {
return foo_case() != FOO_NOT_SET;
}
inline void TestOneof2::clear_has_foo() {
_oneof_case_[0] = FOO_NOT_SET;
}
inline bool TestOneof2::has_bar() const {
return bar_case() != BAR_NOT_SET;
}
inline void TestOneof2::clear_has_bar() {
_oneof_case_[1] = BAR_NOT_SET;
}
inline TestOneof2::FooCase TestOneof2::foo_case() const {
return TestOneof2::FooCase(_oneof_case_[0]);
}
inline TestOneof2::BarCase TestOneof2::bar_case() const {
return TestOneof2::BarCase(_oneof_case_[1]);
}
// -------------------------------------------------------------------
// TestRequiredOneof_NestedMessage
// required double required_double = 1;
inline bool TestRequiredOneof_NestedMessage::has_required_double() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestRequiredOneof_NestedMessage::set_has_required_double() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestRequiredOneof_NestedMessage::clear_has_required_double() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestRequiredOneof_NestedMessage::clear_required_double() {
required_double_ = 0;
clear_has_required_double();
}
inline double TestRequiredOneof_NestedMessage::required_double() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequiredOneof.NestedMessage.required_double)
return required_double_;
}
inline void TestRequiredOneof_NestedMessage::set_required_double(double value) {
set_has_required_double();
required_double_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequiredOneof.NestedMessage.required_double)
}
// -------------------------------------------------------------------
// TestRequiredOneof
// optional int32 foo_int = 1;
inline bool TestRequiredOneof::has_foo_int() const {
return foo_case() == kFooInt;
}
inline void TestRequiredOneof::set_has_foo_int() {
_oneof_case_[0] = kFooInt;
}
inline void TestRequiredOneof::clear_foo_int() {
if (has_foo_int()) {
foo_.foo_int_ = 0;
clear_has_foo();
}
}
inline ::google::protobuf::int32 TestRequiredOneof::foo_int() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequiredOneof.foo_int)
if (has_foo_int()) {
return foo_.foo_int_;
}
return 0;
}
inline void TestRequiredOneof::set_foo_int(::google::protobuf::int32 value) {
if (!has_foo_int()) {
clear_foo();
set_has_foo_int();
}
foo_.foo_int_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequiredOneof.foo_int)
}
// optional string foo_string = 2;
inline bool TestRequiredOneof::has_foo_string() const {
return foo_case() == kFooString;
}
inline void TestRequiredOneof::set_has_foo_string() {
_oneof_case_[0] = kFooString;
}
inline void TestRequiredOneof::clear_foo_string() {
if (has_foo_string()) {
foo_.foo_string_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
clear_has_foo();
}
}
inline const ::std::string& TestRequiredOneof::foo_string() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequiredOneof.foo_string)
if (has_foo_string()) {
return foo_.foo_string_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
return *&::google::protobuf::internal::GetEmptyStringAlreadyInited();
}
inline void TestRequiredOneof::set_foo_string(const ::std::string& value) {
if (!has_foo_string()) {
clear_foo();
set_has_foo_string();
foo_.foo_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
foo_.foo_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRequiredOneof.foo_string)
}
inline void TestRequiredOneof::set_foo_string(const char* value) {
if (!has_foo_string()) {
clear_foo();
set_has_foo_string();
foo_.foo_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
foo_.foo_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
::std::string(value), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestRequiredOneof.foo_string)
}
inline void TestRequiredOneof::set_foo_string(const char* value,
size_t size) {
if (!has_foo_string()) {
clear_foo();
set_has_foo_string();
foo_.foo_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
foo_.foo_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestRequiredOneof.foo_string)
}
inline ::std::string* TestRequiredOneof::mutable_foo_string() {
if (!has_foo_string()) {
clear_foo();
set_has_foo_string();
foo_.foo_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
return foo_.foo_string_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestRequiredOneof.foo_string)
}
inline ::std::string* TestRequiredOneof::release_foo_string() {
if (has_foo_string()) {
clear_has_foo();
return foo_.foo_string_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
} else {
return NULL;
}
}
inline ::std::string* TestRequiredOneof::unsafe_arena_release_foo_string() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (has_foo_string()) {
clear_has_foo();
return foo_.foo_string_.UnsafeArenaRelease(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
} else {
return NULL;
}
}
inline void TestRequiredOneof::set_allocated_foo_string(::std::string* foo_string) {
if (!has_foo_string()) {
foo_.foo_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
clear_foo();
if (foo_string != NULL) {
set_has_foo_string();
foo_.foo_string_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), foo_string,
GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestRequiredOneof.foo_string)
}
inline void TestRequiredOneof::unsafe_arena_set_allocated_foo_string(::std::string* foo_string) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (!has_foo_string()) {
foo_.foo_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
clear_foo();
if (foo_string) {
set_has_foo_string();
foo_.foo_string_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), foo_string, GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestRequiredOneof.foo_string)
}
// optional .protobuf_unittest.TestRequiredOneof.NestedMessage foo_message = 3;
inline bool TestRequiredOneof::has_foo_message() const {
return foo_case() == kFooMessage;
}
inline void TestRequiredOneof::set_has_foo_message() {
_oneof_case_[0] = kFooMessage;
}
inline void TestRequiredOneof::clear_foo_message() {
if (has_foo_message()) {
if (GetArenaNoVirtual() == NULL) {
delete foo_.foo_message_;
}
clear_has_foo();
}
}
inline const ::protobuf_unittest::TestRequiredOneof_NestedMessage& TestRequiredOneof::foo_message() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRequiredOneof.foo_message)
return has_foo_message()
? *foo_.foo_message_
: ::protobuf_unittest::TestRequiredOneof_NestedMessage::default_instance();
}
inline ::protobuf_unittest::TestRequiredOneof_NestedMessage* TestRequiredOneof::mutable_foo_message() {
if (!has_foo_message()) {
clear_foo();
set_has_foo_message();
foo_.foo_message_ =
::google::protobuf::Arena::CreateMessage< ::protobuf_unittest::TestRequiredOneof_NestedMessage >(
GetArenaNoVirtual());
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestRequiredOneof.foo_message)
return foo_.foo_message_;
}
inline ::protobuf_unittest::TestRequiredOneof_NestedMessage* TestRequiredOneof::release_foo_message() {
if (has_foo_message()) {
clear_has_foo();
if (GetArenaNoVirtual() != NULL) {
::protobuf_unittest::TestRequiredOneof_NestedMessage* temp = new ::protobuf_unittest::TestRequiredOneof_NestedMessage;
temp->MergeFrom(*foo_.foo_message_);
foo_.foo_message_ = NULL;
return temp;
} else {
::protobuf_unittest::TestRequiredOneof_NestedMessage* temp = foo_.foo_message_;
foo_.foo_message_ = NULL;
return temp;
}
} else {
return NULL;
}
}
inline void TestRequiredOneof::set_allocated_foo_message(::protobuf_unittest::TestRequiredOneof_NestedMessage* foo_message) {
clear_foo();
if (foo_message) {
if (GetArenaNoVirtual() != NULL &&
::google::protobuf::Arena::GetArena(foo_message) == NULL) {
GetArenaNoVirtual()->Own(foo_message);
} else if (GetArenaNoVirtual() !=
::google::protobuf::Arena::GetArena(foo_message)) {
::protobuf_unittest::TestRequiredOneof_NestedMessage* new_foo_message =
::google::protobuf::Arena::CreateMessage< ::protobuf_unittest::TestRequiredOneof_NestedMessage >(
GetArenaNoVirtual());
new_foo_message->CopyFrom(*foo_message);
foo_message = new_foo_message;
}
set_has_foo_message();
foo_.foo_message_ = foo_message;
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestRequiredOneof.foo_message)
}
inline ::protobuf_unittest::TestRequiredOneof_NestedMessage* TestRequiredOneof::unsafe_arena_release_foo_message() {
if (has_foo_message()) {
clear_has_foo();
::protobuf_unittest::TestRequiredOneof_NestedMessage* temp = foo_.foo_message_;
foo_.foo_message_ = NULL;
return temp;
} else {
return NULL;
}
}
inline void TestRequiredOneof::unsafe_arena_set_allocated_foo_message(::protobuf_unittest::TestRequiredOneof_NestedMessage* foo_message) {
clear_foo();
if (foo_message) {
set_has_foo_message();
foo_.foo_message_ = foo_message;
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf_unittest.TestRequiredOneof.foo_message)
}
inline bool TestRequiredOneof::has_foo() const {
return foo_case() != FOO_NOT_SET;
}
inline void TestRequiredOneof::clear_has_foo() {
_oneof_case_[0] = FOO_NOT_SET;
}
inline TestRequiredOneof::FooCase TestRequiredOneof::foo_case() const {
return TestRequiredOneof::FooCase(_oneof_case_[0]);
}
// -------------------------------------------------------------------
// TestPackedTypes
// repeated int32 packed_int32 = 90 [packed = true];
inline int TestPackedTypes::packed_int32_size() const {
return packed_int32_.size();
}
inline void TestPackedTypes::clear_packed_int32() {
packed_int32_.Clear();
}
inline ::google::protobuf::int32 TestPackedTypes::packed_int32(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestPackedTypes.packed_int32)
return packed_int32_.Get(index);
}
inline void TestPackedTypes::set_packed_int32(int index, ::google::protobuf::int32 value) {
packed_int32_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestPackedTypes.packed_int32)
}
inline void TestPackedTypes::add_packed_int32(::google::protobuf::int32 value) {
packed_int32_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestPackedTypes.packed_int32)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
TestPackedTypes::packed_int32() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestPackedTypes.packed_int32)
return packed_int32_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
TestPackedTypes::mutable_packed_int32() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestPackedTypes.packed_int32)
return &packed_int32_;
}
// repeated int64 packed_int64 = 91 [packed = true];
inline int TestPackedTypes::packed_int64_size() const {
return packed_int64_.size();
}
inline void TestPackedTypes::clear_packed_int64() {
packed_int64_.Clear();
}
inline ::google::protobuf::int64 TestPackedTypes::packed_int64(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestPackedTypes.packed_int64)
return packed_int64_.Get(index);
}
inline void TestPackedTypes::set_packed_int64(int index, ::google::protobuf::int64 value) {
packed_int64_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestPackedTypes.packed_int64)
}
inline void TestPackedTypes::add_packed_int64(::google::protobuf::int64 value) {
packed_int64_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestPackedTypes.packed_int64)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
TestPackedTypes::packed_int64() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestPackedTypes.packed_int64)
return packed_int64_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
TestPackedTypes::mutable_packed_int64() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestPackedTypes.packed_int64)
return &packed_int64_;
}
// repeated uint32 packed_uint32 = 92 [packed = true];
inline int TestPackedTypes::packed_uint32_size() const {
return packed_uint32_.size();
}
inline void TestPackedTypes::clear_packed_uint32() {
packed_uint32_.Clear();
}
inline ::google::protobuf::uint32 TestPackedTypes::packed_uint32(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestPackedTypes.packed_uint32)
return packed_uint32_.Get(index);
}
inline void TestPackedTypes::set_packed_uint32(int index, ::google::protobuf::uint32 value) {
packed_uint32_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestPackedTypes.packed_uint32)
}
inline void TestPackedTypes::add_packed_uint32(::google::protobuf::uint32 value) {
packed_uint32_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestPackedTypes.packed_uint32)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
TestPackedTypes::packed_uint32() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestPackedTypes.packed_uint32)
return packed_uint32_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
TestPackedTypes::mutable_packed_uint32() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestPackedTypes.packed_uint32)
return &packed_uint32_;
}
// repeated uint64 packed_uint64 = 93 [packed = true];
inline int TestPackedTypes::packed_uint64_size() const {
return packed_uint64_.size();
}
inline void TestPackedTypes::clear_packed_uint64() {
packed_uint64_.Clear();
}
inline ::google::protobuf::uint64 TestPackedTypes::packed_uint64(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestPackedTypes.packed_uint64)
return packed_uint64_.Get(index);
}
inline void TestPackedTypes::set_packed_uint64(int index, ::google::protobuf::uint64 value) {
packed_uint64_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestPackedTypes.packed_uint64)
}
inline void TestPackedTypes::add_packed_uint64(::google::protobuf::uint64 value) {
packed_uint64_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestPackedTypes.packed_uint64)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
TestPackedTypes::packed_uint64() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestPackedTypes.packed_uint64)
return packed_uint64_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
TestPackedTypes::mutable_packed_uint64() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestPackedTypes.packed_uint64)
return &packed_uint64_;
}
// repeated sint32 packed_sint32 = 94 [packed = true];
inline int TestPackedTypes::packed_sint32_size() const {
return packed_sint32_.size();
}
inline void TestPackedTypes::clear_packed_sint32() {
packed_sint32_.Clear();
}
inline ::google::protobuf::int32 TestPackedTypes::packed_sint32(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestPackedTypes.packed_sint32)
return packed_sint32_.Get(index);
}
inline void TestPackedTypes::set_packed_sint32(int index, ::google::protobuf::int32 value) {
packed_sint32_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestPackedTypes.packed_sint32)
}
inline void TestPackedTypes::add_packed_sint32(::google::protobuf::int32 value) {
packed_sint32_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestPackedTypes.packed_sint32)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
TestPackedTypes::packed_sint32() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestPackedTypes.packed_sint32)
return packed_sint32_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
TestPackedTypes::mutable_packed_sint32() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestPackedTypes.packed_sint32)
return &packed_sint32_;
}
// repeated sint64 packed_sint64 = 95 [packed = true];
inline int TestPackedTypes::packed_sint64_size() const {
return packed_sint64_.size();
}
inline void TestPackedTypes::clear_packed_sint64() {
packed_sint64_.Clear();
}
inline ::google::protobuf::int64 TestPackedTypes::packed_sint64(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestPackedTypes.packed_sint64)
return packed_sint64_.Get(index);
}
inline void TestPackedTypes::set_packed_sint64(int index, ::google::protobuf::int64 value) {
packed_sint64_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestPackedTypes.packed_sint64)
}
inline void TestPackedTypes::add_packed_sint64(::google::protobuf::int64 value) {
packed_sint64_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestPackedTypes.packed_sint64)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
TestPackedTypes::packed_sint64() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestPackedTypes.packed_sint64)
return packed_sint64_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
TestPackedTypes::mutable_packed_sint64() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestPackedTypes.packed_sint64)
return &packed_sint64_;
}
// repeated fixed32 packed_fixed32 = 96 [packed = true];
inline int TestPackedTypes::packed_fixed32_size() const {
return packed_fixed32_.size();
}
inline void TestPackedTypes::clear_packed_fixed32() {
packed_fixed32_.Clear();
}
inline ::google::protobuf::uint32 TestPackedTypes::packed_fixed32(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestPackedTypes.packed_fixed32)
return packed_fixed32_.Get(index);
}
inline void TestPackedTypes::set_packed_fixed32(int index, ::google::protobuf::uint32 value) {
packed_fixed32_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestPackedTypes.packed_fixed32)
}
inline void TestPackedTypes::add_packed_fixed32(::google::protobuf::uint32 value) {
packed_fixed32_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestPackedTypes.packed_fixed32)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
TestPackedTypes::packed_fixed32() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestPackedTypes.packed_fixed32)
return packed_fixed32_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
TestPackedTypes::mutable_packed_fixed32() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestPackedTypes.packed_fixed32)
return &packed_fixed32_;
}
// repeated fixed64 packed_fixed64 = 97 [packed = true];
inline int TestPackedTypes::packed_fixed64_size() const {
return packed_fixed64_.size();
}
inline void TestPackedTypes::clear_packed_fixed64() {
packed_fixed64_.Clear();
}
inline ::google::protobuf::uint64 TestPackedTypes::packed_fixed64(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestPackedTypes.packed_fixed64)
return packed_fixed64_.Get(index);
}
inline void TestPackedTypes::set_packed_fixed64(int index, ::google::protobuf::uint64 value) {
packed_fixed64_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestPackedTypes.packed_fixed64)
}
inline void TestPackedTypes::add_packed_fixed64(::google::protobuf::uint64 value) {
packed_fixed64_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestPackedTypes.packed_fixed64)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
TestPackedTypes::packed_fixed64() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestPackedTypes.packed_fixed64)
return packed_fixed64_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
TestPackedTypes::mutable_packed_fixed64() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestPackedTypes.packed_fixed64)
return &packed_fixed64_;
}
// repeated sfixed32 packed_sfixed32 = 98 [packed = true];
inline int TestPackedTypes::packed_sfixed32_size() const {
return packed_sfixed32_.size();
}
inline void TestPackedTypes::clear_packed_sfixed32() {
packed_sfixed32_.Clear();
}
inline ::google::protobuf::int32 TestPackedTypes::packed_sfixed32(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestPackedTypes.packed_sfixed32)
return packed_sfixed32_.Get(index);
}
inline void TestPackedTypes::set_packed_sfixed32(int index, ::google::protobuf::int32 value) {
packed_sfixed32_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestPackedTypes.packed_sfixed32)
}
inline void TestPackedTypes::add_packed_sfixed32(::google::protobuf::int32 value) {
packed_sfixed32_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestPackedTypes.packed_sfixed32)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
TestPackedTypes::packed_sfixed32() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestPackedTypes.packed_sfixed32)
return packed_sfixed32_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
TestPackedTypes::mutable_packed_sfixed32() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestPackedTypes.packed_sfixed32)
return &packed_sfixed32_;
}
// repeated sfixed64 packed_sfixed64 = 99 [packed = true];
inline int TestPackedTypes::packed_sfixed64_size() const {
return packed_sfixed64_.size();
}
inline void TestPackedTypes::clear_packed_sfixed64() {
packed_sfixed64_.Clear();
}
inline ::google::protobuf::int64 TestPackedTypes::packed_sfixed64(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestPackedTypes.packed_sfixed64)
return packed_sfixed64_.Get(index);
}
inline void TestPackedTypes::set_packed_sfixed64(int index, ::google::protobuf::int64 value) {
packed_sfixed64_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestPackedTypes.packed_sfixed64)
}
inline void TestPackedTypes::add_packed_sfixed64(::google::protobuf::int64 value) {
packed_sfixed64_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestPackedTypes.packed_sfixed64)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
TestPackedTypes::packed_sfixed64() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestPackedTypes.packed_sfixed64)
return packed_sfixed64_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
TestPackedTypes::mutable_packed_sfixed64() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestPackedTypes.packed_sfixed64)
return &packed_sfixed64_;
}
// repeated float packed_float = 100 [packed = true];
inline int TestPackedTypes::packed_float_size() const {
return packed_float_.size();
}
inline void TestPackedTypes::clear_packed_float() {
packed_float_.Clear();
}
inline float TestPackedTypes::packed_float(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestPackedTypes.packed_float)
return packed_float_.Get(index);
}
inline void TestPackedTypes::set_packed_float(int index, float value) {
packed_float_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestPackedTypes.packed_float)
}
inline void TestPackedTypes::add_packed_float(float value) {
packed_float_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestPackedTypes.packed_float)
}
inline const ::google::protobuf::RepeatedField< float >&
TestPackedTypes::packed_float() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestPackedTypes.packed_float)
return packed_float_;
}
inline ::google::protobuf::RepeatedField< float >*
TestPackedTypes::mutable_packed_float() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestPackedTypes.packed_float)
return &packed_float_;
}
// repeated double packed_double = 101 [packed = true];
inline int TestPackedTypes::packed_double_size() const {
return packed_double_.size();
}
inline void TestPackedTypes::clear_packed_double() {
packed_double_.Clear();
}
inline double TestPackedTypes::packed_double(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestPackedTypes.packed_double)
return packed_double_.Get(index);
}
inline void TestPackedTypes::set_packed_double(int index, double value) {
packed_double_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestPackedTypes.packed_double)
}
inline void TestPackedTypes::add_packed_double(double value) {
packed_double_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestPackedTypes.packed_double)
}
inline const ::google::protobuf::RepeatedField< double >&
TestPackedTypes::packed_double() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestPackedTypes.packed_double)
return packed_double_;
}
inline ::google::protobuf::RepeatedField< double >*
TestPackedTypes::mutable_packed_double() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestPackedTypes.packed_double)
return &packed_double_;
}
// repeated bool packed_bool = 102 [packed = true];
inline int TestPackedTypes::packed_bool_size() const {
return packed_bool_.size();
}
inline void TestPackedTypes::clear_packed_bool() {
packed_bool_.Clear();
}
inline bool TestPackedTypes::packed_bool(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestPackedTypes.packed_bool)
return packed_bool_.Get(index);
}
inline void TestPackedTypes::set_packed_bool(int index, bool value) {
packed_bool_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestPackedTypes.packed_bool)
}
inline void TestPackedTypes::add_packed_bool(bool value) {
packed_bool_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestPackedTypes.packed_bool)
}
inline const ::google::protobuf::RepeatedField< bool >&
TestPackedTypes::packed_bool() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestPackedTypes.packed_bool)
return packed_bool_;
}
inline ::google::protobuf::RepeatedField< bool >*
TestPackedTypes::mutable_packed_bool() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestPackedTypes.packed_bool)
return &packed_bool_;
}
// repeated .protobuf_unittest.ForeignEnum packed_enum = 103 [packed = true];
inline int TestPackedTypes::packed_enum_size() const {
return packed_enum_.size();
}
inline void TestPackedTypes::clear_packed_enum() {
packed_enum_.Clear();
}
inline ::protobuf_unittest::ForeignEnum TestPackedTypes::packed_enum(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestPackedTypes.packed_enum)
return static_cast< ::protobuf_unittest::ForeignEnum >(packed_enum_.Get(index));
}
inline void TestPackedTypes::set_packed_enum(int index, ::protobuf_unittest::ForeignEnum value) {
assert(::protobuf_unittest::ForeignEnum_IsValid(value));
packed_enum_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestPackedTypes.packed_enum)
}
inline void TestPackedTypes::add_packed_enum(::protobuf_unittest::ForeignEnum value) {
assert(::protobuf_unittest::ForeignEnum_IsValid(value));
packed_enum_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestPackedTypes.packed_enum)
}
inline const ::google::protobuf::RepeatedField<int>&
TestPackedTypes::packed_enum() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestPackedTypes.packed_enum)
return packed_enum_;
}
inline ::google::protobuf::RepeatedField<int>*
TestPackedTypes::mutable_packed_enum() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestPackedTypes.packed_enum)
return &packed_enum_;
}
// -------------------------------------------------------------------
// TestUnpackedTypes
// repeated int32 unpacked_int32 = 90 [packed = false];
inline int TestUnpackedTypes::unpacked_int32_size() const {
return unpacked_int32_.size();
}
inline void TestUnpackedTypes::clear_unpacked_int32() {
unpacked_int32_.Clear();
}
inline ::google::protobuf::int32 TestUnpackedTypes::unpacked_int32(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestUnpackedTypes.unpacked_int32)
return unpacked_int32_.Get(index);
}
inline void TestUnpackedTypes::set_unpacked_int32(int index, ::google::protobuf::int32 value) {
unpacked_int32_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestUnpackedTypes.unpacked_int32)
}
inline void TestUnpackedTypes::add_unpacked_int32(::google::protobuf::int32 value) {
unpacked_int32_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestUnpackedTypes.unpacked_int32)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
TestUnpackedTypes::unpacked_int32() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestUnpackedTypes.unpacked_int32)
return unpacked_int32_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
TestUnpackedTypes::mutable_unpacked_int32() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestUnpackedTypes.unpacked_int32)
return &unpacked_int32_;
}
// repeated int64 unpacked_int64 = 91 [packed = false];
inline int TestUnpackedTypes::unpacked_int64_size() const {
return unpacked_int64_.size();
}
inline void TestUnpackedTypes::clear_unpacked_int64() {
unpacked_int64_.Clear();
}
inline ::google::protobuf::int64 TestUnpackedTypes::unpacked_int64(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestUnpackedTypes.unpacked_int64)
return unpacked_int64_.Get(index);
}
inline void TestUnpackedTypes::set_unpacked_int64(int index, ::google::protobuf::int64 value) {
unpacked_int64_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestUnpackedTypes.unpacked_int64)
}
inline void TestUnpackedTypes::add_unpacked_int64(::google::protobuf::int64 value) {
unpacked_int64_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestUnpackedTypes.unpacked_int64)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
TestUnpackedTypes::unpacked_int64() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestUnpackedTypes.unpacked_int64)
return unpacked_int64_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
TestUnpackedTypes::mutable_unpacked_int64() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestUnpackedTypes.unpacked_int64)
return &unpacked_int64_;
}
// repeated uint32 unpacked_uint32 = 92 [packed = false];
inline int TestUnpackedTypes::unpacked_uint32_size() const {
return unpacked_uint32_.size();
}
inline void TestUnpackedTypes::clear_unpacked_uint32() {
unpacked_uint32_.Clear();
}
inline ::google::protobuf::uint32 TestUnpackedTypes::unpacked_uint32(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestUnpackedTypes.unpacked_uint32)
return unpacked_uint32_.Get(index);
}
inline void TestUnpackedTypes::set_unpacked_uint32(int index, ::google::protobuf::uint32 value) {
unpacked_uint32_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestUnpackedTypes.unpacked_uint32)
}
inline void TestUnpackedTypes::add_unpacked_uint32(::google::protobuf::uint32 value) {
unpacked_uint32_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestUnpackedTypes.unpacked_uint32)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
TestUnpackedTypes::unpacked_uint32() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestUnpackedTypes.unpacked_uint32)
return unpacked_uint32_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
TestUnpackedTypes::mutable_unpacked_uint32() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestUnpackedTypes.unpacked_uint32)
return &unpacked_uint32_;
}
// repeated uint64 unpacked_uint64 = 93 [packed = false];
inline int TestUnpackedTypes::unpacked_uint64_size() const {
return unpacked_uint64_.size();
}
inline void TestUnpackedTypes::clear_unpacked_uint64() {
unpacked_uint64_.Clear();
}
inline ::google::protobuf::uint64 TestUnpackedTypes::unpacked_uint64(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestUnpackedTypes.unpacked_uint64)
return unpacked_uint64_.Get(index);
}
inline void TestUnpackedTypes::set_unpacked_uint64(int index, ::google::protobuf::uint64 value) {
unpacked_uint64_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestUnpackedTypes.unpacked_uint64)
}
inline void TestUnpackedTypes::add_unpacked_uint64(::google::protobuf::uint64 value) {
unpacked_uint64_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestUnpackedTypes.unpacked_uint64)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
TestUnpackedTypes::unpacked_uint64() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestUnpackedTypes.unpacked_uint64)
return unpacked_uint64_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
TestUnpackedTypes::mutable_unpacked_uint64() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestUnpackedTypes.unpacked_uint64)
return &unpacked_uint64_;
}
// repeated sint32 unpacked_sint32 = 94 [packed = false];
inline int TestUnpackedTypes::unpacked_sint32_size() const {
return unpacked_sint32_.size();
}
inline void TestUnpackedTypes::clear_unpacked_sint32() {
unpacked_sint32_.Clear();
}
inline ::google::protobuf::int32 TestUnpackedTypes::unpacked_sint32(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestUnpackedTypes.unpacked_sint32)
return unpacked_sint32_.Get(index);
}
inline void TestUnpackedTypes::set_unpacked_sint32(int index, ::google::protobuf::int32 value) {
unpacked_sint32_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestUnpackedTypes.unpacked_sint32)
}
inline void TestUnpackedTypes::add_unpacked_sint32(::google::protobuf::int32 value) {
unpacked_sint32_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestUnpackedTypes.unpacked_sint32)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
TestUnpackedTypes::unpacked_sint32() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestUnpackedTypes.unpacked_sint32)
return unpacked_sint32_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
TestUnpackedTypes::mutable_unpacked_sint32() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestUnpackedTypes.unpacked_sint32)
return &unpacked_sint32_;
}
// repeated sint64 unpacked_sint64 = 95 [packed = false];
inline int TestUnpackedTypes::unpacked_sint64_size() const {
return unpacked_sint64_.size();
}
inline void TestUnpackedTypes::clear_unpacked_sint64() {
unpacked_sint64_.Clear();
}
inline ::google::protobuf::int64 TestUnpackedTypes::unpacked_sint64(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestUnpackedTypes.unpacked_sint64)
return unpacked_sint64_.Get(index);
}
inline void TestUnpackedTypes::set_unpacked_sint64(int index, ::google::protobuf::int64 value) {
unpacked_sint64_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestUnpackedTypes.unpacked_sint64)
}
inline void TestUnpackedTypes::add_unpacked_sint64(::google::protobuf::int64 value) {
unpacked_sint64_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestUnpackedTypes.unpacked_sint64)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
TestUnpackedTypes::unpacked_sint64() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestUnpackedTypes.unpacked_sint64)
return unpacked_sint64_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
TestUnpackedTypes::mutable_unpacked_sint64() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestUnpackedTypes.unpacked_sint64)
return &unpacked_sint64_;
}
// repeated fixed32 unpacked_fixed32 = 96 [packed = false];
inline int TestUnpackedTypes::unpacked_fixed32_size() const {
return unpacked_fixed32_.size();
}
inline void TestUnpackedTypes::clear_unpacked_fixed32() {
unpacked_fixed32_.Clear();
}
inline ::google::protobuf::uint32 TestUnpackedTypes::unpacked_fixed32(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestUnpackedTypes.unpacked_fixed32)
return unpacked_fixed32_.Get(index);
}
inline void TestUnpackedTypes::set_unpacked_fixed32(int index, ::google::protobuf::uint32 value) {
unpacked_fixed32_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestUnpackedTypes.unpacked_fixed32)
}
inline void TestUnpackedTypes::add_unpacked_fixed32(::google::protobuf::uint32 value) {
unpacked_fixed32_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestUnpackedTypes.unpacked_fixed32)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
TestUnpackedTypes::unpacked_fixed32() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestUnpackedTypes.unpacked_fixed32)
return unpacked_fixed32_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
TestUnpackedTypes::mutable_unpacked_fixed32() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestUnpackedTypes.unpacked_fixed32)
return &unpacked_fixed32_;
}
// repeated fixed64 unpacked_fixed64 = 97 [packed = false];
inline int TestUnpackedTypes::unpacked_fixed64_size() const {
return unpacked_fixed64_.size();
}
inline void TestUnpackedTypes::clear_unpacked_fixed64() {
unpacked_fixed64_.Clear();
}
inline ::google::protobuf::uint64 TestUnpackedTypes::unpacked_fixed64(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestUnpackedTypes.unpacked_fixed64)
return unpacked_fixed64_.Get(index);
}
inline void TestUnpackedTypes::set_unpacked_fixed64(int index, ::google::protobuf::uint64 value) {
unpacked_fixed64_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestUnpackedTypes.unpacked_fixed64)
}
inline void TestUnpackedTypes::add_unpacked_fixed64(::google::protobuf::uint64 value) {
unpacked_fixed64_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestUnpackedTypes.unpacked_fixed64)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
TestUnpackedTypes::unpacked_fixed64() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestUnpackedTypes.unpacked_fixed64)
return unpacked_fixed64_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
TestUnpackedTypes::mutable_unpacked_fixed64() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestUnpackedTypes.unpacked_fixed64)
return &unpacked_fixed64_;
}
// repeated sfixed32 unpacked_sfixed32 = 98 [packed = false];
inline int TestUnpackedTypes::unpacked_sfixed32_size() const {
return unpacked_sfixed32_.size();
}
inline void TestUnpackedTypes::clear_unpacked_sfixed32() {
unpacked_sfixed32_.Clear();
}
inline ::google::protobuf::int32 TestUnpackedTypes::unpacked_sfixed32(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestUnpackedTypes.unpacked_sfixed32)
return unpacked_sfixed32_.Get(index);
}
inline void TestUnpackedTypes::set_unpacked_sfixed32(int index, ::google::protobuf::int32 value) {
unpacked_sfixed32_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestUnpackedTypes.unpacked_sfixed32)
}
inline void TestUnpackedTypes::add_unpacked_sfixed32(::google::protobuf::int32 value) {
unpacked_sfixed32_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestUnpackedTypes.unpacked_sfixed32)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
TestUnpackedTypes::unpacked_sfixed32() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestUnpackedTypes.unpacked_sfixed32)
return unpacked_sfixed32_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
TestUnpackedTypes::mutable_unpacked_sfixed32() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestUnpackedTypes.unpacked_sfixed32)
return &unpacked_sfixed32_;
}
// repeated sfixed64 unpacked_sfixed64 = 99 [packed = false];
inline int TestUnpackedTypes::unpacked_sfixed64_size() const {
return unpacked_sfixed64_.size();
}
inline void TestUnpackedTypes::clear_unpacked_sfixed64() {
unpacked_sfixed64_.Clear();
}
inline ::google::protobuf::int64 TestUnpackedTypes::unpacked_sfixed64(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestUnpackedTypes.unpacked_sfixed64)
return unpacked_sfixed64_.Get(index);
}
inline void TestUnpackedTypes::set_unpacked_sfixed64(int index, ::google::protobuf::int64 value) {
unpacked_sfixed64_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestUnpackedTypes.unpacked_sfixed64)
}
inline void TestUnpackedTypes::add_unpacked_sfixed64(::google::protobuf::int64 value) {
unpacked_sfixed64_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestUnpackedTypes.unpacked_sfixed64)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
TestUnpackedTypes::unpacked_sfixed64() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestUnpackedTypes.unpacked_sfixed64)
return unpacked_sfixed64_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
TestUnpackedTypes::mutable_unpacked_sfixed64() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestUnpackedTypes.unpacked_sfixed64)
return &unpacked_sfixed64_;
}
// repeated float unpacked_float = 100 [packed = false];
inline int TestUnpackedTypes::unpacked_float_size() const {
return unpacked_float_.size();
}
inline void TestUnpackedTypes::clear_unpacked_float() {
unpacked_float_.Clear();
}
inline float TestUnpackedTypes::unpacked_float(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestUnpackedTypes.unpacked_float)
return unpacked_float_.Get(index);
}
inline void TestUnpackedTypes::set_unpacked_float(int index, float value) {
unpacked_float_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestUnpackedTypes.unpacked_float)
}
inline void TestUnpackedTypes::add_unpacked_float(float value) {
unpacked_float_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestUnpackedTypes.unpacked_float)
}
inline const ::google::protobuf::RepeatedField< float >&
TestUnpackedTypes::unpacked_float() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestUnpackedTypes.unpacked_float)
return unpacked_float_;
}
inline ::google::protobuf::RepeatedField< float >*
TestUnpackedTypes::mutable_unpacked_float() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestUnpackedTypes.unpacked_float)
return &unpacked_float_;
}
// repeated double unpacked_double = 101 [packed = false];
inline int TestUnpackedTypes::unpacked_double_size() const {
return unpacked_double_.size();
}
inline void TestUnpackedTypes::clear_unpacked_double() {
unpacked_double_.Clear();
}
inline double TestUnpackedTypes::unpacked_double(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestUnpackedTypes.unpacked_double)
return unpacked_double_.Get(index);
}
inline void TestUnpackedTypes::set_unpacked_double(int index, double value) {
unpacked_double_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestUnpackedTypes.unpacked_double)
}
inline void TestUnpackedTypes::add_unpacked_double(double value) {
unpacked_double_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestUnpackedTypes.unpacked_double)
}
inline const ::google::protobuf::RepeatedField< double >&
TestUnpackedTypes::unpacked_double() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestUnpackedTypes.unpacked_double)
return unpacked_double_;
}
inline ::google::protobuf::RepeatedField< double >*
TestUnpackedTypes::mutable_unpacked_double() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestUnpackedTypes.unpacked_double)
return &unpacked_double_;
}
// repeated bool unpacked_bool = 102 [packed = false];
inline int TestUnpackedTypes::unpacked_bool_size() const {
return unpacked_bool_.size();
}
inline void TestUnpackedTypes::clear_unpacked_bool() {
unpacked_bool_.Clear();
}
inline bool TestUnpackedTypes::unpacked_bool(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestUnpackedTypes.unpacked_bool)
return unpacked_bool_.Get(index);
}
inline void TestUnpackedTypes::set_unpacked_bool(int index, bool value) {
unpacked_bool_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestUnpackedTypes.unpacked_bool)
}
inline void TestUnpackedTypes::add_unpacked_bool(bool value) {
unpacked_bool_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestUnpackedTypes.unpacked_bool)
}
inline const ::google::protobuf::RepeatedField< bool >&
TestUnpackedTypes::unpacked_bool() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestUnpackedTypes.unpacked_bool)
return unpacked_bool_;
}
inline ::google::protobuf::RepeatedField< bool >*
TestUnpackedTypes::mutable_unpacked_bool() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestUnpackedTypes.unpacked_bool)
return &unpacked_bool_;
}
// repeated .protobuf_unittest.ForeignEnum unpacked_enum = 103 [packed = false];
inline int TestUnpackedTypes::unpacked_enum_size() const {
return unpacked_enum_.size();
}
inline void TestUnpackedTypes::clear_unpacked_enum() {
unpacked_enum_.Clear();
}
inline ::protobuf_unittest::ForeignEnum TestUnpackedTypes::unpacked_enum(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestUnpackedTypes.unpacked_enum)
return static_cast< ::protobuf_unittest::ForeignEnum >(unpacked_enum_.Get(index));
}
inline void TestUnpackedTypes::set_unpacked_enum(int index, ::protobuf_unittest::ForeignEnum value) {
assert(::protobuf_unittest::ForeignEnum_IsValid(value));
unpacked_enum_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestUnpackedTypes.unpacked_enum)
}
inline void TestUnpackedTypes::add_unpacked_enum(::protobuf_unittest::ForeignEnum value) {
assert(::protobuf_unittest::ForeignEnum_IsValid(value));
unpacked_enum_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestUnpackedTypes.unpacked_enum)
}
inline const ::google::protobuf::RepeatedField<int>&
TestUnpackedTypes::unpacked_enum() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestUnpackedTypes.unpacked_enum)
return unpacked_enum_;
}
inline ::google::protobuf::RepeatedField<int>*
TestUnpackedTypes::mutable_unpacked_enum() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestUnpackedTypes.unpacked_enum)
return &unpacked_enum_;
}
// -------------------------------------------------------------------
// TestPackedExtensions
// -------------------------------------------------------------------
// TestUnpackedExtensions
// -------------------------------------------------------------------
// TestDynamicExtensions_DynamicMessageType
// optional int32 dynamic_field = 2100;
inline bool TestDynamicExtensions_DynamicMessageType::has_dynamic_field() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestDynamicExtensions_DynamicMessageType::set_has_dynamic_field() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestDynamicExtensions_DynamicMessageType::clear_has_dynamic_field() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestDynamicExtensions_DynamicMessageType::clear_dynamic_field() {
dynamic_field_ = 0;
clear_has_dynamic_field();
}
inline ::google::protobuf::int32 TestDynamicExtensions_DynamicMessageType::dynamic_field() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestDynamicExtensions.DynamicMessageType.dynamic_field)
return dynamic_field_;
}
inline void TestDynamicExtensions_DynamicMessageType::set_dynamic_field(::google::protobuf::int32 value) {
set_has_dynamic_field();
dynamic_field_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestDynamicExtensions.DynamicMessageType.dynamic_field)
}
// -------------------------------------------------------------------
// TestDynamicExtensions
// optional fixed32 scalar_extension = 2000;
inline bool TestDynamicExtensions::has_scalar_extension() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestDynamicExtensions::set_has_scalar_extension() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestDynamicExtensions::clear_has_scalar_extension() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestDynamicExtensions::clear_scalar_extension() {
scalar_extension_ = 0u;
clear_has_scalar_extension();
}
inline ::google::protobuf::uint32 TestDynamicExtensions::scalar_extension() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestDynamicExtensions.scalar_extension)
return scalar_extension_;
}
inline void TestDynamicExtensions::set_scalar_extension(::google::protobuf::uint32 value) {
set_has_scalar_extension();
scalar_extension_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestDynamicExtensions.scalar_extension)
}
// optional .protobuf_unittest.ForeignEnum enum_extension = 2001;
inline bool TestDynamicExtensions::has_enum_extension() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void TestDynamicExtensions::set_has_enum_extension() {
_has_bits_[0] |= 0x00000002u;
}
inline void TestDynamicExtensions::clear_has_enum_extension() {
_has_bits_[0] &= ~0x00000002u;
}
inline void TestDynamicExtensions::clear_enum_extension() {
enum_extension_ = 4;
clear_has_enum_extension();
}
inline ::protobuf_unittest::ForeignEnum TestDynamicExtensions::enum_extension() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestDynamicExtensions.enum_extension)
return static_cast< ::protobuf_unittest::ForeignEnum >(enum_extension_);
}
inline void TestDynamicExtensions::set_enum_extension(::protobuf_unittest::ForeignEnum value) {
assert(::protobuf_unittest::ForeignEnum_IsValid(value));
set_has_enum_extension();
enum_extension_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestDynamicExtensions.enum_extension)
}
// optional .protobuf_unittest.TestDynamicExtensions.DynamicEnumType dynamic_enum_extension = 2002;
inline bool TestDynamicExtensions::has_dynamic_enum_extension() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void TestDynamicExtensions::set_has_dynamic_enum_extension() {
_has_bits_[0] |= 0x00000004u;
}
inline void TestDynamicExtensions::clear_has_dynamic_enum_extension() {
_has_bits_[0] &= ~0x00000004u;
}
inline void TestDynamicExtensions::clear_dynamic_enum_extension() {
dynamic_enum_extension_ = 2200;
clear_has_dynamic_enum_extension();
}
inline ::protobuf_unittest::TestDynamicExtensions_DynamicEnumType TestDynamicExtensions::dynamic_enum_extension() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestDynamicExtensions.dynamic_enum_extension)
return static_cast< ::protobuf_unittest::TestDynamicExtensions_DynamicEnumType >(dynamic_enum_extension_);
}
inline void TestDynamicExtensions::set_dynamic_enum_extension(::protobuf_unittest::TestDynamicExtensions_DynamicEnumType value) {
assert(::protobuf_unittest::TestDynamicExtensions_DynamicEnumType_IsValid(value));
set_has_dynamic_enum_extension();
dynamic_enum_extension_ = value;
// @@protoc_insertion_point(field_set:protobuf_unittest.TestDynamicExtensions.dynamic_enum_extension)
}
// optional .protobuf_unittest.ForeignMessage message_extension = 2003;
inline bool TestDynamicExtensions::has_message_extension() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void TestDynamicExtensions::set_has_message_extension() {
_has_bits_[0] |= 0x00000008u;
}
inline void TestDynamicExtensions::clear_has_message_extension() {
_has_bits_[0] &= ~0x00000008u;
}
inline void TestDynamicExtensions::clear_message_extension() {
if (message_extension_ != NULL) message_extension_->::protobuf_unittest::ForeignMessage::Clear();
clear_has_message_extension();
}
inline const ::protobuf_unittest::ForeignMessage& TestDynamicExtensions::message_extension() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestDynamicExtensions.message_extension)
return message_extension_ != NULL ? *message_extension_ : *default_instance_->message_extension_;
}
inline ::protobuf_unittest::ForeignMessage* TestDynamicExtensions::mutable_message_extension() {
set_has_message_extension();
if (message_extension_ == NULL) {
_slow_mutable_message_extension();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestDynamicExtensions.message_extension)
return message_extension_;
}
inline ::protobuf_unittest::ForeignMessage* TestDynamicExtensions::release_message_extension() {
clear_has_message_extension();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_message_extension();
} else {
::protobuf_unittest::ForeignMessage* temp = message_extension_;
message_extension_ = NULL;
return temp;
}
}
inline void TestDynamicExtensions::set_allocated_message_extension(::protobuf_unittest::ForeignMessage* message_extension) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete message_extension_;
}
if (message_extension != NULL) {
_slow_set_allocated_message_extension(message_arena, &message_extension);
}
message_extension_ = message_extension;
if (message_extension) {
set_has_message_extension();
} else {
clear_has_message_extension();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestDynamicExtensions.message_extension)
}
// optional .protobuf_unittest.TestDynamicExtensions.DynamicMessageType dynamic_message_extension = 2004;
inline bool TestDynamicExtensions::has_dynamic_message_extension() const {
return (_has_bits_[0] & 0x00000010u) != 0;
}
inline void TestDynamicExtensions::set_has_dynamic_message_extension() {
_has_bits_[0] |= 0x00000010u;
}
inline void TestDynamicExtensions::clear_has_dynamic_message_extension() {
_has_bits_[0] &= ~0x00000010u;
}
inline void TestDynamicExtensions::clear_dynamic_message_extension() {
if (dynamic_message_extension_ != NULL) dynamic_message_extension_->::protobuf_unittest::TestDynamicExtensions_DynamicMessageType::Clear();
clear_has_dynamic_message_extension();
}
inline const ::protobuf_unittest::TestDynamicExtensions_DynamicMessageType& TestDynamicExtensions::dynamic_message_extension() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestDynamicExtensions.dynamic_message_extension)
return dynamic_message_extension_ != NULL ? *dynamic_message_extension_ : *default_instance_->dynamic_message_extension_;
}
inline ::protobuf_unittest::TestDynamicExtensions_DynamicMessageType* TestDynamicExtensions::mutable_dynamic_message_extension() {
set_has_dynamic_message_extension();
if (dynamic_message_extension_ == NULL) {
_slow_mutable_dynamic_message_extension();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestDynamicExtensions.dynamic_message_extension)
return dynamic_message_extension_;
}
inline ::protobuf_unittest::TestDynamicExtensions_DynamicMessageType* TestDynamicExtensions::release_dynamic_message_extension() {
clear_has_dynamic_message_extension();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_dynamic_message_extension();
} else {
::protobuf_unittest::TestDynamicExtensions_DynamicMessageType* temp = dynamic_message_extension_;
dynamic_message_extension_ = NULL;
return temp;
}
}
inline void TestDynamicExtensions::set_allocated_dynamic_message_extension(::protobuf_unittest::TestDynamicExtensions_DynamicMessageType* dynamic_message_extension) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete dynamic_message_extension_;
}
if (dynamic_message_extension != NULL) {
_slow_set_allocated_dynamic_message_extension(message_arena, &dynamic_message_extension);
}
dynamic_message_extension_ = dynamic_message_extension;
if (dynamic_message_extension) {
set_has_dynamic_message_extension();
} else {
clear_has_dynamic_message_extension();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestDynamicExtensions.dynamic_message_extension)
}
// repeated string repeated_extension = 2005;
inline int TestDynamicExtensions::repeated_extension_size() const {
return repeated_extension_.size();
}
inline void TestDynamicExtensions::clear_repeated_extension() {
repeated_extension_.Clear();
}
inline const ::std::string& TestDynamicExtensions::repeated_extension(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestDynamicExtensions.repeated_extension)
return repeated_extension_.Get(index);
}
inline ::std::string* TestDynamicExtensions::mutable_repeated_extension(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestDynamicExtensions.repeated_extension)
return repeated_extension_.Mutable(index);
}
inline void TestDynamicExtensions::set_repeated_extension(int index, const ::std::string& value) {
// @@protoc_insertion_point(field_set:protobuf_unittest.TestDynamicExtensions.repeated_extension)
repeated_extension_.Mutable(index)->assign(value);
}
inline void TestDynamicExtensions::set_repeated_extension(int index, const char* value) {
repeated_extension_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestDynamicExtensions.repeated_extension)
}
inline void TestDynamicExtensions::set_repeated_extension(int index, const char* value, size_t size) {
repeated_extension_.Mutable(index)->assign(
reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestDynamicExtensions.repeated_extension)
}
inline ::std::string* TestDynamicExtensions::add_repeated_extension() {
return repeated_extension_.Add();
}
inline void TestDynamicExtensions::add_repeated_extension(const ::std::string& value) {
repeated_extension_.Add()->assign(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestDynamicExtensions.repeated_extension)
}
inline void TestDynamicExtensions::add_repeated_extension(const char* value) {
repeated_extension_.Add()->assign(value);
// @@protoc_insertion_point(field_add_char:protobuf_unittest.TestDynamicExtensions.repeated_extension)
}
inline void TestDynamicExtensions::add_repeated_extension(const char* value, size_t size) {
repeated_extension_.Add()->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_add_pointer:protobuf_unittest.TestDynamicExtensions.repeated_extension)
}
inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
TestDynamicExtensions::repeated_extension() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestDynamicExtensions.repeated_extension)
return repeated_extension_;
}
inline ::google::protobuf::RepeatedPtrField< ::std::string>*
TestDynamicExtensions::mutable_repeated_extension() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestDynamicExtensions.repeated_extension)
return &repeated_extension_;
}
// repeated sint32 packed_extension = 2006 [packed = true];
inline int TestDynamicExtensions::packed_extension_size() const {
return packed_extension_.size();
}
inline void TestDynamicExtensions::clear_packed_extension() {
packed_extension_.Clear();
}
inline ::google::protobuf::int32 TestDynamicExtensions::packed_extension(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestDynamicExtensions.packed_extension)
return packed_extension_.Get(index);
}
inline void TestDynamicExtensions::set_packed_extension(int index, ::google::protobuf::int32 value) {
packed_extension_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestDynamicExtensions.packed_extension)
}
inline void TestDynamicExtensions::add_packed_extension(::google::protobuf::int32 value) {
packed_extension_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestDynamicExtensions.packed_extension)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
TestDynamicExtensions::packed_extension() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestDynamicExtensions.packed_extension)
return packed_extension_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
TestDynamicExtensions::mutable_packed_extension() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestDynamicExtensions.packed_extension)
return &packed_extension_;
}
// -------------------------------------------------------------------
// TestRepeatedScalarDifferentTagSizes
// repeated fixed32 repeated_fixed32 = 12;
inline int TestRepeatedScalarDifferentTagSizes::repeated_fixed32_size() const {
return repeated_fixed32_.size();
}
inline void TestRepeatedScalarDifferentTagSizes::clear_repeated_fixed32() {
repeated_fixed32_.Clear();
}
inline ::google::protobuf::uint32 TestRepeatedScalarDifferentTagSizes::repeated_fixed32(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_fixed32)
return repeated_fixed32_.Get(index);
}
inline void TestRepeatedScalarDifferentTagSizes::set_repeated_fixed32(int index, ::google::protobuf::uint32 value) {
repeated_fixed32_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_fixed32)
}
inline void TestRepeatedScalarDifferentTagSizes::add_repeated_fixed32(::google::protobuf::uint32 value) {
repeated_fixed32_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_fixed32)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
TestRepeatedScalarDifferentTagSizes::repeated_fixed32() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_fixed32)
return repeated_fixed32_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
TestRepeatedScalarDifferentTagSizes::mutable_repeated_fixed32() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_fixed32)
return &repeated_fixed32_;
}
// repeated int32 repeated_int32 = 13;
inline int TestRepeatedScalarDifferentTagSizes::repeated_int32_size() const {
return repeated_int32_.size();
}
inline void TestRepeatedScalarDifferentTagSizes::clear_repeated_int32() {
repeated_int32_.Clear();
}
inline ::google::protobuf::int32 TestRepeatedScalarDifferentTagSizes::repeated_int32(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_int32)
return repeated_int32_.Get(index);
}
inline void TestRepeatedScalarDifferentTagSizes::set_repeated_int32(int index, ::google::protobuf::int32 value) {
repeated_int32_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_int32)
}
inline void TestRepeatedScalarDifferentTagSizes::add_repeated_int32(::google::protobuf::int32 value) {
repeated_int32_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_int32)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
TestRepeatedScalarDifferentTagSizes::repeated_int32() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_int32)
return repeated_int32_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
TestRepeatedScalarDifferentTagSizes::mutable_repeated_int32() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_int32)
return &repeated_int32_;
}
// repeated fixed64 repeated_fixed64 = 2046;
inline int TestRepeatedScalarDifferentTagSizes::repeated_fixed64_size() const {
return repeated_fixed64_.size();
}
inline void TestRepeatedScalarDifferentTagSizes::clear_repeated_fixed64() {
repeated_fixed64_.Clear();
}
inline ::google::protobuf::uint64 TestRepeatedScalarDifferentTagSizes::repeated_fixed64(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_fixed64)
return repeated_fixed64_.Get(index);
}
inline void TestRepeatedScalarDifferentTagSizes::set_repeated_fixed64(int index, ::google::protobuf::uint64 value) {
repeated_fixed64_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_fixed64)
}
inline void TestRepeatedScalarDifferentTagSizes::add_repeated_fixed64(::google::protobuf::uint64 value) {
repeated_fixed64_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_fixed64)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
TestRepeatedScalarDifferentTagSizes::repeated_fixed64() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_fixed64)
return repeated_fixed64_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
TestRepeatedScalarDifferentTagSizes::mutable_repeated_fixed64() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_fixed64)
return &repeated_fixed64_;
}
// repeated int64 repeated_int64 = 2047;
inline int TestRepeatedScalarDifferentTagSizes::repeated_int64_size() const {
return repeated_int64_.size();
}
inline void TestRepeatedScalarDifferentTagSizes::clear_repeated_int64() {
repeated_int64_.Clear();
}
inline ::google::protobuf::int64 TestRepeatedScalarDifferentTagSizes::repeated_int64(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_int64)
return repeated_int64_.Get(index);
}
inline void TestRepeatedScalarDifferentTagSizes::set_repeated_int64(int index, ::google::protobuf::int64 value) {
repeated_int64_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_int64)
}
inline void TestRepeatedScalarDifferentTagSizes::add_repeated_int64(::google::protobuf::int64 value) {
repeated_int64_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_int64)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
TestRepeatedScalarDifferentTagSizes::repeated_int64() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_int64)
return repeated_int64_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
TestRepeatedScalarDifferentTagSizes::mutable_repeated_int64() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_int64)
return &repeated_int64_;
}
// repeated float repeated_float = 262142;
inline int TestRepeatedScalarDifferentTagSizes::repeated_float_size() const {
return repeated_float_.size();
}
inline void TestRepeatedScalarDifferentTagSizes::clear_repeated_float() {
repeated_float_.Clear();
}
inline float TestRepeatedScalarDifferentTagSizes::repeated_float(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_float)
return repeated_float_.Get(index);
}
inline void TestRepeatedScalarDifferentTagSizes::set_repeated_float(int index, float value) {
repeated_float_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_float)
}
inline void TestRepeatedScalarDifferentTagSizes::add_repeated_float(float value) {
repeated_float_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_float)
}
inline const ::google::protobuf::RepeatedField< float >&
TestRepeatedScalarDifferentTagSizes::repeated_float() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_float)
return repeated_float_;
}
inline ::google::protobuf::RepeatedField< float >*
TestRepeatedScalarDifferentTagSizes::mutable_repeated_float() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_float)
return &repeated_float_;
}
// repeated uint64 repeated_uint64 = 262143;
inline int TestRepeatedScalarDifferentTagSizes::repeated_uint64_size() const {
return repeated_uint64_.size();
}
inline void TestRepeatedScalarDifferentTagSizes::clear_repeated_uint64() {
repeated_uint64_.Clear();
}
inline ::google::protobuf::uint64 TestRepeatedScalarDifferentTagSizes::repeated_uint64(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_uint64)
return repeated_uint64_.Get(index);
}
inline void TestRepeatedScalarDifferentTagSizes::set_repeated_uint64(int index, ::google::protobuf::uint64 value) {
repeated_uint64_.Set(index, value);
// @@protoc_insertion_point(field_set:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_uint64)
}
inline void TestRepeatedScalarDifferentTagSizes::add_repeated_uint64(::google::protobuf::uint64 value) {
repeated_uint64_.Add(value);
// @@protoc_insertion_point(field_add:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_uint64)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
TestRepeatedScalarDifferentTagSizes::repeated_uint64() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_uint64)
return repeated_uint64_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
TestRepeatedScalarDifferentTagSizes::mutable_repeated_uint64() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestRepeatedScalarDifferentTagSizes.repeated_uint64)
return &repeated_uint64_;
}
// -------------------------------------------------------------------
// TestParsingMerge_RepeatedFieldsGenerator_Group1
// optional .protobuf_unittest.TestAllTypes field1 = 11;
inline bool TestParsingMerge_RepeatedFieldsGenerator_Group1::has_field1() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestParsingMerge_RepeatedFieldsGenerator_Group1::set_has_field1() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestParsingMerge_RepeatedFieldsGenerator_Group1::clear_has_field1() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestParsingMerge_RepeatedFieldsGenerator_Group1::clear_field1() {
if (field1_ != NULL) field1_->::protobuf_unittest::TestAllTypes::Clear();
clear_has_field1();
}
inline const ::protobuf_unittest::TestAllTypes& TestParsingMerge_RepeatedFieldsGenerator_Group1::field1() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.Group1.field1)
return field1_ != NULL ? *field1_ : *default_instance_->field1_;
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge_RepeatedFieldsGenerator_Group1::mutable_field1() {
set_has_field1();
if (field1_ == NULL) {
_slow_mutable_field1();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.Group1.field1)
return field1_;
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge_RepeatedFieldsGenerator_Group1::release_field1() {
clear_has_field1();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_field1();
} else {
::protobuf_unittest::TestAllTypes* temp = field1_;
field1_ = NULL;
return temp;
}
}
inline void TestParsingMerge_RepeatedFieldsGenerator_Group1::set_allocated_field1(::protobuf_unittest::TestAllTypes* field1) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete field1_;
}
if (field1 != NULL) {
_slow_set_allocated_field1(message_arena, &field1);
}
field1_ = field1;
if (field1) {
set_has_field1();
} else {
clear_has_field1();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.Group1.field1)
}
// -------------------------------------------------------------------
// TestParsingMerge_RepeatedFieldsGenerator_Group2
// optional .protobuf_unittest.TestAllTypes field1 = 21;
inline bool TestParsingMerge_RepeatedFieldsGenerator_Group2::has_field1() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestParsingMerge_RepeatedFieldsGenerator_Group2::set_has_field1() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestParsingMerge_RepeatedFieldsGenerator_Group2::clear_has_field1() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestParsingMerge_RepeatedFieldsGenerator_Group2::clear_field1() {
if (field1_ != NULL) field1_->::protobuf_unittest::TestAllTypes::Clear();
clear_has_field1();
}
inline const ::protobuf_unittest::TestAllTypes& TestParsingMerge_RepeatedFieldsGenerator_Group2::field1() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.Group2.field1)
return field1_ != NULL ? *field1_ : *default_instance_->field1_;
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge_RepeatedFieldsGenerator_Group2::mutable_field1() {
set_has_field1();
if (field1_ == NULL) {
_slow_mutable_field1();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.Group2.field1)
return field1_;
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge_RepeatedFieldsGenerator_Group2::release_field1() {
clear_has_field1();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_field1();
} else {
::protobuf_unittest::TestAllTypes* temp = field1_;
field1_ = NULL;
return temp;
}
}
inline void TestParsingMerge_RepeatedFieldsGenerator_Group2::set_allocated_field1(::protobuf_unittest::TestAllTypes* field1) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete field1_;
}
if (field1 != NULL) {
_slow_set_allocated_field1(message_arena, &field1);
}
field1_ = field1;
if (field1) {
set_has_field1();
} else {
clear_has_field1();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.Group2.field1)
}
// -------------------------------------------------------------------
// TestParsingMerge_RepeatedFieldsGenerator
// repeated .protobuf_unittest.TestAllTypes field1 = 1;
inline int TestParsingMerge_RepeatedFieldsGenerator::field1_size() const {
return field1_.size();
}
inline void TestParsingMerge_RepeatedFieldsGenerator::clear_field1() {
field1_.Clear();
}
inline const ::protobuf_unittest::TestAllTypes& TestParsingMerge_RepeatedFieldsGenerator::field1(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.field1)
return field1_.Get(index);
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge_RepeatedFieldsGenerator::mutable_field1(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.field1)
return field1_.Mutable(index);
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge_RepeatedFieldsGenerator::add_field1() {
// @@protoc_insertion_point(field_add:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.field1)
return field1_.Add();
}
inline ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >*
TestParsingMerge_RepeatedFieldsGenerator::mutable_field1() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.field1)
return &field1_;
}
inline const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >&
TestParsingMerge_RepeatedFieldsGenerator::field1() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.field1)
return field1_;
}
// repeated .protobuf_unittest.TestAllTypes field2 = 2;
inline int TestParsingMerge_RepeatedFieldsGenerator::field2_size() const {
return field2_.size();
}
inline void TestParsingMerge_RepeatedFieldsGenerator::clear_field2() {
field2_.Clear();
}
inline const ::protobuf_unittest::TestAllTypes& TestParsingMerge_RepeatedFieldsGenerator::field2(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.field2)
return field2_.Get(index);
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge_RepeatedFieldsGenerator::mutable_field2(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.field2)
return field2_.Mutable(index);
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge_RepeatedFieldsGenerator::add_field2() {
// @@protoc_insertion_point(field_add:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.field2)
return field2_.Add();
}
inline ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >*
TestParsingMerge_RepeatedFieldsGenerator::mutable_field2() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.field2)
return &field2_;
}
inline const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >&
TestParsingMerge_RepeatedFieldsGenerator::field2() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.field2)
return field2_;
}
// repeated .protobuf_unittest.TestAllTypes field3 = 3;
inline int TestParsingMerge_RepeatedFieldsGenerator::field3_size() const {
return field3_.size();
}
inline void TestParsingMerge_RepeatedFieldsGenerator::clear_field3() {
field3_.Clear();
}
inline const ::protobuf_unittest::TestAllTypes& TestParsingMerge_RepeatedFieldsGenerator::field3(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.field3)
return field3_.Get(index);
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge_RepeatedFieldsGenerator::mutable_field3(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.field3)
return field3_.Mutable(index);
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge_RepeatedFieldsGenerator::add_field3() {
// @@protoc_insertion_point(field_add:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.field3)
return field3_.Add();
}
inline ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >*
TestParsingMerge_RepeatedFieldsGenerator::mutable_field3() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.field3)
return &field3_;
}
inline const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >&
TestParsingMerge_RepeatedFieldsGenerator::field3() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.field3)
return field3_;
}
// repeated group Group1 = 10 { ... };
inline int TestParsingMerge_RepeatedFieldsGenerator::group1_size() const {
return group1_.size();
}
inline void TestParsingMerge_RepeatedFieldsGenerator::clear_group1() {
group1_.Clear();
}
inline const ::protobuf_unittest::TestParsingMerge_RepeatedFieldsGenerator_Group1& TestParsingMerge_RepeatedFieldsGenerator::group1(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.group1)
return group1_.Get(index);
}
inline ::protobuf_unittest::TestParsingMerge_RepeatedFieldsGenerator_Group1* TestParsingMerge_RepeatedFieldsGenerator::mutable_group1(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.group1)
return group1_.Mutable(index);
}
inline ::protobuf_unittest::TestParsingMerge_RepeatedFieldsGenerator_Group1* TestParsingMerge_RepeatedFieldsGenerator::add_group1() {
// @@protoc_insertion_point(field_add:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.group1)
return group1_.Add();
}
inline ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestParsingMerge_RepeatedFieldsGenerator_Group1 >*
TestParsingMerge_RepeatedFieldsGenerator::mutable_group1() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.group1)
return &group1_;
}
inline const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestParsingMerge_RepeatedFieldsGenerator_Group1 >&
TestParsingMerge_RepeatedFieldsGenerator::group1() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.group1)
return group1_;
}
// repeated group Group2 = 20 { ... };
inline int TestParsingMerge_RepeatedFieldsGenerator::group2_size() const {
return group2_.size();
}
inline void TestParsingMerge_RepeatedFieldsGenerator::clear_group2() {
group2_.Clear();
}
inline const ::protobuf_unittest::TestParsingMerge_RepeatedFieldsGenerator_Group2& TestParsingMerge_RepeatedFieldsGenerator::group2(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.group2)
return group2_.Get(index);
}
inline ::protobuf_unittest::TestParsingMerge_RepeatedFieldsGenerator_Group2* TestParsingMerge_RepeatedFieldsGenerator::mutable_group2(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.group2)
return group2_.Mutable(index);
}
inline ::protobuf_unittest::TestParsingMerge_RepeatedFieldsGenerator_Group2* TestParsingMerge_RepeatedFieldsGenerator::add_group2() {
// @@protoc_insertion_point(field_add:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.group2)
return group2_.Add();
}
inline ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestParsingMerge_RepeatedFieldsGenerator_Group2 >*
TestParsingMerge_RepeatedFieldsGenerator::mutable_group2() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.group2)
return &group2_;
}
inline const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestParsingMerge_RepeatedFieldsGenerator_Group2 >&
TestParsingMerge_RepeatedFieldsGenerator::group2() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.group2)
return group2_;
}
// repeated .protobuf_unittest.TestAllTypes ext1 = 1000;
inline int TestParsingMerge_RepeatedFieldsGenerator::ext1_size() const {
return ext1_.size();
}
inline void TestParsingMerge_RepeatedFieldsGenerator::clear_ext1() {
ext1_.Clear();
}
inline const ::protobuf_unittest::TestAllTypes& TestParsingMerge_RepeatedFieldsGenerator::ext1(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.ext1)
return ext1_.Get(index);
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge_RepeatedFieldsGenerator::mutable_ext1(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.ext1)
return ext1_.Mutable(index);
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge_RepeatedFieldsGenerator::add_ext1() {
// @@protoc_insertion_point(field_add:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.ext1)
return ext1_.Add();
}
inline ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >*
TestParsingMerge_RepeatedFieldsGenerator::mutable_ext1() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.ext1)
return &ext1_;
}
inline const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >&
TestParsingMerge_RepeatedFieldsGenerator::ext1() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.ext1)
return ext1_;
}
// repeated .protobuf_unittest.TestAllTypes ext2 = 1001;
inline int TestParsingMerge_RepeatedFieldsGenerator::ext2_size() const {
return ext2_.size();
}
inline void TestParsingMerge_RepeatedFieldsGenerator::clear_ext2() {
ext2_.Clear();
}
inline const ::protobuf_unittest::TestAllTypes& TestParsingMerge_RepeatedFieldsGenerator::ext2(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.ext2)
return ext2_.Get(index);
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge_RepeatedFieldsGenerator::mutable_ext2(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.ext2)
return ext2_.Mutable(index);
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge_RepeatedFieldsGenerator::add_ext2() {
// @@protoc_insertion_point(field_add:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.ext2)
return ext2_.Add();
}
inline ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >*
TestParsingMerge_RepeatedFieldsGenerator::mutable_ext2() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.ext2)
return &ext2_;
}
inline const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >&
TestParsingMerge_RepeatedFieldsGenerator::ext2() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.ext2)
return ext2_;
}
// -------------------------------------------------------------------
// TestParsingMerge_OptionalGroup
// optional .protobuf_unittest.TestAllTypes optional_group_all_types = 11;
inline bool TestParsingMerge_OptionalGroup::has_optional_group_all_types() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestParsingMerge_OptionalGroup::set_has_optional_group_all_types() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestParsingMerge_OptionalGroup::clear_has_optional_group_all_types() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestParsingMerge_OptionalGroup::clear_optional_group_all_types() {
if (optional_group_all_types_ != NULL) optional_group_all_types_->::protobuf_unittest::TestAllTypes::Clear();
clear_has_optional_group_all_types();
}
inline const ::protobuf_unittest::TestAllTypes& TestParsingMerge_OptionalGroup::optional_group_all_types() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestParsingMerge.OptionalGroup.optional_group_all_types)
return optional_group_all_types_ != NULL ? *optional_group_all_types_ : *default_instance_->optional_group_all_types_;
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge_OptionalGroup::mutable_optional_group_all_types() {
set_has_optional_group_all_types();
if (optional_group_all_types_ == NULL) {
_slow_mutable_optional_group_all_types();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestParsingMerge.OptionalGroup.optional_group_all_types)
return optional_group_all_types_;
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge_OptionalGroup::release_optional_group_all_types() {
clear_has_optional_group_all_types();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_optional_group_all_types();
} else {
::protobuf_unittest::TestAllTypes* temp = optional_group_all_types_;
optional_group_all_types_ = NULL;
return temp;
}
}
inline void TestParsingMerge_OptionalGroup::set_allocated_optional_group_all_types(::protobuf_unittest::TestAllTypes* optional_group_all_types) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete optional_group_all_types_;
}
if (optional_group_all_types != NULL) {
_slow_set_allocated_optional_group_all_types(message_arena, &optional_group_all_types);
}
optional_group_all_types_ = optional_group_all_types;
if (optional_group_all_types) {
set_has_optional_group_all_types();
} else {
clear_has_optional_group_all_types();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestParsingMerge.OptionalGroup.optional_group_all_types)
}
// -------------------------------------------------------------------
// TestParsingMerge_RepeatedGroup
// optional .protobuf_unittest.TestAllTypes repeated_group_all_types = 21;
inline bool TestParsingMerge_RepeatedGroup::has_repeated_group_all_types() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestParsingMerge_RepeatedGroup::set_has_repeated_group_all_types() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestParsingMerge_RepeatedGroup::clear_has_repeated_group_all_types() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestParsingMerge_RepeatedGroup::clear_repeated_group_all_types() {
if (repeated_group_all_types_ != NULL) repeated_group_all_types_->::protobuf_unittest::TestAllTypes::Clear();
clear_has_repeated_group_all_types();
}
inline const ::protobuf_unittest::TestAllTypes& TestParsingMerge_RepeatedGroup::repeated_group_all_types() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestParsingMerge.RepeatedGroup.repeated_group_all_types)
return repeated_group_all_types_ != NULL ? *repeated_group_all_types_ : *default_instance_->repeated_group_all_types_;
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge_RepeatedGroup::mutable_repeated_group_all_types() {
set_has_repeated_group_all_types();
if (repeated_group_all_types_ == NULL) {
_slow_mutable_repeated_group_all_types();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestParsingMerge.RepeatedGroup.repeated_group_all_types)
return repeated_group_all_types_;
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge_RepeatedGroup::release_repeated_group_all_types() {
clear_has_repeated_group_all_types();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_repeated_group_all_types();
} else {
::protobuf_unittest::TestAllTypes* temp = repeated_group_all_types_;
repeated_group_all_types_ = NULL;
return temp;
}
}
inline void TestParsingMerge_RepeatedGroup::set_allocated_repeated_group_all_types(::protobuf_unittest::TestAllTypes* repeated_group_all_types) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete repeated_group_all_types_;
}
if (repeated_group_all_types != NULL) {
_slow_set_allocated_repeated_group_all_types(message_arena, &repeated_group_all_types);
}
repeated_group_all_types_ = repeated_group_all_types;
if (repeated_group_all_types) {
set_has_repeated_group_all_types();
} else {
clear_has_repeated_group_all_types();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestParsingMerge.RepeatedGroup.repeated_group_all_types)
}
// -------------------------------------------------------------------
// TestParsingMerge
// required .protobuf_unittest.TestAllTypes required_all_types = 1;
inline bool TestParsingMerge::has_required_all_types() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestParsingMerge::set_has_required_all_types() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestParsingMerge::clear_has_required_all_types() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestParsingMerge::clear_required_all_types() {
if (required_all_types_ != NULL) required_all_types_->::protobuf_unittest::TestAllTypes::Clear();
clear_has_required_all_types();
}
inline const ::protobuf_unittest::TestAllTypes& TestParsingMerge::required_all_types() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestParsingMerge.required_all_types)
return required_all_types_ != NULL ? *required_all_types_ : *default_instance_->required_all_types_;
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge::mutable_required_all_types() {
set_has_required_all_types();
if (required_all_types_ == NULL) {
_slow_mutable_required_all_types();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestParsingMerge.required_all_types)
return required_all_types_;
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge::release_required_all_types() {
clear_has_required_all_types();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_required_all_types();
} else {
::protobuf_unittest::TestAllTypes* temp = required_all_types_;
required_all_types_ = NULL;
return temp;
}
}
inline void TestParsingMerge::set_allocated_required_all_types(::protobuf_unittest::TestAllTypes* required_all_types) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete required_all_types_;
}
if (required_all_types != NULL) {
_slow_set_allocated_required_all_types(message_arena, &required_all_types);
}
required_all_types_ = required_all_types;
if (required_all_types) {
set_has_required_all_types();
} else {
clear_has_required_all_types();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestParsingMerge.required_all_types)
}
// optional .protobuf_unittest.TestAllTypes optional_all_types = 2;
inline bool TestParsingMerge::has_optional_all_types() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void TestParsingMerge::set_has_optional_all_types() {
_has_bits_[0] |= 0x00000002u;
}
inline void TestParsingMerge::clear_has_optional_all_types() {
_has_bits_[0] &= ~0x00000002u;
}
inline void TestParsingMerge::clear_optional_all_types() {
if (optional_all_types_ != NULL) optional_all_types_->::protobuf_unittest::TestAllTypes::Clear();
clear_has_optional_all_types();
}
inline const ::protobuf_unittest::TestAllTypes& TestParsingMerge::optional_all_types() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestParsingMerge.optional_all_types)
return optional_all_types_ != NULL ? *optional_all_types_ : *default_instance_->optional_all_types_;
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge::mutable_optional_all_types() {
set_has_optional_all_types();
if (optional_all_types_ == NULL) {
_slow_mutable_optional_all_types();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestParsingMerge.optional_all_types)
return optional_all_types_;
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge::release_optional_all_types() {
clear_has_optional_all_types();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_optional_all_types();
} else {
::protobuf_unittest::TestAllTypes* temp = optional_all_types_;
optional_all_types_ = NULL;
return temp;
}
}
inline void TestParsingMerge::set_allocated_optional_all_types(::protobuf_unittest::TestAllTypes* optional_all_types) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete optional_all_types_;
}
if (optional_all_types != NULL) {
_slow_set_allocated_optional_all_types(message_arena, &optional_all_types);
}
optional_all_types_ = optional_all_types;
if (optional_all_types) {
set_has_optional_all_types();
} else {
clear_has_optional_all_types();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestParsingMerge.optional_all_types)
}
// repeated .protobuf_unittest.TestAllTypes repeated_all_types = 3;
inline int TestParsingMerge::repeated_all_types_size() const {
return repeated_all_types_.size();
}
inline void TestParsingMerge::clear_repeated_all_types() {
repeated_all_types_.Clear();
}
inline const ::protobuf_unittest::TestAllTypes& TestParsingMerge::repeated_all_types(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestParsingMerge.repeated_all_types)
return repeated_all_types_.Get(index);
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge::mutable_repeated_all_types(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestParsingMerge.repeated_all_types)
return repeated_all_types_.Mutable(index);
}
inline ::protobuf_unittest::TestAllTypes* TestParsingMerge::add_repeated_all_types() {
// @@protoc_insertion_point(field_add:protobuf_unittest.TestParsingMerge.repeated_all_types)
return repeated_all_types_.Add();
}
inline ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >*
TestParsingMerge::mutable_repeated_all_types() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestParsingMerge.repeated_all_types)
return &repeated_all_types_;
}
inline const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestAllTypes >&
TestParsingMerge::repeated_all_types() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestParsingMerge.repeated_all_types)
return repeated_all_types_;
}
// optional group OptionalGroup = 10 { ... };
inline bool TestParsingMerge::has_optionalgroup() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void TestParsingMerge::set_has_optionalgroup() {
_has_bits_[0] |= 0x00000008u;
}
inline void TestParsingMerge::clear_has_optionalgroup() {
_has_bits_[0] &= ~0x00000008u;
}
inline void TestParsingMerge::clear_optionalgroup() {
if (optionalgroup_ != NULL) optionalgroup_->::protobuf_unittest::TestParsingMerge_OptionalGroup::Clear();
clear_has_optionalgroup();
}
inline const ::protobuf_unittest::TestParsingMerge_OptionalGroup& TestParsingMerge::optionalgroup() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestParsingMerge.optionalgroup)
return optionalgroup_ != NULL ? *optionalgroup_ : *default_instance_->optionalgroup_;
}
inline ::protobuf_unittest::TestParsingMerge_OptionalGroup* TestParsingMerge::mutable_optionalgroup() {
set_has_optionalgroup();
if (optionalgroup_ == NULL) {
_slow_mutable_optionalgroup();
}
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestParsingMerge.optionalgroup)
return optionalgroup_;
}
inline ::protobuf_unittest::TestParsingMerge_OptionalGroup* TestParsingMerge::release_optionalgroup() {
clear_has_optionalgroup();
if (GetArenaNoVirtual() != NULL) {
return _slow_release_optionalgroup();
} else {
::protobuf_unittest::TestParsingMerge_OptionalGroup* temp = optionalgroup_;
optionalgroup_ = NULL;
return temp;
}
}
inline void TestParsingMerge::set_allocated_optionalgroup(::protobuf_unittest::TestParsingMerge_OptionalGroup* optionalgroup) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete optionalgroup_;
}
if (optionalgroup != NULL) {
_slow_set_allocated_optionalgroup(message_arena, &optionalgroup);
}
optionalgroup_ = optionalgroup;
if (optionalgroup) {
set_has_optionalgroup();
} else {
clear_has_optionalgroup();
}
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestParsingMerge.optionalgroup)
}
// repeated group RepeatedGroup = 20 { ... };
inline int TestParsingMerge::repeatedgroup_size() const {
return repeatedgroup_.size();
}
inline void TestParsingMerge::clear_repeatedgroup() {
repeatedgroup_.Clear();
}
inline const ::protobuf_unittest::TestParsingMerge_RepeatedGroup& TestParsingMerge::repeatedgroup(int index) const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestParsingMerge.repeatedgroup)
return repeatedgroup_.Get(index);
}
inline ::protobuf_unittest::TestParsingMerge_RepeatedGroup* TestParsingMerge::mutable_repeatedgroup(int index) {
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestParsingMerge.repeatedgroup)
return repeatedgroup_.Mutable(index);
}
inline ::protobuf_unittest::TestParsingMerge_RepeatedGroup* TestParsingMerge::add_repeatedgroup() {
// @@protoc_insertion_point(field_add:protobuf_unittest.TestParsingMerge.repeatedgroup)
return repeatedgroup_.Add();
}
inline ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestParsingMerge_RepeatedGroup >*
TestParsingMerge::mutable_repeatedgroup() {
// @@protoc_insertion_point(field_mutable_list:protobuf_unittest.TestParsingMerge.repeatedgroup)
return &repeatedgroup_;
}
inline const ::google::protobuf::RepeatedPtrField< ::protobuf_unittest::TestParsingMerge_RepeatedGroup >&
TestParsingMerge::repeatedgroup() const {
// @@protoc_insertion_point(field_list:protobuf_unittest.TestParsingMerge.repeatedgroup)
return repeatedgroup_;
}
// -------------------------------------------------------------------
// TestCommentInjectionMessage
// optional string a = 1 [default = "*/ <- Neither should this."];
inline bool TestCommentInjectionMessage::has_a() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void TestCommentInjectionMessage::set_has_a() {
_has_bits_[0] |= 0x00000001u;
}
inline void TestCommentInjectionMessage::clear_has_a() {
_has_bits_[0] &= ~0x00000001u;
}
inline void TestCommentInjectionMessage::clear_a() {
a_.ClearToDefault(_default_a_, GetArenaNoVirtual());
clear_has_a();
}
inline const ::std::string& TestCommentInjectionMessage::a() const {
// @@protoc_insertion_point(field_get:protobuf_unittest.TestCommentInjectionMessage.a)
return a_.Get(_default_a_);
}
inline void TestCommentInjectionMessage::set_a(const ::std::string& value) {
set_has_a();
a_.Set(_default_a_, value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:protobuf_unittest.TestCommentInjectionMessage.a)
}
inline void TestCommentInjectionMessage::set_a(const char* value) {
set_has_a();
a_.Set(_default_a_, ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:protobuf_unittest.TestCommentInjectionMessage.a)
}
inline void TestCommentInjectionMessage::set_a(const char* value,
size_t size) {
set_has_a();
a_.Set(_default_a_, ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:protobuf_unittest.TestCommentInjectionMessage.a)
}
inline ::std::string* TestCommentInjectionMessage::mutable_a() {
set_has_a();
// @@protoc_insertion_point(field_mutable:protobuf_unittest.TestCommentInjectionMessage.a)
return a_.Mutable(_default_a_, GetArenaNoVirtual());
}
inline ::std::string* TestCommentInjectionMessage::release_a() {
clear_has_a();
return a_.Release(_default_a_, GetArenaNoVirtual());
}
inline ::std::string* TestCommentInjectionMessage::unsafe_arena_release_a() {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
clear_has_a();
return a_.UnsafeArenaRelease(_default_a_,
GetArenaNoVirtual());
}
inline void TestCommentInjectionMessage::set_allocated_a(::std::string* a) {
if (a != NULL) {
set_has_a();
} else {
clear_has_a();
}
a_.SetAllocated(_default_a_, a,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestCommentInjectionMessage.a)
}
inline void TestCommentInjectionMessage::unsafe_arena_set_allocated_a(
::std::string* a) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (a != NULL) {
set_has_a();
} else {
clear_has_a();
}
a_.UnsafeArenaSetAllocated(_default_a_,
a, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:protobuf_unittest.TestCommentInjectionMessage.a)
}
// -------------------------------------------------------------------
// FooRequest
// -------------------------------------------------------------------
// FooResponse
// -------------------------------------------------------------------
// FooClientMessage
// -------------------------------------------------------------------
// FooServerMessage
// -------------------------------------------------------------------
// BarRequest
// -------------------------------------------------------------------
// BarResponse
#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// @@protoc_insertion_point(namespace_scope)
} // namespace protobuf_unittest
#ifndef SWIG
namespace google {
namespace protobuf {
template <> struct is_proto_enum< ::protobuf_unittest::TestAllTypes_NestedEnum> : ::google::protobuf::internal::true_type {};
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::protobuf_unittest::TestAllTypes_NestedEnum>() {
return ::protobuf_unittest::TestAllTypes_NestedEnum_descriptor();
}
template <> struct is_proto_enum< ::protobuf_unittest::TestOneof2_NestedEnum> : ::google::protobuf::internal::true_type {};
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::protobuf_unittest::TestOneof2_NestedEnum>() {
return ::protobuf_unittest::TestOneof2_NestedEnum_descriptor();
}
template <> struct is_proto_enum< ::protobuf_unittest::TestDynamicExtensions_DynamicEnumType> : ::google::protobuf::internal::true_type {};
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::protobuf_unittest::TestDynamicExtensions_DynamicEnumType>() {
return ::protobuf_unittest::TestDynamicExtensions_DynamicEnumType_descriptor();
}
template <> struct is_proto_enum< ::protobuf_unittest::ForeignEnum> : ::google::protobuf::internal::true_type {};
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::protobuf_unittest::ForeignEnum>() {
return ::protobuf_unittest::ForeignEnum_descriptor();
}
template <> struct is_proto_enum< ::protobuf_unittest::TestEnumWithDupValue> : ::google::protobuf::internal::true_type {};
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::protobuf_unittest::TestEnumWithDupValue>() {
return ::protobuf_unittest::TestEnumWithDupValue_descriptor();
}
template <> struct is_proto_enum< ::protobuf_unittest::TestSparseEnum> : ::google::protobuf::internal::true_type {};
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::protobuf_unittest::TestSparseEnum>() {
return ::protobuf_unittest::TestSparseEnum_descriptor();
}
} // namespace protobuf
} // namespace google
#endif // SWIG
// @@protoc_insertion_point(global_scope)
#endif // PROTOBUF_google_2fprotobuf_2funittest_2eproto__INCLUDED
| [
"captcha.yang@dasudian.com"
] | captcha.yang@dasudian.com |
c7e8b4ad741d0125ab4d8f86203ce1d2def61f91 | d7e54f3f3662250e9d8a71dc08e2092503b02abf | /network/net/Socket.h | 71eb8967406504fa31a13c972c73ff47adbdda0f | [
"Apache-2.0"
] | permissive | huxuan0307/Reactor-network-library | ab620efc0b80ff0ad88419e2a59cb4c44fb78023 | 26873ebfc755534bf127aa36af6fba06bb1b5c2f | refs/heads/master | 2022-05-23T21:49:05.834864 | 2020-04-26T18:20:33 | 2020-04-26T18:20:33 | 256,551,239 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 832 | h | #include "network_global.h"
class InetAddress;
class Socket
{
NONCOPYABLE(Socket)
public:
explicit Socket(int sockfd)
: sockfd_{sockfd}
{
}
~Socket();
int fd() const {return sockfd_;}
bool getTcpInfo(struct tcp_info *) const;
// abort if listen error
void bindAddress(const InetAddress& addr);
// abort if listen error
void listen();
// if success, return fd of the accepted socket
// peeraddr contains info of peer client
// if failed, return -1, peeraddr is untouched
int accept(InetAddress* peeraddr);
//
void shutdownWrite();
void setReuseAddr(bool on = true);
void setReusePort(bool on = true);
void setTcpNoDelay(bool on = true);
private:
// 无法更改的socket 句柄
const int sockfd_;
}; | [
"532391012@qq.com"
] | 532391012@qq.com |
c98bb3a0c6d0ef8d3257511cab9f7d887de48662 | 9dfd2390e654dc2c2eed29b58c8a062118b7b8b4 | /chrome/credential_provider/gaiacp/mdm_utils.cc | d0cc525a061383bb7cdf2d21d300c7c7fc60bf57 | [
"BSD-3-Clause"
] | permissive | tongchiyang/chromium | d8136aeefa4646b7b2cf4c859fc84b2f22491e49 | 58cf4e036131385006e9e5b846577be7df717a9c | refs/heads/master | 2023-03-01T18:24:50.959530 | 2020-03-06T07:28:27 | 2020-03-06T07:28:27 | 245,365,574 | 1 | 0 | null | 2020-03-06T08:22:06 | 2020-03-06T08:22:05 | null | UTF-8 | C++ | false | false | 16,713 | cc | // Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/credential_provider/gaiacp/mdm_utils.h"
#include <windows.h>
#include <winternl.h>
#include <lm.h> // Needed for PNTSTATUS
#define _NTDEF_ // Prevent redefition errors, must come after <winternl.h>
#include <MDMRegistration.h> // For RegisterDeviceWithManagement()
#include <ntsecapi.h> // For LsaQueryInformationPolicy()
#include <atlconv.h>
#include "base/base64.h"
#include "base/files/file_path.h"
#include "base/json/json_writer.h"
#include "base/scoped_native_library.h"
#include "base/stl_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/win/win_util.h"
#include "base/win/wmi.h"
#include "build/branding_buildflags.h"
#include "chrome/credential_provider/common/gcp_strings.h"
#include "chrome/credential_provider/gaiacp/gcp_utils.h"
#include "chrome/credential_provider/gaiacp/gcpw_strings.h"
#include "chrome/credential_provider/gaiacp/logging.h"
#include "chrome/credential_provider/gaiacp/reg_utils.h"
namespace credential_provider {
constexpr wchar_t kRegEnableVerboseLogging[] = L"enable_verbose_logging";
constexpr wchar_t kRegInitializeCrashReporting[] = L"enable_crash_reporting";
constexpr wchar_t kRegMdmUrl[] = L"mdm";
constexpr wchar_t kRegEnableDmEnrollment[] = L"enable_dm_enrollment";
constexpr wchar_t kRegMdmEnableForcePasswordReset[] =
L"enable_force_reset_password_option";
constexpr wchar_t kRegDisablePasswordSync[] = L"disable_password_sync";
constexpr wchar_t kRegMdmSupportsMultiUser[] = L"enable_multi_user_login";
constexpr wchar_t kRegMdmAllowConsumerAccounts[] = L"enable_consumer_accounts ";
constexpr wchar_t kRegDeviceDetailsUploadStatus[] =
L"device_details_upload_status";
constexpr wchar_t kRegGlsPath[] = L"gls_path";
constexpr wchar_t kUserPasswordLsaStoreKeyPrefix[] =
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
L"Chrome-GCPW-";
#else
L"Chromium-GCPW-";
#endif
const char kErrorKeyInRequestResult[] = "error";
// Overridden in tests to force the MDM enrollment to either succeed or fail.
enum class EnrollmentStatus {
kForceSuccess,
kForceFailure,
kDontForce,
};
EnrollmentStatus g_enrollment_status = EnrollmentStatus::kDontForce;
// Overridden in tests to force the MDM enrollment check to either return true
// or false.
enum class EnrolledStatus {
kForceTrue,
kForceFalse,
kDontForce,
};
EnrolledStatus g_enrolled_status = EnrolledStatus::kDontForce;
#if !BUILDFLAG(GOOGLE_CHROME_BRANDING)
enum class EscrowServiceStatus {
kDisabled,
kEnabled,
};
EscrowServiceStatus g_escrow_service_enabled = EscrowServiceStatus::kDisabled;
#endif
enum class DeviceDetailsUploadNeeded {
kForceTrue,
kForceFalse,
kDontForce,
};
DeviceDetailsUploadNeeded g_device_details_upload_needed =
DeviceDetailsUploadNeeded::kDontForce;
namespace {
constexpr wchar_t kDefaultMdmUrl[] =
L"https://deviceenrollmentforwindows.googleapis.com/v1/discovery";
constexpr wchar_t kDefaultEscrowServiceServerUrl[] =
L"https://devicepasswordescrowforwindows-pa.googleapis.com";
template <typename T>
T GetMdmFunctionPointer(const base::ScopedNativeLibrary& library,
const char* function_name) {
if (!library.is_valid())
return nullptr;
return reinterpret_cast<T>(library.GetFunctionPointer(function_name));
}
#define GET_MDM_FUNCTION_POINTER(library, name) \
GetMdmFunctionPointer<decltype(&::name)>(library, #name)
base::string16 GetMdmUrl() {
DWORD enable_dm_enrollment;
HRESULT hr = GetGlobalFlag(kRegEnableDmEnrollment, &enable_dm_enrollment);
if (SUCCEEDED(hr)) {
if (enable_dm_enrollment)
return kDefaultMdmUrl;
return L"";
}
// Fallback to using the older flag to control mdm url.
return GetGlobalFlagOrDefault(kRegMdmUrl, kDefaultMdmUrl);
}
bool IsEnrolledWithGoogleMdm(const base::string16& mdm_url) {
switch (g_enrolled_status) {
case EnrolledStatus::kForceTrue:
return true;
case EnrolledStatus::kForceFalse:
return false;
case EnrolledStatus::kDontForce:
break;
}
base::ScopedNativeLibrary library(
base::FilePath(FILE_PATH_LITERAL("MDMRegistration.dll")));
auto get_device_registration_info_function =
GET_MDM_FUNCTION_POINTER(library, GetDeviceRegistrationInfo);
if (!get_device_registration_info_function) {
// On Windows < 1803 the function GetDeviceRegistrationInfo does not exist
// in MDMRegistration.dll so we have to fallback to the less accurate
// IsDeviceRegisteredWithManagement. This can return false positives if the
// machine is registered to MDM but to a different server.
LOGFN(ERROR) << "GET_MDM_FUNCTION_POINTER(GetDeviceRegistrationInfo)";
auto is_device_registered_with_management_function =
GET_MDM_FUNCTION_POINTER(library, IsDeviceRegisteredWithManagement);
if (!is_device_registered_with_management_function) {
LOGFN(ERROR)
<< "GET_MDM_FUNCTION_POINTER(IsDeviceRegisteredWithManagement)";
return false;
} else {
BOOL is_managed = FALSE;
HRESULT hr = is_device_registered_with_management_function(&is_managed, 0,
nullptr);
return SUCCEEDED(hr) && is_managed;
}
}
MANAGEMENT_REGISTRATION_INFO* info;
HRESULT hr = get_device_registration_info_function(
DeviceRegistrationBasicInfo, reinterpret_cast<void**>(&info));
bool is_enrolled = SUCCEEDED(hr) && info->fDeviceRegisteredWithManagement &&
GURL(mdm_url) == GURL(info->pszMDMServiceUri);
if (SUCCEEDED(hr))
::HeapFree(::GetProcessHeap(), 0, info);
return is_enrolled;
}
HRESULT ExtractRegistrationData(const base::Value& registration_data,
base::string16* out_email,
base::string16* out_id_token,
base::string16* out_access_token,
base::string16* out_sid,
base::string16* out_username,
base::string16* out_domain,
base::string16* out_is_ad_user_joined) {
DCHECK(out_email);
DCHECK(out_id_token);
DCHECK(out_access_token);
DCHECK(out_sid);
DCHECK(out_username);
DCHECK(out_domain);
DCHECK(out_is_ad_user_joined);
if (!registration_data.is_dict()) {
LOGFN(ERROR) << "Registration data is not a dictionary";
return E_INVALIDARG;
}
*out_email = GetDictString(registration_data, kKeyEmail);
*out_id_token = GetDictString(registration_data, kKeyMdmIdToken);
*out_access_token = GetDictString(registration_data, kKeyAccessToken);
*out_sid = GetDictString(registration_data, kKeySID);
*out_username = GetDictString(registration_data, kKeyUsername);
*out_domain = GetDictString(registration_data, kKeyDomain);
*out_is_ad_user_joined = GetDictString(registration_data, kKeyIsAdJoinedUser);
if (out_email->empty()) {
LOGFN(ERROR) << "Email is empty";
return E_INVALIDARG;
}
if (out_id_token->empty()) {
LOGFN(ERROR) << "MDM id token is empty";
return E_INVALIDARG;
}
if (out_access_token->empty()) {
LOGFN(ERROR) << "Access token is empty";
return E_INVALIDARG;
}
if (out_sid->empty()) {
LOGFN(ERROR) << "SID is empty";
return E_INVALIDARG;
}
if (out_username->empty()) {
LOGFN(ERROR) << "username is empty";
return E_INVALIDARG;
}
if (out_domain->empty()) {
LOGFN(ERROR) << "domain is empty";
return E_INVALIDARG;
}
if (out_is_ad_user_joined->empty()) {
LOGFN(ERROR) << "is_ad_user_joined is empty";
return E_INVALIDARG;
}
return S_OK;
}
// Gets localalized name for builtin administrator account. Extracting
// localized name for builtin administrator account requires DomainSid
// to be passed onto the CreateWellKnownSid function unlike any other
// WellKnownSid as per microsoft documentation. Thats why we need to first
// extract the DomainSid (even for local accounts) and pass it as a
// parameter to the CreateWellKnownSid function call.
HRESULT GetLocalizedNameBuiltinAdministratorAccount(
base::string16* builtin_localized_admin_name) {
LSA_HANDLE PolicyHandle;
static LSA_OBJECT_ATTRIBUTES oa = {sizeof(oa)};
NTSTATUS status =
LsaOpenPolicy(0, &oa, POLICY_VIEW_LOCAL_INFORMATION, &PolicyHandle);
if (status >= 0) {
PPOLICY_ACCOUNT_DOMAIN_INFO ppadi;
status = LsaQueryInformationPolicy(
PolicyHandle, PolicyAccountDomainInformation, (void**)&ppadi);
if (status >= 0) {
BYTE well_known_sid[SECURITY_MAX_SID_SIZE];
DWORD size_local_users_group_sid = base::size(well_known_sid);
if (CreateWellKnownSid(::WinAccountAdministratorSid, ppadi->DomainSid,
well_known_sid, &size_local_users_group_sid)) {
return LookupLocalizedNameBySid(well_known_sid,
builtin_localized_admin_name);
} else {
status = GetLastError();
}
LsaFreeMemory(ppadi);
}
LsaClose(PolicyHandle);
}
return status >= 0 ? S_OK : E_FAIL;
}
HRESULT RegisterWithGoogleDeviceManagement(const base::string16& mdm_url,
const base::Value& properties) {
// Make sure all the needed data is present in the dictionary.
base::string16 email;
base::string16 id_token;
base::string16 access_token;
base::string16 sid;
base::string16 username;
base::string16 domain;
base::string16 is_ad_joined_user;
HRESULT hr =
ExtractRegistrationData(properties, &email, &id_token, &access_token,
&sid, &username, &domain, &is_ad_joined_user);
if (FAILED(hr)) {
LOGFN(ERROR) << "ExtractRegistrationData hr=" << putHR(hr);
return E_INVALIDARG;
}
LOGFN(INFO) << "MDM_URL=" << mdm_url
<< " token=" << base::string16(id_token.c_str(), 10);
// Add the serial number to the registration data dictionary.
base::string16 serial_number = GetSerialNumber();
if (serial_number.empty()) {
LOGFN(ERROR) << "Failed to get serial number.";
return E_FAIL;
}
// Add machine_guid to the registration data dictionary.
base::string16 machine_guid;
hr = GetMachineGuid(&machine_guid);
if (FAILED(hr) || machine_guid.empty()) {
LOGFN(ERROR) << "Failed to get machine guid.";
return FAILED(hr) ? hr : E_FAIL;
}
// Need localized local user group name for Administrators group
// for supporting account elevation scenarios.
base::string16 local_administrators_group_name = L"";
hr = LookupLocalizedNameForWellKnownSid(WinBuiltinAdministratorsSid,
&local_administrators_group_name);
if (FAILED(hr)) {
LOGFN(WARNING) << "Failed to fetch name for administrators group";
}
base::string16 builtin_administrator_name = L"";
hr = GetLocalizedNameBuiltinAdministratorAccount(&builtin_administrator_name);
if (FAILED(hr)) {
LOGFN(WARNING) << "Failed to fetch name for builtin administrator account";
}
// Build the json data needed by the server.
base::Value registration_data(base::Value::Type::DICTIONARY);
registration_data.SetStringKey("id_token", id_token);
registration_data.SetStringKey("access_token", access_token);
registration_data.SetStringKey("sid", sid);
registration_data.SetStringKey("username", username);
registration_data.SetStringKey("domain", domain);
registration_data.SetStringKey("serial_number", serial_number);
registration_data.SetStringKey("machine_guid", machine_guid);
registration_data.SetStringKey("admin_local_user_group_name",
local_administrators_group_name);
registration_data.SetStringKey("builtin_administrator_name",
builtin_administrator_name);
registration_data.SetStringKey(kKeyIsAdJoinedUser, is_ad_joined_user);
std::string registration_data_str;
if (!base::JSONWriter::Write(registration_data, ®istration_data_str)) {
LOGFN(ERROR) << "JSONWriter::Write(registration_data)";
return E_FAIL;
}
switch (g_enrollment_status) {
case EnrollmentStatus::kForceSuccess:
return S_OK;
case EnrollmentStatus::kForceFailure:
return E_FAIL;
case EnrollmentStatus::kDontForce:
break;
}
base::ScopedNativeLibrary library(
base::FilePath(FILE_PATH_LITERAL("MDMRegistration.dll")));
auto register_device_with_management_function =
GET_MDM_FUNCTION_POINTER(library, RegisterDeviceWithManagement);
if (!register_device_with_management_function) {
LOGFN(ERROR) << "GET_MDM_FUNCTION_POINTER(RegisterDeviceWithManagement)";
return false;
}
std::string data_encoded;
base::Base64Encode(registration_data_str, &data_encoded);
// This register call is blocking. It won't return until the machine is
// properly registered with the MDM server.
return register_device_with_management_function(
email.c_str(), mdm_url.c_str(), base::UTF8ToWide(data_encoded).c_str());
}
} // namespace
bool NeedsToEnrollWithMdm() {
base::string16 mdm_url = GetMdmUrl();
return !mdm_url.empty() && !IsEnrolledWithGoogleMdm(mdm_url);
}
bool UploadDeviceDetailsNeeded(const base::string16& sid) {
switch (g_device_details_upload_needed) {
case DeviceDetailsUploadNeeded::kForceTrue:
return true;
case DeviceDetailsUploadNeeded::kForceFalse:
return false;
case DeviceDetailsUploadNeeded::kDontForce:
break;
}
DWORD status = 0;
GetUserProperty(sid, kRegDeviceDetailsUploadStatus, &status);
return status != 1;
}
bool MdmEnrollmentEnabled() {
base::string16 mdm_url = GetMdmUrl();
return !mdm_url.empty();
}
GURL EscrowServiceUrl() {
DWORD disable_password_sync =
GetGlobalFlagOrDefault(kRegDisablePasswordSync, 0);
if (disable_password_sync)
return GURL();
// By default, the password recovery feature should be enabled.
return GURL(base::UTF16ToUTF8(kDefaultEscrowServiceServerUrl));
}
bool PasswordRecoveryEnabled() {
return !EscrowServiceUrl().is_empty();
}
bool IsGemEnabled() {
// The gem features are enabled by default.
return GetGlobalFlagOrDefault(kKeyEnableGemFeatures, 1);
}
HRESULT EnrollToGoogleMdmIfNeeded(const base::Value& properties) {
LOGFN(VERBOSE);
// Only enroll with MDM if configured.
base::string16 mdm_url = GetMdmUrl();
if (mdm_url.empty())
return S_OK;
// TODO(crbug.com/935577): Check if machine is already enrolled because
// attempting to enroll when already enrolled causes a crash.
if (IsEnrolledWithGoogleMdm(mdm_url)) {
LOGFN(VERBOSE) << "Already enrolled to Google MDM";
return S_OK;
}
HRESULT hr = RegisterWithGoogleDeviceManagement(mdm_url, properties);
if (FAILED(hr))
LOGFN(ERROR) << "RegisterWithGoogleDeviceManagement hr=" << putHR(hr);
return hr;
}
base::string16 GetUserPasswordLsaStoreKey(const base::string16& sid) {
DCHECK(sid.size());
return kUserPasswordLsaStoreKeyPrefix + sid;
}
// GoogleMdmEnrollmentStatusForTesting ////////////////////////////////////////
GoogleMdmEnrollmentStatusForTesting::GoogleMdmEnrollmentStatusForTesting(
bool success) {
g_enrollment_status = success ? EnrollmentStatus::kForceSuccess
: EnrollmentStatus::kForceFailure;
}
GoogleMdmEnrollmentStatusForTesting::~GoogleMdmEnrollmentStatusForTesting() {
g_enrollment_status = EnrollmentStatus::kDontForce;
}
// GoogleMdmEnrolledStatusForTesting //////////////////////////////////////////
GoogleMdmEnrolledStatusForTesting::GoogleMdmEnrolledStatusForTesting(
bool success) {
g_enrolled_status =
success ? EnrolledStatus::kForceTrue : EnrolledStatus::kForceFalse;
}
GoogleMdmEnrolledStatusForTesting::~GoogleMdmEnrolledStatusForTesting() {
g_enrolled_status = EnrolledStatus::kDontForce;
}
// GoogleMdmEnrolledStatusForTesting //////////////////////////////////////////
// GoogleUploadDeviceDetailsNeededForTesting //////////////////////////////////
GoogleUploadDeviceDetailsNeededForTesting::
GoogleUploadDeviceDetailsNeededForTesting(bool success) {
g_device_details_upload_needed = success
? DeviceDetailsUploadNeeded::kForceTrue
: DeviceDetailsUploadNeeded::kForceFalse;
}
GoogleUploadDeviceDetailsNeededForTesting::
~GoogleUploadDeviceDetailsNeededForTesting() {
g_device_details_upload_needed = DeviceDetailsUploadNeeded::kDontForce;
}
// GoogleUploadDeviceDetailsNeededForTesting //////////////////////////////////
} // namespace credential_provider
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
6c19de51c3a4e85e6a35dfe6d6f0faa8f7d7e47c | a586699434fe7f563c2004a755a7d108d743bf9b | /IMC/Spec/CoverArea.hpp | b48b28892d49357331d57f3d265989701ccd10a2 | [] | no_license | nikkone/ho5_imc_ttk22 | 73394d6c70ef72175f236d0371f411a74b3081dc | 046b587b54530236c24817c34c35f8d5745106d2 | refs/heads/master | 2020-07-12T21:54:21.564794 | 2019-08-28T11:26:23 | 2019-08-28T11:26:23 | 204,915,158 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,834 | hpp | //***************************************************************************
// Copyright 2017 OceanScan - Marine Systems & Technology, Lda. *
//***************************************************************************
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. *
// You may obtain a copy of the License at *
// *
// http://www.apache.org/licenses/LICENSE-2.0 *
// *
// Unless required by applicable law or agreed to in writing, software *
// distributed under the License is distributed on an "AS IS" BASIS, *
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
// See the License for the specific language governing permissions and *
// limitations under the License. *
//***************************************************************************
// Author: Ricardo Martins *
//***************************************************************************
// Automatically generated. *
//***************************************************************************
// IMC XML MD5: 0adc43a7ddd00a255e2ea47f969c64aa *
//***************************************************************************
#ifndef IMC_COVERAREA_HPP_INCLUDED_
#define IMC_COVERAREA_HPP_INCLUDED_
// ISO C++ 98 headers.
#include <ostream>
#include <string>
#include <vector>
// IMC headers.
#include <IMC/Base/Config.hpp>
#include <IMC/Base/Message.hpp>
#include <IMC/Base/InlineMessage.hpp>
#include <IMC/Base/MessageList.hpp>
#include <IMC/Base/JSON.hpp>
#include <IMC/Base/Serialization.hpp>
#include <IMC/Spec/Enumerations.hpp>
#include <IMC/Spec/Bitfields.hpp>
#include <IMC/Spec/PolygonVertex.hpp>
#include <IMC/Spec/Maneuver.hpp>
namespace IMC
{
//! Cover Area.
class CoverArea: public Maneuver
{
public:
//! Latitude WGS-84.
double lat;
//! Longitude WGS-84.
double lon;
//! Z Reference.
float z;
//! Z Units.
uint8_t z_units;
//! Speed.
float speed;
//! Speed Units.
uint8_t speed_units;
//! Polygon.
MessageList<PolygonVertex> polygon;
//! CustomParameters.
std::string custom;
static uint16_t
getIdStatic(void)
{
return 473;
}
static CoverArea*
cast(Message* msg__)
{
return (CoverArea*)msg__;
}
CoverArea(void)
{
m_header.mgid = CoverArea::getIdStatic();
clear();
polygon.setParent(this);
}
CoverArea*
clone(void) const
{
return new CoverArea(*this);
}
void
clear(void)
{
lat = 0;
lon = 0;
z = 0;
z_units = 0;
speed = 0;
speed_units = 0;
polygon.clear();
custom.clear();
}
bool
fieldsEqual(const Message& msg__) const
{
const IMC::CoverArea& other__ = static_cast<const CoverArea&>(msg__);
if (lat != other__.lat) return false;
if (lon != other__.lon) return false;
if (z != other__.z) return false;
if (z_units != other__.z_units) return false;
if (speed != other__.speed) return false;
if (speed_units != other__.speed_units) return false;
if (polygon != other__.polygon) return false;
if (custom != other__.custom) return false;
return true;
}
uint8_t*
serializeFields(uint8_t* bfr__) const
{
uint8_t* ptr__ = bfr__;
ptr__ += IMC::serialize(lat, ptr__);
ptr__ += IMC::serialize(lon, ptr__);
ptr__ += IMC::serialize(z, ptr__);
ptr__ += IMC::serialize(z_units, ptr__);
ptr__ += IMC::serialize(speed, ptr__);
ptr__ += IMC::serialize(speed_units, ptr__);
ptr__ += polygon.serialize(ptr__);
ptr__ += IMC::serialize(custom, ptr__);
return ptr__;
}
size_t
deserializeFields(const uint8_t* bfr__, size_t size__)
{
const uint8_t* start__ = bfr__;
bfr__ += IMC::deserialize(lat, bfr__, size__);
bfr__ += IMC::deserialize(lon, bfr__, size__);
bfr__ += IMC::deserialize(z, bfr__, size__);
bfr__ += IMC::deserialize(z_units, bfr__, size__);
bfr__ += IMC::deserialize(speed, bfr__, size__);
bfr__ += IMC::deserialize(speed_units, bfr__, size__);
bfr__ += polygon.deserialize(bfr__, size__);
bfr__ += IMC::deserialize(custom, bfr__, size__);
return bfr__ - start__;
}
size_t
reverseDeserializeFields(const uint8_t* bfr__, size_t size__)
{
const uint8_t* start__ = bfr__;
bfr__ += IMC::reverseDeserialize(lat, bfr__, size__);
bfr__ += IMC::reverseDeserialize(lon, bfr__, size__);
bfr__ += IMC::reverseDeserialize(z, bfr__, size__);
bfr__ += IMC::deserialize(z_units, bfr__, size__);
bfr__ += IMC::reverseDeserialize(speed, bfr__, size__);
bfr__ += IMC::deserialize(speed_units, bfr__, size__);
bfr__ += polygon.reverseDeserialize(bfr__, size__);
bfr__ += IMC::reverseDeserialize(custom, bfr__, size__);
return bfr__ - start__;
}
uint16_t
getId(void) const
{
return CoverArea::getIdStatic();
}
const char*
getName(void) const
{
return "CoverArea";
}
size_t
getFixedSerializationSize(void) const
{
return 26;
}
size_t
getVariableSerializationSize(void) const
{
return polygon.getSerializationSize() + IMC::getSerializationSize(custom);
}
void
fieldsToJSON(std::ostream& os__, unsigned nindent__) const
{
IMC::toJSON(os__, "lat", lat, nindent__);
IMC::toJSON(os__, "lon", lon, nindent__);
IMC::toJSON(os__, "z", z, nindent__);
IMC::toJSON(os__, "z_units", z_units, nindent__);
IMC::toJSON(os__, "speed", speed, nindent__);
IMC::toJSON(os__, "speed_units", speed_units, nindent__);
polygon.toJSON(os__, "polygon", nindent__);
IMC::toJSON(os__, "custom", custom, nindent__);
}
protected:
void
setTimeStampNested(double value__)
{
polygon.setTimeStamp(value__);
}
void
setSourceNested(uint16_t value__)
{
polygon.setSource(value__);
}
void
setSourceEntityNested(uint8_t value__)
{
polygon.setSourceEntity(value__);
}
void
setDestinationNested(uint16_t value__)
{
polygon.setDestination(value__);
}
void
setDestinationEntityNested(uint8_t value__)
{
polygon.setDestinationEntity(value__);
}
};
}
#endif
| [
"nikolal@stud.ntnu.no"
] | nikolal@stud.ntnu.no |
01ab7223bb08bad78be891fbfff3d69c45ff503a | c319a1da89e0e2f4f70f6cf2081e404f451685c5 | /network/NetworkInterface.h | c4a85bda13219013bd6ab78ef80b0e37dd7e2c83 | [] | no_license | axidaka/IocpServer | 56643ffb4e52cadc04a7c7c554ca16701fbdfa12 | c62acef96d9de49ac411ffbff2063b959c91afbc | refs/heads/master | 2020-03-18T16:19:06.087158 | 2018-05-26T12:24:19 | 2018-05-26T12:24:19 | 134,958,992 | 0 | 0 | null | null | null | null | WINDOWS-1250 | C++ | false | false | 4,466 | h | ///////////////////////////////////////////////////////////
// Network.h
// Implementation of the Class Network
// Created on: 14-Ň»ÔÂ-2008 16:31:53
// Original author: Aitec
///////////////////////////////////////////////////////////
#if !defined(EA_76114261_477A_4b62_88C9_C98E8452015D__INCLUDED_)
#define EA_76114261_477A_4b62_88C9_C98E8452015D__INCLUDED_
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef __linux__
#include <unistd.h>
#include <errno.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/select.h>
#include <sys/un.h>
#elif _WIN32 /*** win32 */
#include <Winsock2.h>
#include <ws2tcpip.h>
#define ssize_t unsigned int
#define u_int8_t unsigned char
#define u_int16_t unsigned short
#define u_int32_t unsigned int
#define socklen_t int
#else /*** other os */
#include <unistd.h>
#include <errno.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/select.h>
#include <sys/un.h>
#endif
#ifndef UNIX_PATH_MAX
#define UNIX_PATH_MAX 108
#endif
#ifndef RET_SUCCESS
#define RET_SUCCESS 0
#endif
#ifndef RET_ERROR
#define RET_ERROR -1
#endif
class NetworkInterface
{
public:
// Init
static int InitNetwork();
static int DeinitNetwork();
public:
// tcp
static int MakeTCPServer(u_int16_t port);
static int MakeTCPClient(const char *ipaddr,u_int16_t port);
static int MakeTCPClient(const char *ipaddr,u_int16_t port,bool const &cancel);
static int MakeTCPClient(const char *ipaddr,u_int16_t port,int msec);
static int MakeTCPClient(u_int32_t ipaddr,u_int16_t port);
static int MakeTCPClient(u_int32_t ipaddr,u_int16_t port,bool const &cancel);
static int MakeTCPClient(u_int32_t ipaddr,u_int16_t port,int msec);
public:
// udp
static int MakeUDPServer(u_int16_t port);
static int MakeUDPClient();
#ifdef __linux__
public:
// unix
static int MakeUnixServer(const char *filename);
static int MakeUnixClient(const char *filename);
#endif
public:
// tcp and unix
static int MakeAccept(int listenfd);
static int MakeAccept(int listenfd,struct sockaddr *saddr);
public:
// tcpˇ˘udp and unix
static int Select(int nfds,fd_set *readfds,fd_set *writefds,fd_set *exceptfds,struct timeval *tv);
public:
// tcp and unix io
static ssize_t Sendn(int fd,const void *vptr,ssize_t n);
static ssize_t Recvn(int fd,void *vptr,ssize_t n);
public:
// udp io
static ssize_t SendTo (int sockfd,const void *vptr,ssize_t n,int flags,const struct sockaddr *addr,socklen_t len);
static ssize_t RecvFrom(int sockfd,void *vptr,ssize_t n,int flags,struct sockaddr *addr,socklen_t *len);
static ssize_t RecvFrom(int sockfd,void *vptr,ssize_t n, int flags);
public:
// tcpˇ˘udp and unix
static int Close(int sockfd);
public:
// udp
static int JoinMultiCast(int sockfd,struct ip_mreq *command);
static int QuitMultiCast(int sockfd,struct ip_mreq *command);
public:
// tcpˇ˘udp and unix
static int SetNonBlock(int sockfd);
static int SetBlock(int sockfd);
public:
// tcp and unix
static int SetNonKeepLive(int sockfd);
static int SetKeepLive(int sockfd,int idle,int intvl,int cnt);
public:
// tcpˇ˘udp and unix
static int SetSendBuf(int sockfd, int Size);
static int SetRecvBuf(int sockfd, int Size);
public:
// tcp and unix
static int SetNonDelay(int sockfd);
static int SetDelay(int sockfd);
public:
//tcp
static int SetLinger(int sockfd);
private:
static int Connect1(const char* ipaddr,u_int16_t port,int msec,const bool &cancel);
static int Connect1(u_int32_t ipaddr,u_int16_t port,int msec,const bool &cancel);
static int Connect2(u_int32_t ipaddr,u_int16_t port,int msec,const bool &cancel);
static int Connect3(int sockfd, const struct sockaddr * saptr, socklen_t salen, int msec, const bool & cancel);
public:
static int MakeInetServer(u_int16_t port);
static int MakeInetClient(char* ipaddr, u_int16_t port);
static int MakeInetClient(char* ipaddr, u_int16_t port, int const & cancel);
static int MakeInetClientFast(char* ipaddr, u_int16_t port, int waitmilliseconds);
static ssize_t Readn(int fd, void* vptr, ssize_t n);
static ssize_t Writen(int fd, void* vptr, ssize_t n);
};
#endif // !defined(EA_76114261_477A_4b62_88C9_C98E8452015D__INCLUDED_)
| [
"zhengqingsong@jd.com"
] | zhengqingsong@jd.com |
6fb8f242c3b6ffb8aeda71d915322b1adaa3f8cc | c88a1c6623b40dca33d80d8be89a35b451bfe28b | /MQ2Map/MQ2Map.h | 8d5d57a164750408ead431f7cdb36e72a3642d75 | [] | no_license | thepluralevan/macroquest2 | de941d6fdea91094689af1f9f277ccb4f93ed603 | d5d72d9ac297067ea4f93e30d66efda3ac765398 | refs/heads/master | 2020-08-03T08:41:51.443441 | 2019-09-18T22:21:08 | 2019-09-18T22:21:08 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,383 | h | #include <map>
using namespace std;
#ifdef ISXEQ
#include "ISXEQMap.h"
#endif
#define MAPFILTER_All 0
#define MAPFILTER_PC 1
#define MAPFILTER_PCConColor 2
#define MAPFILTER_Group 3
#define MAPFILTER_Mount 4
#define MAPFILTER_NPC 5
#define MAPFILTER_NPCConColor 6
#define MAPFILTER_Untargetable 7
#define MAPFILTER_Pet 8
#define MAPFILTER_Corpse 9
#define MAPFILTER_Chest 10
#define MAPFILTER_Trigger 11
#define MAPFILTER_Trap 12
#define MAPFILTER_Timer 13
#define MAPFILTER_Ground 14
#define MAPFILTER_Target 15
#define MAPFILTER_TargetLine 16
#define MAPFILTER_TargetRadius 17
#define MAPFILTER_TargetMelee 18
#define MAPFILTER_Vector 19
#define MAPFILTER_Custom 20
#define MAPFILTER_CastRadius 21
#define MAPFILTER_NormalLabels 22
#define MAPFILTER_ContextMenu 23
#define MAPFILTER_SpellRadius 24
#define MAPFILTER_Aura 25
#define MAPFILTER_Object 26
#define MAPFILTER_Banner 27
#define MAPFILTER_Campfire 28
#define MAPFILTER_PCCorpse 29
#define MAPFILTER_NPCCorpse 30
#define MAPFILTER_Mercenary 31
#define MAPFILTER_Named 32
#define MAPFILTER_TargetPath 33
#define MAPFILTER_Marker 34
#define MAPFILTER_NUMBER 35
#define MAPFILTER_Invalid (-1)
// normal labels
typedef struct _MAPSPAWN
{
PSPAWNINFO pSpawn = 0;
eSpawnType SpawnType;
PMAPLABEL pMapLabel;
PMAPLINE pVector;
BOOL Highlight;
BOOL Explicit;
DWORD Marker;
DWORD MarkerSize;
PMAPLINE MarkerLines[10];
struct _MAPSPAWN *pLast;
struct _MAPSPAWN *pNext;
} MAPSPAWN, *PMAPSPAWN;
typedef struct _MAPLOC {
bool isCreatedFromDefaultLoc;
int index;
PMAPSPAWN mapSpawn;
int yloc;
int xloc;
int zloc;
string label;
string tag; // "yloc,xloc,zloc"
int lineSize;
int width;
int r_color;
int g_color;
int b_color;
int radius;
int rr_color; // radius colors..
int rg_color;
int rb_color;
PMAPLINE markerLines[150]; // lineMax = 4*maxWidth + 360/CASTRADIUS_ANGLESIZE
} MAPLOC, *PMAPLOC;
typedef struct _MAPFILTER {
PCHAR szName;
//DWORD Index;
DWORD Default;
DWORD DefaultColor;
BOOL bIsToggle;
DWORD RequiresOption;
BOOL RegenerateOnChange;
PCHAR szHelpString;
DWORD Marker;
DWORD MarkerSize;
DWORD Enabled;
DWORD Color;
} MAPFILTER, *PMAPFILTER;
extern unsigned long bmMapRefresh;
extern int activeLayer;
extern map<string, PMAPLOC> LocationMap;
extern PMAPLOC DefaultMapLoc;
extern DWORD HighlightColor;
extern DWORD HighlightSIDELEN;
extern BOOL HighlightPulse;
extern BOOL HighlightPulseIncreasing;
extern int HighlightPulseIndex;
extern DWORD HighlightPulseDiff;
extern CHAR MapNameString[MAX_STRING];
extern CHAR MapTargetNameString[MAX_STRING];
extern CHAR mapshowStr[MAX_STRING];
extern CHAR maphideStr[MAX_STRING];
extern SEARCHSPAWN MapFilterCustom;
extern SEARCHSPAWN MapFilterNamed;
extern MAPFILTER MapFilterOptions[];
extern CHAR MapSpecialClickString[16][MAX_STRING];
extern CHAR MapLeftClickString[16][MAX_STRING];
extern BOOL repeatMapshow;
extern BOOL repeatMaphide;
/* COMMANDS */
VOID MapFilters(PSPAWNINFO pChar, PCHAR szLine);
VOID MapFilterSetting(PSPAWNINFO pChar, DWORD nMapFilter, PCHAR szValue = NULL);
VOID MapHighlightCmd(PSPAWNINFO pChar, PCHAR szLine);
VOID PulseReset();
VOID MapHideCmd(PSPAWNINFO pChar, PCHAR szLine);
VOID MapShowCmd(PSPAWNINFO pChar, PCHAR szLine);
VOID MapNames(PSPAWNINFO pChar, PCHAR szLine);
VOID MapClickCommand(PSPAWNINFO pChar, PCHAR szLine);
VOID MapActiveLayerCmd(PSPAWNINFO pChar, PCHAR szLine);
VOID MapSetLocationCmd(PSPAWNINFO pChar, PCHAR szLine);
PCHAR FormatMarker(PCHAR szLine, PCHAR szDest, SIZE_T BufferSize);
DWORD TypeToMapfilter(PSPAWNINFO pChar);
VOID MapRemoveLocation(PSPAWNINFO pChar, PCHAR szLine);
bool is_float(const string &in);
std::tuple<float, float, float> getTargetLoc();
/* API */
VOID MapInit();
VOID MapClear();
VOID MapGenerate();
DWORD MapHighlight(SEARCHSPAWN *pSearch);
DWORD MapHide(SEARCHSPAWN &Search);
DWORD MapShow(SEARCHSPAWN &Search);
VOID MapUpdate();
VOID MapAttach();
VOID MapDetach();
VOID UpdateDefaultMapLoc();
VOID MapLocSyntaxOutput();
VOID MapRemoveLocation(PSPAWNINFO pChar, PCHAR szLine);
VOID DeleteMapLoc(PMAPLOC mapLoc);
VOID UpdateMapLoc(PMAPLOC mapLoc);
VOID AddMapLocToList(PMAPLOC loc);
VOID UpdateMapLocIndexes();
VOID AddMapSpawnForMapLoc(PMAPLOC mapLoc);
bool MapSelectTarget();
void MapClickLocation(float world_point[2], std::vector<float> z_hits);
DWORD FindMarker(PCHAR szMark);
long MakeTime();
#ifndef ISXEQ
BOOL dataMapSpawn(PCHAR szIndex, MQ2TYPEVAR &Ret);
#else
bool dataMapSpawn(int argc, char *argv[], LSTYPEVAR &Ret);
#endif
struct _MAPSPAWN* AddSpawn(PSPAWNINFO pNewSpawn, BOOL ExplicitAllow = false);
bool RemoveSpawn(PSPAWNINFO pSpawn);
void AddGroundItem(PGROUNDITEM pGroundItem);
void RemoveGroundItem(PGROUNDITEM pGroundItem);
static inline BOOL IsOptionEnabled(DWORD Option)
{
if (Option == MAPFILTER_Invalid)
return true;
return (MapFilterOptions[Option].Enabled && IsOptionEnabled(MapFilterOptions[Option].RequiresOption));
}
static inline BOOL RequirementsMet(DWORD Option)
{
if (Option == MAPFILTER_Invalid)
return true;
return (IsOptionEnabled(MapFilterOptions[Option].RequiresOption));
}
PLUGIN_API PMAPLINE InitLine();
PLUGIN_API VOID DeleteLine(PMAPLINE pLine); | [
"brainiac2k@gmail.com"
] | brainiac2k@gmail.com |
22e7dbc6d217f250a30fd7b2eeeba8b4841f17da | aad16ff7e7d47d53d56b5b6499a29cc57d999b6d | /Source/BombermanClone/UndestructableObstacle.cpp | 5fd061ddc7cd5165b71c4b28c5b3441598bfa1e5 | [] | no_license | phillzz/BomberMan | 5b46a0e55f5f08394f8a3af4b4492dadd9ea358d | 788f292c2e37a358b2668cfdf46617ca59687ae9 | refs/heads/master | 2021-04-15T08:06:52.244166 | 2018-04-26T05:17:06 | 2018-04-26T05:17:06 | 126,814,985 | 0 | 0 | null | 2018-04-20T09:17:28 | 2018-03-26T10:53:31 | C++ | UTF-8 | C++ | false | false | 521 | cpp | // BomberBot 3D Game can not be copied and/or distributed without the express permission of Evgheni Feldman(phillzzzz@gmail.com)
#include "UndestructableObstacle.h"
// Sets default values
AUndestructableObstacle::AUndestructableObstacle()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = false;
}
// Called when the game starts or when spawned
void AUndestructableObstacle::BeginPlay()
{
Super::BeginPlay();
}
| [
"phillzzzz@gmail.com"
] | phillzzzz@gmail.com |
7f2ea2f27671f7011dbd534bc014e991897752a0 | 47328e77d0bfe554cb4dfe6a439dcef2b9e1a74b | /libfit/fit_pad_mesg_listener.hpp | 8900ec9705e2fa34031afa1ecc028c23cf4e1e95 | [
"MIT"
] | permissive | vibgy/node-fit | affdd1dc76ae07b035dfc9770837f87f6248321b | 37ef2f2eeb62777b01c03bfa00d014879dc7e8f6 | refs/heads/master | 2021-10-13T02:11:07.260213 | 2013-04-16T22:27:39 | 2013-04-16T22:27:39 | 43,335,290 | 1 | 0 | MIT | 2021-09-24T19:50:54 | 2015-09-29T00:33:25 | C++ | UTF-8 | C++ | false | false | 1,281 | hpp | ////////////////////////////////////////////////////////////////////////////////
// The following FIT Protocol software provided may be used with FIT protocol
// devices only and remains the copyrighted property of Dynastream Innovations Inc.
// The software is being provided on an "as-is" basis and as an accommodation,
// and therefore all warranties, representations, or guarantees of any kind
// (whether express, implied or statutory) including, without limitation,
// warranties of merchantability, non-infringement, or fitness for a particular
// purpose, are specifically disclaimed.
//
// Copyright 2013 Dynastream Innovations Inc.
////////////////////////////////////////////////////////////////////////////////
// ****WARNING**** This file is auto-generated! Do NOT edit this file.
// Profile Version = 6.0Release
// Tag = $Name: AKW6_000 $
////////////////////////////////////////////////////////////////////////////////
#if !defined(FIT_PAD_MESG_LISTENER_HPP)
#define FIT_PAD_MESG_LISTENER_HPP
#include "fit_pad_mesg.hpp"
namespace fit
{
class PadMesgListener
{
public:
virtual ~PadMesgListener() {}
virtual void OnMesg(PadMesg& mesg) = 0;
};
} // namespace fit
#endif // !defined(FIT_PAD_MESG_LISTENER_HPP)
| [
"scott.smerchek@gmail.com"
] | scott.smerchek@gmail.com |
f367c4050740be1197fa33a4a47afb2601300957 | 20966b4094bac00758cd0b8f130b4d1f2297d06f | /troll4.cpp | ec9343497206d0abb99eb9f8a91703834d2a2432 | [] | no_license | myahenochs/CSCI330 | d0c81b3225b64bcaba5f1a30022e01a7d5de1f88 | e5eb66e5ca4814c75b1b72bc5f0bc838ec5d3256 | refs/heads/master | 2023-01-14T10:40:12.303921 | 2020-11-25T00:19:27 | 2020-11-25T00:19:27 | 253,334,270 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,190 | cpp | #include "troll4.h"
const string Troll::RACE_STR = "TROLL";
const PlayerClass::AbilityArray Troll::ABILITY_ADJ = {14, 23, 6, 6, 23, 9};
const int Troll::HIT_DICE[3] = {6, 8, 36};
const int Troll::SAVING_THROW[3] = {11, 4, 3};
const int Troll::BASE_ATTACK_BONUS[2] = {9, 1};
const string Troll::INIT_WEAPON = "CLUB";
const string Troll::INIT_SKILLS[NUM_INITSKILLS] = {"LISTEN", "SPOT"};
Troll::Troll(string newName): Monster(newName, ABILITY_ADJ, Troll::HIT_DICE){
for(int i = 0; i < NUM_INITSKILLS; i++){
AddSkill(INIT_SKILLS[i]);
}
}
string Troll::RaceStr() const{
return RACE_STR;
}
vector<string> Troll::InitialWeaponList() const{
vector<string> wpns;
wpns.push_back(INIT_WEAPON);
return wpns;
}
int Troll::RollAttack() const{
return Monster::RollAttack(BASE_ATTACK_BONUS);
}
int Troll::RollSavingThrow(SavingThrowType kind) const{
return Monster::RollSavingThrow(kind, SAVING_THROW);
}
void Troll::Write(ostream &out) const{
out << RaceStr() << '#';
PlayerClass::Write(out);
}
bool Troll::IsMyFriend(const PlayerClass *p) const{
if(p){
return typeid(Troll) == typeid(*p);
}
else{
return false;
}
} | [
"noreply@github.com"
] | myahenochs.noreply@github.com |
cfb7b52fc86d1d151227d349baa20d8653b8f93f | e769eecaf32d0302b68a0609eb0f74bf1b601b38 | /LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/WaylandInputEvent.cpp | b3d26017be8ba871fd9f32cf55a3979d4f685623 | [
"BSD-3-Clause",
"Zlib",
"MIT",
"Apache-2.0"
] | permissive | SanctuaryComponents/layer_management | 921e1dc63071afeca4e4ce7411f754dd5f5283f7 | d3927a6ae5e6c9230d55b6ba4195d434586521c1 | refs/heads/master | 2020-05-26T09:19:36.530492 | 2013-10-07T12:47:37 | 2013-10-07T12:47:37 | 188,183,267 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,565 | cpp | /***************************************************************************
*
* Copyright 2010, 2011 BMW Car IT GmbH
* Copyright (C) 2011 DENSO CORPORATION and Robert Bosch Car Multimedia Gmbh
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
* CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
****************************************************************************/
#include <time.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <sys/mman.h>
#include <linux/input.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include "WindowSystems/WaylandInputEvent.h"
#include "WindowSystems/WaylandBaseWindowSystem.h"
#define HAVE_MKOSTEMP 1
/////////////////////////////////////////////////////////////////////////////
#ifndef HAVE_MKOSTEMP
static int
setCloexecOrClose(int fd)
{
long flags;
if (fd == -1)
return -1;
flags = fcntl(fd, F_GETFD);
if (flags == -1)
goto err;
if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) == -1)
goto err;
return fd;
err:
close(fd);
return -1;
}
#endif
static int
createTmpFileCloexec(char *tmpname)
{
int fd;
#ifdef HAVE_MKOSTEMP
fd = mkostemp(tmpname, O_CLOEXEC);
if (fd >= 0)
{
unlink(tmpname);
}
#else
fd = mkstemp(tmpname);
if (fd >= 0)
{
fd = setCloexecOrClose(fd);
unlink(tmpname);
}
#endif
return fd;
}
/////////////////////////////////////////////////////////////////////////////
WaylandInputEvent::WaylandInputEvent(WaylandBaseWindowSystem *windowSystem)
: m_windowSystem(windowSystem)
, m_inputDevice(NULL)
, m_wlEventSource(NULL)
, m_fd(0)
, m_xkbContext(NULL)
{
initInputEvent();
}
WaylandInputEvent::~WaylandInputEvent()
{
if (!m_wlEventSource)
wl_event_source_remove(m_wlEventSource);
if (m_xkbInfo.keymap)
xkb_map_unref(m_xkbInfo.keymap);
if (m_xkbInfo.keymap_area)
munmap(m_xkbInfo.keymap_area, m_xkbInfo.keymap_size);
if (m_xkbInfo.keymap_fd >= 0)
close(m_xkbInfo.keymap_fd);
xkb_context_unref(m_xkbContext);
free((char*)m_xkbNames.rules);
free((char*)m_xkbNames.model);
free((char*)m_xkbNames.layout);
free((char*)m_xkbNames.variant);
free((char*)m_xkbNames.options);
}
void
WaylandInputEvent::initInputEvent()
{
LOG_DEBUG("WaylandInputEvent", "initInputEvent IN");
m_inputDevice = new WaylandInputDevice(m_windowSystem->getNativeDisplayHandle());
if (!m_inputDevice)
{
LOG_ERROR("WaylandInputEvent", "Failed to create WaylandInputDevice");
return;
}
memset(&m_xkbInfo, 0, sizeof(m_xkbInfo));
memset(&m_xkbState, 0, sizeof(m_xkbState));
memset(&m_xkbNames, 0, sizeof(m_xkbNames));
LOG_DEBUG("WaylandInputEvent", "initInputEvent OUT");
}
void
WaylandInputEvent::setupInputEvent()
{
if (!m_xkbContext)
{
m_xkbContext = xkb_context_new((enum xkb_context_flags)0);
if (!m_xkbContext)
{
LOG_ERROR("WaylandInputEvent", "Failed to create XKB context");
return;
}
}
m_xkbNames.rules = strdup("evdev");
m_xkbNames.model = strdup("pc105");
m_xkbNames.layout = strdup("us");
}
void
WaylandInputEvent::initPointerDevice()
{
if (m_inputDevice->hasPointer())
return;
m_inputDevice->initPointerDevice();
}
void
WaylandInputEvent::initKeyboardDevice(struct xkb_keymap *keymap)
{
if (m_inputDevice->hasKeyboard())
return;
if (keymap)
{
m_xkbInfo.keymap = xkb_map_ref(keymap);
createNewKeymap();
}
else
{
buildGlobalKeymap();
}
m_xkbState.state = xkb_state_new(m_xkbInfo.keymap);
if (!m_xkbState.state)
{
LOG_ERROR("WaylandInputEvent", "Failed to initialize XKB state");
return;
}
m_inputDevice->initKeyboardDevice();
}
void
WaylandInputEvent::initTouchDevice()
{
if (m_inputDevice->hasTouch())
return;
m_inputDevice->initTouchDevice();
}
int
WaylandInputEvent::createAnonymousFile(off_t size)
{
static const char temp[] = "/weston-shared-XXXXXX";
const char *path;
char *name;
int fd;
path = getenv("XDG_RUNTIME_DIR");
if (!path)
{
return -1;
}
name = (char*)malloc(strlen(path) + sizeof(temp));
if (!name)
{
return -1;
}
strcpy(name, path);
strcat(name, temp);
fd = createTmpFileCloexec(name);
free(name);
if (fd < 0)
{
return -1;
}
if (ftruncate(fd, size) < 0)
{
close(fd);
return -1;
}
return fd;
}
void
WaylandInputEvent::createNewKeymap()
{
m_xkbInfo.shift_mod = xkb_map_mod_get_index(m_xkbInfo.keymap, XKB_MOD_NAME_SHIFT);
m_xkbInfo.caps_mod = xkb_map_mod_get_index(m_xkbInfo.keymap, XKB_MOD_NAME_CAPS);
m_xkbInfo.ctrl_mod = xkb_map_mod_get_index(m_xkbInfo.keymap, XKB_MOD_NAME_CTRL);
m_xkbInfo.alt_mod = xkb_map_mod_get_index(m_xkbInfo.keymap, XKB_MOD_NAME_ALT);
m_xkbInfo.mod2_mod = xkb_map_mod_get_index(m_xkbInfo.keymap, "Mod2");
m_xkbInfo.mod3_mod = xkb_map_mod_get_index(m_xkbInfo.keymap, "Mod3");
m_xkbInfo.super_mod = xkb_map_mod_get_index(m_xkbInfo.keymap, XKB_MOD_NAME_LOGO);
m_xkbInfo.mod5_mod = xkb_map_mod_get_index(m_xkbInfo.keymap, "Mod5");
m_xkbInfo.num_led = xkb_map_led_get_index(m_xkbInfo.keymap, XKB_LED_NAME_NUM);
m_xkbInfo.caps_led = xkb_map_led_get_index(m_xkbInfo.keymap, XKB_LED_NAME_CAPS);
m_xkbInfo.scroll_led = xkb_map_led_get_index(m_xkbInfo.keymap, XKB_LED_NAME_SCROLL);
char *keymapStr = xkb_map_get_as_string(m_xkbInfo.keymap);
if (keymapStr == NULL)
{
LOG_ERROR("WaylandX11InputEvent", "Failed to get string version of keymap");
return;
}
m_xkbInfo.keymap_size = strlen(keymapStr) + 1;
m_xkbInfo.keymap_fd = createAnonymousFile(m_xkbInfo.keymap_size);
if (m_xkbInfo.keymap_fd < 0)
{
LOG_WARNING("WaylandX11InputEvent", "Creating a keymap file for " <<
(unsigned long)m_xkbInfo.keymap_size <<
" bytes failed");
goto err_keymapStr;
}
m_xkbInfo.keymap_area = (char*)mmap(NULL,
m_xkbInfo.keymap_size,
PROT_READ | PROT_WRITE,
MAP_SHARED,
m_xkbInfo.keymap_fd,
0);
if (m_xkbInfo.keymap_area == MAP_FAILED)
{
LOG_WARNING("WaylandX11InputEvent", "Failed to mmap() " <<
(unsigned long) m_xkbInfo.keymap_size <<
" bytes");
goto err_dev_zero;
}
strcpy(m_xkbInfo.keymap_area, keymapStr);
free(keymapStr);
return;
err_dev_zero:
close(m_xkbInfo.keymap_fd);
m_xkbInfo.keymap_fd = -1;
err_keymapStr:
free(keymapStr);
exit(EXIT_FAILURE);
}
void
WaylandInputEvent::buildGlobalKeymap()
{
if (m_xkbInfo.keymap != NULL)
return;
m_xkbInfo.keymap = xkb_map_new_from_names(m_xkbContext,
&m_xkbNames,
static_cast<xkb_map_compile_flags>(0));
if (m_xkbInfo.keymap == NULL)
{
LOG_ERROR("WaylandInputEvent", "Failed to compile global XKB keymap");
LOG_ERROR("WaylandInputEvent", " tried rules: " << m_xkbNames.rules <<
", model: " << m_xkbNames.model <<
", layout: " << m_xkbNames.layout);
return;
}
createNewKeymap();
}
| [
"timo.lotterbach@bmw-carit.de"
] | timo.lotterbach@bmw-carit.de |
4d03a0ccc70fce1f81d9f2df9bddfda6164704b8 | 1fed6e013850bba6e5106567427de0a674428213 | /Digger/Field.h | 4bee9731fc76e61b5b7d3826509032a34fd9e0b3 | [] | no_license | dako98/Digger | 32042ab0f4722f62fd839fd25b65d0d653ee584e | 2cd4ba8eb53caa87928d9541f327db01f26f6716 | refs/heads/master | 2020-04-18T18:21:39.857866 | 2019-02-05T23:04:18 | 2019-02-05T23:04:18 | 167,681,224 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 663 | h | #ifndef _FIELD_
#define _FIELD_
#include <bitset>
#include <vector>
#include <SDL_image.h>
#include "Constants.h"
#include "ResourceLoader.h"
#include "Enemy.h"
#include "Player.h"
//using Matrix = std::vector<std::vector<std::bitset<BITS_IN_CELL>>>;
class Field
{
public:
Field(SDL_Renderer* renderer);
void Print() const;
bool Update(int direction);
void SpawnEnemy();
void Reset();
~Field();
private:
TextureManager textures;
SDL_Renderer * renderer;
Matrix grid;
coord monsterSpawner;
std::vector<Enemy> enemies;
// std::vector<Bag> bags; //TODO
Player player;
coord previousPlayerPos;
int gems;
};
#endif // !_FIELD_
| [
"dako98@users.noreply.github.com"
] | dako98@users.noreply.github.com |
a4b8cd272d3ec5d650f55167903026af5c1cc52d | 72fb6f98ae240328841146e88ab89d94bc0b6198 | /test/core/utilityTests.cpp | 4d92a80c81057035c68e6929116536a9f7ddc95f | [
"MIT"
] | permissive | Team-Hyperion/Hyperion-server | 905e97afc36aa19d1728bb0fb32f493648306211 | 7885e85ef404128e3f3cc4bc8023a244ce3e5580 | refs/heads/master | 2023-01-08T09:45:34.427820 | 2020-11-04T20:29:46 | 2020-11-04T20:29:46 | 297,432,491 | 0 | 0 | MIT | 2020-11-04T20:29:48 | 2020-09-21T18:52:55 | C++ | UTF-8 | C++ | false | false | 1,257 | cpp | // This file is subject to the terms and conditions defined in 'LICENSE' in the source code package
#include <gtest/gtest.h>
#include "core/utility.h"
namespace hyperion::core
{
TEST(Utility, StrToLower) {
EXPECT_EQ(StrToLower("ASDADxcxvcASDJAKDJ:AL"), "asdadxcxvcasdjakdj:al");
}
TEST(Utility, StrToUpper) {
EXPECT_EQ(StrToUpper("ASDADxcxvcASDJAKDJ:AL"), "ASDADXCXVCASDJAKDJ:AL");
}
TEST(Utility, StrTrim) {
EXPECT_EQ(StrTrim("aaaabcdefgbbbb", {'a', 'b'}), "cdefg");
EXPECT_EQ(StrTrim("11112222fff22221113", {'1', '2'}), "fff22221113");
}
TEST(Utility, StrTrimWhitespace) {
std::string str = " abcdefg ";
str.resize(100);
EXPECT_EQ(StrTrimWhitespace(str), "abcdefg");
EXPECT_EQ(StrTrimWhitespace(str).find("abcdefg"), 0);
EXPECT_EQ(StrTrimWhitespace("asdf "), "asdf");
EXPECT_TRUE(StrTrimWhitespace(" ").empty());
EXPECT_TRUE(StrTrimWhitespace("").empty());
}
TEST(Utility, StrMatchLen) {
EXPECT_EQ(StrMatchLen("abc", 10), "abc ");
EXPECT_EQ(StrMatchLen("abc", 0), "abc");
EXPECT_EQ(StrMatchLen("", 5, '-'), "-----");
}
} // namespace hyperion::core
| [
"jaihysc@gmail.com"
] | jaihysc@gmail.com |
447114443c6622c97d87a30ccfda1dda4b347800 | 42e706cac98b6fc654254ca765d1056e9049987f | /Lab/Lab5/Fibonacci.cpp | 226d728e9528fddf14f0dacd2e8d4c31a470d15e | [] | no_license | huyenpham99/LBEP | 623a96f13866db5f376fb86ed883d0ce5bcd413d | 30ef8b6ad0feefe715967d14c4d4b6001dfdb40a | refs/heads/master | 2020-07-14T21:11:31.253719 | 2019-08-30T14:59:25 | 2019-08-30T14:59:25 | 205,403,656 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 372 | cpp | #include<stdio.h>
#include<math.h>
int main(){
long int n;
printf("nhap so n:",n);
scanf("%ld",&n);
long int a1=1;
long int a2=1;
long int T;
if(n==1 ||n==2){
printf("So fibonacci thu %ld la 1",n);
return 0;
}
for(int i=3;i<=n;i++){
T=a1+a2;
a1=a2;
a2=T;
} printf("So fibonacci thu %ld la %d\n",n,T);
return 0;
}
| [
"53186394+huyenpham99@users.noreply.github.com"
] | 53186394+huyenpham99@users.noreply.github.com |
ea04d83664f0a57e97883d0fe1b1a266dfe2aa05 | 4c886a0fb7bdaee2c4f1506feb08da8f3559fd79 | /XPowerControl/ActionRequiredDlg.cpp | 343e7871cad9074b3cfd78b13f8f7be1b3b42c4c | [
"MIT"
] | permissive | shachar700/WoomyDX | 2e81deafa247c9f2d002f383c739226176012a74 | a5e4493cde4bdc06df30dba69a9460247074fdcd | refs/heads/master | 2023-08-26T09:30:50.128018 | 2021-11-11T05:36:38 | 2021-11-11T05:36:38 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,877 | cpp | // ActionRequiredDlg.cpp : implementation file
//
#include "ActionRequiredDlg.h"
#include "afxdialogex.h"
#include "wstring_transform.h"
#include <atlimage.h>
#include <string>
#include "PictureCtrl.h"
using namespace std;
// ActionRequiredDlg dialog
IMPLEMENT_DYNAMIC(ActionRequiredDlg, CDialogEx)
ActionRequiredDlg::ActionRequiredDlg(string picture_file_t, wstring description_text_t, CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_ACTION_REQUIRED, pParent)
{
picture_file = picture_file_t;
description_text = description_text_t;
DoModal();
}
ActionRequiredDlg::~ActionRequiredDlg()
{
}
void ActionRequiredDlg::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_STATIC_SCREENSHOT, img_screenshot);
}
BEGIN_MESSAGE_MAP(ActionRequiredDlg, CDialogEx)
END_MESSAGE_MAP()
// ActionRequiredDlg message handlers
// FirstSetupDlg3 message handlers
BOOL ActionRequiredDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// set font for the dialog title
CFont* font_dlg = GetDlgItem(IDC_STATIC_TITLE)->GetFont();
LOGFONT logfont_bold;
font_dlg->GetLogFont(&logfont_bold);
logfont_bold.lfWeight = 700;
logfont_bold.lfHeight = 14;
CFont* font_bold = new CFont();
font_bold->CreateFontIndirectW(&logfont_bold);
GetDlgItem(IDC_STATIC_TITLE)->SetFont(font_bold);
HICON m_hIcon1 = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
SetIcon(m_hIcon1, TRUE); // Set big icon
SetIcon(m_hIcon1, FALSE); // Set small icon
// make sure the window is in the foreground, even after helper software is called
::SetForegroundWindow(this->GetSafeHwnd());
::SetWindowPos(this->GetSafeHwnd(),
HWND_TOPMOST,
0,
0,
0,
0,
SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE);
img_screenshot.LoadFromFile(CString(transform::s2ws(picture_file).c_str()));
GetDlgItem(IDC_STATIC_DESCRIPTION)->SetWindowTextW(description_text.c_str());
return 0;
}
| [
"hello@snowpoke.ink"
] | hello@snowpoke.ink |
762388aac95321d9f001f0bddfe06ee6141d28da | 9d096b1c4e0573e9f57afb494a8de50c6e7238d5 | /main.cpp | 56c122d336d2f3a8f10ede1122b02510959c6471 | [] | no_license | NicolleSchunck/aula-de-C---04-03 | d9983c2893382ec3aaecc328f902c7a182cb25b1 | 30b275726e0218030abcce9d9f6bda35b598d059 | refs/heads/master | 2023-03-13T00:49:40.601525 | 2021-03-04T23:33:34 | 2021-03-04T23:33:34 | 344,638,101 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,921 | cpp | /*
Quadro Resumo
1) nome, status, imc, peso, altura
2) nome, peso, altura
3) imc = peso / altura * altura
4) nome, imc, status
*
*
*/
#include <cstdlib>
#include <iostream>
#include <string>
#include <math.h>
#include <iomanip>
using namespace std;
string nome, status;
double imc, peso, altura;
int main ()
{
setlocale(LC_ALL, "Portuguese");
int item = 0;
MENU: // Ponto de Repetição
system("clear");
cout << "\n***Menu***";
cout << "\n1 Ler";
cout << "\n2 Calcular";
cout << "\n3 Exibir";
cout << "\n4 Sair";
cout << "\nItem:";
cin >> item;
if ( item == 1 )
{
system("clear");
cout << "\nDigite o nome:";
cin.ignore(); // ignora o enter do cin anterior
getline (cin, nome );
cout << "\nDigite o Peso:";
cin >> peso;
cout << "\nDigite altura:";
cin >> altura;
}
else if (item == 2)
{
imc = peso / pow (altura, 2 );
// Processamento do Status
if ( imc < 18.5 )
{
status = "Vc está abaixo do peso!";
}
else if ( imc <= 24.9 )
{
status = "Vc está dentro de seu peso normal!";
}
else
{
status = "Vc está com sobrepeso! Procure ajuda!";
}
cout << "\ncalculando imc..." << endl;
system("sleep 3");
}
else if (item == 3)
{
system("clear");
cout << "\n*** Tela de Saída***";
cout << "\nNome:" << nome;
cout << fixed << setprecision (2) << "\nIMC.:" << imc;
cout << "\nStatus:" << status << endl;
system("sleep 5");
}
else if ( item == 4 )
{
exit(0); // sair do programa
}
goto MENU; // Volta ao ponto de repetição
return 0;
} | [
"araujo.nicolle468@gmail.com"
] | araujo.nicolle468@gmail.com |
ff0d808b175c17aa053a0f6b370b362079e6f0a2 | ef1ff47700c85548f7cb0cfd18e85b855933474c | /include/PDF/Annots/Underline.h | 3aa98e07c4763bac07c5a2085b8dc5835aefb30e | [] | no_license | Innovasium-2014/PDFTron-SDK | 6ea169ba89b5031083d0188e2a96f1fe6157dc76 | 0aa79129af0292c1f195d3e17b71ec9501479f0c | refs/heads/master | 2023-03-27T22:40:59.947292 | 2021-04-01T15:30:26 | 2021-04-01T15:30:26 | 236,060,276 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,921 | h | //---------------------------------------------------------------------------------------
// Copyright (c) 2001-2020 by PDFTron Systems Inc. All Rights Reserved.
// Consult legal.txt regarding legal and license information.
//---------------------------------------------------------------------------------------
#ifndef PDFTRON_H_CPPPDFAnnotsUnderline
#define PDFTRON_H_CPPPDFAnnotsUnderline
#include <PDF/Annots/TextMarkup.h>
namespace pdftron {
namespace PDF {
namespace Annots {
/**
* An Underline annotation shows as a line segment across the bottom
* of a word or a group of contiguous words.
*/
class Underline : public TextMarkup
{
public:
/**
* Creates an Underline annotation and initializes it using given Cos/SDF object.
* @param d The Cos/SDF object to initialze the annotation with.
* @note The constructor does not copy any data, but is instead the logical
* equivalent of a type cast.
*/
Underline(SDF::Obj d);
/**
* Creates an Underline annotation and initializes it using given annotation object.
* @param ann Annot object used to initialize the Underline annotation.
* @note The constructor does not copy any data, but is instead the logical
* equivalent of a type cast.
*/
Underline(const Annot& ann) : TextMarkup(ann.GetSDFObj()) {}
/**
* Creates a new Underline annotation in the specified document.
*
* @param doc A document to which the Underline annotation is added.
* @param pos A rectangle specifying the Underline annotation's bounds in default user space units.
*
* @return A newly created blank Underline annotation.
*/
static Underline Create(SDF::SDFDoc& doc, const Rect& pos);
// @cond PRIVATE_DOC
#ifndef SWIGHIDDEN
Underline(TRN_Annot underline);
#endif
// @endcond
};//class Underline
};//namespace Annot
};//namespace PDF
};//namespace pdftron
#include <Impl/Page.inl>
#endif // PDFTRON_H_CPPPDFAnnotsUnderline
| [
"alegemaate@gmail.com"
] | alegemaate@gmail.com |
d4e52a147c1eaed248e294bdbdf2fe6c3178945f | 8bd4ce2cff2482643beff53d3e2897adb2bd389f | /ReadImage/Util.h | 7095bd497668a926009d861bd61a054fb3e12047 | [] | no_license | leokiri1998/readimage | 19ae56f987532bb5bcb19cee13e4cb4a8ce5e3ff | 0d9d3def97da5ed1bc5c550a1e26b56cddef5735 | refs/heads/master | 2021-01-03T03:41:09.059975 | 2020-02-12T02:17:17 | 2020-02-12T02:17:17 | 239,907,249 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,565 | h | /*
//////////////////////////////////////////////////////////////////////////
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
//////////////////////////////////////////////////////////////////////////
CUtil : Copyright (C) 2008, Kazi Shupantha Imam (shupantha@yahoo.com)
//////////////////////////////////////////////////////////////////////////
Covered code is provided under this license on an "as is" basis, without
warranty of any kind, either expressed or implied, including, without
limitation, warranties that the covered code is free of defects,
merchantable, fit for a particular purpose or non-infringing. The entire
risk as to the quality and performance of the covered code is with you.
Should any covered code prove defective in any respect, you (not the
initial developer or any other contributor) assume the cost of any
necessary servicing, repair or correction. This disclaimer of warranty
constitutes an essential part of this license. No use of any covered code
is authorized hereunder except under this disclaimer.
Permission is hereby granted to use, copy, modify, and distribute this
source code, or portions hereof, for any purpose, including commercial
applications, freely and without fee, subject to the following
restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
//////////////////////////////////////////////////////////////////////////
*/
#pragma once
#ifdef WIN32
#include <windows.h>
#include "atlbase.h"
#endif
#include <sys\types.h>
#include <sys\stat.h>
#include <vector>
#include <string>
using std::vector;
using std::string;
using std::wstring;
#ifdef UNICODE
#define _tstring wstring
#else
#define _tstring string
#endif
#ifdef WIN32
#define DIRECTORY_SEPARATOR_W L"\\"
#define DIRECTORY_SEPARATOR_W_C L'\\'
#define DIRECTORY_SEPARATOR_A "\\"
#define DIRECTORY_SEPARATOR_A_C '\\'
#else
#define DIRECTORY_SEPARATOR_W L"/"
#define DIRECTORY_SEPARATOR_W_C L'/'
#define DIRECTORY_SEPARATOR_A "/"
#define DIRECTORY_SEPARATOR_A_C '/'
#endif
#ifdef UNICODE
#define DIRECTORY_SEPARATOR DIRECTORY_SEPARATOR_W
#define DIRECTORY_SEPARATOR_C DIRECTORY_SEPARATOR_W_C
#else
#define DIRECTORY_SEPARATOR DIRECTORY_SEPARATOR_A
#define DIRECTORY_SEPARATOR_C DIRECTORY_SEPARATOR_A_C
#endif
class CUtil
{
public:
CUtil(void);
~CUtil(void);
public:
// Get list of all files in the target directory
static void GetFileList(const _tstring& strTargetDirectoryPath, const _tstring& strWildCard, bool bLookInSubdirectories, vector<_tstring>& vecstrFileList);
public:
// Add "\" to the end of a directory path, if not present
static wstring AddDirectoryEnding(const wstring& strDirectoryPath);
static string AddDirectoryEnding(const string& strDirectoryPath);
// Remove "\" from the end of a directory path, if present
static wstring RemoveDirectoryEnding(const wstring& strDirectoryPath);
static string RemoveDirectoryEnding(const string& strDirectoryPath);
public:
// Get the name of the directory form a given directory path: e.g. C:\Program Files\XYZ, will return XYZ
static wstring GetDirectoryName(const wstring& strDirectoryPath);
static string GetDirectoryName(const string& strDirectoryPath);
};
| [
"nguyentienthanh2712@gmail.com"
] | nguyentienthanh2712@gmail.com |
a02478120de631f3aa7f168605d7578f93984261 | 94a61fcf44a93ba39f0dff165814b423950f0229 | /Games/Warpscape/source/level_warp.h | 0d55f8aef45f3c9c30890f2033a14dc2981f00e5 | [] | no_license | jstty/OlderProjects | e9c8438dc6fe066e3d1bc2f36e937e7c72625192 | 4e64babeef2384d3882484a50e1c788784b08a05 | refs/heads/master | 2021-01-23T22:53:21.630742 | 2013-07-08T01:58:27 | 2013-07-08T01:58:27 | 10,214,450 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,136 | h | /****************************************
filename: level_warp.h
project: warpattack
created by: Joseph E. Sutton
date: 2010/04/08
description: warp level
****************************************/
#ifndef _LEVEL_WARP_
#define _LEVEL_WARP_
class cWarpLevel : public cLevel
{
enum ZoomState { Zoom_StartIn, Zoom_MovingIn, Zoom_DoneIn,
Zoom_StartOut, Zoom_ResetMovingOut, Zoom_MovingOut, Zoom_DoneOut };
public:
cWarpLevel();
~cWarpLevel();
virtual uInt32 Enter(uInt32 level_num);
virtual uInt32 Exit();
virtual void Draw();
virtual void Update();
virtual void Input(LevelInput input);
virtual int LoadSettings(const char *filename);
void Clear();
protected:
uInt32 i, j;
cPlayerShipBullet * mTmpBullet;
uInt8 mLevelMax;
uInt32 mScore;
uInt32 mLives;
cPolygon mLivesPoly;
ZoomState mZoomState;
cTimer mZoomTimer;
float mZoomMoveRate;
uInt32 mZoomSteps;
float mZoomStartFieldOfView;
float mZoomEndFieldOfView;
float mZoomFieldOfView;
float mZoomStartZPos;
float mZoomEndZPos;
float mZoomZPos;
cBackground * mCurrentBkg;
cWarpPath * mWarpPath;
float mScaleWarpPathX;
float mScaleWarpPathY;
cPlayerShip * mPlayerShip;
float mFogDensity;
vector<cEnemy *> mEnemies;
uInt32 mMaxNumEnemies;
vector<cBackground *> mBackground;
vector<cPlayerShipBullet *> mBullets;
uInt32 mMaxNumBullets;
uInt32 mMaxBulletRate;
cTimer mBulletRateTimer;
bool CollisionTest(Point3D p, PointBox3D b);
void DestroyBullet(uInt32 index);
void DrawPaused();
};
#endif // _LEVEL_WARP_
| [
"joe@jstty.com"
] | joe@jstty.com |
f3b2a02da5726793ec491af22996fb5756f55d3b | ee8c16c1474e161359f2cb77b0105f9ded8068d1 | /webrtc-jni/src/main/cpp/src/JNI_DesktopCapturer.cpp | d375dcfef2e6e1d7db8efdcd4c7a6545d36fda8b | [
"BSD-3-Clause",
"LicenseRef-scancode-html5",
"DOC",
"Apache-2.0"
] | permissive | m-sobieszek/webrtc-java | b46fa47a4e1cd7b8e5992322311562a31eeabdee | 406336052da1bc079ca62577a3fc845e22e215c1 | refs/heads/master | 2022-08-22T12:32:28.509935 | 2022-06-15T11:47:50 | 2022-06-15T11:47:50 | 230,241,997 | 0 | 0 | Apache-2.0 | 2019-12-26T10:12:11 | 2019-12-26T10:12:10 | null | UTF-8 | C++ | false | false | 3,364 | cpp | /*
* Copyright 2019 Alex Andres
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "JNI_DesktopCapturer.h"
#include "JavaArrayList.h"
#include "JavaError.h"
#include "JavaUtils.h"
#include "media/video/desktop/DesktopCapturer.h"
#include "media/video/desktop/DesktopCaptureCallback.h"
#include "media/video/desktop/DesktopSource.h"
#include "modules/desktop_capture/desktop_capturer.h"
JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_desktop_DesktopCapturer_dispose
(JNIEnv * env, jobject caller)
{
jni::DesktopCapturer * capturer = GetHandle<jni::DesktopCapturer>(env, caller);
CHECK_HANDLE(capturer);
delete capturer;
SetHandle<std::nullptr_t>(env, caller, nullptr);
auto callback = GetHandle<jni::DesktopCaptureCallback>(env, caller, "callbackHandle");
if (callback) {
delete callback;
}
}
JNIEXPORT jobject JNICALL Java_dev_onvoid_webrtc_media_video_desktop_DesktopCapturer_getDesktopSources
(JNIEnv * env, jobject caller)
{
jni::DesktopCapturer * capturer = GetHandle<jni::DesktopCapturer>(env, caller);
CHECK_HANDLEV(capturer, nullptr);
webrtc::DesktopCapturer::SourceList sources;
if (!capturer->GetSourceList(&sources)) {
env->Throw(jni::JavaError(env, "Get source list failed"));
return nullptr;
}
jni::JavaArrayList sourceList(env, sources.size());
for (const auto & source : sources) {
sourceList.add(jni::DesktopSource::toJava(env, source));
}
return sourceList.listObject().release();
}
JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_desktop_DesktopCapturer_selectSource
(JNIEnv * env, jobject caller, jobject jsource)
{
jni::DesktopCapturer * capturer = GetHandle<jni::DesktopCapturer>(env, caller);
CHECK_HANDLE(capturer);
auto source = jni::DesktopSource::toNative(env, jni::JavaLocalRef<jobject>(env, jsource));
if (!capturer->SelectSource(source.id)) {
env->Throw(jni::JavaError(env, "Select source failed"));
}
}
JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_desktop_DesktopCapturer_start
(JNIEnv * env, jobject caller, jobject jcallback)
{
if (jcallback == nullptr) {
env->Throw(jni::JavaNullPointerException(env, "DesktopCaptureCallback is null"));
return;
}
jni::DesktopCapturer * capturer = GetHandle<jni::DesktopCapturer>(env, caller);
CHECK_HANDLE(capturer);
auto callback = new jni::DesktopCaptureCallback(env, jni::JavaGlobalRef<jobject>(env, jcallback));
try {
SetHandle(env, caller, "callbackHandle", callback);
capturer->Start(callback);
}
catch (...) {
ThrowCxxJavaException(env);
}
}
JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_media_video_desktop_DesktopCapturer_captureFrame
(JNIEnv * env, jobject caller)
{
jni::DesktopCapturer * capturer = GetHandle<jni::DesktopCapturer>(env, caller);
CHECK_HANDLE(capturer);
try {
capturer->CaptureFrame();
}
catch (...) {
ThrowCxxJavaException(env);
}
} | [
"andres.alex@protonmail.com"
] | andres.alex@protonmail.com |
325f74125aec9890917847a13e14eada0e4f6c53 | 07688811ec91393d7b270c5d1988407bb02a7694 | /GameClient/Classes/game_ui/MapThumbnailLayer.h | 795144e9a4ae2986ade2680407aece418d39c432 | [] | no_license | mofr123/game | b2c7b01b11fd264400c298d3567c1e1d37dc5b89 | d214ca6f83a2ec22e74b119725a92f17145532dd | refs/heads/master | 2021-01-13T16:46:00.319756 | 2014-12-01T02:48:18 | 2014-12-01T02:48:18 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,974 | h | #ifndef __mir9__MapThumbnailLayer__
#define __mir9__MapThumbnailLayer__
#include "publicDef/PublicDef.h"
class MapThumbnailLayer;
class MapThumbnailMenu:
public Sprite
//public CCTargetedTouchDelegate
{
public:
MapThumbnailMenu();
~MapThumbnailMenu();
static MapThumbnailMenu* create();
bool initWithFile(const char *pszFilename);
virtual void onEnter();
virtual void onExit();
protected:
Sprite* m_playerIndicator;
Dictionary* m_enemyDic;
vector<int> keyVec;
Label* m_pCoordinateTTF;
protected:
void update(float delay);
virtual bool onTouchBegan(Touch *pTouch, Event *pEvent);
virtual void onTouchMoved(Touch *pTouch, Event *pEvent);
virtual void onTouchEnded(Touch *pTouch, Event *pEvent);
virtual void onTouchCancelled(Touch *pTouch, Event *pEvent);
};
class MapThumbnailScrollView;
class MapThumbnailLayer:
public Layer
{
public:
CREATE_FUNC(MapThumbnailLayer);
bool init();
protected:
MapThumbnailScrollView* m_nMap;
//void registerWithTouchDispatcher(void);
void touchDownAction(Ref *senderz, Control::EventType controlEvent);//add by 2014-11-15 11:08:02
virtual bool onTouchBegan(Touch *pTouch, Event *pEvent);
};
class MapThumbnailScrollView:
public extension::ScrollView
{
bool m_bIsMoved;
Sprite* m_playerIndicator;
Sprite* m_pEndPoint;
void update(float delay);
Point m_beginPoint;
public:
MapThumbnailScrollView();
~MapThumbnailScrollView();
static MapThumbnailScrollView* create();
void initWithMap();
virtual bool onTouchBegan(Touch *pTouch, Event *pEvent);
virtual void onTouchMoved(Touch *pTouch, Event *pEvent);
virtual void onTouchEnded(Touch *pTouch, Event *pEvent);
};
#endif /* defined(__mir9__MapThumbnailLayer__) */
| [
"mofr_123@sina.com"
] | mofr_123@sina.com |
47debc12c378d417cab112221e547b6f07e0bceb | 2b00dd1ca25855fd10a8f913f9d7dd3a72721cc4 | /Trunk/litedb/Litedb.cpp | 260ca7eeb3085a206b415b12d3cb3bd46c849745 | [] | no_license | fanbojie/litedb | 314b8f96c4d31d285d000ee29aae633bb9a0f058 | 8a4ecc882936aafa78060923853c072b4a7fd452 | refs/heads/master | 2021-01-20T14:22:33.054095 | 2017-05-08T06:47:02 | 2017-05-08T06:47:02 | 90,595,572 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 623 | cpp | #include "Litedb.h"
#include "ConnectionPool.h"
#include "SqlTask.h"
LITEDB_API int litedb_init( const char* connStr, int size )
{
litedb::CConnectionPool::getInstance().init(size);
return litedb::CConnectionPool::getInstance().open(connStr);
}
LITEDB_API litedb::CSqlTask* litedb_create_task( int type )
{
return litedb::CConnectionPool::getInstance().createTask(type);
}
LITEDB_API void litedb_push_task( litedb::CSqlTask* task )
{
litedb::CConnectionPool::getInstance().pushTask(task);
}
LITEDB_API void litedb_uninit()
{
litedb::CConnectionPool::getInstance().close();
}
| [
"bojfan@cisco.com"
] | bojfan@cisco.com |
0ae897c0a22c480989a1eb3c0d6e85e4310648f5 | caace399580bb11e7817c75afbdfc899e2dbe4d0 | /MP2/Network.cpp | ba26fcd1e6500730dcf2525fb30a6f676a0aba40 | [] | no_license | john-james-ai/cloud-networking | 4420041e874c5834bcb000bc78fa7974b8389691 | 3efc911911b608418b792624b3987aef52199c2a | refs/heads/master | 2023-05-02T08:41:48.660282 | 2021-05-14T02:23:17 | 2021-05-14T02:23:17 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,447 | cpp | #include "Network.h"
//===========================================================================//
// UNARY FUNCTIONS //
//===========================================================================//
// Used to generate an iterator to a Route object specified by a route_id.
FindNode::FindNode(short node_id)
: node_id_(node_id)
{}
bool FindNode::operator()(Node node) {
return node.getNodeId() == node_id_;
}
//===========================================================================//
// NODE //
//===========================================================================//
//---------------------------------------------------------------------------//
// CONSTRUCTORS //
//---------------------------------------------------------------------------//
Node::Node() {}
Node::Node(short node_id)
: node_id_(node_id), active_(false),
classname_("Node")
{
setIPAddr();
setSocketAddr();
active_ = false;
struct timeval last_Heartbeat_ = {0,0};
std::string* address_ = (std::string*)this;
};
//---------------------------------------------------------------------------//
// SET IP ADDR //
//---------------------------------------------------------------------------//
void Node::setIPAddr() {
sprintf(ip_addr_,"10.1.1.%d", node_id_);
}
//---------------------------------------------------------------------------//
// SET SOCKET ADDR //
//---------------------------------------------------------------------------//
void Node::setSocketAddr() {
memset(&socket_addr_, 0, sizeof(socket_addr_));
socket_addr_.sin_family = AF_INET;
socket_addr_.sin_port = htons(7777);
inet_pton(AF_INET, ip_addr_, &socket_addr_.sin_addr);
}
//---------------------------------------------------------------------------//
// GET NODE ID //
//---------------------------------------------------------------------------//
short Node::getNodeId() {
return node_id_;
}
//---------------------------------------------------------------------------//
// GET IP ADDR //
//---------------------------------------------------------------------------//
std::string Node::getIPAddr() {
return ip_addr_;
}
//---------------------------------------------------------------------------//
// GET SOCKET ADDR //
//---------------------------------------------------------------------------//
void Node::getSocketAddr(sockaddr_in& sock_addr) {
sock_addr = socket_addr_;
}
//---------------------------------------------------------------------------//
// HEY //
//---------------------------------------------------------------------------//
bool Node::hey() {
holla(classname_, address_);
return true;
};
//===========================================================================//
// NETWORK //
//===========================================================================//
//---------------------------------------------------------------------------//
// CONSTRUCTORS //
//---------------------------------------------------------------------------//
Network::Network()
: classname_("Network")
{
iam(classname_, __FUNCTION__);
std::string* address_ = (std::string*)this;
}
Network::Network(Parameters* params, Socket* socket)
: router_id_(params->router_id_),
socket_(socket),
socket_fd_(socket_->getSocket()),
n_network_(params->n_network_),
classname_("Network")
{
iam(classname_, __FUNCTION__);
std::string* address_ = (std::string*)this;
createNetwork();
}
//---------------------------------------------------------------------------//
// CREATE NODE //
//---------------------------------------------------------------------------//
void Network::createNode(short node_id) {
iam(classname_, __FUNCTION__);
if (nodeExists(node_id)) {
std::string message = "Node " + intToString(node_id) + " already exists.";
error(classname_, __FUNCTION__, message);
exit(1);
}
Node node = Node(node_id);
network_.push_back(node);
}
//---------------------------------------------------------------------------//
// CREATE NETWORK //
//---------------------------------------------------------------------------//
void Network::createNetwork() {
iam(classname_, __FUNCTION__);
for (int i=0; i< n_network_; ++i) {
if (i != router_id_) {
createNode(i);
}
}
}
//---------------------------------------------------------------------------//
// NODE EXISTS //
//---------------------------------------------------------------------------//
bool Network::nodeExists(short node_id) {
iam(classname_, __FUNCTION__);
std::vector<Node>::iterator it;
FindNode theNode = FindNode(node_id);
it = std::find_if(network_.begin(), network_.end(), theNode);
if (it != network_.end()) {
return true;
} else {
return false;
}
}
//---------------------------------------------------------------------------//
// GET NODE //
//---------------------------------------------------------------------------//
Node Network::getNode(short node_id) {
iam(classname_, __FUNCTION__);
FindNode theNode = FindNode(node_id);
node_iterator_ = std::find_if(network_.begin(), network_.end(), theNode);
if (node_iterator_ == network_.end()) {
std::string message = "Node " + intToString(node_id) + " not found.";
error(classname_, __FUNCTION__, message);
exit(1);
} else {
return *node_iterator_;
}
}
//---------------------------------------------------------------------------//
// GET NODE IDS //
//---------------------------------------------------------------------------//
std::vector<short> Network::getNodeIds() {
int i;
std::vector<short> ids;
ids.reserve(N_NODES);
for (i=0; i<N_NODES; ++i) {
if (i != router_id_) {
ids.push_back(i);
}
}
return ids;
}
//---------------------------------------------------------------------------//
// GET NETWORK //
//---------------------------------------------------------------------------//
std::vector<Node> Network::getNetwork() {
iam(classname_, __FUNCTION__);
return network_;
}
//---------------------------------------------------------------------------//
// GET SOCKET ADDR //
//---------------------------------------------------------------------------//
// This is the full sockaddr_in struct
void Network::getSocketAddr(short node_id, sockaddr_in& sock_addr) {
long addr;
FindNode theNode = FindNode(node_id);
node_iterator_ = std::find_if(network_.begin(), network_.end(), theNode);
if (node_iterator_ == network_.end()) {
std::string message = "Node " + intToString(node_id) + " not found.";
error(classname_, __FUNCTION__, message);
exit(1);
} else {
(*node_iterator_).getSocketAddr(sock_addr);
}
}
//---------------------------------------------------------------------------//
// N NODES //
//---------------------------------------------------------------------------//
size_t Network::nNodes() {
iam(classname_, __FUNCTION__);
return network_.size();
}
//---------------------------------------------------------------------------//
// HEY AND NAME //
//---------------------------------------------------------------------------//
bool Network::hey() {
std::vector<Node>::iterator it;
assert(network_.size()== 255);
for (it=network_.begin();it != network_.end();++it) {
assert((*it).hey());
}
holla(classname_, address_);
return true;
};
std::string Network::name() {
return classname_;
}
//---------------------------------------------------------------------------//
// PRINT //
//---------------------------------------------------------------------------//
void Network::printNode(short node_id) {
Node node = getNode(node_id);
std::cout << "---------------------------------------------------------------------" << std::endl;
std::cout << " Node Id: " << node.getNodeId() << std::endl;
std::cout << "---------------------------------------------------------------------" << std::endl;
std::cout << " IP Address: " << node.getIPAddr() << std::endl;
std::cout << "---------------------------------------------------------------------" << std::endl;
}
void Network::printNetwork() {
std::cout << "----------------------------------------------------------------------" << std::endl;
std::cout << " Network" << std::endl;
std::cout << "----------------------------------------------------------------------" << std::endl;
std::cout << " Node Id IP Address State" << std::endl;
std::vector<Node>::iterator it;
for (it=network_.begin();it != network_.end(); ++it) {
std::cout << " " << (*it).getNodeId();
std::cout << " " << (*it).getIPAddr();
std::cout << std::endl;
}
}
| [
"john-james-sf@gmail.com"
] | john-james-sf@gmail.com |
4a9326cc4267127ab9ede3efe762d48816f0f235 | f2eac4342040772e2f0ebc01a57c37ae50216da5 | /Christopher/sketch_jan21a/sketch_jan21a.ino | b6766b793c17964585bd4bcaeab75e03e009c772 | [] | no_license | eatpoopandgrowstrong/AMP_CDIO | d4ebac1e6ff685ff528a7a943421a435cff6d954 | c51b75e46969edd2bfc2e7851cd7bc12a9606152 | refs/heads/master | 2023-03-19T16:04:50.057009 | 2021-03-11T05:28:05 | 2021-03-11T05:28:05 | 312,161,148 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 356 | ino | const int LED = 6;
const int LED2 = 5;
void setup() {
// put your setup code here, to run once:
pinMode(LED,OUTPUT);
pinMode(LED2,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(LED,HIGH);
delay(500);
digitalWrite(LED,LOW);
delay(500);
digitalWrite(LED2,HIGH);
delay(500);
digitalWrite(LED2,LOW);
delay(500);
}
| [
"CTJH22.19@ICHAT.SP.EDU.SG"
] | CTJH22.19@ICHAT.SP.EDU.SG |
0beea8c0462ba9bee0e4c44b05a75e411c25c3a8 | 39449cefc9e3e4add1cd204d59fdd76f58686e5e | /src/Shaders.h | 29549ff85edc3da3ea511e5e49e4ff42f403ca3b | [] | no_license | Skyminers/CGHW4 | 8d94538dfda9777fc2973eca8a1ee64c4296dfb6 | 86f296d897d12078cf27557425a5b4b549c0f20e | refs/heads/master | 2023-01-01T21:44:48.572382 | 2020-10-26T03:02:45 | 2020-10-26T03:02:45 | 306,259,708 | 8 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,326 | h | //
// Created by 刘一辰 on 2020/10/24.
//
#ifndef GLTEST_SHADERS_H
#define GLTEST_SHADERS_H
#include <glad/glad.h>
#include <glm/glm.hpp>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
class Shaders {
public:
unsigned int ID;
Shaders(const char* vertexShaderFile, const char* fragmentShaderFile);
~Shaders();
void useProgram();
void setBool(const std::string &name, bool value) const;
void setInt(const std::string &name, int value) const;
void setFloat(const std::string &name, float value) const;
void setVec2(const std::string &name, const glm::vec2 &value) const;
void setVec2(const std::string &name, float x, float y) const;
void setVec3(const std::string &name, const glm::vec3 &value) const;
void setVec3(const std::string &name, float x, float y, float z) const;
void setVec4(const std::string &name, const glm::vec4 &value) const;
void setVec4(const std::string &name, float x, float y, float z, float w);
void setMat2(const std::string &name, const glm::mat2 &mat) const;
void setMat3(const std::string &name, const glm::mat3 &mat) const;
void setMat4(const std::string &name, const glm::mat4 &mat) const;
private:
void checkCompileErrors(GLuint shader, std::string type);
};
#endif //GLTEST_SHADERS_H
| [
"458482582@qq.com"
] | 458482582@qq.com |
7225b89c3b2eed9d9b7387012ce973328095c2b4 | fd3be021fcf480133f223a79571b6f1475e62920 | /src/ssc/tnlib/tnip.h | f7b55a6241e16996786d9997f318767ca7c462a0 | [] | no_license | cherodney/firefox-daemon | 121de37a587fe5f56d2318114acfec89aa2d3020 | ee65daca5debbe6c8d27fbddd906d82bd006014e | refs/heads/master | 2021-01-24T10:16:07.310042 | 2008-09-30T13:22:21 | 2008-09-30T13:22:21 | 65,323 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 633 | h | #ifndef TNIP_H
# define TNIP_H
# include "tnlib/tnstring.h"
# include <netinet/in.h>
class TNIP
{
protected:
TNString _ip;
uint8 _a;
uint8 _b;
uint8 _c;
uint8 _d;
public:
TNIP(void);
TNIP(const TNIP&);
TNIP(struct sockaddr_in *);
virtual ~TNIP(void);
TNIP& operator=(uint32);
TNIP& operator=(const TNIP&);
operator const char *() const;
void set(uint32 ip);
uint32 ip(void){return((_a<<24)|(_b<<16)|(_c<<8)|_d);}
};
#endif
| [
"jeff@baobabhealth.org"
] | jeff@baobabhealth.org |
b8db729b5438a11ee9d9758138adfd890c918aea | e18af5a806478f6e6fded2a2d83cc50b3052c71a | /手势识别相关文档和程序备份/2016-5-9-1/DLPGesture/CGNone.cpp | 89cc2578efa9ffd8ed75bfc09971ee23c625b46a | [
"MIT"
] | permissive | andyqian2015/Kinect- | 2bf8f6fde9a659c599910c928c968f78572eb7ff | 24436f89af49154ef006365634a52563313aee9a | refs/heads/master | 2020-03-25T05:04:15.706762 | 2018-08-05T04:11:08 | 2018-08-05T04:11:08 | 143,428,200 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,129 | cpp | #include "stdafx.h"
#include "CGNone.h"
namespace GestureEng
{
CGNone::CGNone() :CGstEnsenssial()
{
m_gstout.gtype = DualHand;
m_gstout.pos.x = 0.0;
m_gstout.pos.y = 0.0;
m_gstout.t = 0;
m_gstout.fScale = 1;
m_gstout.fScreenRotateAngle = 0;
m_gstout.fScreenPivot.x = 0.0;
m_gstout.fScreenPivot.y = 0.0;
}
void CGNone::GstTell(const std::vector<sAction> &r, sGesture &g)
{
DataRecieve(r, g);
for (int i = 0; i != r.size(); ++i)
{
int id = r[i].ID;
if (Up == r[i].st)
{
m_gstout.gtype = GNone;
m_gstout.t = m_sgs[id].t;
m_gstout.pos = m_sgs[id].pos_fin;
GestureOut(g);
ResetCtn();
}
//if (m_gstflag.over_flag | m_gstflag.click_flag)
ResetFlag(m_sgs[id], m_gstflags[id]);
}
}
void CGNone::ResetCtn()
{
m_gstout.gtype = DualHand;
// m_gstout.pos.x = 0.0;
// m_gstout.pos.y = 0.0;
// m_gstout.t = 0;
// m_gstout.fScale = 1;
// m_gstout.fScreenRotateAngle = 0;
// m_gstout.fScreenPivot.x = 0.0;
// m_gstout.fScreenPivot.y = 0.0;
}
void CGNone::GestureOut(sGesture &g)
{
g = m_gstout;
}
} | [
"andylina@163.com"
] | andylina@163.com |
1e799ae11ee39853b7a90b134f0cbd01e6750bdc | b22588340d7925b614a735bbbde1b351ad657ffc | /athena/Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/JEMHits.h | c44e2895b63a4c4f7619a03773464a5fd11d48a6 | [] | no_license | rushioda/PIXELVALID_athena | 90befe12042c1249cbb3655dde1428bb9b9a42ce | 22df23187ef85e9c3120122c8375ea0e7d8ea440 | refs/heads/master | 2020-12-14T22:01:15.365949 | 2020-01-19T03:59:35 | 2020-01-19T03:59:35 | 234,836,993 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,432 | h | /*
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
//***************************************************************************
// JEMHits.h - description
// -------------------
// begin : 25 05 2006
// email : Alan.Watson@cern.ch
// ***************************************************************************/
#ifndef JEMHits_H
#define JEMHits_H
#include "CLIDSvc/CLASS_DEF.h"
#include <iostream>
#ifndef TRIGGERSPACE
#include "TrigT1Interfaces/Coordinate.h"
#else
#include "Coordinate.h"
#endif
namespace LVL1 {
class JEMHits {
public:
JEMHits();
JEMHits(int crate, int module);
JEMHits(int crate, int module, const std::vector<unsigned int>& JetHits, int peak);
virtual ~JEMHits();
void setPeak(int peak);
void addJetHits(const std::vector<unsigned int>& hits);
int crate() const;
int module() const;
unsigned int JetHits() const;
const std::vector<unsigned int>& JetHitsVec() const;
int peak() const;
bool forward() const;
/** Internal data */
private:
int m_crate;
int m_module;
int m_peak;
std::vector <unsigned int> m_JetHits;
};
} // end of namespace
#ifndef JEMHits_ClassDEF_H
#include "TrigT1CaloEvent/JEMHits_ClassDEF.h"
#endif
#endif
| [
"rushioda@lxplus754.cern.ch"
] | rushioda@lxplus754.cern.ch |
8a768de2ca3ec6049887ad925d288f5cbaf0d1ef | 614284717489bddd6891a78bcb3a876e1bbf7073 | /ngraph/src/ngraph/runtime/reference/reverse.hpp | 355d4242f0fd853949008b4689252ca839c2358a | [
"Apache-2.0"
] | permissive | bartholmberg/openvino | 01e113438971dc7bdf4e1fe3d0563b823f0ecefd | bd42f09e98e0c155a1b9e75c21d0f51b34708bc9 | refs/heads/master | 2023-02-04T07:17:34.782966 | 2020-07-27T16:47:37 | 2020-07-27T16:47:37 | 261,867,844 | 1 | 0 | Apache-2.0 | 2020-05-06T20:11:00 | 2020-05-06T20:11:00 | null | UTF-8 | C++ | false | false | 2,036 | hpp | //*****************************************************************************
// Copyright 2017-2020 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//*****************************************************************************
#pragma once
#include <cmath>
#include "ngraph/coordinate_transform.hpp"
namespace ngraph
{
namespace runtime
{
namespace reference
{
template <typename T>
void reverse(const T* arg,
T* out,
const Shape& arg_shape,
const Shape& out_shape,
const AxisSet& reversed_axes)
{
// In fact arg_shape == out_shape, but we'll use both for stylistic consistency with
// other kernels.
CoordinateTransform arg_transform(arg_shape);
CoordinateTransform output_transform(out_shape);
for (Coordinate out_coord : output_transform)
{
Coordinate arg_coord = out_coord;
for (size_t i = 0; i < arg_coord.size(); i++)
{
if (reversed_axes.count(i) != 0)
{
arg_coord[i] = arg_shape[i] - arg_coord[i] - 1;
}
}
out[output_transform.index(out_coord)] = arg[arg_transform.index(arg_coord)];
}
}
}
}
}
| [
"alexey.suhov@intel.com"
] | alexey.suhov@intel.com |
37d01d5491816091da856a17fccc5746f445b750 | e0e6ca083ab1b70655942f2afbf5c8737fba4c5c | /Source/IRenderable.h | b5ae9cc42886306e40d0da3306513da0f28203ea | [] | no_license | mlshort/Zelda1 | dbef9d5505c7baa821371014dbe8ded33cd9ec88 | 82b7a4ea3af087a3856a9696ff054fb36ca1e8a2 | refs/heads/master | 2020-09-02T13:07:45.503353 | 2019-11-08T22:49:08 | 2019-11-08T22:49:08 | 219,228,706 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 695 | h | /**
* @file IRenderable.h
* @brief IRenderable abstract base class interface definition
* @author Mark L. Short
* @date March 12, 2017
*
* <b>Course:</b> CPSC 5377 Advanced Game Programming
*
* <b>Instructor:</b> Sean Orme
*
* <b>Assignment:</b> Zelda1
*
*/
#pragma once
#if !defined(__IRENDERABLE_H__)
#define __IRENDERABLE_H__
///////////////////////////////////////////////////////////////////////////////
// Forward Declarations
class CView;
struct __declspec(novtable) IRenderable
{
virtual ~IRenderable() = default;
virtual void Update(float fDeltaTime) = 0;
virtual void Render(const CView* pWhere) const = 0;
};
#endif | [
"markl_short@yahoo.com"
] | markl_short@yahoo.com |
32d5a158aa85c6cafa8149bf27b5baff3270369b | c52f8ddc2ff7f91f42007ee6b557ad1ca6a30b26 | /src/LayerListWidget.cpp | 6e14744e1346cc59e1c1b3e77cdebaaf2e20c1e4 | [
"MIT"
] | permissive | bjoernh/RunParticles | 14bdc17c71f56522157c48136757effb10f50564 | 309188c75277cd6227f7f8aab4f1e13bb94caa30 | refs/heads/master | 2020-07-02T22:23:57.219708 | 2019-08-15T14:59:11 | 2019-08-15T14:59:11 | 201,685,484 | 0 | 0 | null | 2019-08-10T21:37:16 | 2019-08-10T21:37:16 | null | UTF-8 | C++ | false | false | 5,618 | cpp |
#include "LayerListWidget.h"
#include <QString>
#include "Util.h"
#define DATE_FMT "MMM d, yyyy h:mm:ss ap"
void
LayerListWidgetItem::setData(int column, int role, const QVariant & value)
{
Qt::CheckState state = checkState(column);
QTreeWidgetItem::setData(column, role, value);
if (role == Qt::CheckStateRole && state != checkState(column)) {
LayerListWidget *myTree = dynamic_cast<LayerListWidget*>(treeWidget());
if (myTree)
myTree->itemChecked(this, column);
}
}
bool
LayerListWidgetItem::operator<(const QTreeWidgetItem & other) const
{
int sortCol = treeWidget()->sortColumn();
if (sortCol == LayerListWidget::ColumnStartTime) {
QDateTime myTime = data(sortCol,
LayerListWidget::DateTimeRole).toDateTime();
QDateTime otherTime = other.data(sortCol,
LayerListWidget::DateTimeRole).toDateTime();
return myTime < otherTime;
} else if (sortCol == LayerListWidget::ColumnDuration) {
unsigned int myDuration = data(sortCol,
LayerListWidget::NumericRole).toUInt();
unsigned int otherDuration = other.data(sortCol,
LayerListWidget::NumericRole).toUInt();
return myDuration < otherDuration;
} else {
return text(sortCol) < other.text(sortCol);
}
}
LayerListWidget::LayerListWidget(QWidget *parent)
: QTreeWidget(parent),
_frameLayerAction(new QAction("Frame selected layers", this)),
_lockViewAction(new QAction("Lock View to layer", this)),
_showLayersAction(new QAction("Show layers", this)),
_hideLayersAction(new QAction("Hide layers", this))
{
setObjectName("LayerListWidget");
setWindowTitle("Layer list");
setColumnCount(ColumnCount);
QStringList columns = QStringList() << "Visible" << "Name"
<< "Sport" << "Start" << "Duration";
setHeaderLabels(columns);
setSortingEnabled(true);
setSelectionMode(QAbstractItemView::ExtendedSelection);
addAction(_frameLayerAction);
addAction(_lockViewAction);
addAction(_showLayersAction);
addAction(_hideLayersAction);
connect(_frameLayerAction, &QAction::triggered,
this, &LayerListWidget::onFrameLayersSelected);
connect(_lockViewAction, &QAction::triggered,
this, &LayerListWidget::onLockViewSelected);
setContextMenuPolicy(Qt::ActionsContextMenu);
connect(this, &LayerListWidget::itemSelectionChanged,
this, &LayerListWidget::onSelectionChanged);
connect(_showLayersAction, &QAction::triggered,
this, &LayerListWidget::onShowLayersSelected);
connect(_hideLayersAction, &QAction::triggered,
this, &LayerListWidget::onHideLayersSelected);
sortByColumn(ColumnStartTime, Qt::AscendingOrder);
resizeColumnToContents(ColumnVisible);
}
LayerListWidget::~LayerListWidget()
{
// do nothing
}
void
LayerListWidget::addLayer(Layer *layer)
{
QString duration;
QStringList colData;
colData << ""
<< layer->name()
<< layer->sport()
<< layer->startTime().toString(DATE_FMT)
<< Util::secondsToString(layer->duration());
LayerListWidgetItem *item = new LayerListWidgetItem(this, colData);
item->setCheckState(ColumnVisible, ( layer->visible()
? Qt::Checked : Qt::Unchecked));
item->setData(ColumnName, LayerIdRole, QVariant(layer->id()));
item->setData(ColumnStartTime, DateTimeRole, QVariant(layer->startTime()));
item->setData(ColumnDuration, NumericRole, QVariant(layer->duration()));
}
QList<LayerId>
LayerListWidget::selectedLayerIds() const
{
QList<unsigned int> selectedIds;
QList<QTreeWidgetItem *> items = selectedItems();
QTreeWidgetItem *thisItem;
foreach(thisItem, items) {
selectedIds.push_back(thisItem->data(ColumnName, LayerIdRole).toUInt());
}
return selectedIds;
}
void
LayerListWidget::itemChecked(LayerListWidgetItem *which, int column)
{
if (column == ColumnVisible) {
LayerId layerId = which->data(ColumnName, LayerIdRole).toUInt();
emit signalLayerVisibilityChanged(layerId,
which->checkState(column) == Qt::Checked);
}
}
void
LayerListWidget::slotSetSelectedLayers(QList<LayerId> layerIds)
{
clearSelection();
QTreeWidgetItem *root = invisibleRootItem();
for (int i = 0; i < root->childCount(); i++) {
QTreeWidgetItem *item = root->child(i);
LayerId thisLayerId = item->data(ColumnName, LayerIdRole).toUInt();
if (layerIds.contains(thisLayerId)) {
item->setSelected(true);
if (layerIds.length() == 1)
setCurrentItem(item);
}
}
}
void
LayerListWidget::onSelectionChanged()
{
emit signalLayerSelectionChanged(selectedLayerIds());
}
void
LayerListWidget::onFrameLayersSelected()
{
emit signalFrameLayers(selectedLayerIds());
}
void LayerListWidget::onShowLayersSelected()
{
QTreeWidgetItem *myItem;
foreach(myItem, selectedItems()) {
myItem->setCheckState(ColumnVisible, Qt::Checked);
}
}
void LayerListWidget::onHideLayersSelected()
{
QTreeWidgetItem *myItem;
foreach(myItem, selectedItems()) {
myItem->setCheckState(ColumnVisible, Qt::Unchecked);
}
}
void
LayerListWidget::onLockViewSelected()
{
QList<LayerId> layerIds = selectedLayerIds();
if (!layerIds.empty())
emit signalLockViewToLayer(layerIds.last());
}
| [
"github@renderfast.com"
] | github@renderfast.com |
412702c9dd179f6a6cb274e9520228f7a21a4c33 | b09e22839cfade772bb522b09a6ddd4153b3a99b | /NDEProject/Graphics.cpp | a2c607ea60308835dfef2f5308f6d9256fe02af1 | [] | no_license | gborachev95/NDE | 50c9adf97a5eb18bcbb4ee0c5f1124dda100f771 | ffb79591484e11cf50bc637e0394682be29e2684 | refs/heads/master | 2021-08-26T07:25:10.975513 | 2017-11-22T06:08:38 | 2017-11-22T06:08:38 | 111,641,671 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 39,237 | cpp | #include "Graphics.h"
#include "OBJECT_VS.csh"
#include "OBJECT_PS.csh"
#include "OBJECT_VS_TARGET.csh"
#include "OBJECT_PS_TARGET.csh"
#include "ANIMATION_VS.csh"
#include "POST_PROCESSING_VS.csh"
#include "POST_PROCESSING_PS.csh"
#include "PARTICLE_VS.csh"
#include "PARTICLE_PS.csh"
#include "UI_VS.csh"
#include "UI_PS.csh"
#include "INSTANCING_VS.csh"
#include "SpriteBatch.h"
#include "SpriteFont.h"
#define COLOR_TEST 0
// Statics
HWND Graphics::m_window;
HINSTANCE Graphics::m_application;
WNDPROC Graphics::m_appWndProc;
std::unique_ptr<Keyboard> Graphics::single_keyboard = NULL;
std::unique_ptr<Mouse> Graphics::single_mouse = NULL;
CComPtr<IDXGISwapChain> Graphics::m_swapChain;
CComPtr<ID3D11Device> Graphics::m_device;
CComPtr<ID3D11DeviceContext> Graphics::m_deviceContext;
CComPtr<ID3D11RasterizerState> Graphics::m_rasterState;
CComPtr<ID3D11RasterizerState> Graphics::m_wireRasterState;
CComPtr<ID3D11Texture2D> Graphics::m_depthBuffer;
CComPtr<ID3D11DepthStencilView> Graphics::m_depthView;
CComPtr<ID3D11DepthStencilState> Graphics::m_depthState;
CComPtr<ID3D11DepthStencilState> Graphics::m_depthStateFront;
CComPtr<ID3D11RenderTargetView> Graphics::m_renderTargetView;
D3D11_VIEWPORT Graphics::m_viewPort;
CComPtr<ID3D11SamplerState> Graphics::m_samplerState;
CComPtr<ID3D11BlendState> Graphics::m_blendTransperentState;
CComPtr<ID3D11Buffer> Graphics::m_structBuffer;
CComPtr<ID3D11ShaderResourceView> Graphics::m_resourceViewStruct;
COLOR Graphics::m_backColor;
bool Graphics::m_resized;
bool Graphics::m_fullscreen;
bool Graphics::m_debugWire;
unsigned int Graphics::m_backBufferWidth;
unsigned int Graphics::m_backBufferHeight;
std::vector<CComPtr<ID3D11VertexShader>> Graphics::m_vsShaders;
std::vector<CComPtr<ID3D11PixelShader>> Graphics::m_psShaders;
std::vector<CComPtr<ID3D11InputLayout>> Graphics::m_layouts;
CComPtr<ID3D11RenderTargetView> Graphics::m_postRenderTargetView;
CComPtr<ID3D11Texture2D> Graphics::m_postTexture;
CComPtr<ID3D11ShaderResourceView> Graphics::m_postShaderResourceView;
CComPtr<ID3D11DepthStencilView> Graphics::m_postDepthView;
CComPtr<ID3D11Buffer> Graphics::m_postDataConstBuffer;
CComPtr<ID3D11Buffer> Graphics::m_quadPostBuffer;
CComPtr<ID3D11Buffer> Graphics::m_quadPostIndexBuffer;
CComPtr<ID3D11Texture2D> Graphics::m_postDepthBuffer;
CComPtr<ID3D11ShaderResourceView> Graphics::m_postZShaderToResourceView;
POST_DATA_TO_VRAM Graphics::m_postData;
XTime Graphics::m_timer;
BUFFER_STRUCT *Graphics::m_bufferStruct;
// Globals
std::unique_ptr<SpriteBatch> g_Sprites;
std::unique_ptr<SpriteFont> g_FontFrank;
std::unique_ptr<SpriteFont> g_FontItalic;
unsigned int g_flags = NULL;
const int sizeGrid = 1000;
// Constructor
Graphics::Graphics()
{
}
// Initializing
Graphics::Graphics(HINSTANCE _hinst, WNDPROC _proc)
{
#ifdef DEBUG
g_flags = D3D11_CREATE_DEVICE_DEBUG;
#endif
single_keyboard = make_unique<Keyboard>();
single_mouse = make_unique<Mouse>();
m_resized = false;
m_backBufferHeight = WINDOW_HEIGHT;
m_backBufferWidth = WINDOW_WIDTH;
m_debugWire = false;
m_backColor.SetColor(0.39f, 0.58f, 0.92f, 1.0f);
// Creates the window
CreateAppWindow(_hinst, _proc);
// Creates the swapchain and back buffer
Initialize();
// Creates the view port
CreateViewPorts();
// Initilizing the depth stencil view
CreateDepthBuffer();
// Creating the shaders
CreateShaders();
// Creating the layouts for the shaders
CreateLayouts();
// Create a sampler state
CreateSamplerState();
// Creates a rasterizer state
CreateRasterState();
// Creates the post quad filter
CreatePostFilterQuad();
// Creates the post processing texture
CreatePostProcessingTexture();
CreateConstBuffers();
CreateBlendState();
m_postData.data[0] = 0.0f;
m_postData.data[1] = -0.3f;
g_Sprites.reset(new SpriteBatch(m_deviceContext.p));
g_FontFrank.reset(new SpriteFont(m_device.p, L"..\\NDEProject\\Assets\\FrankKnows.spritefont"));
g_FontItalic.reset(new SpriteFont(m_device.p, L"..\\NDEProject\\Assets\\italic.spritefont"));
#if COLOR_TEST
m_bufferStruct = new BUFFER_STRUCT[sizeGrid];
//CreateStructBuffer();
#endif
}
// Destructor
Graphics::~Graphics()
{
#if COLOR_TEST
delete m_bufferStruct;
#endif
}
// Resize Window
void Graphics::ResizeWindow()
{
if (m_swapChain)
{
HWND desktop = GetDesktopWindow();
RECT rect;
GetWindowRect(desktop, &rect);
if (!m_fullscreen)
{
m_fullscreen = true;
m_backBufferHeight = rect.bottom;
m_backBufferWidth = rect.right;
}
else
{
m_fullscreen = false;
m_backBufferHeight = WINDOW_HEIGHT;
m_backBufferWidth = WINDOW_WIDTH;
}
// Resizing the depth buffer
m_depthBuffer.Release();
m_depthView.Release();
m_renderTargetView.Release();
// Set the buffer parameters
m_swapChain->ResizeBuffers(1, m_backBufferWidth, m_backBufferHeight, DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH);
// Creation of the texture
D3D11_TEXTURE2D_DESC textureDesc;
ZeroMemory(&textureDesc, sizeof(D3D11_TEXTURE2D_DESC));
textureDesc.Width = m_backBufferWidth;
textureDesc.Height = m_backBufferHeight;
textureDesc.Format = DXGI_FORMAT_D32_FLOAT;
textureDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL;
textureDesc.MipLevels = 1;
textureDesc.ArraySize = 1;
textureDesc.SampleDesc.Count = 1;
textureDesc.SampleDesc.Quality = 0;
textureDesc.Usage = D3D11_USAGE_DEFAULT;
m_device->CreateTexture2D(&textureDesc, nullptr, &m_depthBuffer.p);
// Creation of the depth stencil view
D3D11_DEPTH_STENCIL_VIEW_DESC depthDesc;
ZeroMemory(&depthDesc, sizeof(D3D11_DEPTH_STENCIL_VIEW_DESC));
depthDesc.Format = DXGI_FORMAT_D32_FLOAT;
depthDesc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D;
depthDesc.Texture2D.MipSlice = 0;
m_device->CreateDepthStencilView(m_depthBuffer.p, nullptr, &m_depthView.p);
// Resizing the viewport
ZeroMemory(&m_viewPort, sizeof(m_viewPort));
m_viewPort.Width = float(m_backBufferWidth);
m_viewPort.Height = float(m_backBufferHeight);
m_viewPort.MaxDepth = 1;
// Setting the backbuffer
ID3D11Texture2D *backBuffer;
m_swapChain->GetBuffer(0, __uuidof(backBuffer), (LPVOID*)(&backBuffer));
// Creating the render view
m_device->CreateRenderTargetView(backBuffer, NULL, &m_renderTargetView.p);
backBuffer->Release();
m_resized = true;
ResizePPTexture(m_backBufferWidth, m_backBufferHeight);
// Swapchain resize function
if (m_fullscreen)
m_swapChain->SetFullscreenState(true, nullptr);
else
m_swapChain->SetFullscreenState(false, nullptr);
}
}
// TODO:: WORK ON RESIZING
void Graphics::ResizeTextures(unsigned int _width, unsigned int _height)
{
// Releasing
//m_renderToTexture.Release();
//zRendertoTextureBuffer.Release();
//m_renderTargetView.Release();
//renderToShaderResourceView.Release();
//m_depthBuffer.Release();
//// Creation of the texture
//D3D11_TEXTURE2D_DESC textureDesc;
//ZeroMemory(&textureDesc, sizeof(D3D11_TEXTURE2D_DESC));
//textureDesc.Width = _width;
//textureDesc.Height = _height;
//textureDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
//textureDesc.BindFlags = D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE;
//textureDesc.MiscFlags = D3D11_RESOURCE_MISC_GENERATE_MIPS;
//textureDesc.Usage = D3D11_USAGE_DEFAULT;
//textureDesc.MipLevels = 1;
//textureDesc.ArraySize = 1;
//textureDesc.SampleDesc.Count = 1;
//textureDesc.SampleDesc.Quality = 0;
//m_device->CreateTexture2D(&textureDesc, NULL, &renderToTexture.p);
// Render target
//D3D11_RENDER_TARGET_VIEW_DESC renderTargetViewDesc;
//ZeroMemory(&renderTargetViewDesc, sizeof(D3D11_RENDER_TARGET_VIEW_DESC));
//renderTargetViewDesc.Format = textureDesc.Format;
//renderTargetViewDesc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D;
//m_device->CreateRenderTargetView(renderToTexture, NULL, &RenderTargetViewToTexture.p);
//Device->CreateShaderResourceView(renderToTexture, NULL, &renderToShaderResourceView);
//// Creation of the texture for depth buffer
//ZeroMemory(&textureDesc, sizeof(D3D11_TEXTURE2D_DESC));
//textureDesc.Width = _width;
//textureDesc.Height = _height;
//textureDesc.Format = DXGI_FORMAT_D32_FLOAT;
//textureDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL;
//textureDesc.MipLevels = 1;
//textureDesc.ArraySize = 1;
//textureDesc.SampleDesc.Count = 1;
//textureDesc.SampleDesc.Quality = 0;
//textureDesc.Usage = D3D11_USAGE_DEFAULT;
//
//// Creation of the depth stencil view
//D3D11_DEPTH_STENCIL_VIEW_DESC depthDesc;
//ZeroMemory(&depthDesc, sizeof(D3D11_DEPTH_STENCIL_VIEW_DESC));
//depthDesc.Format = DXGI_FORMAT_D32_FLOAT;
//depthDesc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D;
//depthDesc.Texture2D.MipSlice = 0;
//
//// Creation of the texture for render to texture
//Device->CreateTexture2D(&textureDesc, nullptr, &zRendertoTextureBuffer.p);
//// Creation of the depth stencil view
//Device->CreateDepthStencilView(zRendertoTextureBuffer.p, &depthDesc, &depthRenderToTextureView.p);
}
void Graphics::ResizePPTexture(unsigned int _width, unsigned int _height)
{
// Releasing
m_postTexture.Release();
m_postRenderTargetView.Release();
m_postShaderResourceView.Release();
m_postDepthView.Release();
m_postDepthBuffer.Release();
m_postZShaderToResourceView.Release();
CreatePostProcessingTexture();
// Creation of the texture
D3D11_TEXTURE2D_DESC textureDesc;
ZeroMemory(&textureDesc, sizeof(D3D11_TEXTURE2D_DESC));
textureDesc.Width = _width;
textureDesc.Height = _height;
textureDesc.Format = DXGI_FORMAT_R32_TYPELESS;
textureDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL | D3D11_BIND_SHADER_RESOURCE;
textureDesc.MipLevels = 1;
textureDesc.ArraySize = 1;
textureDesc.SampleDesc.Count = 1;
textureDesc.SampleDesc.Quality = 0;
textureDesc.Usage = D3D11_USAGE_DEFAULT;
// Creation of the depth stencil view
D3D11_DEPTH_STENCIL_VIEW_DESC depthDesc;
ZeroMemory(&depthDesc, sizeof(D3D11_DEPTH_STENCIL_VIEW_DESC));
depthDesc.Format = DXGI_FORMAT_D32_FLOAT;
depthDesc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D;
D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc;
ZeroMemory(&srvDesc, sizeof(D3D11_SHADER_RESOURCE_VIEW_DESC));
srvDesc.Format = DXGI_FORMAT_R32_FLOAT;
srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
srvDesc.Texture2D.MipLevels = 1;
// Post processing
// Creation of the texture for render to texture
m_device->CreateTexture2D(&textureDesc, nullptr, &m_postDepthBuffer.p);
// Creation of the depth stencil view
m_device->CreateDepthStencilView(m_postDepthBuffer.p, &depthDesc, &m_postDepthView.p);
m_device->CreateShaderResourceView(m_postDepthBuffer, &srvDesc, &m_postZShaderToResourceView.p);
}
// Renders the scene
void Graphics::Render()
{
m_timer.Signal();
// Blend state for transperancy
float blendFactor[] = { 0, 0, 0, 0 };
unsigned int sampleMask = 0xffffffff;
m_deviceContext->OMSetBlendState(m_blendTransperentState, blendFactor, sampleMask);
// Setting the render target with the depth buffer
m_deviceContext->RSSetViewports(1, &m_viewPort);
m_deviceContext->OMSetRenderTargets(1, &m_postRenderTargetView.p, m_postDepthView.p);
//m_deviceContext->OMSetRenderTargets(1, &m_renderTargetView.p, m_depthView.p);
if (m_debugWire)
m_deviceContext->RSSetState(m_wireRasterState.p);
else
m_deviceContext->RSSetState(m_rasterState.p);
m_deviceContext->PSSetSamplers(0, 1, &m_samplerState.p);
// Clearing the screen
ClearScreen(m_backColor);
#if COLOR_TEST
// TESTING:: Set the deffered rendering shader resource
m_deviceContext->PSSetShaderResources(4, 1, &m_resourceViewStruct.p);
#endif
}
// Post render to the screen
void Graphics::PostRender()
{
if (m_debugWire)
m_deviceContext->RSSetState(m_rasterState.p);
m_deviceContext->OMSetRenderTargets(1, &m_renderTargetView.p, m_depthView.p);
// Render the Quad filter
unsigned int stride = sizeof(SM_VERTEX);
unsigned int offset = 0;
// Set the buffers
m_deviceContext->IASetVertexBuffers(0, 1, &m_quadPostBuffer.p, &stride, &offset);
m_deviceContext->IASetIndexBuffer(m_quadPostIndexBuffer, DXGI_FORMAT_R32_UINT, 0);
m_deviceContext->VSSetShader(m_vsShaders[POST_PROCESSING], NULL, NULL);
m_deviceContext->PSSetShader(m_psShaders[POST_PROCESSING], NULL, NULL);
m_deviceContext->IASetInputLayout(m_layouts[POST_PROCESSING]);
// Setting constant buffers - first parameter is the regester (b0) in shader
m_deviceContext->VSSetConstantBuffers(0, 1, &m_postDataConstBuffer.p);
m_deviceContext->PSSetConstantBuffers(0, 1, &m_postDataConstBuffer.p);
// Set the shader resource - for the texture
m_deviceContext->PSSetShaderResources(0, 1, &m_postShaderResourceView.p);
m_deviceContext->PSSetShaderResources(1, 1, &m_postZShaderToResourceView.p);
// Post effect information
m_postData.data[0] = float(m_timer.TotalTimeExact());
// DEBUG::TEMPORARY
#if 0
if (single_keyboard->GetState().Z)
m_postData.data[1] += float(m_timer.Delta());
else if(single_keyboard->GetState().X)
m_postData.data[1] -= float(m_timer.Delta());
#endif
D3D11_MAPPED_SUBRESOURCE mapSubresource;
ZeroMemory(&mapSubresource, sizeof(mapSubresource));
m_deviceContext->Map(m_postDataConstBuffer, NULL, D3D11_MAP_WRITE_DISCARD, NULL, &mapSubresource);
memcpy(mapSubresource.pData, &m_postData, sizeof(POST_DATA_TO_VRAM));
m_deviceContext->Unmap(m_postDataConstBuffer, NULL);
// Drawing the filter quad
m_deviceContext->DrawIndexed(6, 0, 0);
// Don't read from the shader anymore
CComPtr<ID3D11ShaderResourceView> nullShaderResourceView;
m_deviceContext->PSSetShaderResources(0, 1, &nullShaderResourceView.p);
m_deviceContext->PSSetShaderResources(1, 1, &nullShaderResourceView.p);
m_deviceContext->OMSetRenderTargets(1, &m_renderTargetView.p, m_depthView.p);
// Cleaning the depth buffer so it gives the infinite look
m_deviceContext->ClearDepthStencilView(m_depthView.p, D3D11_CLEAR_DEPTH, 1, 0);
}
// Terminates the application
bool Graphics::ShutDown()
{
m_swapChain->SetFullscreenState(false, NULL);
UnregisterClass(L"DirectXApplication", m_application);
return true;
}
// Creates the window
void Graphics::CreateAppWindow(HINSTANCE _hinst, WNDPROC _proc)
{
m_application = _hinst;
m_appWndProc = _proc;
// Setting up the window
WNDCLASSEX wndClass;
ZeroMemory(&wndClass, sizeof(wndClass));
wndClass.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
wndClass.lpfnWndProc = m_appWndProc;
wndClass.hInstance = m_application;
wndClass.cbSize = sizeof(WNDCLASSEX);
//wndClass.hIcon = LoadIcon(NULL, MAKEINTRESOURCE(IDI_WINLOGO));
wndClass.hIconSm = wndClass.hIcon;
wndClass.lpszClassName = L"NDEProject";
wndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndClass.hbrBackground = (HBRUSH)(COLOR_3DFACE);
RegisterClassEx(&wndClass);
// Window size rectangle
RECT window_size = { 0, 0,WINDOW_WIDTH, WINDOW_HEIGHT };
AdjustWindowRect(&window_size, WS_BORDER/*WS_OVERLAPPEDWINDOW*/, false);
// Creating the window
m_window = CreateWindow(L"NDEProject", L"Near Death Experience", WS_BORDER/*WS_OVERLAPPEDWINDOW*/, CW_USEDEFAULT, CW_USEDEFAULT,
window_size.right - window_size.left, window_size.bottom - window_size.top, NULL, NULL, m_application, this);
// Moving it to the center
RECT desktop;
// Get a handle to the desktop window
const HWND hDesktop = GetDesktopWindow();
// Get the size of screen to the variable desktop
GetWindowRect(hDesktop, &desktop);
// The top left corner will have coordinates (0,0) and the bottom right corner will have coordinates (horizontal, vertical)
int hX = int(desktop.right * 0.5f) - int(WINDOW_WIDTH * 0.5f);
int vY = int(desktop.bottom * 0.5f) - int(WINDOW_HEIGHT * 0.5f);
SetWindowPos(m_window, 0, hX, vY, 0, 0, SWP_NOSIZE);
//HCURSOR hCursor = LoadCursor(NULL, L"..\\NDEProject\\Assets\\Cursor_Industrialized.png");
//SetCursor(hCursor);
// Turning off windows window settings
LONG lStyle = GetWindowLong(m_window, GWL_STYLE);
lStyle &= ~(/*WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE |*/ WS_SYSMENU);
SetWindowLong(m_window, GWL_STYLE, lStyle);
// Showing the window
ShowCursor(false);
ShowWindow(m_window, SW_SHOW);
}
// Clears the screen
void Graphics::ClearScreen(COLOR _color)
{
m_deviceContext->ClearRenderTargetView(m_postRenderTargetView.p, _color.GetColor());
m_deviceContext->ClearDepthStencilView(m_postDepthView.p, D3D11_CLEAR_DEPTH, 1, 0);
}
void Graphics::ClearBaseScreen(COLOR _color)
{
m_deviceContext->ClearRenderTargetView(m_renderTargetView.p, _color.GetColor());
m_deviceContext->ClearDepthStencilView(m_depthView.p, D3D11_CLEAR_DEPTH, 1, 0);
}
// Initializes graphics
void Graphics::Initialize()
{
DXGI_SWAP_CHAIN_DESC swapChainDesc;
// Creating the swap chain and the device
ZeroMemory(&swapChainDesc, sizeof(swapChainDesc));
// Set the buffer parameters
DXGI_MODE_DESC buffer;
ZeroMemory(&buffer, sizeof(DXGI_MODE_DESC));
buffer.Height = m_backBufferHeight;
buffer.Width = m_backBufferWidth;
buffer.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
// Set the swap chain desc parameters
swapChainDesc.BufferDesc = buffer;
swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
swapChainDesc.BufferCount = 1;
swapChainDesc.OutputWindow = m_window;
swapChainDesc.Windowed = TRUE;
swapChainDesc.SampleDesc.Count = 1;
swapChainDesc.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH;
// For frame capping
swapChainDesc.BufferDesc.RefreshRate.Numerator = 60;
swapChainDesc.BufferDesc.RefreshRate.Denominator = 1;
// Create the device and swap chain
HRESULT hresultHandle = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, g_flags,
NULL, NULL, D3D11_SDK_VERSION, &swapChainDesc, &m_swapChain, &m_device, NULL, &m_deviceContext);
// Setting the backbuffer
CComPtr<ID3D11Texture2D> backBuffer;
m_swapChain->GetBuffer(0, __uuidof(backBuffer), (LPVOID*)&backBuffer/* reinterpret_cast<void**>(&backBuffer)*/);
// Creating the render view
m_device->CreateRenderTargetView(backBuffer, NULL, &m_renderTargetView.p);
}
// Creates depth buffer
void Graphics::CreateDepthBuffer()
{
// Creation of the texture
D3D11_TEXTURE2D_DESC textureDesc;
ZeroMemory(&textureDesc, sizeof(D3D11_TEXTURE2D_DESC));
textureDesc.Width = m_backBufferWidth;
textureDesc.Height = m_backBufferHeight;
textureDesc.Format = DXGI_FORMAT_R32_TYPELESS;
textureDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL | D3D11_BIND_SHADER_RESOURCE;
textureDesc.MipLevels = 1;
textureDesc.ArraySize = 1;
textureDesc.SampleDesc.Count = 1;
textureDesc.SampleDesc.Quality = 0;
textureDesc.Usage = D3D11_USAGE_DEFAULT;
// Creation of the depth stencil view
D3D11_DEPTH_STENCIL_VIEW_DESC depthDesc;
ZeroMemory(&depthDesc, sizeof(D3D11_DEPTH_STENCIL_VIEW_DESC));
depthDesc.Format = DXGI_FORMAT_D32_FLOAT;
depthDesc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D;
D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc;
ZeroMemory(&srvDesc, sizeof(D3D11_SHADER_RESOURCE_VIEW_DESC));
srvDesc.Format = DXGI_FORMAT_R32_FLOAT;
srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
srvDesc.Texture2D.MipLevels = 1;
m_device->CreateTexture2D(&textureDesc, nullptr, &m_depthBuffer.p);
m_device->CreateDepthStencilView(m_depthBuffer.p, &depthDesc, &m_depthView.p);
D3D11_DEPTH_STENCIL_DESC dpthStencil;
ZeroMemory(&dpthStencil, sizeof(D3D11_DEPTH_STENCIL_DESC));
dpthStencil.DepthEnable = TRUE;
dpthStencil.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL;
dpthStencil.DepthFunc = D3D11_COMPARISON_LESS;
dpthStencil.StencilEnable = FALSE;
dpthStencil.StencilReadMask = D3D11_DEFAULT_STENCIL_READ_MASK;
dpthStencil.StencilWriteMask = D3D11_DEFAULT_STENCIL_WRITE_MASK;
dpthStencil.FrontFace.StencilFunc = D3D11_COMPARISON_ALWAYS;
dpthStencil.BackFace.StencilFunc = D3D11_COMPARISON_ALWAYS;
dpthStencil.FrontFace.StencilDepthFailOp = D3D11_STENCIL_OP_KEEP;
dpthStencil.BackFace.StencilDepthFailOp = D3D11_STENCIL_OP_KEEP;
dpthStencil.FrontFace.StencilPassOp = D3D11_STENCIL_OP_KEEP;
dpthStencil.BackFace.StencilPassOp = D3D11_STENCIL_OP_KEEP;
dpthStencil.FrontFace.StencilFailOp = D3D11_STENCIL_OP_KEEP;
dpthStencil.BackFace.StencilFailOp = D3D11_STENCIL_OP_KEEP;
m_device->CreateDepthStencilState(&dpthStencil, &m_depthState.p);
// Post processing
// Creation of the texture for render to texture
m_device->CreateTexture2D(&textureDesc, nullptr, &m_postDepthBuffer.p);
// Creation of the depth stencil view
m_device->CreateDepthStencilView(m_postDepthBuffer.p, &depthDesc, &m_postDepthView.p);
m_device->CreateShaderResourceView(m_postDepthBuffer, &srvDesc, &m_postZShaderToResourceView.p);
// Render outfront stencil buffer
ZeroMemory(&dpthStencil, sizeof(D3D11_DEPTH_STENCIL_DESC));
dpthStencil.DepthEnable = TRUE;
dpthStencil.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL;
dpthStencil.DepthFunc = D3D11_COMPARISON_GREATER;
dpthStencil.StencilEnable = FALSE;
dpthStencil.StencilReadMask = D3D11_DEFAULT_STENCIL_READ_MASK;
dpthStencil.StencilWriteMask = D3D11_DEFAULT_STENCIL_WRITE_MASK;
dpthStencil.FrontFace.StencilFunc = D3D11_COMPARISON_ALWAYS;
dpthStencil.BackFace.StencilFunc = D3D11_COMPARISON_ALWAYS;
dpthStencil.FrontFace.StencilDepthFailOp = D3D11_STENCIL_OP_KEEP;
dpthStencil.BackFace.StencilDepthFailOp = D3D11_STENCIL_OP_KEEP;
dpthStencil.FrontFace.StencilPassOp = D3D11_STENCIL_OP_KEEP;
dpthStencil.BackFace.StencilPassOp = D3D11_STENCIL_OP_KEEP;
dpthStencil.FrontFace.StencilFailOp = D3D11_STENCIL_OP_KEEP;
dpthStencil.BackFace.StencilFailOp = D3D11_STENCIL_OP_KEEP;
m_device->CreateDepthStencilState(&dpthStencil, &m_depthStateFront.p);
}
// Create view ports
void Graphics::CreateViewPorts()
{
// Creating the view port
ZeroMemory(&m_viewPort, sizeof(m_viewPort));
m_viewPort.Width = WINDOW_WIDTH;
m_viewPort.Height = WINDOW_HEIGHT;
m_viewPort.MaxDepth = 1;
}
// Creates the layouts
void Graphics::CreateLayouts()
{
CComPtr<ID3D11InputLayout> inputLayoutObject;
CComPtr<ID3D11InputLayout> inputLayoutAnimation;
CComPtr<ID3D11InputLayout> inputLayoutPostProcessor;
CComPtr<ID3D11InputLayout> inputLayoutParticles;
CComPtr<ID3D11InputLayout> inputLayoutUI;
CComPtr<ID3D11InputLayout> inputLayoutInstanced;
D3D11_INPUT_ELEMENT_DESC vLayoutTrival[] =
{
{ "POSITION", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "UV", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 }
};
D3D11_INPUT_ELEMENT_DESC vLayoutParticle[] =
{
{ "SIDE", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "UP", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "FORWARD", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "POSITION", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "UV", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 }
};
D3D11_INPUT_ELEMENT_DESC vLayoutObject[] =
{
{ "POSITION", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "NORMALS", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "UV", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "TANGENTS", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "BITANGENTS", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "SKIN_INDICES", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "SKIN_WEIGHT", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
};
D3D11_INPUT_ELEMENT_DESC vLayoutAnimation[] =
{
{ "POSITION", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "NORMALS", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "UV", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "TANGENTS", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "BITANGENTS", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "SKIN_INDICES", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "SKIN_WEIGHT", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
};
// Creating layouts // TODO:: TRIVAL VS
m_device->CreateInputLayout(vLayoutObject, ARRAYSIZE(vLayoutObject), OBJECT_VS, sizeof(OBJECT_VS), &inputLayoutObject.p);
m_device->CreateInputLayout(vLayoutAnimation, ARRAYSIZE(vLayoutAnimation), ANIMATION_VS, sizeof(ANIMATION_VS), &inputLayoutAnimation.p);
m_device->CreateInputLayout(vLayoutTrival, ARRAYSIZE(vLayoutTrival), POST_PROCESSING_VS, sizeof(POST_PROCESSING_VS), &inputLayoutPostProcessor.p);
m_device->CreateInputLayout(vLayoutParticle, ARRAYSIZE(vLayoutParticle), PARTICLE_VS, sizeof(PARTICLE_VS), &inputLayoutParticles.p);
m_device->CreateInputLayout(vLayoutTrival, ARRAYSIZE(vLayoutTrival), UI_VS, sizeof(UI_VS), &inputLayoutUI.p);
m_device->CreateInputLayout(vLayoutObject, ARRAYSIZE(vLayoutObject), INSTANCING_VS, sizeof(INSTANCING_VS), &inputLayoutInstanced.p);
m_layouts.push_back(inputLayoutObject);
m_layouts.push_back(inputLayoutAnimation);
m_layouts.push_back(inputLayoutPostProcessor);
m_layouts.push_back(inputLayoutParticles);
m_layouts.push_back(inputLayoutUI);
m_layouts.push_back(inputLayoutInstanced);
m_layouts.push_back(inputLayoutObject);
}
// Create shaders
void Graphics::CreateShaders()
{
CComPtr<ID3D11VertexShader> VS_OBJECT;
CComPtr<ID3D11VertexShader> VS_ANIMATION;
CComPtr<ID3D11PixelShader> PS_OBJECT;
CComPtr<ID3D11VertexShader> VS_OBJECT_TARGET;
CComPtr<ID3D11PixelShader> PS_OBJECT_TARGET;
CComPtr<ID3D11VertexShader> VS_POST_PROCESSING;
CComPtr<ID3D11PixelShader> PS_POST_PROCESSING;
CComPtr<ID3D11VertexShader> VS_PARTICLES;
CComPtr<ID3D11PixelShader> PS_PARTICLES;
CComPtr<ID3D11VertexShader> VS_UI;
CComPtr<ID3D11PixelShader> PS_UI;
CComPtr<ID3D11VertexShader> VS_INSTANCING;
// Creates the shaders for the Object
m_device->CreateVertexShader(OBJECT_VS, sizeof(OBJECT_VS), nullptr, &VS_OBJECT.p);
m_device->CreatePixelShader(OBJECT_PS, sizeof(OBJECT_PS), nullptr, &PS_OBJECT.p);
m_device->CreateVertexShader(OBJECT_VS_TARGET, sizeof(OBJECT_VS_TARGET), nullptr, &VS_OBJECT_TARGET.p);
m_device->CreatePixelShader(OBJECT_PS_TARGET, sizeof(OBJECT_PS_TARGET), nullptr, &PS_OBJECT_TARGET.p);
m_device->CreateVertexShader(ANIMATION_VS, sizeof(ANIMATION_VS), nullptr, &VS_ANIMATION.p);
m_device->CreateVertexShader(POST_PROCESSING_VS, sizeof(POST_PROCESSING_VS), nullptr, &VS_POST_PROCESSING.p);
m_device->CreatePixelShader(POST_PROCESSING_PS, sizeof(POST_PROCESSING_PS), nullptr, &PS_POST_PROCESSING.p);
m_device->CreateVertexShader(PARTICLE_VS, sizeof(PARTICLE_VS), nullptr, &VS_PARTICLES.p);
m_device->CreatePixelShader(PARTICLE_PS, sizeof(PARTICLE_PS), nullptr, &PS_PARTICLES.p);
m_device->CreateVertexShader(UI_VS, sizeof(UI_VS), nullptr, &VS_UI.p);
m_device->CreatePixelShader(UI_PS, sizeof(UI_PS), nullptr, &PS_UI.p);
m_device->CreateVertexShader(INSTANCING_VS, sizeof(INSTANCING_VS), nullptr, &VS_INSTANCING.p);
// Normal Objects
m_vsShaders.push_back(VS_OBJECT);
m_psShaders.push_back(PS_OBJECT);
// Animated Objects
m_vsShaders.push_back(VS_ANIMATION);
m_psShaders.push_back(PS_OBJECT);
// Post processing
m_vsShaders.push_back(VS_POST_PROCESSING);
m_psShaders.push_back(PS_POST_PROCESSING);
// Particles
m_vsShaders.push_back(VS_PARTICLES);
m_psShaders.push_back(PS_PARTICLES);
// UI objects
m_vsShaders.push_back(VS_UI);
m_psShaders.push_back(PS_UI);
// Instanced Objects
m_vsShaders.push_back(VS_INSTANCING);
m_psShaders.push_back(PS_OBJECT);
// Target
m_vsShaders.push_back(VS_OBJECT_TARGET);
m_psShaders.push_back(PS_OBJECT_TARGET);
}
// Creates the sampler state that goes to the pixel shader texture
void Graphics::CreateSamplerState()
{
D3D11_SAMPLER_DESC samplerDesc;
ZeroMemory(&samplerDesc, sizeof(D3D11_SAMPLER_DESC));
samplerDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
samplerDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;
samplerDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP;
samplerDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP;
samplerDesc.MinLOD = -FLT_MAX;
samplerDesc.MaxLOD = FLT_MAX;
samplerDesc.MipLODBias = 0.0f;
samplerDesc.MaxAnisotropy = 1;
samplerDesc.ComparisonFunc = D3D11_COMPARISON_NEVER;
m_device->CreateSamplerState(&samplerDesc, &m_samplerState.p);
}
// Creates a backculling rasterizer
void Graphics::CreateRasterState()
{
D3D11_RASTERIZER_DESC rasterDesc;
ZeroMemory(&rasterDesc, sizeof(D3D11_RASTERIZER_DESC));
rasterDesc.AntialiasedLineEnable = false;
rasterDesc.CullMode = D3D11_CULL_FRONT;//D3D11_CULL_NONE;//
rasterDesc.DepthBias = 0;
rasterDesc.DepthBiasClamp = 0.0f;
rasterDesc.DepthClipEnable = true;
rasterDesc.FillMode = D3D11_FILL_SOLID;
rasterDesc.FrontCounterClockwise = true;
rasterDesc.MultisampleEnable = false;
rasterDesc.ScissorEnable = false;
rasterDesc.SlopeScaledDepthBias = 0.0f;
m_device->CreateRasterizerState(&rasterDesc, &m_rasterState.p);
// Wire rasterizer
ZeroMemory(&rasterDesc, sizeof(D3D11_RASTERIZER_DESC));
rasterDesc.AntialiasedLineEnable = false;
rasterDesc.CullMode = D3D11_CULL_NONE;
rasterDesc.DepthBias = 0;
rasterDesc.DepthBiasClamp = 0.0f;
rasterDesc.DepthClipEnable = true;
rasterDesc.FillMode = D3D11_FILL_WIREFRAME;
rasterDesc.FrontCounterClockwise = true;
rasterDesc.MultisampleEnable = false;
rasterDesc.ScissorEnable = false;
rasterDesc.SlopeScaledDepthBias = 0.0f;
m_device->CreateRasterizerState(&rasterDesc, &m_wireRasterState.p);
}
// Create Post processing texture
void Graphics::CreatePostProcessingTexture()
{
// Creation of the texture
D3D11_TEXTURE2D_DESC textureDesc;
ZeroMemory(&textureDesc, sizeof(D3D11_TEXTURE2D_DESC));
textureDesc.Width = m_backBufferWidth;
textureDesc.Height = m_backBufferHeight;
textureDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
textureDesc.BindFlags = D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE;
textureDesc.MiscFlags = D3D11_RESOURCE_MISC_GENERATE_MIPS;
textureDesc.Usage = D3D11_USAGE_DEFAULT;
textureDesc.MipLevels = 1;
textureDesc.ArraySize = 1;
textureDesc.SampleDesc.Count = 1;
textureDesc.SampleDesc.Quality = 0;
m_device->CreateTexture2D(&textureDesc, NULL, &m_postTexture.p);
// Render target
D3D11_RENDER_TARGET_VIEW_DESC renderTargetViewDesc;
ZeroMemory(&renderTargetViewDesc, sizeof(D3D11_RENDER_TARGET_VIEW_DESC));
renderTargetViewDesc.Format = textureDesc.Format;
renderTargetViewDesc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D;
m_device->CreateRenderTargetView(m_postTexture, &renderTargetViewDesc, &m_postRenderTargetView.p);
m_device->CreateShaderResourceView(m_postTexture, NULL, &m_postShaderResourceView);
}
void Graphics::CreatePostFilterQuad()
{
const unsigned int numVerts = 4;
SM_VERTEX quadPoints[numVerts];
ZeroMemory(&quadPoints, sizeof(SM_VERTEX) * numVerts);
quadPoints[3].position = XMFLOAT4(1, -1, 0.1f, 0.0f);
quadPoints[2].position = XMFLOAT4(-1, -1, 0.1f,0.0f);
quadPoints[1].position = XMFLOAT4(-1, 1, 0.1f, 0.0f);
quadPoints[0].position = XMFLOAT4(1, 1, 0.1f, 0.0f);
quadPoints[0].uv = XMFLOAT4(1.0f, 0.0f, 0.0f, 0.0f);
quadPoints[1].uv = XMFLOAT4(0.0f, 0, 0.0f, 0.0f);
quadPoints[2].uv = XMFLOAT4(0.0f, 1.0f, 0.0f, 0.0f);
quadPoints[3].uv = XMFLOAT4(1.0f, 1.0f, 0.0f, 0.0f);
// Create the vertex buffer storing vertsPoints
D3D11_BUFFER_DESC bufferDesc;
ZeroMemory(&bufferDesc, sizeof(bufferDesc));
bufferDesc.ByteWidth = sizeof(SM_VERTEX) * numVerts;
bufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
bufferDesc.Usage = D3D11_USAGE_IMMUTABLE;
bufferDesc.StructureByteStride = sizeof(SM_VERTEX);
// Setting the resource data
D3D11_SUBRESOURCE_DATA resourceData;
ZeroMemory(&resourceData, sizeof(D3D11_SUBRESOURCE_DATA));
resourceData.pSysMem = &quadPoints;
m_device->CreateBuffer(&bufferDesc, &resourceData, &m_quadPostBuffer.p);
// Create indices.
const unsigned int numIndices = 6;
unsigned int indices[numIndices] = { 2,1,0,3,2,0 };//{ 0, 2, 3, 0, 1, 2 };
//320210
// Fill in a buffer description.
ZeroMemory(&bufferDesc, sizeof(D3D11_BUFFER_DESC));
bufferDesc.Usage = D3D11_USAGE_IMMUTABLE;
bufferDesc.ByteWidth = sizeof(unsigned int) * numIndices;
bufferDesc.BindFlags = D3D11_BIND_INDEX_BUFFER;
bufferDesc.StructureByteStride = sizeof(unsigned int);
// Define the resource data.
D3D11_SUBRESOURCE_DATA initData;
ZeroMemory(&initData, sizeof(D3D11_SUBRESOURCE_DATA));
initData.pSysMem = indices;
// Create the buffer with the device.
m_device->CreateBuffer(&bufferDesc, &initData, &m_quadPostIndexBuffer.p);
}
void Graphics::CreateConstBuffers()
{
// Create data const buffer
D3D11_BUFFER_DESC constBufferDesc;
ZeroMemory(&constBufferDesc, sizeof(D3D11_BUFFER_DESC));
constBufferDesc.ByteWidth = sizeof(POST_DATA_TO_VRAM);
constBufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
constBufferDesc.Usage = D3D11_USAGE_DYNAMIC;
constBufferDesc.StructureByteStride = sizeof(float);
constBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
m_device->CreateBuffer(&constBufferDesc, NULL, &m_postDataConstBuffer.p);
}
void Graphics::CreateBlendState()
{
D3D11_BLEND_DESC blendDesc;
ZeroMemory(&blendDesc, sizeof(D3D11_BLEND_DESC));
blendDesc.RenderTarget[0].BlendEnable = TRUE;
blendDesc.RenderTarget[0].SrcBlend = D3D11_BLEND_SRC_ALPHA;
blendDesc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA;
blendDesc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD;
blendDesc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE;
blendDesc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ZERO;
blendDesc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD;
blendDesc.RenderTarget[0].RenderTargetWriteMask = 0x0f;
m_device->CreateBlendState(&blendDesc, &m_blendTransperentState.p);
//ZeroMemory(&blendDesc, sizeof(D3D11_BLEND_DESC));
//blendDesc.RenderTarget[0].BlendEnable = FALSE;
//blendDesc.RenderTarget[0].SrcBlend = D3D11_BLEND_ONE;
//blendDesc.RenderTarget[0].DestBlend = D3D11_BLEND_ZERO;
//blendDesc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD;
//blendDesc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE;
//blendDesc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ZERO;
//blendDesc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD;
//blendDesc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
//
//m_device->CreateBlendState(&blendDesc, &blendClassicState.p);
}
void Graphics::OpenCSOShaders()
{
//ID3DBlob* PS_Buffer;
//ID3DReadFileToBlob(L"PixelShader.cso", &PS_Buffer);
}
// Sets the color of the raster
void Graphics::SetBackColor(float _r, float _g, float _b, float _a)
{
m_backColor.SetColor(_r, _g, _b, _a);
}
void Graphics::RenderText(const wchar_t* _text, XMFLOAT2 _pos, FXMVECTOR _color, unsigned int _fontType)
{
//POINT coordinate;
//coordinate.x = LONG(_pos.x);
//coordinate.y = LONG(_pos.y);
//XMFLOAT2 position = XMFLOAT2(float(coordinate.x), float(coordinate.y));
//position.x = float((Graphics::GetBackBufferWidth() * 0.5f) - position.x) - 100.0f;
//position.y = (float((Graphics::GetBackBufferHeight() * 0.5f) - position.y)) + 5.0f;
XMFLOAT2 position = XMFLOAT2(_pos.x, _pos.y);
// Converting te ratio to be between 0 and max of screen
position.x = ((-float(Graphics::GetBackBufferWidth()) * position.x) + (Graphics::GetBackBufferWidth() * 0.5f));
position.y = ((-float(Graphics::GetBackBufferHeight()) * position.y) + (Graphics::GetBackBufferHeight() * 0.5f));
// Draw sprite
g_Sprites->Begin(SpriteSortMode::SpriteSortMode_Immediate);
switch (_fontType)
{
case 0:
g_FontFrank->DrawString(g_Sprites.get(), _text, position, _color);
break;
case 1:
g_FontItalic->DrawString(g_Sprites.get(), _text, position, _color);
default:
break;
}
g_Sprites->End();
// Don't read from their shaders anymore
Graphics::GetDeviceContext()->OMSetDepthStencilState(m_depthState, 0);
Graphics::GetDeviceContext()->RSSetState(m_rasterState);
Graphics::GetDeviceContext()->PSSetSamplers(0, 1, &m_samplerState.p);
float blendFactor[] = { 0, 0, 0, 0 };
unsigned int sampleMask = 0xffffffff;
m_deviceContext->OMSetBlendState(m_blendTransperentState, blendFactor, sampleMask);
}
#if 0
// TESTING:: Create struct buffer for screen
void Graphics::CreateStructBuffer()
{
// Creating the const buffer
D3D11_BUFFER_DESC bufferDesc;
ZeroMemory(&bufferDesc, sizeof(D3D11_BUFFER_DESC));
bufferDesc.ByteWidth = sizeof(BUFFER_STRUCT) * sizeGrid;
bufferDesc.Usage = D3D11_USAGE_DEFAULT;
bufferDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
bufferDesc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED;
bufferDesc.StructureByteStride = sizeof(BUFFER_STRUCT);
bufferDesc.CPUAccessFlags = 0;
D3D11_SUBRESOURCE_DATA initData;
ZeroMemory(&initData, sizeof(D3D11_SUBRESOURCE_DATA));
initData.pSysMem = m_bufferStruct;
m_device->CreateBuffer(&bufferDesc, &initData, &m_structBuffer.p);
D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc;
ZeroMemory(&srvDesc, sizeof(D3D11_SHADER_RESOURCE_VIEW_DESC));
srvDesc.Format = DXGI_FORMAT_UNKNOWN;
srvDesc.ViewDimension = D3D11_SRV_DIMENSION_BUFFER;
srvDesc.Buffer.ElementOffset = 0;
srvDesc.Buffer.ElementWidth = sizeGrid;
m_device->CreateShaderResourceView(m_structBuffer, &srvDesc, &m_resourceViewStruct.p);
}
#endif
void Graphics::ClearDepthBuffer()
{
m_deviceContext->ClearDepthStencilView(m_postDepthView.p, D3D11_CLEAR_DEPTH, 1,0);
}
#if 0
void Graphics::SetIndicesOfLightsTEST(unsigned int _indexBuffer, unsigned int _indexLight)
{
m_bufferStruct[_indexBuffer].index = _indexLight;
}
void Graphics::SetColorOfLightsTEST(unsigned int _indexBuffer, XMFLOAT4 _color)
{
m_bufferStruct[_indexBuffer].color[0] = _color.x;
m_bufferStruct[_indexBuffer].color[1] = _color.y;
m_bufferStruct[_indexBuffer].color[2] = _color.z;
m_bufferStruct[_indexBuffer].color[3] = _color.w;
}
#endif | [
"gborachev@gmail.com"
] | gborachev@gmail.com |
2ba87a7e0a1dc72994e123f2e08a98315f307eb6 | 30494e4cb64a2c3d5dd2dd191287dcf52a309d1e | /SelectNextActionDialog.h | 52906aecf55f5156279dc165b3172becdb6c590b | [] | no_license | spmno/Aside | a831eff364c5f96ee3902bd13298d3f5c65705cc | 6c33ffb8afb28f3e954b384a8e8deae29fecb681 | refs/heads/master | 2020-04-14T12:43:26.694594 | 2013-05-08T01:18:57 | 2013-05-08T01:18:57 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 302 | h | #pragma once
#include <QtWidgets/qdialog.h>
#include "ui_selectNextAction.h"
class SelectNextActionDialog : public QDialog
{
Q_OBJECT
public:
SelectNextActionDialog(QWidget* parent = 0);
~SelectNextActionDialog(void);
private:
Ui::selectActionDialog ui;
private slots:
void saveNextAction();
};
| [
"sunqingpeng@hotmail.com"
] | sunqingpeng@hotmail.com |
0d880376352b796c720e7e85704976aef0d0178d | a06515f4697a3dbcbae4e3c05de2f8632f8d5f46 | /corpus/taken_from_cppcheck_tests/stolen_9987.cpp | 3f3428652d9d3661ae4aa8d5d212f9eb5b71f0df | [] | no_license | pauldreik/fuzzcppcheck | 12d9c11bcc182cc1f1bb4893e0925dc05fcaf711 | 794ba352af45971ff1f76d665b52adeb42dcab5f | refs/heads/master | 2020-05-01T01:55:04.280076 | 2019-03-22T21:05:28 | 2019-03-22T21:05:28 | 177,206,313 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 56 | cpp | void foo(char *s) {
s += 20;
}
void bar() { foo(0); }
| [
"github@pauldreik.se"
] | github@pauldreik.se |
abec651d87a9dfee0aeac593ff6e086b6d160636 | 1880ae99db197e976c87ba26eb23a20248e8ee51 | /sqlserver/include/tencentcloud/sqlserver/v20180328/model/DescribeUploadIncrementalInfoRequest.h | 8657b163281023b3376135b5ed4fdf08de80cd59 | [
"Apache-2.0"
] | permissive | caogenwang/tencentcloud-sdk-cpp | 84869793b5eb9811bb1eb46ed03d4dfa7ce6d94d | 6e18ee6622697a1c60a20a509415b0ddb8bdeb75 | refs/heads/master | 2023-08-23T12:37:30.305972 | 2021-11-08T01:18:30 | 2021-11-08T01:18:30 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,618 | h | /*
* Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef TENCENTCLOUD_SQLSERVER_V20180328_MODEL_DESCRIBEUPLOADINCREMENTALINFOREQUEST_H_
#define TENCENTCLOUD_SQLSERVER_V20180328_MODEL_DESCRIBEUPLOADINCREMENTALINFOREQUEST_H_
#include <string>
#include <vector>
#include <map>
#include <tencentcloud/core/AbstractModel.h>
namespace TencentCloud
{
namespace Sqlserver
{
namespace V20180328
{
namespace Model
{
/**
* DescribeUploadIncrementalInfo请求参数结构体
*/
class DescribeUploadIncrementalInfoRequest : public AbstractModel
{
public:
DescribeUploadIncrementalInfoRequest();
~DescribeUploadIncrementalInfoRequest() = default;
std::string ToJsonString() const;
/**
* 获取导入目标实例ID
* @return InstanceId 导入目标实例ID
*/
std::string GetInstanceId() const;
/**
* 设置导入目标实例ID
* @param InstanceId 导入目标实例ID
*/
void SetInstanceId(const std::string& _instanceId);
/**
* 判断参数 InstanceId 是否已赋值
* @return InstanceId 是否已赋值
*/
bool InstanceIdHasBeenSet() const;
/**
* 获取备份导入任务ID,由CreateBackupMigration接口返回
* @return BackupMigrationId 备份导入任务ID,由CreateBackupMigration接口返回
*/
std::string GetBackupMigrationId() const;
/**
* 设置备份导入任务ID,由CreateBackupMigration接口返回
* @param BackupMigrationId 备份导入任务ID,由CreateBackupMigration接口返回
*/
void SetBackupMigrationId(const std::string& _backupMigrationId);
/**
* 判断参数 BackupMigrationId 是否已赋值
* @return BackupMigrationId 是否已赋值
*/
bool BackupMigrationIdHasBeenSet() const;
/**
* 获取增量导入任务ID
* @return IncrementalMigrationId 增量导入任务ID
*/
std::string GetIncrementalMigrationId() const;
/**
* 设置增量导入任务ID
* @param IncrementalMigrationId 增量导入任务ID
*/
void SetIncrementalMigrationId(const std::string& _incrementalMigrationId);
/**
* 判断参数 IncrementalMigrationId 是否已赋值
* @return IncrementalMigrationId 是否已赋值
*/
bool IncrementalMigrationIdHasBeenSet() const;
private:
/**
* 导入目标实例ID
*/
std::string m_instanceId;
bool m_instanceIdHasBeenSet;
/**
* 备份导入任务ID,由CreateBackupMigration接口返回
*/
std::string m_backupMigrationId;
bool m_backupMigrationIdHasBeenSet;
/**
* 增量导入任务ID
*/
std::string m_incrementalMigrationId;
bool m_incrementalMigrationIdHasBeenSet;
};
}
}
}
}
#endif // !TENCENTCLOUD_SQLSERVER_V20180328_MODEL_DESCRIBEUPLOADINCREMENTALINFOREQUEST_H_
| [
"tencentcloudapi@tenent.com"
] | tencentcloudapi@tenent.com |
c4659eb99b79e2765adc5beb5818d83f7138f8d3 | d9d7ff04aeabccc991a77f2d0f37b69f9b4ae2a5 | /code/application/uifeature/uifactory.cc | 25d271781cae64dfa9f0e21d0cee25a52d57ebf7 | [] | no_license | kienvn/nebula3 | f5e7e8df1906884bad944ee6fce1549ded1c0c80 | 153aa717b37029eede5e393cd9410d462838dfcf | refs/heads/master | 2016-09-10T20:24:15.903745 | 2015-03-16T01:56:00 | 2015-03-16T01:56:00 | 32,295,090 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,399 | cc | //------------------------------------------------------------------------------
// uifeature/uifactory.cc
// (C) 2008 Radon Labs GmbH
//------------------------------------------------------------------------------
#include "stdneb.h"
#include "uifeature/uifactory.h"
#include "uifeature/elements/canvas.h"
#include "uifeature/elements/button.h"
#include "uifeature/elements/label.h"
namespace UI
{
__ImplementClass(UIFactory, 'UIFA', Core::RefCounted);
__ImplementSingleton(UIFactory);
//------------------------------------------------------------------------------
/**
*/
UIFactory::UIFactory()
{
__ConstructSingleton;
}
//------------------------------------------------------------------------------
/**
*/
UIFactory::~UIFactory()
{
__DestructSingleton;
}
//------------------------------------------------------------------------------
/**
Create a user interface element from a type string.
*/
Ptr<Element>
UIFactory::CreateElement(const Util::String& type) const
{
if (type == "Canvas") return Canvas::Create();
else if (type == "Button") return Button::Create();
else if (type == "Label") return Label::Create();
else
{
n_error("Invalid UI element type: '%s'!", type.AsCharPtr());
return 0;
}
}
}; // namespace UI
| [
"vadim.macagon@0da202b3-2e52-0410-ae64-51d24114e80a"
] | vadim.macagon@0da202b3-2e52-0410-ae64-51d24114e80a |
2b70170beb3fdfb38192d4280ec4de04e275b02b | 4728c8d66b28dbc2644b0e89713d1815804da237 | /src/devices/bus/drivers/pci/test/fakes/fake_ecam.h | 7993411ba93fe85868fdaacffc90ce4ad93551da | [
"BSD-3-Clause"
] | permissive | osphea/zircon-rpi | 094aca2d06c9a5f58ceb66c3e7d3d57e8bde9e0c | 82c90329892e1cb3d09c99fee0f967210d11dcb2 | refs/heads/master | 2022-11-08T00:22:37.817127 | 2020-06-29T23:16:20 | 2020-06-29T23:16:20 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,580 | h | // Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SRC_DEVICES_BUS_DRIVERS_PCI_TEST_FAKES_FAKE_ECAM_H_
#define SRC_DEVICES_BUS_DRIVERS_PCI_TEST_FAKES_FAKE_ECAM_H_
#include <lib/mmio/mmio.h>
#include <zircon/hw/pci.h>
#include <ddktl/protocol/pciroot.h>
#include <hwreg/bitfields.h>
#include "../../common.h"
struct IoBaseAddress {
uint32_t value;
DEF_SUBBIT(value, 0, is_io_space);
// bit 1 is reserved.
DEF_SUBFIELD(value, 31, 2, address);
};
static_assert(sizeof(IoBaseAddress) == 4, "Bad size for IoBaseAddress");
struct Mmio32BaseAddress {
uint32_t value;
DEF_SUBBIT(value, 0, is_io_space);
// bit 1 is reserved.
DEF_SUBBIT(value, 2, is_64bit);
DEF_SUBBIT(value, 3, is_prefetchable);
DEF_SUBFIELD(value, 31, 4, address);
};
static_assert(sizeof(Mmio32BaseAddress) == 4, "Bad size for Mmio32BaseAddress");
struct FakeBaseAddress {
union {
IoBaseAddress io;
Mmio32BaseAddress mmio32;
uint32_t mmio64;
};
};
static_assert(sizeof(FakeBaseAddress) == 4, "Bad size for FakeBaseAddress");
// Defines set_NAME and NAME() in addition to a private member to match the same
// chaining possible using the set_ methods DEF_SUBBIT generates.
//
// This macro has a pitfall if used following a private: declaration in the
// class/struct, so only use it in the public section.
#define DEF_WRAPPED_FIELD(TYPE, NAME) \
private: \
TYPE NAME##_; \
\
public: \
TYPE NAME() { return NAME##_; } \
auto& set_##NAME(TYPE val) { \
NAME##_ = val; \
return *this; \
} \
static_assert(true) // eat a ;
// A fake implementation of a PCI device configuration (Type 00h)
struct FakePciType0Config {
DEF_WRAPPED_FIELD(uint16_t, vendor_id);
DEF_WRAPPED_FIELD(uint16_t, device_id);
DEF_WRAPPED_FIELD(uint16_t, command);
DEF_SUBBIT(command_, 0, io_space_en);
DEF_SUBBIT(command_, 1, mem_space_en);
DEF_SUBBIT(command_, 2, bus_master_en);
DEF_SUBBIT(command_, 3, special_cycles_en);
DEF_SUBBIT(command_, 4, men_write_and_inval_en);
DEF_SUBBIT(command_, 5, vga_palette_snoop_en);
DEF_SUBBIT(command_, 6, parity_error_resp);
// bit 7 is hardwired to 0.
DEF_SUBBIT(command_, 8, serr_en);
DEF_SUBBIT(command_, 9, fast_back_to_back_en);
DEF_SUBBIT(command_, 10, interrupt_disable);
DEF_WRAPPED_FIELD(uint16_t, status);
// bits 2:0 are reserved.
DEF_SUBBIT(status_, 3, int_status);
DEF_SUBBIT(status_, 4, capabilities_list);
DEF_SUBBIT(status_, 5, is_66mhz_capable);
// bit 6 is reserved.
DEF_SUBBIT(status_, 7, fast_back_to_back_capable);
DEF_SUBBIT(status_, 8, master_data_parity_error);
DEF_SUBFIELD(status_, 10, 9, devsel_timing);
DEF_SUBBIT(status_, 11, signaled_target_abort);
DEF_SUBBIT(status_, 12, received_target_abort);
DEF_SUBBIT(status_, 13, received_master_abort);
DEF_SUBBIT(status_, 14, signaled_system_error);
DEF_SUBBIT(status_, 15, detected_parity_error);
DEF_WRAPPED_FIELD(uint8_t, revision_id);
DEF_WRAPPED_FIELD(uint8_t, program_interface);
DEF_WRAPPED_FIELD(uint8_t, sub_class);
DEF_WRAPPED_FIELD(uint8_t, base_class);
DEF_WRAPPED_FIELD(uint8_t, cache_line_size);
DEF_WRAPPED_FIELD(uint8_t, latency_timer);
DEF_WRAPPED_FIELD(uint8_t, header_type);
DEF_WRAPPED_FIELD(uint8_t, bist);
DEF_SUBFIELD(bist_, 3, 0, completion_code);
// bits 4-5 are reserved.
DEF_SUBBIT(bist_, 6, start_bist);
DEF_SUBBIT(bist_, 7, bist_capable);
FakeBaseAddress base_address[6];
DEF_WRAPPED_FIELD(uint32_t, cardbus_cis_ptr);
DEF_WRAPPED_FIELD(uint16_t, subsystem_vendor_id);
DEF_WRAPPED_FIELD(uint16_t, subsystem_id);
DEF_WRAPPED_FIELD(uint32_t, expansion_rom_address);
DEF_WRAPPED_FIELD(uint8_t, capabilities_ptr);
uint8_t reserved_0[3];
uint32_t reserved_1;
DEF_WRAPPED_FIELD(uint8_t, interrupt_line);
DEF_WRAPPED_FIELD(uint8_t, interrupt_pin);
DEF_WRAPPED_FIELD(uint8_t, min_grant);
DEF_WRAPPED_FIELD(uint8_t, max_latency);
};
static_assert(sizeof(FakePciType0Config) == 64, "Bad size for PciType0Config");
// A fake implementation of a PCI bridge configuration (Type 01h)
struct FakePciType1Config {
DEF_WRAPPED_FIELD(uint16_t, vendor_id);
DEF_WRAPPED_FIELD(uint16_t, device_id);
DEF_WRAPPED_FIELD(uint16_t, command);
DEF_SUBBIT(command_, 0, io_space_en);
DEF_SUBBIT(command_, 1, mem_space_en);
DEF_SUBBIT(command_, 2, bus_master_en);
DEF_SUBBIT(command_, 3, special_cycles_en);
DEF_SUBBIT(command_, 4, men_write_and_inval_en);
DEF_SUBBIT(command_, 5, vga_palette_snoop_en);
DEF_SUBBIT(command_, 6, parity_error_resp);
// bit 7 is hardwired to 0.
DEF_SUBBIT(command_, 8, serr_en);
DEF_SUBBIT(command_, 9, fast_back_to_back_en);
DEF_SUBBIT(command_, 10, interrupt_disable);
DEF_WRAPPED_FIELD(uint16_t, status);
// bits 2:0 are reserved.
DEF_SUBBIT(status_, 3, int_status);
DEF_SUBBIT(status_, 4, capabilities_list);
DEF_SUBBIT(status_, 5, is_66mhz_capable);
// bit 6 is reserved.
DEF_SUBBIT(status_, 7, fast_back_to_back_capable);
DEF_SUBBIT(status_, 8, master_data_parity_error);
DEF_SUBFIELD(status_, 10, 9, devsel_timing);
DEF_SUBBIT(status_, 11, signaled_target_abort);
DEF_SUBBIT(status_, 12, received_target_abort);
DEF_SUBBIT(status_, 13, received_master_abort);
DEF_SUBBIT(status_, 14, signaled_system_error);
DEF_SUBBIT(status_, 15, detected_parity_error);
DEF_WRAPPED_FIELD(uint8_t, revision_id);
DEF_WRAPPED_FIELD(uint8_t, program_interface);
DEF_WRAPPED_FIELD(uint8_t, sub_class);
DEF_WRAPPED_FIELD(uint8_t, base_class);
DEF_WRAPPED_FIELD(uint8_t, cache_line_size);
DEF_WRAPPED_FIELD(uint8_t, latency_timer);
DEF_WRAPPED_FIELD(uint8_t, header_type);
DEF_WRAPPED_FIELD(uint8_t, bist);
DEF_SUBFIELD(bist_, 3, 0, completion_code);
// bits 5:4 are reserved.
DEF_SUBBIT(bist_, 6, start_bist);
DEF_SUBBIT(bist_, 7, bist_capable);
FakeBaseAddress base_address[2];
DEF_WRAPPED_FIELD(uint8_t, primary_bus_number);
DEF_WRAPPED_FIELD(uint8_t, secondary_bus_number);
DEF_WRAPPED_FIELD(uint8_t, subordinate_bus_number);
DEF_WRAPPED_FIELD(uint8_t, secondary_latency_timer);
DEF_WRAPPED_FIELD(uint8_t, io_base);
DEF_WRAPPED_FIELD(uint8_t, io_limit);
DEF_WRAPPED_FIELD(uint16_t, secondary_status);
// bits 4:0 are reserved.
DEF_SUBBIT(secondary_status_, 5, secondary_is_66mhz_capable);
// bit 6 is reserved.
DEF_SUBBIT(secondary_status_, 7, secondary_fast_back_to_back_capable);
DEF_SUBBIT(secondary_status_, 8, secondary_master_data_parity_error);
DEF_SUBFIELD(secondary_status_, 10, 9, secondary_devsel_timing);
DEF_SUBBIT(secondary_status_, 11, secondary_signaled_target_abort);
DEF_SUBBIT(secondary_status_, 12, secondary_received_target_abort);
DEF_SUBBIT(secondary_status_, 13, secondary_received_master_abort);
DEF_SUBBIT(secondary_status_, 14, secondary_signaled_system_error);
DEF_SUBBIT(secondary_status_, 15, secondary_detected_parity_error);
DEF_WRAPPED_FIELD(uint16_t, memory_base);
DEF_WRAPPED_FIELD(uint16_t, memory_limit);
DEF_WRAPPED_FIELD(uint16_t, prefetchable_memory_base);
DEF_WRAPPED_FIELD(uint16_t, prefetchable_memory_limit);
DEF_WRAPPED_FIELD(uint32_t, prfetchable_memory_base_upper);
DEF_WRAPPED_FIELD(uint32_t, prfetchable_memory_limit_upper);
DEF_WRAPPED_FIELD(uint16_t, io_base_upper);
DEF_WRAPPED_FIELD(uint16_t, io_limit_upper);
DEF_WRAPPED_FIELD(uint8_t, capabilities_ptr);
uint8_t reserved_0[3];
DEF_WRAPPED_FIELD(uint32_t, expansion_rom_address);
DEF_WRAPPED_FIELD(uint8_t, interrupt_line);
DEF_WRAPPED_FIELD(uint8_t, interrupt_pin);
DEF_WRAPPED_FIELD(uint16_t, bridge_control);
DEF_SUBBIT(bridge_control_, 0, secondary_parity_error_resp);
DEF_SUBBIT(bridge_control_, 1, secondary_serr_en);
DEF_SUBBIT(bridge_control_, 2, isa_enable);
DEF_SUBBIT(bridge_control_, 3, vga_enable);
DEF_SUBBIT(bridge_control_, 4, vga_16bit_decode);
DEF_SUBBIT(bridge_control_, 5, master_abort_mode);
DEF_SUBBIT(bridge_control_, 6, seconday_bus_reset);
DEF_SUBBIT(bridge_control_, 7, secondary_fast_back_to_back_en);
DEF_SUBBIT(bridge_control_, 8, primary_discard_timer);
DEF_SUBBIT(bridge_control_, 9, secondary_discard_timer);
DEF_SUBBIT(bridge_control_, 10, discard_timer_status);
DEF_SUBBIT(bridge_control_, 11, discard_timer_serr_en);
// bits 15:12 are reserved.
};
static_assert(sizeof(FakePciType1Config) == 64, "Bad size for PciType1Config");
#undef DEF_WRAPPED_FIELD
union FakeDeviceConfig {
FakePciType0Config device;
FakePciType1Config bridge;
uint8_t config[PCI_BASE_CONFIG_SIZE];
uint8_t ext_config[PCI_EXT_CONFIG_SIZE];
};
static_assert(sizeof(FakeDeviceConfig) == 4096, "Bad size for FakeDeviceConfig");
// FakeEcam represents a contiguous block of PCI devices covering the bus range
// from |bus_start|:|bus_end|. This allows tests to create a virtual collection
// of buses that look like a real contiguous ecam with valid devices to scan
// and poke at by the PCI bus driver.
class FakeEcam {
public:
// Allow assign / move.
FakeEcam(FakeEcam&&) = default;
FakeEcam& operator=(FakeEcam&&) = default;
// Disallow copy.
FakeEcam(const FakeEcam&) = delete;
FakeEcam& operator=(const FakeEcam&) = delete;
FakeEcam(uint8_t bus_start = 0, uint8_t bus_end = 0)
: bus_start_(bus_start),
bus_end_(bus_end),
config_cnt_((bus_end - bus_start + 1) * PCI_MAX_FUNCTIONS_PER_BUS) {
const size_t bytes = sizeof(FakeDeviceConfig) * config_cnt_;
zx::vmo vmo;
std::optional<ddk::MmioBuffer> mmio;
ZX_ASSERT(zx::vmo::create(bytes, 0, &vmo) == ZX_OK);
ZX_ASSERT(ddk::MmioBuffer::Create(0, bytes, std::move(vmo), ZX_CACHE_POLICY_UNCACHED_DEVICE,
&mmio) == ZX_OK);
mmio_ = std::move(*mmio);
configs_ = static_cast<FakeDeviceConfig*>(mmio_->get());
reset();
}
// Provide ways to access individual devices in the ecam by BDF address.
FakeDeviceConfig& get(uint8_t bus_id, uint8_t dev_id, uint8_t func_id) {
ZX_ASSERT(bus_id >= bus_start_);
ZX_ASSERT(bus_id <= bus_end_);
size_t offset = bus_id * PCI_MAX_FUNCTIONS_PER_BUS;
offset += dev_id * PCI_MAX_FUNCTIONS_PER_DEVICE;
offset += func_id;
ZX_ASSERT(offset < config_cnt_);
return configs_[offset];
}
FakeDeviceConfig& get(pci_bdf_t bdf) { return get(bdf.bus_id, bdf.device_id, bdf.function_id); }
uint8_t bus_start() const { return bus_start_; }
uint8_t bus_end() const { return bus_end_; }
ddk::MmioBuffer& mmio() { return *mmio_; }
void reset() {
// Memset optimizations cause faults on uncached memory, so zero out
// the memory by hand.
assert(mmio_->get_size() % ZX_PAGE_SIZE == 0);
assert(mmio_->get_size() % sizeof(uint64_t) == 0);
assert(reinterpret_cast<uintptr_t>(mmio_->get()) % sizeof(uint64_t) == 0);
for (size_t i = 0; i < mmio_->get_size(); i += sizeof(uint64_t)) {
mmio_->Write<uint64_t>(0, i);
}
// Mark all vendor & device ids as invalid so that only the devices
// explicitly configured will be considered in a proper bus scan.
for (size_t i = 0; i < config_cnt_; i++) {
configs_[i].device.set_vendor_id(0xffff).set_device_id(0xffff);
}
}
private:
uint8_t bus_start_;
uint8_t bus_end_;
size_t config_cnt_;
std::optional<ddk::MmioBuffer> mmio_;
FakeDeviceConfig* configs_;
};
#endif // SRC_DEVICES_BUS_DRIVERS_PCI_TEST_FAKES_FAKE_ECAM_H_
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
4c88c696bbce706be027eb4b85481b3af1d99429 | 48298469e7d828ab1aa54a419701c23afeeadce1 | /Common/Packets/GWTeamRetInvite.cpp | 3ce66d9663e6f68df967b7c7733e9a8e40d2e10d | [] | no_license | brock7/TianLong | c39fccb3fd2aa0ad42c9c4183d67a843ab2ce9c2 | 8142f9ccb118e76a5cd0a8b168bcf25e58e0be8b | refs/heads/master | 2021-01-10T14:19:19.850859 | 2016-02-20T13:58:55 | 2016-02-20T13:58:55 | 52,155,393 | 5 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 797 | cpp | #include "stdafx.h"
#include "GWTeamRetInvite.h"
BOOL GWTeamRetInvite::Read(SocketInputStream& iStream )
{
__ENTER_FUNCTION
iStream.Read( (CHAR*)&m_Return, sizeof(BYTE) );
iStream.Read((CHAR*)&m_SourGUID,sizeof(GUID_t));
iStream.Read((CHAR*)&m_DestGUID,sizeof(GUID_t));
return TRUE;
__LEAVE_FUNCTION
return FALSE;
}
BOOL GWTeamRetInvite::Write(SocketOutputStream& oStream ) const
{
__ENTER_FUNCTION
oStream.Write( (CHAR*)&m_Return, sizeof(BYTE) );
oStream.Write((CHAR*)&m_SourGUID,sizeof(GUID_t));
oStream.Write((CHAR*)&m_DestGUID,sizeof(GUID_t));
return TRUE;
__LEAVE_FUNCTION
return FALSE;
}
UINT GWTeamRetInvite::Execute(Player* pPlayer )
{
__ENTER_FUNCTION
return GWTeamRetInviteHandler::Execute(this,pPlayer);
__LEAVE_FUNCTION
return FALSE;
}
| [
"xiaowave@gmail.com"
] | xiaowave@gmail.com |
e9385a8fe2556e3753f421df4739ed922557c2ce | 89d2e474996e8f20cd8fb9530d5cd6f6cb091a2a | /zuoye/mainwindow.h | 28f809f9aa9f929ed687f95f5b86d8f54c404fa5 | [] | no_license | jiaowozining/wenjianjia | 1c8f5ca03d77e3614f9462976acfdff7644deb36 | 84f9186825ec56c5f5a296c2dec6801e10ba7ff0 | refs/heads/master | 2022-12-19T05:51:16.276653 | 2020-09-22T08:30:50 | 2020-09-22T08:30:50 | 295,053,376 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 713 | h | #ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QtGui>//可能需要使用gui中的内容,添加头文件
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
void paintEvent(QPaintEvent *);//用于绘图
void mouseReleaseEvent(QMouseEvent *);//用于检测鼠标的信号
private:
Ui::MainWindow *ui;
int a[20][20];//棋盘数组
int isWin(int, int);
int f1(int, int);
int f2(int, int);
int f3(int, int);
int f4(int, int);
int player;
};
#endif // MAINWINDOW_H
| [
"noreply@github.com"
] | jiaowozining.noreply@github.com |
11f02fe7b18082e0a6b737c313f630ecd3536a15 | 526fbe3a7d08a928652f8d4938d1c45cf90fb1b0 | /TCS.h | bdf8bde7bbb37d3f6ea1120ab80a76063c151ed9 | [
"MIT"
] | permissive | ilhamadun/TCS | 158f6375cc63874b54eeec6e44fe80f90bf3f732 | 143c81def231d5ecb0ca555f79e28a5c307ce119 | refs/heads/master | 2021-01-10T09:43:28.551041 | 2016-04-13T17:58:11 | 2016-04-13T17:58:11 | 49,324,088 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,951 | h | /**
* TCS RGB Sensor Library For Arduino
*
* Copyright (c) 2016 Ilham Imaduddin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do
* so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef _TCS_H_
#define _TCS_H_
#define DARKEST 0
#define BRIGHTEST 1
enum color_t {RED, GREEN, BLUE, CLEAR};
enum speed_t {OFF, SLOW, MEDIUM, FAST};
class TCS
{
private:
int pinS0, pinS1, pinS2, pinS3, pinOE, pinOUT;
void selectColor(color_t color);
// Calibration values
int darkest[4];
int brightest[4];
public:
TCS();
TCS(int S0, int S1, int S2, int S3, int OE, int OUT);
void setup(int S0, int S1, int S2, int S3, int OE, int OUT);
void setSpeed(speed_t speed);
void calibrate(long calibrationTime);
void setCalibrationValue(color_t color, int dark, int bright);
void getCalibratedArray(byte type, int data[4]);
int getCalibratedValue(byte type, color_t color);
int readRawInput(color_t color);
byte readColor(color_t color);
byte readGrayscale();
};
#endif | [
"ilham.imaduddin@mail.ugm.ac.id"
] | ilham.imaduddin@mail.ugm.ac.id |
f03bcfb8df6ae0262d80fc4b7a3dc9729e48431a | 6f477ed5bde39de6d14e8ba785af65250afc61d6 | /GeekDb/GeekDb/GeekMapDb.h | 7e8d34b7e8474eb560287cee0d5b586ea0812d3b | [] | no_license | GeekBand/GeekBand-C150010 | c9933cbcd98d1e5ae0502bec1c62ddc477f33c2b | 341a9effc4bf6fba2bc2f5dd5d0a0f6cf919a79f | refs/heads/master | 2021-01-10T19:33:02.719759 | 2015-09-11T07:21:47 | 2015-09-11T07:21:47 | 40,455,591 | 0 | 1 | null | 2015-09-11T07:21:47 | 2015-08-10T00:33:26 | C++ | UTF-8 | C++ | false | false | 1,618 | h | //*************************************************
// Module: GeekMapDb.h
// Notices: Copyright (c) 2015 blackerXHunter
//*************************************************
#pragma once
#include "GeekDb.h"
#include "GeekDbStorage.h"
#include "FileLogger.h"
#include <map>
namespace geek {
//
// Geek database implementation using std::vector
//
class GeekMapDb : public GeekDb {
public:
GeekMapDb(const GeekDbMetadata& metadata)
: GeekDb(metadata) {
context = new ManagerObserverContext();
logger = new FileLogger(this->m_Metadata);
}
~GeekMapDb() { logger->Save(); }
public:
GeekResult InsertKeyValue(INPARAM const GeekKeyValue& entry);
GeekResult UpdateKeyValue(INPARAM const GeekKeyValue& entry);
GeekResult DeleteKeyValue(INPARAM const std::wstring& wszKey);
GeekResult QueryKeyValue(
INPARAM const std::wstring& wszKey,
OUTPARAM std::vector<GeekKeyValue>& entries
);
GeekResult DumpKeyValues(INPARAM const std::wstring& wszFileName);
GeekResult LoadKeyValues(
INPARAM const std::wstring& wszFileName,
OUTPARAM std::wstring& wszName
);
void TraverseKeyVaues(void);
const std::size_t GetSize(void) const;
private:
void updateContext(int c = 0, int d = 0, int u = 0, int q = 0) {
context = new ManagerObserverContext(c, d, u, q);
}
typedef std::map<std::wstring, std::wstring> KeyValueContainer;
typedef KeyValueContainer::iterator KeyValueIterator;
KeyValueContainer m_kvContainer;
};
//
// Traits returns the concrete database type.
//
template<>
struct GeekDbTraits<GeekMapDb> {
public:
typedef GeekMapDb Database;
};
} | [
"blackerXHunter@outlook.com"
] | blackerXHunter@outlook.com |
44ae2b8ded0bd6204959197911f25ecdef28bfbe | ccc36739c169402f45fab29d410add3f4ea3a0c8 | /mirootlib/test/test_data1d_nerr.cc | 281e00dafeeacaf35dfd775ddc10923d9c224899 | [] | no_license | moriiism/mitool | 663eebf1b73b33001db1ecbce28c4bcf0371265d | 701566c7a70016545a8a28079b42d927bef64cd9 | refs/heads/master | 2023-04-13T00:47:03.018649 | 2023-04-12T01:52:53 | 2023-04-12T01:52:53 | 63,654,649 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,737 | cc | #include "mi_str.h"
#include "mi_iolib.h"
#include "mir_data1d_nerr.h"
// global variable
int g_flag_debug = 0;
int g_flag_help = 0;
int g_flag_verbose = 0;
int main(int argc, char* argv[])
{
int status_prog = kRetNormal;
// void Init(long ndata);
{
printf("--- test Init(long ndata)\n");
DataArrayNerr1d* da1d_1 = new DataArrayNerr1d("da1d_1");
da1d_1->Init(4);
da1d_1->PrintInfo(stdout);
da1d_1->PrintData(stdout, 1, 0.0);
delete da1d_1;
printf("=== \n");
}
// void Fill(long idata);
{
printf("--- test Fill(long idata)\n");
DataArrayNerr1d* da1d_1 = new DataArrayNerr1d("da1d_1");
da1d_1->Init(4);
da1d_1->Fill(1);
da1d_1->PrintData(stdout, 1, 0.0);
delete da1d_1;
printf("=== \n");
}
// void Fill(long idata, double weight);
{
printf("--- test Fill(long idata, double weight)\n");
DataArrayNerr1d* da1d_1 = new DataArrayNerr1d("da1d_1");
da1d_1->Init(4);
da1d_1->Fill(1, 3.0);
da1d_1->PrintData(stdout, 1, 0.0);
delete da1d_1;
printf("=== \n");
}
// void FillByLarger(long idata, double val);
{
printf("--- test FillByLarger(long idata, double val)\n");
DataArrayNerr1d* da1d_1 = new DataArrayNerr1d("da1d_1");
da1d_1->Init(4);
da1d_1->FillByLarger(1, 3.0);
da1d_1->PrintData(stdout, 1, 0.0);
delete da1d_1;
printf("=== \n");
}
// void FillBySmaller(long idata, double val);
{
printf("--- test FillBySmaller(long idata, double val)\n");
DataArrayNerr1d* da1d_1 = new DataArrayNerr1d("da1d_1");
da1d_1->Init(4);
da1d_1->FillBySmaller(1, 3.0);
da1d_1->PrintData(stdout, 1, 0.0);
delete da1d_1;
printf("=== \n");
}
// void SetConst(double constant);
{
printf("--- test SetConst(double constant)\n");
DataArrayNerr1d* da1d_1 = new DataArrayNerr1d("da1d_1");
da1d_1->Init(4);
da1d_1->SetConst(4.0);
da1d_1->PrintData(stdout, 1, 0.0);
delete da1d_1;
printf("=== \n");
}
// DataArrayNerr1d* const Clone() const;
{
printf("--- test Clone()\n");
DataArrayNerr1d* da1d_1 = new DataArrayNerr1d("da1d_1");
da1d_1->Init(4);
da1d_1->SetConst(4.0);
da1d_1->PrintData(stdout, 1, 0.0);
DataArrayNerr1d* da1d_2 = da1d_1->Clone();
da1d_2->PrintData(stdout, 1, 0.0);
delete da1d_1;
delete da1d_2;
printf("=== \n");
}
// void Load(string file);
{
printf("--- test Load(string file)\n");
DataArrayNerr1d* da1d_1 = new DataArrayNerr1d("da1d_1");
da1d_1->Load("data/test_data1d_nerr.dat");
da1d_1->PrintData(stdout, 1, 0.0);
delete da1d_1;
printf("=== \n");
}
// void Sort();
{
printf("--- test Sort()\n");
DataArrayNerr1d* da1d_1 = new DataArrayNerr1d("da1d_1");
da1d_1->Init(4);
da1d_1->SetValElm(0, 10);
da1d_1->SetValElm(1, 12);
da1d_1->SetValElm(2, 11);
da1d_1->SetValElm(3, 13);
da1d_1->PrintData(stdout, 1, 0.0);
da1d_1->Sort();
da1d_1->PrintData(stdout, 1, 0.0);
delete da1d_1;
printf("=== \n");
}
// double GetValAndErrMin() const;
// double GetValAndErrMax() const;
{
printf("--- test GetValAndErrMin()\n");
printf("--- test GetValAndErrMax()\n");
DataArrayNerr1d* da1d_1 = new DataArrayNerr1d("da1d_1");
da1d_1->Init(4);
da1d_1->SetValElm(0, 10);
da1d_1->SetValElm(1, 11);
da1d_1->SetValElm(2, 12);
da1d_1->SetValElm(3, 13);
double val_min = da1d_1->GetValAndErrMin();
printf("val_min = %e\n", val_min);
double val_max = da1d_1->GetValAndErrMax();
printf("val_max = %e\n", val_max);
delete da1d_1;
printf("=== \n");
}
// void PrintData(FILE* fp, int mode,
// double offset_val) const;
{
printf("--- test PrintData\n");
DataArrayNerr1d* da1d_1 = new DataArrayNerr1d("da1d_1");
da1d_1->Init(4);
da1d_1->SetValElm(0, 10);
da1d_1->SetValElm(1, 11);
da1d_1->SetValElm(2, 12);
da1d_1->SetValElm(3, 13);
da1d_1->PrintData(stdout, 0, 0.0);
da1d_1->PrintData(stdout, 1, 0.0);
da1d_1->PrintData(stdout, 2, 0.0);
da1d_1->PrintData(stdout, 0, 1.0);
da1d_1->PrintData(stdout, 1, 1.0);
da1d_1->PrintData(stdout, 2, 1.0);
delete da1d_1;
printf("=== \n");
}
// double GetOffsetValFromTag(string offset_tag) const;
{
printf("--- test GetOffsetValFromTag(string offset_tag)\n");
DataArrayNerr1d* da1d_1 = new DataArrayNerr1d("da1d_1");
da1d_1->Init(4);
da1d_1->SetValElm(0, 10);
da1d_1->SetValElm(1, 11);
da1d_1->SetValElm(2, 12);
da1d_1->SetValElm(3, 13);
double val_st = da1d_1->GetOffsetValFromTag("st");
printf("val_st = %e\n", val_st);
double val_md = da1d_1->GetOffsetValFromTag("md");
printf("val_md = %e\n", val_md);
double val_ed = da1d_1->GetOffsetValFromTag("ed");
printf("val_ed = %e\n", val_ed);
double val_no = da1d_1->GetOffsetValFromTag("no");
printf("val_no = %e\n", val_no);
double val_val = da1d_1->GetOffsetValFromTag("777.0");
printf("val_val = %e\n", val_val);
delete da1d_1;
printf("=== \n");
}
return status_prog;
}
| [
"morii@ism.ac.jp"
] | morii@ism.ac.jp |
8e044de26bd50442cc956e038ca54f0006e01e1d | 2cf838b54b556987cfc49f42935f8aa7563ea1f4 | /aws-cpp-sdk-imagebuilder/include/aws/imagebuilder/model/ListInfrastructureConfigurationsRequest.h | 4ed5323bafff6bc7754f06726f1dcfeb7d01ca9c | [
"MIT",
"Apache-2.0",
"JSON"
] | permissive | QPC-database/aws-sdk-cpp | d11e9f0ff6958c64e793c87a49f1e034813dac32 | 9f83105f7e07fe04380232981ab073c247d6fc85 | refs/heads/main | 2023-06-14T17:41:04.817304 | 2021-07-09T20:28:20 | 2021-07-09T20:28:20 | 384,714,703 | 1 | 0 | Apache-2.0 | 2021-07-10T14:16:41 | 2021-07-10T14:16:41 | null | UTF-8 | C++ | false | false | 5,424 | h | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/imagebuilder/Imagebuilder_EXPORTS.h>
#include <aws/imagebuilder/ImagebuilderRequest.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/imagebuilder/model/Filter.h>
#include <utility>
namespace Aws
{
namespace imagebuilder
{
namespace Model
{
/**
*/
class AWS_IMAGEBUILDER_API ListInfrastructureConfigurationsRequest : public ImagebuilderRequest
{
public:
ListInfrastructureConfigurationsRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "ListInfrastructureConfigurations"; }
Aws::String SerializePayload() const override;
/**
* <p>The filters.</p>
*/
inline const Aws::Vector<Filter>& GetFilters() const{ return m_filters; }
/**
* <p>The filters.</p>
*/
inline bool FiltersHasBeenSet() const { return m_filtersHasBeenSet; }
/**
* <p>The filters.</p>
*/
inline void SetFilters(const Aws::Vector<Filter>& value) { m_filtersHasBeenSet = true; m_filters = value; }
/**
* <p>The filters.</p>
*/
inline void SetFilters(Aws::Vector<Filter>&& value) { m_filtersHasBeenSet = true; m_filters = std::move(value); }
/**
* <p>The filters.</p>
*/
inline ListInfrastructureConfigurationsRequest& WithFilters(const Aws::Vector<Filter>& value) { SetFilters(value); return *this;}
/**
* <p>The filters.</p>
*/
inline ListInfrastructureConfigurationsRequest& WithFilters(Aws::Vector<Filter>&& value) { SetFilters(std::move(value)); return *this;}
/**
* <p>The filters.</p>
*/
inline ListInfrastructureConfigurationsRequest& AddFilters(const Filter& value) { m_filtersHasBeenSet = true; m_filters.push_back(value); return *this; }
/**
* <p>The filters.</p>
*/
inline ListInfrastructureConfigurationsRequest& AddFilters(Filter&& value) { m_filtersHasBeenSet = true; m_filters.push_back(std::move(value)); return *this; }
/**
* <p>The maximum items to return in a request.</p>
*/
inline int GetMaxResults() const{ return m_maxResults; }
/**
* <p>The maximum items to return in a request.</p>
*/
inline bool MaxResultsHasBeenSet() const { return m_maxResultsHasBeenSet; }
/**
* <p>The maximum items to return in a request.</p>
*/
inline void SetMaxResults(int value) { m_maxResultsHasBeenSet = true; m_maxResults = value; }
/**
* <p>The maximum items to return in a request.</p>
*/
inline ListInfrastructureConfigurationsRequest& WithMaxResults(int value) { SetMaxResults(value); return *this;}
/**
* <p>A token to specify where to start paginating. This is the NextToken from a
* previously truncated response.</p>
*/
inline const Aws::String& GetNextToken() const{ return m_nextToken; }
/**
* <p>A token to specify where to start paginating. This is the NextToken from a
* previously truncated response.</p>
*/
inline bool NextTokenHasBeenSet() const { return m_nextTokenHasBeenSet; }
/**
* <p>A token to specify where to start paginating. This is the NextToken from a
* previously truncated response.</p>
*/
inline void SetNextToken(const Aws::String& value) { m_nextTokenHasBeenSet = true; m_nextToken = value; }
/**
* <p>A token to specify where to start paginating. This is the NextToken from a
* previously truncated response.</p>
*/
inline void SetNextToken(Aws::String&& value) { m_nextTokenHasBeenSet = true; m_nextToken = std::move(value); }
/**
* <p>A token to specify where to start paginating. This is the NextToken from a
* previously truncated response.</p>
*/
inline void SetNextToken(const char* value) { m_nextTokenHasBeenSet = true; m_nextToken.assign(value); }
/**
* <p>A token to specify where to start paginating. This is the NextToken from a
* previously truncated response.</p>
*/
inline ListInfrastructureConfigurationsRequest& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}
/**
* <p>A token to specify where to start paginating. This is the NextToken from a
* previously truncated response.</p>
*/
inline ListInfrastructureConfigurationsRequest& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}
/**
* <p>A token to specify where to start paginating. This is the NextToken from a
* previously truncated response.</p>
*/
inline ListInfrastructureConfigurationsRequest& WithNextToken(const char* value) { SetNextToken(value); return *this;}
private:
Aws::Vector<Filter> m_filters;
bool m_filtersHasBeenSet;
int m_maxResults;
bool m_maxResultsHasBeenSet;
Aws::String m_nextToken;
bool m_nextTokenHasBeenSet;
};
} // namespace Model
} // namespace imagebuilder
} // namespace Aws
| [
"aws-sdk-cpp-automation@github.com"
] | aws-sdk-cpp-automation@github.com |
eca85656590713a4289d1e4e686e1d30328d7dd2 | 2cd0a84aefb8a7141d1c8da99845a8ada0cc009c | /tensorflow/core/kernels/mirror_pad_op.h | 62690ec3c5158ff4960385fbf02f56a74db40482 | [
"Apache-2.0"
] | permissive | hholst80/tensorflow-old | d466cee96eac717524ab8e4ee85275ce28bb5d68 | 79df325975402e03df89747947ff5b7f18407c52 | refs/heads/master | 2022-12-20T22:07:40.427519 | 2016-05-13T09:57:24 | 2016-05-13T09:57:24 | 58,914,336 | 1 | 1 | Apache-2.0 | 2022-12-09T21:52:14 | 2016-05-16T08:00:04 | C++ | UTF-8 | C++ | false | false | 16,419 | h | /* Copyright 2016 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_KERNELS_MIRROR_PAD_OP_H_
#define TENSORFLOW_KERNELS_MIRROR_PAD_OP_H_
#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
#include "tensorflow/core/framework/tensor_types.h"
#include "tensorflow/core/platform/types.h"
namespace Eigen {
template <typename PaddingDimensions, typename XprType>
class TensorMirrorPadOp;
namespace internal {
template <typename PaddingDimensions, typename XprType>
struct traits<TensorMirrorPadOp<PaddingDimensions, XprType>>
: public traits<XprType> {
typedef typename XprType::Scalar Scalar;
typedef traits<XprType> XprTraits;
typedef typename XprTraits::StorageKind StorageKind;
typedef typename XprTraits::Index Index;
typedef typename XprType::Nested Nested;
typedef typename remove_reference<Nested>::type _Nested;
static constexpr int NumDimensions = XprTraits::NumDimensions;
static constexpr int Layout = XprTraits::Layout;
};
template <typename PaddingDimensions, typename XprType>
struct eval<TensorMirrorPadOp<PaddingDimensions, XprType>, Eigen::Dense> {
typedef const TensorMirrorPadOp<PaddingDimensions, XprType>& type;
};
template <typename PaddingDimensions, typename XprType>
struct nested<
TensorMirrorPadOp<PaddingDimensions, XprType>, 1,
typename eval<TensorMirrorPadOp<PaddingDimensions, XprType>>::type> {
typedef TensorMirrorPadOp<PaddingDimensions, XprType> type;
};
} // namespace internal
template <typename PaddingDimensions, typename XprType>
class TensorMirrorPadOp
: public TensorBase<TensorMirrorPadOp<PaddingDimensions, XprType>,
ReadOnlyAccessors> {
public:
typedef typename Eigen::internal::traits<TensorMirrorPadOp>::Scalar Scalar;
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar;
typedef typename XprType::CoeffReturnType CoeffReturnType;
typedef typename Eigen::internal::nested<TensorMirrorPadOp>::type Nested;
typedef typename Eigen::internal::traits<TensorMirrorPadOp>::StorageKind
StorageKind;
typedef typename Eigen::internal::traits<TensorMirrorPadOp>::Index Index;
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
TensorMirrorPadOp(const XprType& expr, const PaddingDimensions& padding_dims,
Index offset)
: xpr_(expr), padding_dims_(padding_dims), offset_(offset) {}
EIGEN_DEVICE_FUNC
const PaddingDimensions& padding() const { return padding_dims_; }
EIGEN_DEVICE_FUNC
Index offset() const { return offset_; }
EIGEN_DEVICE_FUNC
const typename internal::remove_all<typename XprType::Nested>::type&
expression() const {
return xpr_;
}
protected:
typename XprType::Nested xpr_;
const PaddingDimensions padding_dims_;
const Index offset_;
};
// Eval as rvalue
template <typename PaddingDimensions, typename ArgType, typename Device>
struct TensorEvaluator<const TensorMirrorPadOp<PaddingDimensions, ArgType>,
Device> {
typedef TensorMirrorPadOp<PaddingDimensions, ArgType> XprType;
typedef typename XprType::Index Index;
static constexpr int Dims = internal::array_size<PaddingDimensions>::value;
typedef DSizes<Index, Dims> Dimensions;
typedef typename XprType::Scalar Scalar;
typedef typename XprType::CoeffReturnType CoeffReturnType;
// Copied from Eigen3 Github version 0e806c1.
typedef typename PacketType<CoeffReturnType, Device>::type PacketReturnType;
enum {
IsAligned = false,
PacketAccess = TensorEvaluator<ArgType, Device>::PacketAccess,
BlockAccess = false,
Layout = TensorEvaluator<ArgType, Device>::Layout,
CoordAccess = true,
RawAccess = false
};
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op,
const Device& device)
: impl_(op.expression(), device), padding_(op.padding()) {
EIGEN_STATIC_ASSERT(Dims > 0, YOU_MADE_A_PROGRAMMING_MISTAKE)
// op.offset() == 0 if padding mode is symmetric.
// op.offset() == 1 if padding mode is reflect.
eigen_assert(op.offset() == 0 || op.offset() == 1);
left_offset_ = -1 + op.offset();
right_offset_ = -1 - op.offset();
// This should trigger compilation error if padding dimensions and
// expression dimensions do not match.
dimensions_ = impl_.dimensions();
for (int dim = 0; dim < Dims; ++dim) {
eigen_assert(padding_[dim].first + op.offset() <= dimensions_[dim]);
eigen_assert(padding_[dim].second + op.offset() <= dimensions_[dim]);
dimensions_[dim] += padding_[dim].first + padding_[dim].second;
}
const auto& input_dims = impl_.dimensions();
if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
input_strides_[0] = 1;
output_strides_[0] = 1;
for (int i = 0; i < Dims - 1; ++i) {
input_strides_[i + 1] = input_strides_[i] * input_dims[i];
output_strides_[i + 1] = output_strides_[i] * dimensions_[i];
}
} else {
input_strides_[numext::maxi(0, Dims - 1)] = 1;
output_strides_[numext::maxi(0, Dims - 1)] = 1;
for (int i = Dims - 1; i > 0; --i) {
input_strides_[i - 1] = input_strides_[i] * input_dims[i];
output_strides_[i - 1] = output_strides_[i] * dimensions_[i];
}
}
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Dimensions& dimensions() const {
return dimensions_;
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(Scalar*) {
impl_.evalSubExprsIfNeeded(nullptr);
return true;
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void cleanup() { impl_.cleanup(); }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType
coeff(Index index) const {
eigen_assert(index < dimensions().TotalSize());
const Index input_index = ToInputIndex(index);
return impl_.coeff(input_index);
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType
coeff(array<Index, Dims> coords) const {
for (int dim = 0; dim < Dims; ++dim) {
coords[dim] = ToInputCoord(coords[dim], dim);
}
ReadInputHelper<TensorEvaluator<ArgType, Device>::CoordAccess> helper;
return helper(coords, input_strides_, impl_);
}
template <int LoadMode>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType
packet(Index index) const {
constexpr int kPacketSize =
internal::unpacket_traits<PacketReturnType>::size;
EIGEN_STATIC_ASSERT(kPacketSize > 1, YOU_MADE_A_PROGRAMMING_MISTAKE)
eigen_assert(index + kPacketSize <= dimensions().TotalSize());
// Find the effective inner-most dimension where padding actually happens.
// NOTE: This is independent of index argument, and can be done in the
// constructor to save computation. However, if packet access does not
// happen, then moving to constructor will incur needless overhead.
int dim = -1;
if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
for (int k = 0; k < Dims; ++k) {
if (padding_[k].first != 0 || padding_[k].second != 0) {
dim = k;
break;
}
}
} else {
for (int k = Dims - 1; k >= 0; --k) {
if (padding_[k].first != 0 || padding_[k].second != 0) {
dim = k;
break;
}
}
}
const Index input_index = ToInputIndex(index);
// If dim < 0, this means there is no padding at all.
if (dim < 0) {
return impl_.template packet<Unaligned>(input_index);
}
// Check if the way from the begin of the packet to the end of the packet
// is paved with contiguous road. That is, the indices must be between the
// padded region in the effective inner-most dimension.
const Index left = padding_[dim].first * output_strides_[dim];
const Index right =
(dimensions_[dim] - padding_[dim].second) * output_strides_[dim];
if (left <= index && (index + kPacketSize - 1) < right) {
return impl_.template packet<Unaligned>(input_index);
}
// If the road is not contiguous, then fall back to coeff().
EIGEN_ALIGN_MAX typename internal::remove_const<CoeffReturnType>::type
values[kPacketSize];
values[0] = impl_.coeff(input_index);
for (int i = 1; i < kPacketSize; ++i) {
values[i] = coeff(index + i);
}
PacketReturnType result = internal::pload<PacketReturnType>(values);
return result;
}
#ifdef EIGEN_USE_COST_MODEL
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost
costPerCoeff(bool vectorized) const {
constexpr int kPacketSize =
internal::unpacket_traits<PacketReturnType>::size;
const double compute_cost = Dims * (7 * TensorOpCost::AddCost<Index>() +
2 * TensorOpCost::MulCost<Index>() +
TensorOpCost::DivCost<Index>());
return impl_.costPerCoeff(vectorized) +
TensorOpCost(1, 0, compute_cost, vectorized, kPacketSize);
}
#endif // EIGEN_USE_COST_MODEL
EIGEN_DEVICE_FUNC Scalar* data() const { return nullptr; }
protected:
using Coords = array<Index, Dims>;
// Full template specialization is not allowed within non-fully specialized
// template class. Adding a dummy parameter to make specializations partial.
template <bool CoordAccess, bool dummy = true>
struct ReadInputHelper;
template <bool dummy>
struct ReadInputHelper<false, dummy> {
template <typename Eval>
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Index
operator()(const Coords& coord, const Coords& strides, const Eval& eval) {
Index index = 0;
for (int k = 0; k < Dims; ++k) {
index += coord[k] * strides[k];
}
return eval.coeff(index);
}
};
template <bool dummy>
struct ReadInputHelper<true, dummy> {
template <typename Eval>
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Index
operator()(const Coords& coord, const Coords& strides, const Eval& eval) {
return eval.coeff(coord);
}
};
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Index ToInputCoord(Index k,
int dim) const {
const Index m = impl_.dimensions()[dim];
k -= padding_[dim].first;
if (k < 0) {
return -k + left_offset_;
}
if (k < m) {
return k;
}
return m - (k - m) + right_offset_;
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index
ToInputIndex(const Coords& coords) const {
Index input_index = 0;
for (int dim = 0; dim < Dims; ++dim) {
input_index += ToInputCoord(coords[dim], dim) * input_strides_[dim];
}
return input_index;
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index ToInputIndex(Index index) const {
Index input_index = 0;
if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
for (int dim = Dims - 1; dim > 0; --dim) {
const Index k = index / output_strides_[dim];
index -= k * output_strides_[dim];
input_index += ToInputCoord(k, dim) * input_strides_[dim];
}
input_index += ToInputCoord(index, 0);
} else {
for (int dim = 0; dim < Dims - 1; ++dim) {
const Index k = index / output_strides_[dim];
index -= k * output_strides_[dim];
input_index += ToInputCoord(k, dim) * input_strides_[dim];
}
input_index += ToInputCoord(index, Dims - 1);
}
return input_index;
}
TensorEvaluator<ArgType, Device> impl_;
PaddingDimensions padding_;
Dimensions dimensions_;
array<Index, Dims> input_strides_;
array<Index, Dims> output_strides_;
Index left_offset_;
Index right_offset_;
};
} // namespace Eigen
namespace tensorflow {
namespace functor {
// offset argument must be either 0 or 1. This controls whether the boundary
// values are replicated (offset == 0) or not replicated (offset == 1).
template <typename Device, typename T, int Dims>
struct MirrorPad {
void operator()(const Device& device,
typename TTypes<T, Dims, int32>::Tensor output,
typename TTypes<T, Dims, int32>::ConstTensor input,
TTypes<int32>::ConstMatrix padding, int offset) {
Eigen::array<Eigen::IndexPair<int32>, Dims> padding_dims;
for (int i = 0; i < Dims; ++i) {
padding_dims[i] = Eigen::IndexPair<int32>(padding(i, 0), padding(i, 1));
}
output.device(device) = MirrorPadOp(input, padding_dims, offset);
}
template <typename PaddingDimensions, typename Derived>
static const Eigen::TensorMirrorPadOp<PaddingDimensions, const Derived>
MirrorPadOp(
const Eigen::TensorBase<Derived, Eigen::ReadOnlyAccessors>& tensor,
const PaddingDimensions& padding, int offset) {
return Eigen::TensorMirrorPadOp<PaddingDimensions, const Derived>(
static_cast<const Derived&>(tensor), padding, offset);
}
};
// offset argument must be either 0 or 1. This controls whether the boundary
// values are replicated (offset == 0) or not replicated (offset == 1).
template <typename Device, typename T, int Dims>
struct MirrorPadGrad {
void operator()(const Device& device,
typename TTypes<T, Dims, int32>::Tensor output,
typename TTypes<T, Dims, int32>::ConstTensor input,
TTypes<int32>::ConstMatrix paddings, int offset,
typename TTypes<T, Dims, int32>::Tensor scratch) {
// Copy the gradient input into the scratch buffer.
scratch.device(device) = input;
Eigen::array<int32, Dims> lhs_offsets;
Eigen::array<int32, Dims> rhs_offsets;
Eigen::array<int32, Dims> extents;
Eigen::array<bool, Dims> reverses;
for (int i = 0; i < Dims; ++i) {
lhs_offsets[i] = 0;
rhs_offsets[i] = 0;
extents[i] = scratch.dimension(i);
reverses[i] = false;
}
// At this point, the central part (non-padded area) does not include the
// gradients back-propagated through padded areas. Those gradient components
// need be added to the central part.
//
// Note that a gradient input element falls into a padded area iff in at
// least one dimension i, the coordinate x(i) is in the range (python-style)
// [:paddings(i,0)] or [-paddings(i,1):].
for (int i = 0; i < Dims; ++i) {
reverses[i] = true;
// This handles the case when coordinate in dimension i is in the range
// [:paddings(i,0)]. This portion is added to the range
// [paddings(i,0) + offset:2 * paddings(i,0) + offset].
if (paddings(i, 0) > 0) {
rhs_offsets[i] = 0;
lhs_offsets[i] = paddings(i, 0) + offset;
extents[i] = paddings(i, 0);
scratch.slice(lhs_offsets, extents).device(device) +=
scratch.slice(rhs_offsets, extents).reverse(reverses);
}
// This handles the case when coordinate in dimension i is in the range
// [-paddings(i,1):]. This portion is added to the range
// [-2 * paddings(i,1) - offset:-paddings(i,1) - offset].
if (paddings(i, 1) > 0) {
rhs_offsets[i] = scratch.dimension(i) - paddings(i, 1);
lhs_offsets[i] = rhs_offsets[i] - paddings(i, 1) - offset;
extents[i] = paddings(i, 1);
scratch.slice(lhs_offsets, extents).device(device) +=
scratch.slice(rhs_offsets, extents).reverse(reverses);
}
reverses[i] = false;
lhs_offsets[i] = paddings(i, 0);
rhs_offsets[i] = paddings(i, 0);
extents[i] = output.dimension(i);
// At this point, scratch buffer contains gradient input as if paddings
// for dimension k = 0,...,i are zeros. Therefore after the loop
// termination, the central part of the scratch buffer contains the folded
// gradients.
}
// Copy the central part of the scratch buffer to the output.
output.device(device) = scratch.slice(rhs_offsets, extents);
}
};
} // namespace functor
} // namespace tensorflow
#endif // TENSORFLOW_KERNELS_MIRROR_PAD_OP_H_
| [
"henrik.holst@frostbite.com"
] | henrik.holst@frostbite.com |
fc30f91eb594500d14e44342bd603ee6f43e9184 | 6ab1bea634bfddabb0bf8775eb61bfe487917105 | /test/unit-test/fam-api/fam_create_destroy_region_test_mt.cpp | 3822e4ad8fc33cfedf8a413108450dd3e55771c9 | [
"BSD-3-Clause"
] | permissive | faizan-barmawer/OpenFAM | a5e2c9a8c2f650514db6b5cb0ca167bdf6a240d9 | d3bf738e519f33616d735b4bc593ed6fd5b657cc | refs/heads/master | 2020-08-13T19:40:09.877094 | 2019-10-13T18:29:17 | 2019-10-13T18:29:17 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,594 | cpp | /*
* fam_create_destroy_region_test_mt.cpp
* Copyright (c) 2019 Hewlett Packard Enterprise Development, LP. All rights
* reserved. Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* See https://spdx.org/licenses/BSD-3-Clause
*
*/
#include <fam/fam_exception.h>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <pthread.h>
#include <fam/fam.h>
#include "common/fam_test_config.h"
using namespace std;
using namespace openfam;
fam *my_fam;
/* thread function */
void *thr_func(void *arg) {
Fam_Region_Descriptor *desc1, *desc2, *desc3;
string name;
name = "test" + to_string(rand());
desc1 = my_fam->fam_create_region(name.c_str(), 8192, 0777, RAID1);
if (desc1 == NULL) {
cout << "fam create region failed" << endl;
exit(1);
}
name = "test" + to_string(rand());
desc2 = my_fam->fam_create_region(name.c_str(), 8192, 0777, RAID1);
if (desc2 == NULL) {
cout << "fam create region failed" << endl;
exit(1);
}
name = "test" + to_string(rand());
desc3 = my_fam->fam_create_region(name.c_str(), 8192, 0777, RAID1);
if (desc3 == NULL) {
cout << "fam create region failed" << endl;
exit(1);
}
if (desc3 != NULL)
my_fam->fam_destroy_region(desc3);
if (desc1 != NULL)
my_fam->fam_destroy_region(desc1);
if (desc2 != NULL)
my_fam->fam_destroy_region(desc2);
name = "test" + to_string(rand());
desc1 = my_fam->fam_create_region(name.c_str(), 8192, 0777, RAID1);
if (desc1 == NULL) {
cout << "fam create region failed" << endl;
exit(1);
}
name = "test" + to_string(rand());
desc2 = my_fam->fam_create_region(name.c_str(), 8192, 0777, RAID1);
if (desc2 == NULL) {
cout << "fam create region failed" << endl;
exit(1);
}
if (desc1 != NULL)
my_fam->fam_destroy_region(desc1);
if (desc2 != NULL)
my_fam->fam_destroy_region(desc2);
pthread_exit(NULL);
}
int main() {
Fam_Options fam_opts;
pthread_t thr[10];
int i, rc;
my_fam = new fam();
memset((void *)&fam_opts, 0, sizeof(Fam_Options));
fam_opts.memoryServer = strdup(TEST_MEMORY_SERVER);
fam_opts.grpcPort = strdup(TEST_GRPC_PORT);
fam_opts.libfabricPort = strdup(TEST_LIBFABRIC_PORT);
fam_opts.allocator = strdup(TEST_ALLOCATOR);
fam_opts.runtime = strdup("NONE");
if (my_fam->fam_initialize("default", &fam_opts) < 0) {
cout << "fam initialization failed" << endl;
exit(1);
} else {
cout << "fam initialization successful" << endl;
}
for (i = 0; i < 10; ++i) {
if ((rc = pthread_create(&thr[i], NULL, thr_func, NULL))) {
fprintf(stderr, "error: pthread_create, rc: %d\n", rc);
return -1;
}
}
for (i = 0; i < 10; ++i) {
pthread_join(thr[i], NULL);
}
my_fam->fam_finalize("default");
cout << "fam finalize successful" << endl;
return 0;
}
| [
"sharad.singhal@hpe.com"
] | sharad.singhal@hpe.com |
acd8fd28faffb4a0525c1a80527403cef757e6d1 | 0be07c052b887c513afb1913ad806d68ce3a9d8a | /libs/hwdrivers/include/mrpt/hwdrivers/CJoystick.h | a48fa6efa4c9e5cd4db8cb293a374f5426bac13d | [
"BSD-3-Clause"
] | permissive | bcsdleweev/mrpt | b9336421099e56499a3c3e99dec96e2c26088e4d | 2ef41868ffdf4f61ca676c7c0ab1427b4a052671 | refs/heads/master | 2020-12-27T15:09:20.875967 | 2014-04-14T11:14:47 | 2014-04-14T11:14:47 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,942 | h | /* +---------------------------------------------------------------------------+
| Mobile Robot Programming Toolkit (MRPT) |
| http://www.mrpt.org/ |
| |
| Copyright (c) 2005-2014, Individual contributors, see AUTHORS file |
| See: http://www.mrpt.org/Authors - All rights reserved. |
| Released under BSD License. See details in http://www.mrpt.org/License |
+---------------------------------------------------------------------------+ */
#ifndef CJOYSTICK_H
#define CJOYSTICK_H
#include <mrpt/config.h>
#include <mrpt/utils/utils_defs.h>
#include <mrpt/hwdrivers/link_pragmas.h>
/*---------------------------------------------------------------
Class
---------------------------------------------------------------*/
namespace mrpt
{
namespace hwdrivers
{
/** Access to joysticks and gamepads (read buttons and position), and request number of joysticks in the system.
* \ingroup mrpt_hwdrivers_grp
*/
class HWDRIVERS_IMPEXP CJoystick
{
private:
/** The axis limits:
*/
int m_x_min,m_x_max,m_y_min,m_y_max,m_z_min,m_z_max;
#if defined(MRPT_OS_LINUX)
int m_joy_fd; //!< File FD for the joystick, or -1 if not open (Linux only)
int m_joy_index; //!< The index of the joystick open in m_joy_fd (Linux only)
/** Using an event system we only have deltas, need to keep the whole joystick state (Linux only) */
vector_bool m_joystate_btns;
/** Using an event system we only have deltas, need to keep the whole joystick state (Linux only) */
vector_int m_joystate_axes;
#endif
public:
/** Constructor
*/
CJoystick();
/** Destructor
*/
virtual ~CJoystick();
/** Returns the number of Joysticks in the computer.
*/
static int getJoysticksCount();
/** Gets joystick information.
*
* This method will try first to open the joystick, so you can safely call it while the joystick is plugged and removed arbitrarly.
*
* \param nJoy The index of the joystick to query: The first one is 0, the second 1, etc... See CJoystick::getJoysticksCount to discover the number of joysticks in the system.
* \param x The x axis position, range [-1,1]
* \param y The y axis position, range [-1,1]
* \param z The z axis position, range [-1,1]
* \param buttons Each element will hold true if buttons are pressed. The size of the vector will be set automatically to the number of buttons.
* \param raw_x_pos If it is desired the raw integer measurement from JoyStick, set this pointer to a desired placeholder.
* \param raw_y_pos If it is desired the raw integer measurement from JoyStick, set this pointer to a desired placeholder.
* \param raw_z_pos If it is desired the raw integer measurement from JoyStick, set this pointer to a desired placeholder.
*
* \return Returns true if successfull, false on error, for example, if joystick is not present.
*
* \sa setLimits
*/
bool getJoystickPosition(
int nJoy,
float &x,
float &y,
float &z,
std::vector<bool> &buttons,
int *raw_x_pos=NULL,
int *raw_y_pos=NULL,
int *raw_z_pos=NULL );
/** Set the axis limit values, for computing a [-1,1] position index easily (Only required to calibrate analog joystick).
* It seems that these values must been calibrated for each joystick model.
*
* \sa getJoystickPosition
*/
#ifdef MRPT_OS_WINDOWS
void setLimits( int x_min = 0,int x_max = 0xFFFF, int y_min=0,int y_max = 0xFFFF,int z_min=0,int z_max = 0xFFFF );
#else
void setLimits( int x_min = -32767,int x_max = 32767, int y_min=-32767,int y_max = 32767,int z_min=-32767,int z_max = 32767);
#endif
}; // End of class def.
} // End of namespace
} // End of namespace
#endif
| [
"joseluisblancoc@gmail.com"
] | joseluisblancoc@gmail.com |
f05e9dee45099eaed73ab9f11eeb62a11c53b1f1 | 96aa6f9a7011eec46a3219c13be04513ce41d045 | /code/src/include/Formula.h | 04f6c292b0cc0a5c85affe5a0a404cd1d88aad49 | [] | no_license | lighttime0/RSC | 4c6390560ab4c4dc6131c16d64e82bd4c0f5bb64 | 7bb57c5958573fa1ebc63e5de36f3badbf34e16e | refs/heads/master | 2020-03-21T04:27:23.480759 | 2018-08-05T15:10:32 | 2018-08-05T15:10:32 | 138,109,054 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,199 | h | //===---- Formula.h - QF_LIA Formulas. --------------------------*- C++ -*-===//
#ifndef FORMULA_H
#define FORMULA_H
#include <cassert>
#include <memory>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <fstream>
#include <functional>
#include <llvm/ADT/StringRef.h>
#include <llvm/IR/Value.h>
#include <llvm/Support/Format.h>
#include <llvm/Support/raw_ostream.h>
#include <z3.h>
#include <z3++.h>
namespace rsc {
class Expr;
class Operand;
class Constant;
class Variable;
class Signature;
class __Formula;
typedef std::shared_ptr<__Formula> Formula;
class Context {
/* Operand pool */
std::vector<Operand*> operands; // Owner of constants and signatures
Constant *get_constant(long long c);
Variable *get_variable(llvm::Value *v);
Variable *get_variable(const std::string &name);
Signature *get_signature(const std::string &sig);
Operand *parse_to_operand(Z3_ast ast);
Formula parse_to_formula(Z3_ast ast);
public:
z3::context z3;
llvm::Function *F;
// maps for operands
std::map<int, Constant*> constants;
std::map<llvm::Value*, Variable*> variables; // Owner of variables
std::map<std::string, Variable*> name_to_variables;
std::map<std::string, Signature*> signatures;
void operand_is_legal(Operand *op);
// maps for atoms
std::map<llvm::Value*, Formula> value_to_atoms;
std::map<std::string, Formula> name_to_atoms; // Atoms of type bool_const
int pathid;
std::map<int, int> pathtree; // new path -> old path
Context() : pathid(0) { pathtree[0] = -1; }
~Context();
Operand *get_operand(llvm::Value *v);
Operand *get_operand(int i) { return get_operand((long long)i); }
Operand *get_operand(long long i);
Operand *get_operand(const char *sig);
Operand *get_operand(const std::string &sig);
Operand *get_operand(Operand *op, std::function<Expr*(Context&, Expr*)> sub);
Formula get_atom(llvm::Value *v);
Formula get_atom(const std::string &name);
Formula parse(z3::expr e);
void switch_pathid(int id) { pathid = id; }
void copy_path(int old_id, int new_id) { pathtree[new_id] = old_id; }
void dump_var_bindings();
};
class Expr {
public:
Context &c;
protected:
virtual void init_expr() { assert(0); };
public:
Expr(Context &c) : c(c) {}
virtual ~Expr() {}
virtual z3::expr z3_expr() = 0;
virtual void serialize(std::ofstream &fout) = 0;
};
class Operand : public Expr {
public:
Operand(Context &c) : Expr(c) {}
virtual ~Operand() {}
virtual bool is_constant() { return false; }
virtual bool is_variable() { return false; }
virtual bool is_signature() { return false; }
virtual Operand *deep_copy(Context &c, std::function<Expr*(Context&, Expr*)> sub) = 0;
static Operand *deserialize(Context &c, std::ifstream &fin);
virtual void print(llvm::raw_ostream & out) = 0;
};
class Constant : public Operand {
public:
long long i;
Constant(Context &c) : Operand(c) {}
virtual ~Constant() {}
virtual bool is_constant() { return true; }
virtual z3::expr z3_expr() {
return c.z3.int_val(i);
}
virtual Operand *deep_copy(Context &c, std::function<Expr*(Context&, Expr*)> sub);
virtual void serialize(std::ofstream &fout);
static Operand *deserialize(Context &c, std::ifstream &fin);
virtual void print(llvm::raw_ostream & out) {
if (i < 10)
out << i;
else
out << llvm::format("0x%x", i);
}
};
class Variable : public Operand {
public:
std::string name;
llvm::Value *v;
Variable(Context &c) : Operand(c), v(NULL) {}
virtual ~Variable() {}
virtual bool is_variable() { return true; }
virtual z3::expr z3_expr() {
return c.z3.int_const(name.c_str());
}
virtual Operand *deep_copy(Context &c, std::function<Expr*(Context&, Expr*)> sub);
virtual void serialize(std::ofstream &fout);
virtual void print(llvm::raw_ostream & out) {
if (v)
v->printAsOperand(out, false);
else if (!name.empty())
out << name;
else
out << "??";
}
};
class Signature : public Operand {
public:
std::string sig;
Signature(Context &c) : Operand(c) {}
virtual ~Signature() {}
virtual bool is_signature() { return true; }
virtual z3::expr z3_expr() {
return c.z3.int_const(sig.c_str());
}
virtual Operand *deep_copy(Context &c, std::function<Expr*(Context&, Expr*)> sub);
virtual void serialize(std::ofstream &fout);
static Operand *deserialize(Context &c, std::ifstream &fin);
virtual void print(llvm::raw_ostream & out) {
if (!sig.empty())
out << sig;
else
out << "??";
}
};
class __Formula : public Expr {
friend class FormulaVisitor;
protected:
enum Type {
T_Base,
T_True,
T_False,
T_Atom,
T_Conjunction,
T_Disjunction,
T_Negation,
};
__Formula(Context &c) : Expr(c) {}
virtual Type get_type() { return T_Base; };
public:
virtual ~__Formula() {}
Formula simplify();
Formula deep_simplify();
bool check();
bool is_true() { return get_type() == T_True; }
bool is_false() { return get_type() == T_False; }
virtual Formula deep_copy(Context &c, std::function<Expr*(Context&, Expr*)> sub) = 0;
static Formula deserialize(Context &c, std::ifstream &fin);
virtual void print(llvm::raw_ostream & out) = 0;
friend llvm::raw_ostream & operator<<(llvm::raw_ostream & out, Formula const & e);
};
class True : public __Formula {
True(Context &c) : __Formula(c) {}
protected:
virtual Type get_type() { return T_True; }
public:
virtual ~True() {}
static Formula get(Context &c) {
Formula t(new True(c));
return t;
}
virtual z3::expr z3_expr() {
return c.z3.bool_val(true);
}
virtual Formula deep_copy(Context &c, std::function<Expr*(Context&, Expr*)> sub);
virtual void serialize(std::ofstream &fout);
static Formula deserialize(Context &c, std::ifstream &fin);
virtual void print(llvm::raw_ostream & out) {
out << "True";
}
};
class False : public __Formula {
False(Context &c) : __Formula(c) {}
protected:
virtual Type get_type() { return T_False; }
public:
virtual ~False() {}
static Formula get(Context &c) {
Formula f(new False(c));
return f;
}
virtual z3::expr z3_expr() {
return c.z3.bool_val(false);
}
virtual Formula deep_copy(Context &c, std::function<Expr*(Context&, Expr*)> sub);
virtual void serialize(std::ofstream &fout);
static Formula deserialize(Context &c, std::ifstream &fin);
virtual void print(llvm::raw_ostream & out) {
out << "False";
}
};
class Atom : public __Formula {
public:
enum Operator {
OP_NULL,
OP_BEGIN,
OP_EQ = OP_BEGIN,
OP_NE,
OP_LT,
OP_LE,
OP_GT,
OP_GE,
OP_END,
};
static const char *OP_SYMBOL[OP_END];
protected:
virtual Type get_type() { return T_Atom; }
public:
Operator op;
Operand *lhs, *rhs;
llvm::Value *v;
std::string name;
virtual ~Atom() {}
Atom(Context &c) : __Formula(c), op(OP_NULL), lhs(NULL), rhs(NULL) {}
Atom(Context &c, llvm::Value *v);
Atom(Context &c, const char *name) : __Formula(c), op(OP_NULL), lhs(NULL), rhs(NULL), name(name) {}
Atom(Context &c, Operator op, Operand *lhs, Operand *rhs)
: __Formula(c), v(NULL), op(op), lhs(lhs), rhs(rhs) {}
static Formula create(Context &c, Operator op, llvm::StringRef lhs, llvm::StringRef rhs);
llvm::StringRef getName() { return llvm::StringRef(name); }
virtual z3::expr z3_expr() {
switch (op) {
case OP_EQ:
return (lhs->z3_expr() == rhs->z3_expr());
case OP_NE:
return (lhs->z3_expr() != rhs->z3_expr());
case OP_LT:
return (lhs->z3_expr() < rhs->z3_expr());
case OP_LE:
return (lhs->z3_expr() <= rhs->z3_expr());
case OP_GT:
return (lhs->z3_expr() > rhs->z3_expr());
case OP_GE:
return (lhs->z3_expr() >= rhs->z3_expr());
}
return c.z3.bool_const(name.c_str());
}
Formula deep_copy(Context &c, std::function<Expr*(Context&, Expr*)> sub);
virtual void serialize(std::ofstream &fout);
static Formula deserialize(Operator op, Context &c, std::ifstream &fin);
virtual void print(llvm::raw_ostream & out) {
if (op == OP_NULL)
out << name;
else {
out << "(";
lhs->print(out);
out << " " << OP_SYMBOL[op] << " ";
rhs->print(out);
out << ")";
}
}
};
class Conjunction : public __Formula {
Conjunction(Context &c, Formula p, Formula q)
: __Formula(c), p(p), q(q) {}
protected:
virtual Type get_type() { return T_Conjunction; }
public:
Formula p, q;
virtual ~Conjunction() {}
virtual z3::expr z3_expr() {
return (p->z3_expr() && q->z3_expr());
}
Formula deep_copy(Context &c, std::function<Expr*(Context&, Expr*)> sub);
virtual void serialize(std::ofstream &fout);
static Formula deserialize(Context &c, std::ifstream &fin);
friend Formula operator&&(Formula p, Formula q);
virtual void print(llvm::raw_ostream & out) {
out << "(";
p->print(out);
out << " /\\ ";
q->print(out);
out << ")";
}
};
class Disjunction : public __Formula {
Disjunction(Context &c, Formula p, Formula q)
: __Formula(c), p(p), q(q) {}
protected:
virtual Type get_type() { return T_Disjunction; }
public:
Formula p, q;
virtual ~Disjunction() {}
virtual z3::expr z3_expr() {
return (p->z3_expr() || q->z3_expr());
}
Formula deep_copy(Context &c, std::function<Expr*(Context&, Expr*)> sub);
virtual void serialize(std::ofstream &fout);
static Formula deserialize(Context &c, std::ifstream &fin);
friend Formula operator||(Formula p, Formula q);
virtual void print(llvm::raw_ostream & out) {
out << "(";
p->print(out);
out << " \\/ ";
q->print(out);
out << ")";
}
};
class Negation : public __Formula {
Negation(Context &c, Formula p)
: __Formula(c), p(p) {}
protected:
virtual Type get_type() { return T_Negation; }
public:
Formula p;
virtual ~Negation() {}
virtual z3::expr z3_expr() {
return !p->z3_expr();
}
Formula deep_copy(Context &c, std::function<Expr*(Context&, Expr*)> sub);
virtual void serialize(std::ofstream &fout);
static Formula deserialize(Context &c, std::ifstream &fin);
friend Formula operator!(Formula p);
virtual void print(llvm::raw_ostream & out) {
out << "~";
p->print(out);
}
};
Formula operator&&(Formula p, Formula q);
Formula operator||(Formula p, Formula q);
Formula operator!(Formula p);
llvm::raw_ostream & operator<<(llvm::raw_ostream & out, Formula const & e);
}
#endif /* FORMULA_H */
| [
"lighttime0@gmail.com"
] | lighttime0@gmail.com |
413a6e90d834984d7bfac06e5428b0a16b411c9a | e3b684338c71a731868a4b71fcc808c742ca4076 | /src/libzerocoin/Params.cpp | d69490aefb9dca5db85b4f08dfdd8d522c510895 | [
"MIT"
] | permissive | linnerg11/tym | 96a4ee61edfa890750d08a8469c07e10e42830b3 | 53f25d50d921cac562d9a8c9a07b04147948cad5 | refs/heads/master | 2023-01-27T23:05:59.775154 | 2020-12-03T21:12:03 | 2020-12-03T21:12:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,424 | cpp | /**
* @file Params.cpp
*
* @brief Parameter class for Zerocoin.
*
* @author Ian Miers, Christina Garman and Matthew Green
* @date June 2013
*
* @copyright Copyright 2013 Ian Miers, Christina Garman and Matthew Green
* @license This project is released under the MIT license.
**/
// Copyright (c) 2017-2019 The PIVX developers
// Copyright (c) 2020 The TimelockCoin developers
#include "Params.h"
#include "ParamGeneration.h"
namespace libzerocoin {
ZerocoinParams::ZerocoinParams(CBigNum N, uint32_t securityLevel) {
this->zkp_hash_len = securityLevel;
this->zkp_iterations = securityLevel;
this->accumulatorParams.k_prime = ACCPROOF_KPRIME;
this->accumulatorParams.k_dprime = ACCPROOF_KDPRIME;
// Generate the parameters
CalculateParams(*this, N, ZEROCOIN_PROTOCOL_VERSION, securityLevel);
this->accumulatorParams.initialized = true;
this->initialized = true;
}
AccumulatorAndProofParams::AccumulatorAndProofParams() {
this->initialized = false;
}
IntegerGroupParams::IntegerGroupParams() {
this->initialized = false;
}
CBigNum IntegerGroupParams::randomElement() const {
// The generator of the group raised
// to a random number less than the order of the group
// provides us with a uniformly distributed random number.
return this->g.pow_mod(CBigNum::randBignum(this->groupOrder),this->modulus);
}
} /* namespace libzerocoin */
| [
"marian@priv.profiweb.biz"
] | marian@priv.profiweb.biz |
12c73ca05196a64ed0bdd68c194ff7a131815655 | e7a91eb528f543e4de9d098c89ebbbd0df7e677d | /src/helpers.h | 20f972727740e7fc2128199f2e567535874da298 | [
"MIT"
] | permissive | MacSark/keen5 | 33c7abab7bbb7fa567e674bfb1d165d5747f0c0d | 3c63b68c7ca48d8d1bd5f7b56247f74d0756600e | refs/heads/master | 2020-06-01T13:57:59.633913 | 2014-05-22T01:34:56 | 2014-05-22T01:34:56 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 627 | h | #ifndef HELPERS_H
#define HELPERS_H
#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include "SDL/SDL_ttf.h"
#include <string>
#include <vector>
// Screen attributes
const int SCREEN_WIDTH = 640;
const int SCREEN_HEIGHT = 480;
const int SCREEN_BPP = 32;
// The surfaces
extern std::vector<SDL_Surface*> surfaces;
extern SDL_Surface *screen;
extern SDL_Surface *background;
extern SDL_Surface *keen;
SDL_Surface *load_image(std::string filename);
void apply_surface(int x, int y, SDL_Surface *source, SDL_Surface *destination, SDL_Rect *clip);
bool init();
bool load_files();
void set_clips();
void clean_up();
#endif
| [
"matt@cygwin.com"
] | matt@cygwin.com |
d91e8998dd8ecb77ed950fdde4a457c8767c5f3c | 9994b7c5f1028560868923a06da62a706b76b5d2 | /misc/marchingcubes.cpp | 2ee1a12e1792c026efa1975cfdbdc6f068056d7f | [] | no_license | leuat/GeometryLibrary | 1e7ad40928a27884e288e41cdc72a31ffd53a534 | f700619ae05742527be40064ad2eb5a247a8f9a6 | refs/heads/master | 2020-05-21T12:27:31.168249 | 2017-01-24T15:00:50 | 2017-01-24T15:00:50 | 49,636,306 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,095 | cpp | #include "marchingcubes.h"
MarchingCubes::MarchingCubes(QObject *parent) : QObject(parent)
{
}
float MarchingCubes::threshold() const
{
return m_threshold;
}
QVector3D MarchingCubes::minValues() const
{
return m_minValues;
}
QVector3D MarchingCubes::maxValues() const
{
return m_maxValues;
}
QVector3D MarchingCubes::resolution() const
{
return m_resolution;
}
void MarchingCubes::setThreshold(float threshold)
{
if (m_threshold == threshold)
return;
m_threshold = threshold;
emit thresholdChanged(threshold);
}
void MarchingCubes::setMinValues(QVector3D minValues)
{
if (m_minValues == minValues)
return;
m_minValues = minValues;
emit minValuesChanged(minValues);
}
void MarchingCubes::setMaxValues(QVector3D maxValues)
{
if (m_maxValues == maxValues)
return;
m_maxValues = maxValues;
emit maxValuesChanged(maxValues);
}
void MarchingCubes::setResolution(QVector3D resolution)
{
if (m_resolution == resolution)
return;
m_resolution = resolution;
emit resolutionChanged(resolution);
}
| [
"andershaf@gmail.com"
] | andershaf@gmail.com |
d1e7b6c97997ef8177dd28f62d98928855b8cfba | 3dab0b6228c7b273477b8da56904bab3c75b440f | /RockTest/Toy.h | d1e2117b82bdb21b6f1855e610e5958ce6ef1a60 | [] | no_license | rockpzj/RockTest | 0047de107541abbde834637421a15ed4ece2885e | b2e857eef2fae66a42c5ec5b20ae0d61ce2b9dba | refs/heads/master | 2020-05-16T23:05:08.064511 | 2020-03-28T11:20:08 | 2020-03-28T11:20:08 | 183,354,507 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 346 | h | #pragma once
#include <string>
using namespace std;
class Toy
{
public:
Toy();
Toy(string name, int price, string origin);
~Toy();
string getName() const;
int getPrice() const;
string getOrigin() const;
void setDiscount(float discount);
private:
string name;
int price;
string origin; //产地
float discount = 1.0; //则扣
};
| [
"noreply@github.com"
] | rockpzj.noreply@github.com |
8aec496a16b4ebce57cc910c807d2074404ac847 | 8e5c79cdfd13c6e1f251743c1f200ca9d733f459 | /NequeoSockets/NequeoSockets/AddressFamily.h | 5eb312c5ce8d5baa7cb607b2357d87e20c04d255 | [
"MIT"
] | permissive | nequeo/sockets | fd49e647e5f994c896bcd016ee7e6515a8ddf70a | 99fd20bd968066917c3297dec199c10c221f48d5 | refs/heads/master | 2021-01-09T20:16:57.043039 | 2016-10-18T22:43:11 | 2016-10-18T22:43:11 | 64,716,369 | 1 | 0 | null | null | null | null | WINDOWS-1252 | C++ | false | false | 1,931 | h | /* Company : Nequeo Pty Ltd, http://www.nequeo.com.au/
* Copyright : Copyright © Nequeo Pty Ltd 2014 http://www.nequeo.com.au/
*
* File : AddressFamily.h
* Purpose : AddressFamily enum.
*
*/
/*
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
#ifndef _ADDRESSFAMILY_H
#define _ADDRESSFAMILY_H
#include "GlobalSocket.h"
namespace Nequeo {
namespace Net {
namespace Sockets
{
// AddressFamily possible address families for IP addresses.
enum AddressFamily
{
IPv4 = 1,
IPv6 = 2
};
// The maximum address length.
enum AddressLength
{
IPv4Length = IPv4_Length,
IPv6Length = IPv6_Length
};
// The IP version.
enum IPVersion
{
IPv4_ONLY, /// Return interfaces with IPv4 address only
IPv6_ONLY, /// Return interfaces with IPv6 address only
IPv4_OR_IPv6 /// Return interfaces with IPv4 or IPv6 address
};
}
}
}
#endif | [
"drazenzadravec@live.com.au"
] | drazenzadravec@live.com.au |
496dbc463645ffcd36f384433fb06e3fdfc2dfbc | a45d8a5ea3fd351aff32ac5a56183bbbb1d51d23 | /Chat2/widget.cpp | 984f98f3c77c0803e9f570eb7d47d8effcae3e09 | [] | no_license | 11hengstenberg/Chat-Interface | 8983e0dc926746419156a2b8e36ad329e6cb2477 | 5b266a29a60c7c9686a9312bdabf646d2c163593 | refs/heads/master | 2022-04-18T04:25:07.724839 | 2020-04-19T02:43:02 | 2020-04-19T02:43:02 | 255,457,761 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 512 | cpp | #include "widget.h"
#include "ui_widget.h"
Widget::Widget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::Widget)
{
ui->setupUi(this);
}
Widget::~Widget()
{
delete ui;
}
void Widget::on_pushButton_clicked()
{
close();
}
void Widget::on_pushButton_2_clicked()
{
Ayuda *ventana1 = new Ayuda(this);
ventana1->setModal(true);
ventana1->show();
}
void Widget::on_pushButton_3_clicked()
{
Menu *menu = new Menu(this);
menu->setModal(true);
menu->show();
}
| [
"hen17699@uvg.edu.gt"
] | hen17699@uvg.edu.gt |
833e3f58665853a8b8cddf8e65dbb967ea68b627 | 35cbc0049d0c88cd9282a3c82980500bc2093cf2 | /2018-2-9/滑动窗口/线段树.cpp | 10c9cc1f247399d618f1b1a134fd69ac9b6012b4 | [] | no_license | ciwomuli/NOIP2017exercise | 9f96026a7c88548a0d2783374b0a9582012acf33 | e13a818f14da49b3ec94626e7f664301a9da985e | refs/heads/master | 2023-01-22T14:02:02.850686 | 2020-12-04T14:21:08 | 2020-12-04T14:21:08 | 108,097,370 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,159 | cpp | #include <iostream>
#include <climits>
#define int long long
using std::cin;
using std::cout;
using std::endl;
using namespace std;
inline long long max(long long a, long long b ){
return a > b ? a : b;
}
inline long long min(long long a, long long b ){
return a < b ? a : b;
}
struct Node
{
int lb = 0, rb = 0;
int max =0,min =0;
int lc = 0, rc = 0;
explicit Node(int l, int r)
: lb(l), rb(r) {}
Node() = default;
int size() const { return rb - lb + 1; }
bool unique() const { return lb == rb; }
bool out(int l, int r) const {
return l > rb || r < lb;
}
bool covered(int l, int r ) const {
return l <= lb && r >= rb;
}
};
Node segtree[200010];
Node &root = segtree[1];
int segend = 1;
int a[100010];
int n, m;
inline Node& left(const Node& curr) {
return segtree[curr.lc];
}
inline Node& right(const Node& curr) {
return segtree[curr.rc];
}
inline void getup(Node& curr) {
curr.min = min(left(curr).min , right(curr).min);
curr.max = max(left(curr).max , right(curr).max);
}
inline void build(Node& curr, int l, int r) {
curr = Node(l, r);
if (curr.unique()) {
curr.max =curr.min = a[l];
return;
}
curr.lc = ++segend;
curr.rc = ++segend;
int mid = (l + r) >> 1;
build(left(curr), l, mid);
build(right(curr), mid + 1, r);
getup(curr);
}
inline int querymin(Node& curr, int l, int r) {
if (curr.out(l, r))
return 0;
if (curr.covered(l, r))
return curr.min;
return min(querymin(left(curr), l, r) , querymin(right(curr), l, r));
}
inline int querymax(Node& curr, int l, int r) {
if (curr.out(l, r))
return 0;
if (curr.covered(l, r))
return curr.max;
return max(querymax(left(curr), l, r) , querymax(right(curr), l, r));
}
#undef int
int main() {
int k;
cin >> n >> k;
for (int i = 1; i <= n;i++){
scanf("%d", a[i]);
}
build(root, 1, n);
for (int i=0;i<=n-k;i++){
printf("%d ",querymin(root,i,i+k-1));
}
printf("\n");
for (int i = 0; i <= n - k; i++)
{
printf("%d ",querymax(root,i,i+k-1));
}
return 0;
} | [
"570727732@qq.com"
] | 570727732@qq.com |
01714da0b07e37541c53d750cd9f871bb0fc15f1 | 2672fb23cd50c4f025c48e39d9f55fd95016a5bc | /ActionScenarioAnnotator/pedestrian.cpp | b717e7d3ef01b8f1fb9531f5ece89bc41a29aeea | [] | no_license | mvpeterson/JTA-Mods | 11f2d9acc5a7dd66a7823f27d1bb2d1f0317b7bf | 0c40bf11ac78025d41b636b2b10ff2cb1a2ce43e | refs/heads/master | 2021-03-12T14:20:26.322356 | 2020-03-27T12:43:37 | 2020-03-27T12:43:37 | 246,628,665 | 0 | 0 | null | 2020-03-11T16:52:35 | 2020-03-11T16:52:35 | null | UTF-8 | C++ | false | false | 3,990 | cpp | #include "Pedestrian.h"
#include "dictionary.h"
Pedestrian::Pedestrian(Hash _modelHash)
{
setModelHash(_modelHash);
this->state_current = NOT_EXISTS;
}
Pedestrian::~Pedestrian() {}
void Pedestrian::setModelHash(Hash _modelHash)
{
this->modelHash = _modelHash;
}
void Pedestrian::assignJointCodes()
{
joint_int_codes[0] = m.find("SKEL_Head")->second;
joint_int_codes[1] = m.find("SKEL_Neck_1")->second;
joint_int_codes[2] = m.find("SKEL_R_Clavicle")->second;
joint_int_codes[3] = m.find("SKEL_R_UpperArm")->second;
joint_int_codes[4] = m.find("SKEL_R_Forearm")->second;
joint_int_codes[5] = m.find("SKEL_R_Hand")->second;
joint_int_codes[6] = m.find("SKEL_L_Clavicle")->second;
joint_int_codes[7] = m.find("SKEL_L_UpperArm")->second;
joint_int_codes[8] = m.find("SKEL_L_Forearm")->second;
joint_int_codes[9] = m.find("SKEL_L_Hand")->second;
joint_int_codes[10] = m.find("SKEL_Spine3")->second;
joint_int_codes[11] = m.find("SKEL_Spine2")->second;
joint_int_codes[12] = m.find("SKEL_Spine1")->second;
joint_int_codes[13] = m.find("SKEL_Spine0")->second;
joint_int_codes[14] = m.find("SKEL_Spine_Root")->second;
joint_int_codes[15] = m.find("SKEL_R_Thigh")->second;
joint_int_codes[16] = m.find("SKEL_R_Calf")->second;
joint_int_codes[17] = m.find("SKEL_R_Foot")->second;
joint_int_codes[18] = m.find("SKEL_L_Thigh")->second;
joint_int_codes[19] = m.find("SKEL_L_Calf")->second;
joint_int_codes[20] = m.find("SKEL_L_Foot")->second;
}
void Pedestrian::spawn(Vector3 pos)
{
if (this->state_current == NOT_EXISTS)
{
STREAMING::REQUEST_MODEL(modelHash);
while (!STREAMING::HAS_MODEL_LOADED(modelHash))
WAIT(0);
ped_id = PED::CREATE_PED(NULL, modelHash, pos.x, pos.y, pos.z, 0.0, false, false);
STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(modelHash);
WAIT(50);
PED::SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped_id, TRUE);
WAIT(100);
spawn_point = pos;
this->state_current = SPAWNED;
}
}
Vector3 Pedestrian::getCurrentCoord()
{
return ENTITY::GET_ENTITY_COORDS(ped_id, true);
}
void Pedestrian::taskWalkToTarget(Vector3 target_point, float speed)
{
Object seq;
AI::OPEN_SEQUENCE_TASK(&seq);
AI::TASK_GO_TO_COORD_ANY_MEANS(0, target_point.x, target_point.y, target_point.z, speed, 0, 0, 786603, 0xbf800000);
AI::CLOSE_SEQUENCE_TASK(seq);
AI::TASK_PERFORM_SEQUENCE(ped_id, seq);
AI::CLEAR_SEQUENCE_TASK(&seq);
this->state_current = TASK_WALK_TO_TARGET;
}
void Pedestrian::taskFollowToOffsetOfEntity(Ped ped_target, float offset, float speed)
{
AI::TASK_FOLLOW_TO_OFFSET_OF_ENTITY(this->ped_id, ped_target, offset, offset, offset, speed + 0.2, -1, 10, 1);
this->state_current = TASK_FOLLOW;
}
void Pedestrian::taskUseMobilPhoneTimed(int time_ms)
{
AI::TASK_USE_MOBILE_PHONE_TIMED(this->ped_id, time_ms);
task_start_time = std::clock() / CLOCKS_PER_SEC;
this->state_current = TASK_PHONE;
}
void Pedestrian::taskChatToPed(Ped target_ped)
{
AI::TASK_CHAT_TO_PED(this->ped_id, target_ped, 16, 0.0, 0.0, 0.0, 0.0, 0.0);
task_start_time = std::clock() / CLOCKS_PER_SEC;
this->state_current = TASK_CHAT;
}
void Pedestrian::taskWanderInArea(float x, float y, float z, float radius, float minimalLength, float timeBetweenWalks)
{
AI::TASK_WANDER_IN_AREA(this->ped_id, x, y, z, radius, minimalLength, timeBetweenWalks);
task_start_time = std::clock() / CLOCKS_PER_SEC;
this->state_current = TASK_WANDER_IN_AREA;
}
void Pedestrian::taskAimAtEntity(Entity entity, int duration, BOOL p3)
{
AI::TASK_AIM_GUN_AT_ENTITY(ped_id, entity, duration, p3);
task_start_time = std::clock() / CLOCKS_PER_SEC;
this->state_current = TASK_AIM_AT_ENTITY;
}
void Pedestrian::taskGoToCoordWhileAimingAtCoord(float x, float y, float z, float aimAtX, float aimAtY, float aimAtZ, float moveSpeed)
{
AI::TASK_GO_TO_COORD_WHILE_AIMING_AT_COORD(ped_id, x, y, z, aimAtX, aimAtY, aimAtZ, moveSpeed,
false, 2.0, 0.5, true, 0, 0, 0xC6EE6B4C);
task_start_time = std::clock() / CLOCKS_PER_SEC;
this->state_current = TASK_GO_TO_COORD_WHILE_AIMING_AT_COORD;
} | [
"maxim.peterson@gmail.com"
] | maxim.peterson@gmail.com |
31be9a3a42ce0ae9fc0c7f753c99480293bf38aa | ca3449d1291ae8e93f88a56c5c9032103f730106 | /LilEngie/Core/src/Entity/Scene.cpp | 30d1977fcf982e08a56b10e0eaffad901f6d16dd | [
"MIT"
] | permissive | Nordaj/LilEngie | f1d38304ffabb55f2d21272179db0d3b2697e6c4 | 453cee13c45ae33abe2665e1446fc90e67b1117a | refs/heads/master | 2020-03-18T17:28:15.097151 | 2018-09-02T04:10:48 | 2018-09-02T04:10:48 | 135,031,092 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,917 | cpp | #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <Entity/Components/Camera.h>
#include <Entity/Components/Mesh.h>
#include <Entity/GameObject.h>
#include <Graphics/LightHandler.h>
#include <Graphics/Renderer.h>
#include <Application/Debug.h>
#include "Scene.h"
Scene::Scene()
{ }
Scene::~Scene()
{
if (isLoaded)
Debug::Popup("Unload function not called for scene.", DebugType::Warning, false);
}
GameObject *Scene::AddObject(std::string name)
{
objects.insert(std::make_pair(name, new GameObject(this)));
return objects[name];
}
GameObject *Scene::GetObject(std::string name)
{
return objects[name];
}
void Scene::AddToQueue(Mesh *m)
{
renderQueue.push_back(m);
}
Camera* Scene::GetCam()
{
return currentCamera;
}
void Scene::SetCurrentCamera(Camera *cam)
{
currentCamera = cam;
}
std::vector<Mesh*> *Scene::GetQueue()
{
return &renderQueue;
}
void Scene::Start()
{
//Start all objects
std::map<std::string, GameObject*>::iterator it;
for (it = objects.begin(); it != objects.end(); it++)
{
it->second->Start();
}
//Set ambient and clear color
LightHandler::SetAmbient(ambient);
Renderer::SetClearColor(clearColor.r, clearColor.g, clearColor.b, 1);
}
void Scene::Update()
{
std::map<std::string, GameObject*>::iterator it;
for (it = objects.begin(); it != objects.end(); it++)
{
it->second->Update();
}
}
void Scene::Close()
{
LightHandler::Clean();
}
void Scene::Unload()
{
isLoaded = false;
Close();
//Delete all objects
std::map<std::string, GameObject*>::iterator it;
for (it = objects.begin(); it != objects.end(); it++)
delete it->second;
//Clear object map
objects.clear();
//Clear render queue
renderQueue.clear();
//Set current camera to nullptr
currentCamera = nullptr;
//Dump up all handlers
shaders.Clean();
models.Clean();
textures.Clean();
materials.Clean();
texts.Clean();
//Delete myself
delete this;
}
| [
"Nordajnapmach@gmail.com"
] | Nordajnapmach@gmail.com |
35006956324eded0febeb86cb1ebb84b00a881d1 | e5482932b92c9063298a46263588894f36643089 | /src/libs/grasp/grp_Cmds.hh | 65ecc6fdc3b038689dfcd4ab18a2ebbe358af318 | [] | no_license | satmuseum/grasp | 4ca06ffc19d7a57967569e2782e4b415573ff0f8 | c328783d0ae7a4028d31fa969cbce2bf8da1f713 | refs/heads/master | 2021-01-10T04:03:36.256733 | 2015-10-30T20:10:03 | 2015-10-30T20:10:03 | 45,273,920 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,271 | hh | //-----------------------------------------------------------------------------
// File: grp_Cmds.hh
//
// Purpose: Handles command line arguments for configuring the GRASP SAT
// algorithmci framework.
//
// Remarks: None.
//
// History: 6/21/95 - JPMS - created.
// 3/16/96 - JPMS - repackaged for new version.
//-----------------------------------------------------------------------------
#ifndef __GRP_CMDS
#define __GRP_CMDS
#include "cmdArg.hh"
#include "cmdLine.hh"
#include "grp_Mode.hh" // Only needs to be aware of the configuration modes
//-----------------------------------------------------------------------------
// Class: SAT_Cmds
//
// Purpose: Parser for command line options for batch execution.
//-----------------------------------------------------------------------------
class SAT_Cmds {
public:
//-------------------------------------------------------------------------
// Constructor/destructor.
//-------------------------------------------------------------------------
SAT_Cmds (SAT_Mode &nmode);
virtual ~SAT_Cmds();
//-------------------------------------------------------------------------
// Interface methods.
//-------------------------------------------------------------------------
virtual char *cmdLineParse (int argc, char *argv[]);
virtual char *cmdParse (char *str);
virtual int fileParse (char *name);
protected:
//-------------------------------------------------------------------------
// Protected methods for configuring some options of GRASP.
//-------------------------------------------------------------------------
virtual int handlePlusOption (CmdArg &cmd);
virtual int handleMinusOption (CmdArg &cmd);
void setBacktrackMode (CmdArg &arg);
void setDecideMode (CmdArg &arg);
void setMultConfs (CmdArg &arg);
void setPreprocessMode (CmdArg &arg);
private:
//-------------------------------------------------------------------------
// Data structures for configuring the search engine.
//-------------------------------------------------------------------------
SAT_Mode &_mode;
};
#endif
/*****************************************************************************/
| [
"daniel.leberre@univ-artois.fr"
] | daniel.leberre@univ-artois.fr |
da758bdb0d111f80056c269bc1c7e61c55ad8133 | d19d5f5f2f7e44884932aa087c63a549f53f0907 | /SwingEngine/SEGeometricTools/Intersection/SEIntrSegment3Box3.cpp | 71d654b523540418554260ee4398744bb88b705f | [] | no_license | jazzboysc/SwingEngine2 | d26c60f4cbf89f0d7207e5152cae69677a4d7b18 | d7dbd09a5e7748def0bd3fa6a547b1c734529f61 | refs/heads/master | 2021-03-27T11:05:20.543758 | 2018-07-13T09:42:22 | 2018-07-13T09:42:22 | 44,491,987 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,919 | cpp | // Swing Engine Version 2 Source Code
// Most of techniques in the engine are mainly based on David Eberly's
// Wild Magic 4 and 5 open-source game engine. The author of Swing Engine
// learned a lot from Eberly's experience of architecture and algorithm.
// Several subsystems are totally new, and others are reorganized or
// reimplimented based on Wild Magic's subsystems.
// Copyright (c) 2007-2011
//
// David Eberly's permission:
// Geometric Tools, LLC
// Copyright (c) 1998-2010
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
// http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
#include "SEGeometricToolsPCH.h"
#include "SEIntrSegment3Box3.h"
#include "SEIntrLine3Box3.h"
using namespace Swing;
//----------------------------------------------------------------------------
SEIntrSegment3Box3f::SEIntrSegment3Box3f(const SESegment3f& rSegment,
const SEBox3f& rBox, bool bSolid)
:
m_pSegment(&rSegment),
m_pBox(&rBox)
{
m_bSolid = bSolid;
}
//----------------------------------------------------------------------------
const SESegment3f& SEIntrSegment3Box3f::GetSegment() const
{
return *m_pSegment;
}
//----------------------------------------------------------------------------
const SEBox3f& SEIntrSegment3Box3f::GetBox() const
{
return *m_pBox;
}
//----------------------------------------------------------------------------
bool SEIntrSegment3Box3f::Test()
{
float afAWdU[3], afADdU[3], afAWxDdU[3], fRhs;
SEVector3f vec3fDiff = m_pSegment->Origin - m_pBox->Center;
afAWdU[0] = SEMath<float>::FAbs(m_pSegment->Direction.Dot(
m_pBox->Axis[0]));
afADdU[0] = SEMath<float>::FAbs(vec3fDiff.Dot(m_pBox->Axis[0]));
fRhs = m_pBox->Extent[0] + m_pSegment->Extent*afAWdU[0];
if( afADdU[0] > fRhs )
{
return false;
}
afAWdU[1] = SEMath<float>::FAbs(m_pSegment->Direction.Dot(
m_pBox->Axis[1]));
afADdU[1] = SEMath<float>::FAbs(vec3fDiff.Dot(m_pBox->Axis[1]));
fRhs = m_pBox->Extent[1] + m_pSegment->Extent*afAWdU[1];
if( afADdU[1] > fRhs )
{
return false;
}
afAWdU[2] = SEMath<float>::FAbs(m_pSegment->Direction.Dot(
m_pBox->Axis[2]));
afADdU[2] = SEMath<float>::FAbs(vec3fDiff.Dot(m_pBox->Axis[2]));
fRhs = m_pBox->Extent[2] + m_pSegment->Extent*afAWdU[2];
if( afADdU[2] > fRhs )
{
return false;
}
SEVector3f vec3fWxD = m_pSegment->Direction.Cross(vec3fDiff);
afAWxDdU[0] = SEMath<float>::FAbs(vec3fWxD.Dot(m_pBox->Axis[0]));
fRhs = m_pBox->Extent[1]*afAWdU[2] + m_pBox->Extent[2]*afAWdU[1];
if( afAWxDdU[0] > fRhs )
{
return false;
}
afAWxDdU[1] = SEMath<float>::FAbs(vec3fWxD.Dot(m_pBox->Axis[1]));
fRhs = m_pBox->Extent[0]*afAWdU[2] + m_pBox->Extent[2]*afAWdU[0];
if( afAWxDdU[1] > fRhs )
{
return false;
}
afAWxDdU[2] = SEMath<float>::FAbs(vec3fWxD.Dot(m_pBox->Axis[2]));
fRhs = m_pBox->Extent[0]*afAWdU[1] + m_pBox->Extent[1]*afAWdU[0];
if( afAWxDdU[2] > fRhs )
{
return false;
}
return true;
}
//----------------------------------------------------------------------------
bool SEIntrSegment3Box3f::Find()
{
float fT0 = -m_pSegment->Extent, fT1 = m_pSegment->Extent;
return SEIntrLine3Box3f::DoClipping(fT0, fT1, m_pSegment->Origin,
m_pSegment->Direction, *m_pBox, m_bSolid, m_iCount, m_aPoint,
m_iIntersectionType);
}
//----------------------------------------------------------------------------
int SEIntrSegment3Box3f::GetCount() const
{
return m_iCount;
}
//----------------------------------------------------------------------------
const SEVector3f& SEIntrSegment3Box3f::GetPoint(int i) const
{
SE_ASSERT( 0 <= i && i < m_iCount );
return m_aPoint[i];
}
//----------------------------------------------------------------------------
| [
"S515380c"
] | S515380c |
22cdf1c9e5ca5c55f6cf416ca0c54e7743776e7e | 000a7af455ed3f5f534b28b18be0b5997ddbdefa | /TClient/TWorldmapDlg.h | f524aaa7f1a1633805918bbfdcdf51dee0b0a522 | [] | no_license | boyfromhell/4Ever | 6f58182c07182f9569201dbc0f9116cc6644d296 | 8bd1d638f9ae23c3b97a56bd04f00061f39fbe61 | refs/heads/master | 2020-04-15T14:21:14.071423 | 2018-07-22T17:07:17 | 2018-07-22T17:07:17 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,971 | h | #pragma once
class CTWorldmapDlg : public CTClientUIBase
{
public:
TComponent *m_pTMYPOS;
TComponent *m_pTCURSORPOS;
TComponent *m_pTALLWORLDMAP;
TCOMP_ARRAY m_vTWORLDBUTTON;
VTFRAMEOFFSET m_vTWORLDBUTTON_OFFSET;
TImageList *m_pTWORLDMAP;
TImageList *m_pTITLE;
TImageList *m_pTCHAR;
TImageList *m_pTNPC;
TComponent *m_pTPURSUIT;
TComponent *m_pTDEAD;
TComponent *m_pTEXT;
TComponent *m_pNPCNAME;
public:
BOOL m_bTALLWORLDMODE;
TComponent *m_pTLASTWBTN;
D3DXVECTOR2 m_vTCENTER;
FLOAT m_fTSCALE;
BYTE m_bMOVE;
CTClientChar *m_pHost;
CTClientChar *m_pDead;
LPMAPMONSTER m_pTMON;
CTClientMAP *m_pTMAP;
CTRSCSDlg *m_pTRSCS;
CD3DDevice *m_pDevice;
CTClientCAM *m_pCAM;
BOOL m_bDrawNPC;
INT m_nMainUnitX;
INT m_nMainUnitZ;
public:
void RenderALLWORLDMAP( DWORD dwTickCount);
void RenderWORLDMAP( DWORD dwTickCount);
void RenderOBJ( DWORD dwTickCount);
CPoint GetPosition(
FLOAT fPosX,
FLOAT fPosZ,
int nWidth,
int nHeight);
D3DXVECTOR2 GetPositionInverse(
CPoint vRESULT,
int nWidth,
int nHeight);
TComponent* GetHitWorldButton( const CPoint& pt);
BYTE CheckRequireItem( LPTNPC pTNPC);
DWORD MakeUnitID(
WORD wMapID,
BYTE nUnitX,
BYTE nUnitY);
BYTE GetWorldmapLevel(
FLOAT fPosX,
FLOAT fPosY);
void GetUnitPosition(
FLOAT fPosX,
FLOAT fPosY,
INT& outUnitX,
INT& outUnitY);
void DrawBack();
public:
virtual void ShowComponent( BOOL bVisible = TRUE);
virtual void OnRButtonDown( UINT nFlags, CPoint pt);
virtual void OnLButtonDown( UINT nFlags, CPoint pt);
virtual void OnRButtonUp( UINT nFlags, CPoint pt);
virtual void OnLButtonUp( UINT nFlags, CPoint pt);
virtual void OnMouseMove( UINT nFlags, CPoint pt);
virtual HRESULT Render( DWORD dwTickCount);
virtual BOOL HitTest( CPoint pt);
virtual void DefaultPosition( CPoint* vBASIS, BOOL bRestore );
virtual void ResetPosition();
public:
CTWorldmapDlg( TComponent *pParent, LP_FRAMEDESC pDesc);
virtual ~CTWorldmapDlg();
};
| [
"pierre.bouffier05@gmail.com"
] | pierre.bouffier05@gmail.com |
6375da454a230c28f3475656b629ebbdb9a9ee0e | 03b830414faedabf35eac66e0d7baf477133300b | /src/20200604/80paly.cpp | 07fc9e9ea8daea98ddf44f746670b6dae47957ab | [] | no_license | liupengzhouyi/nowCoder | 12abb70c30b6872a73c993365575d4d888795c7e | 14fa3aa5a54def9f34f4552f01088a6c4dd5f96d | refs/heads/master | 2022-10-04T21:14:02.085585 | 2020-06-05T10:11:43 | 2020-06-05T10:11:43 | 267,886,016 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,072 | cpp | //
// Created by 刘鹏 on 2020/6/4.
//
/*
#include <iostream>
#include <algorithm>
using namespace std;
int asd(int numberI, int numberII) {
std::string strNumber = std::to_string(numberI);
int number = 1;
for (int i = 0; i < strNumber.length(); i++) {
number = number * 10;
}
// std::cout << number << std::endl;
if (numberII % number == numberI) {
return 1;
} else {
return 0;
}
}
int paly80(void)
{
int n;
std::cin >> n;
int count = 0;
for (int i = 0; i < n; i++) {
int ii = i * i;
count = count + asd(i, ii);
}
std::cout << count << std::endl;
return 0;
}
*/
#include <iostream>
#include <string>
using namespace std;
int paly80(){
int n;
while(cin>>n){
int cnt=0;
string pow;
string str;
for(int val=0;val<=n;++val){
pow=to_string(val*val);
str=to_string(val);
if(pow.substr(pow.size()-str.size())==str)
++cnt;
}
cout<<cnt<<endl;
}
return 0;
}
| [
"liupeng.0@outlook.com"
] | liupeng.0@outlook.com |
41de0e21b88e922d1ee7751bf745c1a0adab9c8d | 458eecef336ac5a5f1cbeec706d81b1b82101cdb | /BuildingEscape/Source/BuildingEscape/OpenDoor.cpp | 73498c5bfc005ada4611fdcac64fc9ee05d4f5f6 | [] | no_license | Schoelsy/EscapeRoom | c42aad97ecfb2adff3eaa93b0a62c663014f75dc | 8775a09fc14573f56fe7d8e28b7a8b744a73c7dd | refs/heads/master | 2021-01-20T14:40:27.567805 | 2017-05-08T12:52:12 | 2017-05-08T12:52:12 | 90,644,322 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,429 | cpp | // Fill out your copyright notice in the Description page of Project Settings.
#include "BuildingEscape.h"
#include "OpenDoor.h"
// Sets default values for this component's properties
UOpenDoor::UOpenDoor()
{
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
// off to improve performance if you don't need them.
PrimaryComponentTick.bCanEverTick = true;
// ...
}
// Called when the game starts
void UOpenDoor::BeginPlay()
{
Super::BeginPlay();
// Find the owning Actor
Owner = GetOwner();
ActorThatOpens = GetWorld()->GetFirstPlayerController()->GetPawn();
}
void UOpenDoor::OpenDoor()
{
// Set the door rotation
Owner->SetActorRotation(FRotator(0.0f, OpenAngle, 0.0f));
}
// Called every frame
void UOpenDoor::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
// Poll the Trigger Volume
// If the actor that opens is in the volume
if (PressurePlate->IsOverlappingActor(ActorThatOpens))
{
OpenDoor();
LastDoorOpenTime = GetWorld()->GetRealTimeSeconds();
}
// check if it's a time to close the door
if (GetWorld()->GetRealTimeSeconds() - LastDoorOpenTime > DoorCloseDelay)
{
CloseDoor();
}
}
void UOpenDoor::CloseDoor()
{
// Set the door rotation
Owner->SetActorRotation(FRotator(0.0f, 0.0f, 0.0f));
}
| [
"Schoelsy@wp.pl"
] | Schoelsy@wp.pl |
2e2ddddaeea260f14bd542e0bd2b1c644e22759c | 711e5c8b643dd2a93fbcbada982d7ad489fb0169 | /XPSP1/NT/inetsrv/msmq/src/replserv/mq1repl/rpseqnum.cpp | 22e252955acbfea8dc0a1a85acfc79e61796a5c5 | [] | no_license | aurantst/windows-XP-SP1 | 629a7763c082fd04d3b881e0d32a1cfbd523b5ce | d521b6360fcff4294ae6c5651c539f1b9a6cbb49 | refs/heads/master | 2023-03-21T01:08:39.870106 | 2020-09-28T08:10:11 | 2020-09-28T08:10:11 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,446 | cpp | /*++
Copyright (c) 1998 Microsoft Corporation
Module Name: rpseqnum.cpp
Abstract: Code to handle seq numbers.
Author:
Doron Juster (DoronJ) 23-Mar-98
--*/
#include "mq1repl.h"
#include "rpseqnum.tmh"
//+-------------------------
//
// void StringToSeqNum()
//
//+-------------------------
void StringToSeqNum( IN TCHAR pszSeqNum[],
OUT CSeqNum *psn )
{
BYTE *pSN = const_cast<BYTE*> (psn->GetPtr()) ;
DWORD dwSize = psn->GetSerializeSize() ;
ASSERT(dwSize == 8) ;
WCHAR wszTmp[3] ;
for ( DWORD j = 0 ; j < dwSize ; j++ )
{
memcpy(wszTmp, &pszSeqNum[ j * 2 ], (2 * sizeof(TCHAR))) ;
wszTmp[2] = 0 ;
DWORD dwTmp ;
_stscanf(wszTmp, TEXT("%2x"), &dwTmp) ;
*pSN = (BYTE) dwTmp ;
pSN++ ;
}
}
//+-------------------------
//
// void i64ToSeqNum()
//
//+-------------------------
void i64ToSeqNum( IN __int64 i64SeqNum,
OUT CSeqNum *psn )
{
TCHAR wszSeq[ SEQ_NUM_BUF_LEN ] ;
_stprintf(wszSeq, TEXT("%016I64x"), i64SeqNum) ;
StringToSeqNum( wszSeq,
psn ) ;
}
//+-------------------------
//
// void GetSNForReplication
//
//+-------------------------
void GetSNForReplication (IN __int64 i64SeqNum,
IN CDSMaster *pMaster,
IN GUID *pNeighborId,
OUT CSeqNum *psn )
{
CSeqNum sn;
if ( i64SeqNum )
{
i64ToSeqNum(i64SeqNum, &sn) ;
}
else
{
//
// it is sync request about pre-migration object
//
ASSERT(i64SeqNum == 0) ;
ASSERT(pNeighborId);
SYNC_REQUEST_SNS *pSyncReqSNs;
pSyncReqSNs = pMaster->GetSyncRequestSNs(pNeighborId);
ASSERT (pSyncReqSNs);
sn = pSyncReqSNs->snFrom;
ASSERT( sn < pSyncReqSNs->snTo );
ASSERT(!sn.IsInfiniteLsn()); //if we are here sn must be finite number!
sn.Increment();
pSyncReqSNs->snFrom = sn;
pMaster->SetSyncRequestSNs (pNeighborId, pSyncReqSNs);
}
*psn = sn;
}
//+-------------------------
//
// void SeqNumToUsn()
//
// Convert a MQIS seqnum to a DS usn, after subtracting the delta.
// Return as string, decimal.
//
//+-------------------------
void SeqNumToUsn( IN CSeqNum *psn,
IN __int64 i64Delta,
IN BOOL fIsFromUsn,
OUT BOOL *pfIsPreMig,
OUT TCHAR *ptszUsn )
{
TCHAR wszSeq[ SEQ_NUM_BUF_LEN ] ;
psn->GetValueForPrint(wszSeq) ;
__int64 i64Seq = 0 ;
_stscanf(wszSeq, TEXT("%I64x"), &i64Seq) ;
//
// in case of sync0 request *psn can be equal to 0 => i64Seq will be 0
//
if (!psn->IsSmallestValue())
{
ASSERT(i64Seq > 0) ;
}
i64Seq -= i64Delta ;
ASSERT(i64Seq > 0) ;
_stprintf(ptszUsn, TEXT("%I64d"), i64Seq) ;
if (i64Seq < g_i64LastMigHighestUsn)
{
//
// we got SN smaller than last highest migration USN
// It means that it is sync of pre-migration objects or sync0 request
// but we know to answer only about SN greater than s_wszFirstHighestUsn
//
*pfIsPreMig = TRUE;
if (fIsFromUsn)
{
_stprintf(ptszUsn, TEXT("%I64d"), g_i64FirstMigHighestUsn) ;
}
else
{
_stprintf(ptszUsn, TEXT("%I64d"), g_i64LastMigHighestUsn) ;
//
// we have to redefine upper limit of SN.
// Upper limit is the first USN suitable for replication
// of objects are changed after migration.
// ToSN = LastHighestUsn + Delta
//
__int64 i64ToSN = g_i64LastMigHighestUsn ;
ASSERT(i64ToSN > 0) ;
i64ToSN += i64Delta ;
i64ToSeqNum( i64ToSN, psn );
}
}
}
//+-------------------------
//
// HRESULT SaveSeqNum()
//
//+-------------------------
HRESULT SaveSeqNum( IN CSeqNum *psn,
IN CDSMaster *pMaster,
IN BOOL fInSN)
{
try
{
GUID *pSiteGuid = const_cast<GUID *> ( pMaster->GetMasterId() ) ;
unsigned short *lpszGuid ;
UuidToString( pSiteGuid,
&lpszGuid ) ;
TCHAR tszSn[ SEQ_NUM_BUF_LEN ] ;
psn->GetValueForPrint(tszSn) ;
BOOL f;
if (fInSN)
{
f = WritePrivateProfileString( RECENT_SEQ_NUM_SECTION_IN,
lpszGuid,
tszSn,
g_wszIniName ) ;
ASSERT(f) ;
}
else
{
f = WritePrivateProfileString( RECENT_SEQ_NUM_SECTION_OUT,
lpszGuid,
tszSn,
g_wszIniName ) ;
ASSERT(f) ;
}
RpcStringFree( &lpszGuid ) ;
HRESULT hr = MQSync_OK;
BOOL fNt4 = pMaster->GetNT4SiteFlag() ;
if (!fNt4)
{
//
// It's a NT5 master. Update the "purge" sn in the master object.
// We need this for the proper operation of the "PrepareHello"
// method. For NT5 servers, the NT5 DS handle purging of deleted
// objects. We can't control it's purge algorithm. So we'll
// arbitrarily set the "purge" number to equal (sn - PurgeBuffer).
//
pMaster->SetNt5PurgeSn() ;
}
else
{
//
// change performance counter for NT4 master
//
LPTSTR pszName = pMaster->GetPathName();
__int64 i64Seq = 0 ;
_stscanf(tszSn, TEXT("%I64x"), &i64Seq) ;
BOOL f;
if (fInSN)
{
f = g_Counters.SetInstanceCounter(pszName, eLastSNIn, (DWORD) i64Seq);
}
else
{
f = g_Counters.SetInstanceCounter(pszName, eLastSNOut, (DWORD) i64Seq);
}
}
return hr ;
}
catch(...)
{
//
// Not enough resources; try later
//
return(MQ_ERROR_INSUFFICIENT_RESOURCES);
}
}
//+-------------------------
//
// void IncrementUsn()
//
// Increment inplace.
//
//+-------------------------
void IncrementUsn(TCHAR tszUsn[])
{
__int64 i64Usn = 0 ;
_stscanf(tszUsn, TEXT("%I64d"), &i64Usn) ;
ASSERT(i64Usn != 0) ;
i64Usn++ ;
_stprintf(tszUsn, TEXT("%I64d"), i64Usn) ;
}
| [
"112426112@qq.com"
] | 112426112@qq.com |
6b54c4a186e79eabaf7c84d61fca6fe4f54fc7c5 | 7f75ebad3a0031b9868fb75dd5479be4f123b768 | /src/include/cleantype/details/cleantype_fp/fp_tree.hpp | 497255b3cc926a70e8888cc49f85e727d7cf1ee5 | [
"BSL-1.0"
] | permissive | ExternalRepositories/cleantype | 9a137618f8fef821e933bb6acd8ef7a2a7f0c224 | d95221b1bc8e2df7af77b54b833025fde64de049 | refs/heads/master | 2022-01-28T21:30:50.174872 | 2019-03-21T12:05:06 | 2019-03-21T12:05:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,651 | hpp | // This file is part of cleantype: Clean Types for C++
// Copyright Pascal Thomet - 2018
// Distributed under the Boost Software License, Version 1.0. (see LICENSE.md)
#pragma once
// These functions parse and manipulate trees in a functional way (this is the basis
// of the type parsing in this project)
#include <algorithm>
#include <deque>
#include <functional>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <cleantype/details/cleantype_fp/fp_base.hpp>
#include <cleantype/details/cleantype_fp/fp_show.hpp>
namespace cleantype_fp_tree
{
template <typename T>
struct tree
{
tree(const T & value, const std::vector<tree<T>> & children)
: value_(value), children_(children)
{
}
T value_;
std::vector<tree<T>> children_;
};
struct lhs_rhs
{
std::string lhs;
std::string rhs;
};
using lhs_rhs_tree = tree<lhs_rhs>;
struct tree_separators
{
char open_child = '<';
char close_child = '>';
char siblings_separator = ',';
};
enum class siblings_spacing_t
{
no_spacing,
space,
new_line
};
enum class children_indent_t
{
no_indent,
newline_before_open_child,
newline_before_child
};
struct show_tree_lhs_rhs_options
{
children_indent_t children_indent;
bool add_space_after_lhs = false;
bool add_space_before_rhs = false;
siblings_spacing_t siblings_spacing = siblings_spacing_t::no_spacing;
std::string indent = " ";
};
inline lhs_rhs_tree parse_lhs_rhs_tree(std::string const & s,
const tree_separators & separators,
bool remove_space_after_separator)
{
bool is_filling_rhs = false;
std::deque<char> fifo_letters;
{
for (const auto & letter : s)
fifo_letters.push_back(letter);
}
lhs_rhs_tree result{{}, {}};
lhs_rhs_tree * current = &result;
std::vector<lhs_rhs_tree *> parents;
bool is_first_after_separator = false;
while (!fifo_letters.empty())
{
char c = fifo_letters.front();
fifo_letters.pop_front();
if (isspace(c))
{
if (remove_space_after_separator && is_first_after_separator)
continue;
}
if (c == separators.open_child)
{
lhs_rhs_tree child{{}, {}};
current->children_.push_back(child);
parents.push_back(current);
current = &(parents.back()->children_.back());
is_first_after_separator = true;
is_filling_rhs = false;
}
else if (c == separators.siblings_separator)
{
lhs_rhs_tree brother{{}, {}};
parents.back()->children_.push_back(brother);
current = &(parents.back()->children_.back());
is_first_after_separator = true;
is_filling_rhs = false;
}
else if (c == separators.close_child)
{
current = parents.back();
parents.pop_back();
is_first_after_separator = true;
is_filling_rhs = true;
}
else
{
if (is_filling_rhs)
current->value_.rhs += c;
else
current->value_.lhs += c;
is_first_after_separator = false;
}
}
return result;
}
template <typename T>
tree<T> tree_keep_if(std::function<bool(const T &)> f, const tree<T> & xs)
{
tree<T> result = xs;
result.children_ = cleantype_fp::keep_if([f](const tree<T> & xxs) { return f(xxs.value_); },
result.children_);
std::vector<tree<T>> children_filtered_grandchhildren;
for (auto & child : result.children_)
{
auto child_filtered = tree_keep_if(f, child);
children_filtered_grandchhildren.push_back(child_filtered);
}
result.children_ = children_filtered_grandchhildren;
return result;
}
template <typename T, typename Transformer_T>
void tree_transform_leafs_depth_first_inplace(Transformer_T transformer, tree<T> & xs_io)
{
for (auto & child : xs_io.children_)
tree_transform_leafs_depth_first_inplace(transformer, child);
transformer(xs_io.value_);
}
template <typename T, typename Transformer_T>
void tree_transform_leafs_breadth_first_inplace(Transformer_T transformer, tree<T> & xs_io)
{
transformer(xs_io.value_);
for (auto & child : xs_io.children_)
tree_transform_leafs_breadth_first_inplace(transformer, child);
}
namespace detail
{
template <typename T>
std::size_t tree_depth_impl(const tree<T> & xs, int current_depth)
{
std::vector<std::size_t> sizes;
sizes.push_back(current_depth);
for (auto & child : xs.children_)
sizes.push_back(tree_depth_impl(child, current_depth + 1));
return cleantype_fp::maximum(sizes);
}
} // namespace detail
template <typename T>
std::size_t tree_depth(const tree<T> & xs)
{
return detail::tree_depth_impl(xs, 0);
}
template <typename OutputType, typename InputType, typename F>
std::vector<OutputType> transform_vector(F f, const std::vector<InputType> & xs)
{
std::vector<OutputType> out;
for (const auto & v : xs)
{
out.push_back(f(v));
}
return out;
}
template <typename T>
std::string show_tree_children(const std::vector<tree<T>> & children,
const tree_separators & separators,
const show_tree_lhs_rhs_options & options,
int level = 0)
{
std::vector<std::string> children_strs = transform_vector<std::string>(
[=](const tree<T> & vv) -> std::string {
return show_tree_lhs_rhs(vv, separators, options, level + 1);
},
children);
const std::string siblings_separator = [&] {
std::string separator_string(1, separators.siblings_separator);
if (options.siblings_spacing == siblings_spacing_t::no_spacing)
return separator_string;
else if (options.siblings_spacing == siblings_spacing_t::space)
return separator_string + " ";
else
{ // if (options.siblings_spacing == siblings_spacing_t::new_line)
return separator_string + std::string("\n");
}
}();
std::string children_str = cleantype_fp::join(siblings_separator, children_strs);
return children_str;
}
template <typename T>
std::string show_tree_lhs_rhs(const tree<T> & v,
const tree_separators & separators,
const show_tree_lhs_rhs_options & options,
int level = 0)
{
auto line_start = cleantype_fp::repeat(level, options.indent);
std::string result;
if (options.children_indent != cleantype_fp_tree::children_indent_t::no_indent)
result = line_start;
result += cleantype_fp::show(v.value_.lhs);
if (!v.value_.lhs.empty() && options.add_space_after_lhs)
result += " ";
if (!v.children_.empty())
{
if (options.children_indent == children_indent_t::newline_before_open_child)
result += "\n" + line_start;
result += separators.open_child;
if (options.children_indent != children_indent_t::no_indent)
result += "\n";
std::string children_str = show_tree_children(v.children_, separators, options, level);
result += children_str;
if (options.children_indent != children_indent_t::no_indent)
result += "\n" + line_start;
result += separators.close_child;
}
if (!v.value_.rhs.empty() && options.add_space_before_rhs)
result += " ";
result += cleantype_fp::show(v.value_.rhs);
return result;
}
} // namespace cleantype_fp_tree
| [
"pthomet@gmail.com"
] | pthomet@gmail.com |
fbca758b14c6dd02af65f2f9e00f1cf434b8f2dd | c78d01c917aed3b1428e560190527cc242e6f751 | /natural.cpp | 9619017c0149c6fc19a09e4315b4dd31db795762 | [] | no_license | viniferraria/Tad-Natural-Inteiro | ca04f43721b046590c4147e0ebaf915c393523b5 | d013073bdd1fe551bc5944b3700897c00905a120 | refs/heads/master | 2020-09-05T22:29:15.638913 | 2019-11-07T12:27:55 | 2019-11-07T12:27:55 | 220,232,010 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 87 | cpp | #include "natural.h"
Natural::Natural(int v):Inteiro(v,'+'){};
Natural::~Natural(){};
| [
"vferraria10@gmail.com"
] | vferraria10@gmail.com |
d68682e90e5c0775482b5f450cd98fa381fb7605 | bbdd63f4403ad2e15dce8dfd5ef35263d2f2bd86 | /common/x64/dependency/include/DBCommon/TableCommon.h | 57ec920f9873dc8c244752f65c85b06b6ffe2e26 | [] | no_license | MelodyD/pytest_API | a7d4dcb1bd8ba9b1981ca640080c27e2b5aaa0b7 | 77e11924e3fec6e3ddbf65f07d05cf77a4fe94ea | refs/heads/main | 2023-07-18T10:02:15.382032 | 2021-09-11T12:57:08 | 2021-09-11T12:57:08 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,557 | h | /**
*******************************************************************************
* Continental Confidential
* Copyright (c) Continental AG. 2016-2018
*
* This software is furnished under license and may be used or
* copied only in accordance with the terms of such license.
*******************************************************************************
* @file TableCommon.h
* @brief Header file of class TableCommon.
*******************************************************************************
*/
#ifndef DB_OPERATION_H_
#define DB_OPERATION_H_
#include "DBCommon/DBLayerManager.h"
#include "DBCommon/SQLGenerator.h"
#include "typeDef.h"
#include <vector>
namespace roadDBCore
{
/**
*******************************************************************************
* @class TableCommon "DBCommon/TableCommon.h"
* @brief This is a table operation interface class.
*
* This class provide the basic operations of one table in database.
*******************************************************************************
*/
class TableCommon
{
public:
TableCommon(const std::string &dbFileName,
const std::string &tableName,
const std::string &createTable = "");
/**
****************************************************************************
* @brief insertRecord - This function is used to insert one record
*
* <1> Parameter Description:
*
* @param [In] - record
*
* @return success return 0, or return error code
*
* <2> Detailed Description:
*
*
* \ingroup MasterDB
****************************************************************************
*/
uint32_t insertRecord(const std::vector<std::string>& record);
/**
****************************************************************************
* @brief insertRecord - This function is used to insert multi records
*
* <1> Parameter Description:
*
* @param [In] - records the record set of to be inserted
*
* @return success return 0, or return error code
*
* <2> Detailed Description:
*
*
* \ingroup MasterDB
****************************************************************************
*/
uint32_t insertRecord(const std::vector<std::vector<std::string>>& records);
/**
****************************************************************************
* @brief getRecord - This function is used to get record by condition;
*
* <1> Parameter Description:
*
* @param [In] whereCondition SQL where statement used by SQLGenerator
*
* @param [In] - dbResult data of record
*
* @param [Out] - row row of record
*
*
* @return success return 0, or return error code
*
* <2> Detailed Description:
*
*
* \ingroup MasterDB
****************************************************************************
*/
//*** USE THE BELOW TWO INTERFACES
uint32_t getRecord(const std::vector<std::string> &whereCondtion,
std::vector<std::vector<std::string>>& records);
uint32_t getRecord(const std::vector<std::string>& selectValue,
const std::vector<std::string> &whereCondtion,
std::vector<std::vector<std::string>>& records);
/**
****************************************************************************
* @brief deleteRecord - This function is used to delete multi records
*
* <1> Parameter Description:
*
* @param [In] - records the record set of to be deleted
*
* @return success return 0, or return error code
*
* <2> Detailed Description:
*
*
* \ingroup MasterDB
****************************************************************************
*/
uint32_t deleteRecord(std::vector<std::string>& where);
uint32_t deleteRecord(const std::string& where);
SegmentID_t getSegmentID();
virtual ~TableCommon(){};
protected:
SQLGenerator generator_;
std::shared_ptr<DBAbstractLayer> dbLayer_;
std::string tableName_;
};
struct TableBuffer
{
public:
TableBuffer(DBAbstractLayer &layer):
buf(NULL),
dbLayer(layer)
{
}
~TableBuffer()
{
if (NULL != buf)
{
dbLayer.freeTable();
}
}
char ** buf; //store table record pointer;
DBAbstractLayer &dbLayer;
};
}
#endif
| [
"guangli.bao@roaddb.com"
] | guangli.bao@roaddb.com |
09eb23c4c9c4eeca9641032ed4c10cf2719455f5 | 21262e403efd2b8eef212894bbc6b3794ceeaea5 | /joy_control/src/main.cpp | b6dd71fbe7f12408bfbf5974bd863db061fb843f | [] | no_license | ChenBao294/tas | 7cc4358bb8aea90823f7ae87f4c855e4b349069e | c7fde936847bb08c90b6bfa43f2e2eb034fea2cb | refs/heads/master | 2021-01-20T11:10:53.442205 | 2016-01-28T09:48:12 | 2016-01-28T09:48:12 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 402 | cpp | #include "joy_lib/joy_lib.h"
int main(int argc, char **argv)
{
ros::init(argc, argv, "teleop_joy");
joy_lib teleop_joy;
ros::Rate loop_rate(50);
static int count = 0;
ROS_INFO("Started Joy Node");
while(ros::ok())
{
teleop_joy.joy_communication_publisher.publish(teleop_joy.joy_state);
ros::spinOnce();
loop_rate.sleep();
}
return 0;
}
| [
"kvowinckel@yahoo.de"
] | kvowinckel@yahoo.de |
23e835b546660031e439e0d80c7383c0eb6daa09 | 797d1837b407ebc3e5bbd19a92538910dad8b3a5 | /Source/ToonTanks/Components/HealthComponent.cpp | 85a6996373c504bbe1cee2876cc0d8f25024e1cd | [] | no_license | LShearan/ToonTanks | ea69ed535e69e7949a5cd2017d28a17b268c5554 | a65cf77debfe4daff0b993821ae3c76227d6900f | refs/heads/main | 2023-03-24T00:37:22.914781 | 2021-03-22T13:50:26 | 2021-03-22T13:50:26 | 350,360,121 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,254 | cpp | // Fill out your copyright notice in the Description page of Project Settings.
#include "HealthComponent.h"
#include "ToonTanks/GameModes/TankGameModeBase.h"
#include "Kismet/GameplayStatics.h"
// Sets default values for this component's properties
UHealthComponent::UHealthComponent()
{
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
// off to improve performance if you don't need them.
PrimaryComponentTick.bCanEverTick = false;
// ...
}
// Called when the game starts
void UHealthComponent::BeginPlay()
{
Super::BeginPlay();
Health = DefaultHealth;
GameModeRef = Cast<ATankGameModeBase>(UGameplayStatics::GetGameMode(GetWorld()));
GetOwner()->OnTakeAnyDamage.AddDynamic(this,&UHealthComponent::TakeDamage);
}
void UHealthComponent::TakeDamage(AActor* DamageActor, float Damage, const UDamageType* DamageType, AController* InsigatedBy, AActor* DamageCauser)
{
if(Damage == 0 || Health <= 0)
{
return;
}
Health = FMath::Clamp(Health - Damage,0.f,DefaultHealth);
if(Health <= 0)
{
if(GameModeRef)
{
GameModeRef->ActorDied(GetOwner());
}
else
{
UE_LOG(LogTemp,Warning,TEXT("Health Component has no refrence to the GameMode"));
}
}
}
| [
"liamshearan@gmail.com"
] | liamshearan@gmail.com |
3bd2d81782efc35f87db2b2bc1b19eeca094c60a | 330d9ea4d7a786f9ae12fb7003da6548e0670434 | /src/smessage.cpp | 9da9bba68e3578e40b7eeb0c2d8c83864bd4faaa | [
"MIT"
] | permissive | JBchain/JBChain | 98d4272764b8dcc558bdcb41834617bf44837cf9 | 67048ede088bc9375e59d4b9358a71d79fb6f36b | refs/heads/master | 2020-03-27T08:42:04.944560 | 2018-08-27T09:59:15 | 2018-08-27T09:59:15 | 145,394,451 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 119,352 | cpp | // Copyright (c) 2014 The JBChain developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
/*
Notes:
Running with -debug could leave to and from address hashes and public keys in the log.
parameters:
-nosmsg Disable secure messaging (fNoSmsg)
-debugsmsg Show extra debug messages (fDebugSmsg)
-smsgscanchain Scan the block chain for public key addresses on startup
Wallet Locked
A copy of each incoming message is stored in bucket files ending in _wl.dat
wl (wallet locked) bucket files are deleted if they expire, like normal buckets
When the wallet is unlocked all the messages in wl files are scanned.
Address Whitelist
Owned Addresses are stored in smsgAddresses vector
Saved to smsg.ini
Modify options using the smsglocalkeys rpc command or edit the smsg.ini file (with client closed)
*/
#include "smessage.h"
#include <stdint.h>
#include <time.h>
#include <map>
#include <stdexcept>
#include <sstream>
#include <errno.h>
#include <openssl/crypto.h>
#include <openssl/ec.h>
#include <openssl/ecdh.h>
#include <openssl/sha.h>
#include <openssl/aes.h>
#include <openssl/evp.h>
#include <openssl/hmac.h>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include "base58.h"
#include "db.h"
#include "init.h" // pwalletMain
#include "txdb.h"
#include "lz4/lz4.c"
#include "xxhash/xxhash.h"
#include "xxhash/xxhash.c"
// On 64 bit system ld is 64bits
#ifdef IS_ARCH_64
#undef PRId64
#undef PRIu64
#undef PRIx64
#define PRId64 "ld"
#define PRIu64 "lu"
#define PRIx64 "lx"
#endif // IS_ARCH_64
// TODO: For buckets older than current, only need to store no. messages and hash in memory
boost::signals2::signal<void (SecMsgStored& inboxHdr)> NotifySecMsgInboxChanged;
boost::signals2::signal<void (SecMsgStored& outboxHdr)> NotifySecMsgOutboxChanged;
boost::signals2::signal<void ()> NotifySecMsgWalletUnlocked;
bool fSecMsgEnabled = false;
std::map<int64_t, SecMsgBucket> smsgBuckets;
std::vector<SecMsgAddress> smsgAddresses;
SecMsgOptions smsgOptions;
uint32_t nPeerIdCounter = 1;
CCriticalSection cs_smsg;
CCriticalSection cs_smsgDB;
leveldb::DB *smsgDB = NULL;
namespace fs = boost::filesystem;
bool SecMsgCrypter::SetKey(const std::vector<unsigned char>& vchNewKey, unsigned char* chNewIV)
{
if (vchNewKey.size() < sizeof(chKey))
return false;
return SetKey(&vchNewKey[0], chNewIV);
};
bool SecMsgCrypter::SetKey(const unsigned char* chNewKey, unsigned char* chNewIV)
{
// -- for EVP_aes_256_cbc() key must be 256 bit, iv must be 128 bit.
memcpy(&chKey[0], chNewKey, sizeof(chKey));
memcpy(chIV, chNewIV, sizeof(chIV));
fKeySet = true;
return true;
};
bool SecMsgCrypter::Encrypt(unsigned char* chPlaintext, uint32_t nPlain, std::vector<unsigned char> &vchCiphertext)
{
if (!fKeySet)
return false;
// -- max ciphertext len for a n bytes of plaintext is n + AES_BLOCK_SIZE - 1 bytes
int nLen = nPlain;
int nCLen = nLen + AES_BLOCK_SIZE, nFLen = 0;
vchCiphertext = std::vector<unsigned char> (nCLen);
EVP_CIPHER_CTX ctx;
bool fOk = true;
EVP_CIPHER_CTX_init(&ctx);
if (fOk) fOk = EVP_EncryptInit_ex(&ctx, EVP_aes_256_cbc(), NULL, &chKey[0], &chIV[0]);
if (fOk) fOk = EVP_EncryptUpdate(&ctx, &vchCiphertext[0], &nCLen, chPlaintext, nLen);
if (fOk) fOk = EVP_EncryptFinal_ex(&ctx, (&vchCiphertext[0])+nCLen, &nFLen);
EVP_CIPHER_CTX_cleanup(&ctx);
if (!fOk)
return false;
vchCiphertext.resize(nCLen + nFLen);
return true;
};
bool SecMsgCrypter::Decrypt(unsigned char* chCiphertext, uint32_t nCipher, std::vector<unsigned char>& vchPlaintext)
{
if (!fKeySet)
return false;
// plaintext will always be equal to or lesser than length of ciphertext
int nPLen = nCipher, nFLen = 0;
vchPlaintext.resize(nCipher);
EVP_CIPHER_CTX ctx;
bool fOk = true;
EVP_CIPHER_CTX_init(&ctx);
if (fOk) fOk = EVP_DecryptInit_ex(&ctx, EVP_aes_256_cbc(), NULL, &chKey[0], &chIV[0]);
if (fOk) fOk = EVP_DecryptUpdate(&ctx, &vchPlaintext[0], &nPLen, &chCiphertext[0], nCipher);
if (fOk) fOk = EVP_DecryptFinal_ex(&ctx, (&vchPlaintext[0])+nPLen, &nFLen);
EVP_CIPHER_CTX_cleanup(&ctx);
if (!fOk)
return false;
vchPlaintext.resize(nPLen + nFLen);
return true;
};
void SecMsgBucket::hashBucket()
{
if (fDebugSmsg)
printf("SecMsgBucket::hashBucket()\n");
timeChanged = GetTime();
std::set<SecMsgToken>::iterator it;
void* state = XXH32_init(1);
for (it = setTokens.begin(); it != setTokens.end(); ++it)
{
XXH32_update(state, it->sample, 8);
};
hash = XXH32_digest(state);
if (fDebugSmsg)
printf("Hashed %"PRIszu" messages, hash %u\n", setTokens.size(), hash);
};
bool SecMsgDB::Open(const char* pszMode)
{
if (smsgDB)
{
pdb = smsgDB;
return true;
};
bool fCreate = strchr(pszMode, 'c');
fs::path fullpath = GetDataDir() / "smsgDB";
if (!fCreate
&& (!fs::exists(fullpath)
|| !fs::is_directory(fullpath)))
{
printf("SecMsgDB::open() - DB does not exist.\n");
return false;
};
leveldb::Options options;
options.create_if_missing = fCreate;
leveldb::Status s = leveldb::DB::Open(options, fullpath.string(), &smsgDB);
if (!s.ok())
{
printf("SecMsgDB::open() - Error opening db: %s.\n", s.ToString().c_str());
return false;
};
pdb = smsgDB;
return true;
};
class SecMsgBatchScanner : public leveldb::WriteBatch::Handler
{
public:
std::string needle;
bool* deleted;
std::string* foundValue;
bool foundEntry;
SecMsgBatchScanner() : foundEntry(false) {}
virtual void Put(const leveldb::Slice& key, const leveldb::Slice& value)
{
if (key.ToString() == needle)
{
foundEntry = true;
*deleted = false;
*foundValue = value.ToString();
};
};
virtual void Delete(const leveldb::Slice& key)
{
if (key.ToString() == needle)
{
foundEntry = true;
*deleted = true;
};
};
};
// When performing a read, if we have an active batch we need to check it first
// before reading from the database, as the rest of the code assumes that once
// a database transaction begins reads are consistent with it. It would be good
// to change that assumption in future and avoid the performance hit, though in
// practice it does not appear to be large.
bool SecMsgDB::ScanBatch(const CDataStream& key, std::string* value, bool* deleted) const
{
if (!activeBatch)
return false;
*deleted = false;
SecMsgBatchScanner scanner;
scanner.needle = key.str();
scanner.deleted = deleted;
scanner.foundValue = value;
leveldb::Status s = activeBatch->Iterate(&scanner);
if (!s.ok())
{
printf("SecMsgDB ScanBatch error: %s\n", s.ToString().c_str());
return false;
};
return scanner.foundEntry;
}
bool SecMsgDB::TxnBegin()
{
if (activeBatch)
return true;
activeBatch = new leveldb::WriteBatch();
return true;
};
bool SecMsgDB::TxnCommit()
{
if (!activeBatch)
return false;
leveldb::WriteOptions writeOptions;
writeOptions.sync = true;
leveldb::Status status = pdb->Write(writeOptions, activeBatch);
delete activeBatch;
activeBatch = NULL;
if (!status.ok())
{
printf("SecMsgDB batch commit failure: %s\n", status.ToString().c_str());
return false;
};
return true;
};
bool SecMsgDB::TxnAbort()
{
delete activeBatch;
activeBatch = NULL;
return true;
};
bool SecMsgDB::ReadPK(CKeyID& addr, CPubKey& pubkey)
{
if (!pdb)
return false;
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
ssKey.reserve(sizeof(addr) + 2);
ssKey << 'p';
ssKey << 'k';
ssKey << addr;
std::string strValue;
bool readFromDb = true;
if (activeBatch)
{
// -- check activeBatch first
bool deleted = false;
readFromDb = ScanBatch(ssKey, &strValue, &deleted) == false;
if (deleted)
return false;
};
if (readFromDb)
{
leveldb::Status s = pdb->Get(leveldb::ReadOptions(), ssKey.str(), &strValue);
if (!s.ok())
{
if (s.IsNotFound())
return false;
printf("LevelDB read failure: %s\n", s.ToString().c_str());
return false;
};
};
try {
CDataStream ssValue(strValue.data(), strValue.data() + strValue.size(), SER_DISK, CLIENT_VERSION);
ssValue >> pubkey;
} catch (std::exception& e) {
printf("SecMsgDB::ReadPK() unserialize threw: %s.\n", e.what());
return false;
}
return true;
};
bool SecMsgDB::WritePK(CKeyID& addr, CPubKey& pubkey)
{
if (!pdb)
return false;
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
ssKey.reserve(sizeof(addr) + 2);
ssKey << 'p';
ssKey << 'k';
ssKey << addr;
CDataStream ssValue(SER_DISK, CLIENT_VERSION);
ssValue.reserve(sizeof(pubkey));
ssValue << pubkey;
if (activeBatch)
{
activeBatch->Put(ssKey.str(), ssValue.str());
return true;
};
leveldb::WriteOptions writeOptions;
writeOptions.sync = true;
leveldb::Status s = pdb->Put(writeOptions, ssKey.str(), ssValue.str());
if (!s.ok())
{
printf("SecMsgDB write failure: %s\n", s.ToString().c_str());
return false;
};
return true;
};
bool SecMsgDB::ExistsPK(CKeyID& addr)
{
if (!pdb)
return false;
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
ssKey.reserve(sizeof(addr)+2);
ssKey << 'p';
ssKey << 'k';
ssKey << addr;
std::string unused;
if (activeBatch)
{
bool deleted;
if (ScanBatch(ssKey, &unused, &deleted) && !deleted)
{
return true;
};
};
leveldb::Status s = pdb->Get(leveldb::ReadOptions(), ssKey.str(), &unused);
return s.IsNotFound() == false;
};
bool SecMsgDB::NextSmesg(leveldb::Iterator* it, std::string& prefix, unsigned char* chKey, SecMsgStored& smsgStored)
{
if (!pdb)
return false;
if (!it->Valid()) // first run
it->Seek(prefix);
else
it->Next();
if (!(it->Valid()
&& it->key().size() == 18
&& memcmp(it->key().data(), prefix.data(), 2) == 0))
return false;
memcpy(chKey, it->key().data(), 18);
try {
CDataStream ssValue(it->value().data(), it->value().data() + it->value().size(), SER_DISK, CLIENT_VERSION);
ssValue >> smsgStored;
} catch (std::exception& e) {
printf("SecMsgDB::NextSmesg() unserialize threw: %s.\n", e.what());
return false;
}
return true;
};
bool SecMsgDB::NextSmesgKey(leveldb::Iterator* it, std::string& prefix, unsigned char* chKey)
{
if (!pdb)
return false;
if (!it->Valid()) // first run
it->Seek(prefix);
else
it->Next();
if (!(it->Valid()
&& it->key().size() == 18
&& memcmp(it->key().data(), prefix.data(), 2) == 0))
return false;
memcpy(chKey, it->key().data(), 18);
return true;
};
bool SecMsgDB::ReadSmesg(unsigned char* chKey, SecMsgStored& smsgStored)
{
if (!pdb)
return false;
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
ssKey.write((const char*)chKey, 18);
std::string strValue;
bool readFromDb = true;
if (activeBatch)
{
// -- check activeBatch first
bool deleted = false;
readFromDb = ScanBatch(ssKey, &strValue, &deleted) == false;
if (deleted)
return false;
};
if (readFromDb)
{
leveldb::Status s = pdb->Get(leveldb::ReadOptions(), ssKey.str(), &strValue);
if (!s.ok())
{
if (s.IsNotFound())
return false;
printf("LevelDB read failure: %s\n", s.ToString().c_str());
return false;
};
};
try {
CDataStream ssValue(strValue.data(), strValue.data() + strValue.size(), SER_DISK, CLIENT_VERSION);
ssValue >> smsgStored;
} catch (std::exception& e) {
printf("SecMsgDB::ReadSmesg() unserialize threw: %s.\n", e.what());
return false;
}
return true;
};
bool SecMsgDB::WriteSmesg(unsigned char* chKey, SecMsgStored& smsgStored)
{
if (!pdb)
return false;
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
ssKey.write((const char*)chKey, 18);
CDataStream ssValue(SER_DISK, CLIENT_VERSION);
ssValue << smsgStored;
if (activeBatch)
{
activeBatch->Put(ssKey.str(), ssValue.str());
return true;
};
leveldb::WriteOptions writeOptions;
writeOptions.sync = true;
leveldb::Status s = pdb->Put(writeOptions, ssKey.str(), ssValue.str());
if (!s.ok())
{
printf("SecMsgDB write failed: %s\n", s.ToString().c_str());
return false;
};
return true;
};
bool SecMsgDB::ExistsSmesg(unsigned char* chKey)
{
if (!pdb)
return false;
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
ssKey.write((const char*)chKey, 18);
std::string unused;
if (activeBatch)
{
bool deleted;
if (ScanBatch(ssKey, &unused, &deleted) && !deleted)
{
return true;
};
};
leveldb::Status s = pdb->Get(leveldb::ReadOptions(), ssKey.str(), &unused);
return s.IsNotFound() == false;
return true;
};
bool SecMsgDB::EraseSmesg(unsigned char* chKey)
{
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
ssKey.write((const char*)chKey, 18);
if (activeBatch)
{
activeBatch->Delete(ssKey.str());
return true;
};
leveldb::WriteOptions writeOptions;
writeOptions.sync = true;
leveldb::Status s = pdb->Delete(writeOptions, ssKey.str());
if (s.ok() || s.IsNotFound())
return true;
printf("SecMsgDB erase failed: %s\n", s.ToString().c_str());
return false;
};
void ThreadSecureMsg(void* parg)
{
// -- bucket management thread
RenameThread("JBChain-smsg"); // Make this thread recognisable
uint32_t delay = 0;
while (fSecMsgEnabled)
{
// shutdown thread waits 5 seconds, this should be less
MilliSleep(1000); // milliseconds
if (!fSecMsgEnabled) // check again after sleep
break;
delay++;
if (delay < SMSG_THREAD_DELAY) // check every SMSG_THREAD_DELAY seconds
continue;
delay = 0;
int64_t now = GetTime();
if (fDebugSmsg)
printf("SecureMsgThread %"PRId64" \n", now);
int64_t cutoffTime = now - SMSG_RETENTION;
{
LOCK(cs_smsg);
std::map<int64_t, SecMsgBucket>::iterator it;
it = smsgBuckets.begin();
while (it != smsgBuckets.end())
{
//if (fDebugSmsg)
// printf("Checking bucket %"PRId64", size %"PRIszu" \n", it->first, it->second.setTokens.size());
if (it->first < cutoffTime)
{
if (fDebugSmsg)
printf("Removing bucket %"PRId64" \n", it->first);
std::string fileName = boost::lexical_cast<std::string>(it->first) + "_01.dat";
fs::path fullPath = GetDataDir() / "smsgStore" / fileName;
if (fs::exists(fullPath))
{
try {
fs::remove(fullPath);
} catch (const fs::filesystem_error& ex)
{
printf("Error removing bucket file %s.\n", ex.what());
};
} else
printf("Path %s does not exist \n", fullPath.string().c_str());
// -- look for a wl file, it stores incoming messages when wallet is locked
fileName = boost::lexical_cast<std::string>(it->first) + "_01_wl.dat";
fullPath = GetDataDir() / "smsgStore" / fileName;
if (fs::exists(fullPath))
{
try {
fs::remove(fullPath);
} catch (const fs::filesystem_error& ex)
{
printf("Error removing wallet locked file %s.\n", ex.what());
};
};
smsgBuckets.erase(it++);
} else
{
// -- tick down nLockCount, so will eventually expire if peer never sends data
if (it->second.nLockCount > 0)
{
it->second.nLockCount--;
if (it->second.nLockCount == 0) // lock timed out
{
uint32_t nPeerId = it->second.nLockPeerId;
int64_t ignoreUntil = GetTime() + SMSG_TIME_IGNORE;
if (fDebugSmsg)
printf("Lock on bucket %"PRId64" for peer %u timed out.\n", it->first, nPeerId);
// -- look through the nodes for the peer that locked this bucket
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes)
{
if (pnode->smsgData.nPeerId != nPeerId)
continue;
pnode->smsgData.ignoreUntil = ignoreUntil;
// -- alert peer that they are being ignored
std::vector<unsigned char> vchData;
vchData.resize(8);
memcpy(&vchData[0], &ignoreUntil, 8);
pnode->PushMessage("smsgIgnore", vchData);
if (fDebugSmsg)
printf("This node will ignore peer %u until %"PRId64".\n", nPeerId, ignoreUntil);
break;
};
it->second.nLockPeerId = 0;
}; // if (it->second.nLockCount == 0)
};
++it;
}; // ! if (it->first < cutoffTime)
};
}; // LOCK(cs_smsg);
};
printf("ThreadSecureMsg exited.\n");
};
void ThreadSecureMsgPow(void* parg)
{
// -- proof of work thread
RenameThread("JBChain-smsg-pow"); // Make this thread recognisable
int rv;
std::vector<unsigned char> vchKey;
SecMsgStored smsgStored;
std::string sPrefix("qm");
unsigned char chKey[18];
while (fSecMsgEnabled)
{
// -- sleep at end, then fSecMsgEnabled is tested on wake
SecMsgDB dbOutbox;
leveldb::Iterator* it;
{
LOCK(cs_smsgDB);
if (!dbOutbox.Open("cr+"))
continue;
// -- fifo (smallest key first)
it = dbOutbox.pdb->NewIterator(leveldb::ReadOptions());
}
// -- break up lock, SecureMsgSetHash will take long
for (;;)
{
{
LOCK(cs_smsgDB);
if (!dbOutbox.NextSmesg(it, sPrefix, chKey, smsgStored))
break;
}
unsigned char* pHeader = &smsgStored.vchMessage[0];
unsigned char* pPayload = &smsgStored.vchMessage[SMSG_HDR_LEN];
SecureMessage* psmsg = (SecureMessage*) pHeader;
// -- do proof of work
rv = SecureMsgSetHash(pHeader, pPayload, psmsg->nPayload);
if (rv == 2)
break; // /eave message in db, if terminated due to shutdown
// -- message is removed here, no matter what
{
LOCK(cs_smsgDB);
dbOutbox.EraseSmesg(chKey);
}
if (rv != 0)
{
printf("SecMsgPow: Could not get proof of work hash, message removed.\n");
continue;
};
// -- add to message store
{
LOCK(cs_smsg);
if (SecureMsgStore(pHeader, pPayload, psmsg->nPayload, true) != 0)
{
printf("SecMsgPow: Could not place message in buckets, message removed.\n");
continue;
};
}
// -- test if message was sent to self
if (SecureMsgScanMessage(pHeader, pPayload, psmsg->nPayload, true) != 0)
{
// message recipient is not this node (or failed)
};
};
{
LOCK(cs_smsg);
delete it;
}
// -- shutdown thread waits 5 seconds, this should be less
MilliSleep(1000); // milliseconds
};
printf("ThreadSecureMsgPow exited.\n");
};
std::string getTimeString(int64_t timestamp, char *buffer, size_t nBuffer)
{
struct tm* dt;
time_t t = timestamp;
dt = localtime(&t);
strftime(buffer, nBuffer, "%Y-%m-%d %H:%M:%S %z", dt); // %Z shows long strings on windows
return std::string(buffer); // copies the null-terminated character sequence
};
std::string fsReadable(uint64_t nBytes)
{
char buffer[128];
if (nBytes >= 1024ll*1024ll*1024ll*1024ll)
snprintf(buffer, sizeof(buffer), "%.2f TB", nBytes/1024.0/1024.0/1024.0/1024.0);
else
if (nBytes >= 1024*1024*1024)
snprintf(buffer, sizeof(buffer), "%.2f GB", nBytes/1024.0/1024.0/1024.0);
else
if (nBytes >= 1024*1024)
snprintf(buffer, sizeof(buffer), "%.2f MB", nBytes/1024.0/1024.0);
else
if (nBytes >= 1024)
snprintf(buffer, sizeof(buffer), "%.2f KB", nBytes/1024.0);
else
snprintf(buffer, sizeof(buffer), "%"PRIu64" bytes", nBytes);
return std::string(buffer);
};
int SecureMsgBuildBucketSet()
{
/*
Build the bucket set by scanning the files in the smsgStore dir.
smsgBuckets should be empty
*/
if (fDebugSmsg)
printf("SecureMsgBuildBucketSet()\n");
int64_t now = GetTime();
uint32_t nFiles = 0;
uint32_t nMessages = 0;
fs::path pathSmsgDir = GetDataDir() / "smsgStore";
fs::directory_iterator itend;
if (!fs::exists(pathSmsgDir)
|| !fs::is_directory(pathSmsgDir))
{
printf("Message store directory does not exist.\n");
return 0; // not an error
}
for (fs::directory_iterator itd(pathSmsgDir) ; itd != itend ; ++itd)
{
if (!fs::is_regular_file(itd->status()))
continue;
std::string fileType = (*itd).path().extension().string();
if (fileType.compare(".dat") != 0)
continue;
std::string fileName = (*itd).path().filename().string();
if (fDebugSmsg)
printf("Processing file: %s.\n", fileName.c_str());
nFiles++;
// TODO files must be split if > 2GB
// time_noFile.dat
size_t sep = fileName.find_first_of("_");
if (sep == std::string::npos)
continue;
std::string stime = fileName.substr(0, sep);
int64_t fileTime = boost::lexical_cast<int64_t>(stime);
if (fileTime < now - SMSG_RETENTION)
{
printf("Dropping file %s, expired.\n", fileName.c_str());
try {
fs::remove((*itd).path());
} catch (const fs::filesystem_error& ex)
{
printf("Error removing bucket file %s, %s.\n", fileName.c_str(), ex.what());
};
continue;
};
if (boost::algorithm::ends_with(fileName, "_wl.dat"))
{
if (fDebugSmsg)
printf("Skipping wallet locked file: %s.\n", fileName.c_str());
continue;
};
SecureMessage smsg;
std::set<SecMsgToken>& tokenSet = smsgBuckets[fileTime].setTokens;
{
LOCK(cs_smsg);
FILE *fp;
if (!(fp = fopen((*itd).path().string().c_str(), "rb")))
{
printf("Error opening file: %s\n", strerror(errno));
continue;
};
for (;;)
{
long int ofs = ftell(fp);
SecMsgToken token;
token.offset = ofs;
errno = 0;
if (fread(&smsg.hash[0], sizeof(unsigned char), SMSG_HDR_LEN, fp) != (size_t)SMSG_HDR_LEN)
{
if (errno != 0)
{
printf("fread header failed: %s\n", strerror(errno));
} else
{
//printf("End of file.\n");
};
break;
};
token.timestamp = smsg.timestamp;
if (smsg.nPayload < 8)
continue;
if (fread(token.sample, sizeof(unsigned char), 8, fp) != 8)
{
printf("fread data failed: %s\n", strerror(errno));
break;
};
if (fseek(fp, smsg.nPayload-8, SEEK_CUR) != 0)
{
printf("fseek, strerror: %s.\n", strerror(errno));
break;
};
tokenSet.insert(token);
};
fclose(fp);
};
smsgBuckets[fileTime].hashBucket();
nMessages += tokenSet.size();
if (fDebugSmsg)
printf("Bucket %"PRId64" contains %"PRIszu" messages.\n", fileTime, tokenSet.size());
};
printf("Processed %u files, loaded %"PRIszu" buckets containing %u messages.\n", nFiles, smsgBuckets.size(), nMessages);
return 0;
};
int SecureMsgAddWalletAddresses()
{
if (fDebugSmsg)
printf("SecureMsgAddWalletAddresses()\n");
uint32_t nAdded = 0;
BOOST_FOREACH(const PAIRTYPE(CTxDestination, std::string)& entry, pwalletMain->mapAddressBook)
{
if (!IsMine(*pwalletMain, entry.first))
continue;
CBitcoinAddress coinAddress(entry.first);
if (!coinAddress.IsValid())
continue;
std::string address;
std::string strPublicKey;
address = coinAddress.ToString();
bool fExists = 0;
for (std::vector<SecMsgAddress>::iterator it = smsgAddresses.begin(); it != smsgAddresses.end(); ++it)
{
if (address != it->sAddress)
continue;
fExists = 1;
break;
};
if (fExists)
continue;
bool recvEnabled = 1;
bool recvAnon = 1;
smsgAddresses.push_back(SecMsgAddress(address, recvEnabled, recvAnon));
nAdded++;
};
if (fDebugSmsg)
printf("Added %u addresses to whitelist.\n", nAdded);
return 0;
};
int SecureMsgReadIni()
{
if (!fSecMsgEnabled)
return false;
if (fDebugSmsg)
printf("SecureMsgReadIni()\n");
fs::path fullpath = GetDataDir() / "smsg.ini";
FILE *fp;
errno = 0;
if (!(fp = fopen(fullpath.string().c_str(), "r")))
{
printf("Error opening file: %s\n", strerror(errno));
return 1;
};
char cLine[512];
char *pName, *pValue;
char cAddress[64];
int addrRecv, addrRecvAnon;
while (fgets(cLine, 512, fp))
{
cLine[strcspn(cLine, "\n")] = '\0';
cLine[strcspn(cLine, "\r")] = '\0';
cLine[511] = '\0'; // for safety
// -- check that line contains a name value pair and is not a comment, or section header
if (cLine[0] == '#' || cLine[0] == '[' || strcspn(cLine, "=") < 1)
continue;
if (!(pName = strtok(cLine, "="))
|| !(pValue = strtok(NULL, "=")))
continue;
if (strcmp(pName, "newAddressRecv") == 0)
{
smsgOptions.fNewAddressRecv = (strcmp(pValue, "true") == 0) ? true : false;
} else
if (strcmp(pName, "newAddressAnon") == 0)
{
smsgOptions.fNewAddressAnon = (strcmp(pValue, "true") == 0) ? true : false;
} else
if (strcmp(pName, "key") == 0)
{
int rv = sscanf(pValue, "%64[^|]|%d|%d", cAddress, &addrRecv, &addrRecvAnon);
if (rv == 3)
{
smsgAddresses.push_back(SecMsgAddress(std::string(cAddress), addrRecv, addrRecvAnon));
} else
{
printf("Could not parse key line %s, rv %d.\n", pValue, rv);
}
} else
{
printf("Unknown setting name: '%s'.", pName);
};
};
printf("Loaded %"PRIszu" addresses.\n", smsgAddresses.size());
fclose(fp);
return 0;
};
int SecureMsgWriteIni()
{
if (!fSecMsgEnabled)
return false;
if (fDebugSmsg)
printf("SecureMsgWriteIni()\n");
fs::path fullpath = GetDataDir() / "smsg.ini~";
FILE *fp;
errno = 0;
if (!(fp = fopen(fullpath.string().c_str(), "w")))
{
printf("Error opening file: %s\n", strerror(errno));
return 1;
};
if (fwrite("[Options]\n", sizeof(char), 10, fp) != 10)
{
printf("fwrite error: %s\n", strerror(errno));
fclose(fp);
return false;
};
if (fprintf(fp, "newAddressRecv=%s\n", smsgOptions.fNewAddressRecv ? "true" : "false") < 0
|| fprintf(fp, "newAddressAnon=%s\n", smsgOptions.fNewAddressAnon ? "true" : "false") < 0)
{
printf("fprintf error: %s\n", strerror(errno));
fclose(fp);
return false;
}
if (fwrite("\n[Keys]\n", sizeof(char), 8, fp) != 8)
{
printf("fwrite error: %s\n", strerror(errno));
fclose(fp);
return false;
};
for (std::vector<SecMsgAddress>::iterator it = smsgAddresses.begin(); it != smsgAddresses.end(); ++it)
{
errno = 0;
if (fprintf(fp, "key=%s|%d|%d\n", it->sAddress.c_str(), it->fReceiveEnabled, it->fReceiveAnon) < 0)
{
printf("fprintf error: %s\n", strerror(errno));
continue;
};
};
fclose(fp);
try {
fs::path finalpath = GetDataDir() / "smsg.ini";
fs::rename(fullpath, finalpath);
} catch (const fs::filesystem_error& ex)
{
printf("Error renaming file %s, %s.\n", fullpath.string().c_str(), ex.what());
};
return 0;
};
/** called from AppInit2() in init.cpp */
bool SecureMsgStart(bool fDontStart, bool fScanChain)
{
if (fDontStart)
{
printf("Secure messaging not started.\n");
return false;
};
printf("Secure messaging starting.\n");
fSecMsgEnabled = true;
if (SecureMsgReadIni() != 0)
printf("Failed to read smsg.ini\n");
if (smsgAddresses.size() < 1)
{
printf("No address keys loaded.\n");
if (SecureMsgAddWalletAddresses() != 0)
printf("Failed to load addresses from wallet.\n");
};
if (fScanChain)
{
SecureMsgScanBlockChain();
};
if (SecureMsgBuildBucketSet() != 0)
{
printf("SecureMsg could not load bucket sets, secure messaging disabled.\n");
fSecMsgEnabled = false;
return false;
};
// -- start threads
if (!NewThread(ThreadSecureMsg, NULL)
|| !NewThread(ThreadSecureMsgPow, NULL))
{
printf("SecureMsg could not start threads, secure messaging disabled.\n");
fSecMsgEnabled = false;
return false;
};
return true;
};
/** called from Shutdown() in init.cpp */
bool SecureMsgShutdown()
{
if (!fSecMsgEnabled)
return false;
printf("Stopping secure messaging.\n");
if (SecureMsgWriteIni() != 0)
printf("Failed to save smsg.ini\n");
fSecMsgEnabled = false;
if (smsgDB)
{
LOCK(cs_smsgDB);
delete smsgDB;
smsgDB = NULL;
};
// -- main program will wait 5 seconds for threads to terminate.
return true;
};
bool SecureMsgEnable()
{
// -- start secure messaging at runtime
if (fSecMsgEnabled)
{
printf("SecureMsgEnable: secure messaging is already enabled.\n");
return false;
};
{
LOCK(cs_smsg);
fSecMsgEnabled = true;
smsgAddresses.clear(); // should be empty already
if (SecureMsgReadIni() != 0)
printf("Failed to read smsg.ini\n");
if (smsgAddresses.size() < 1)
{
printf("No address keys loaded.\n");
if (SecureMsgAddWalletAddresses() != 0)
printf("Failed to load addresses from wallet.\n");
};
smsgBuckets.clear(); // should be empty already
if (SecureMsgBuildBucketSet() != 0)
{
printf("SecureMsgEnable: could not load bucket sets, secure messaging disabled.\n");
fSecMsgEnabled = false;
return false;
};
}; // LOCK(cs_smsg);
// -- start threads
if (!NewThread(ThreadSecureMsg, NULL)
|| !NewThread(ThreadSecureMsgPow, NULL))
{
printf("SecureMsgEnable could not start threads, secure messaging disabled.\n");
fSecMsgEnabled = false;
return false;
};
// -- ping each peer, don't know which have messaging enabled
{
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes)
{
pnode->PushMessage("smsgPing");
pnode->PushMessage("smsgPong"); // Send pong as have missed initial ping sent by peer when it connected
};
}
printf("Secure messaging enabled.\n");
return true;
};
bool SecureMsgDisable()
{
// -- stop secure messaging at runtime
if (!fSecMsgEnabled)
{
printf("SecureMsgDisable: secure messaging is already disabled.\n");
return false;
};
{
LOCK(cs_smsg);
fSecMsgEnabled = false;
// -- clear smsgBuckets
std::map<int64_t, SecMsgBucket>::iterator it;
it = smsgBuckets.begin();
for (it = smsgBuckets.begin(); it != smsgBuckets.end(); ++it)
{
it->second.setTokens.clear();
};
smsgBuckets.clear();
// -- tell each smsg enabled peer that this node is disabling
{
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes)
{
if (!pnode->smsgData.fEnabled)
continue;
pnode->PushMessage("smsgDisabled");
pnode->smsgData.fEnabled = false;
};
}
if (SecureMsgWriteIni() != 0)
printf("Failed to save smsg.ini\n");
smsgAddresses.clear();
}; // LOCK(cs_smsg);
// -- allow time for threads to stop
MilliSleep(3000); // milliseconds
// TODO be certain that threads have stopped
if (smsgDB)
{
LOCK(cs_smsgDB);
delete smsgDB;
smsgDB = NULL;
};
printf("Secure messaging disabled.\n");
return true;
};
bool SecureMsgReceiveData(CNode* pfrom, std::string strCommand, CDataStream& vRecv)
{
/*
Called from ProcessMessage
Runs in ThreadMessageHandler2
*/
if (fDebugSmsg)
printf("SecureMsgReceiveData() %s %s.\n", pfrom->addrName.c_str(), strCommand.c_str());
{
// break up?
LOCK(cs_smsg);
if (strCommand == "smsgInv")
{
std::vector<unsigned char> vchData;
vRecv >> vchData;
if (vchData.size() < 4)
{
pfrom->Misbehaving(1);
return false; // not enough data received to be a valid smsgInv
};
int64_t now = GetTime();
if (now < pfrom->smsgData.ignoreUntil)
{
if (fDebugSmsg)
printf("Node is ignoring peer %u until %"PRId64".\n", pfrom->smsgData.nPeerId, pfrom->smsgData.ignoreUntil);
return false;
};
uint32_t nBuckets = smsgBuckets.size();
uint32_t nLocked = 0; // no. of locked buckets on this node
uint32_t nInvBuckets; // no. of bucket headers sent by peer in smsgInv
memcpy(&nInvBuckets, &vchData[0], 4);
if (fDebugSmsg)
printf("Remote node sent %d bucket headers, this has %d.\n", nInvBuckets, nBuckets);
// -- Check no of buckets:
if (nInvBuckets > (SMSG_RETENTION / SMSG_BUCKET_LEN) + 1) // +1 for some leeway
{
printf("Peer sent more bucket headers than possible %u, %u.\n", nInvBuckets, (SMSG_RETENTION / SMSG_BUCKET_LEN));
pfrom->Misbehaving(1);
return false;
};
if (vchData.size() < 4 + nInvBuckets*16)
{
printf("Remote node did not send enough data.\n");
pfrom->Misbehaving(1);
return false;
};
std::vector<unsigned char> vchDataOut;
vchDataOut.reserve(4 + 8 * nInvBuckets); // reserve max possible size
vchDataOut.resize(4);
uint32_t nShowBuckets = 0;
unsigned char *p = &vchData[4];
for (uint32_t i = 0; i < nInvBuckets; ++i)
{
int64_t time;
uint32_t ncontent, hash;
memcpy(&time, p, 8);
memcpy(&ncontent, p+8, 4);
memcpy(&hash, p+12, 4);
p += 16;
// Check time valid:
if (time < now - SMSG_RETENTION)
{
if (fDebugSmsg)
printf("Not interested in peer bucket %"PRId64", has expired.\n", time);
if (time < now - SMSG_RETENTION - SMSG_TIME_LEEWAY)
pfrom->Misbehaving(1);
continue;
};
if (time > now + SMSG_TIME_LEEWAY)
{
if (fDebugSmsg)
printf("Not interested in peer bucket %"PRId64", in the future.\n", time);
pfrom->Misbehaving(1);
continue;
};
if (ncontent < 1)
{
if (fDebugSmsg)
printf("Peer sent empty bucket, ignore %"PRId64" %u %u.\n", time, ncontent, hash);
continue;
};
if (fDebugSmsg)
{
printf("peer bucket %"PRId64" %u %u.\n", time, ncontent, hash);
printf("this bucket %"PRId64" %"PRIszu" %u.\n", time, smsgBuckets[time].setTokens.size(), smsgBuckets[time].hash);
};
if (smsgBuckets[time].nLockCount > 0)
{
if (fDebugSmsg)
printf("Bucket is locked %u, waiting for peer %u to send data.\n", smsgBuckets[time].nLockCount, smsgBuckets[time].nLockPeerId);
nLocked++;
continue;
};
// -- if this node has more than the peer node, peer node will pull from this
// if then peer node has more this node will pull fom peer
if (smsgBuckets[time].setTokens.size() < ncontent
|| (smsgBuckets[time].setTokens.size() == ncontent
&& smsgBuckets[time].hash != hash)) // if same amount in buckets check hash
{
if (fDebugSmsg)
printf("Requesting contents of bucket %"PRId64".\n", time);
uint32_t sz = vchDataOut.size();
vchDataOut.resize(sz + 8);
memcpy(&vchDataOut[sz], &time, 8);
nShowBuckets++;
};
};
// TODO: should include hash?
memcpy(&vchDataOut[0], &nShowBuckets, 4);
if (vchDataOut.size() > 4)
{
pfrom->PushMessage("smsgShow", vchDataOut);
} else
if (nLocked < 1) // Don't report buckets as matched if any are locked
{
// -- peer has no buckets we want, don't send them again until something changes
// peer will still request buckets from this node if needed (< ncontent)
vchDataOut.resize(8);
memcpy(&vchDataOut[0], &now, 8);
pfrom->PushMessage("smsgMatch", vchDataOut);
if (fDebugSmsg)
printf("Sending smsgMatch, %"PRId64".\n", now);
};
} else
if (strCommand == "smsgShow")
{
std::vector<unsigned char> vchData;
vRecv >> vchData;
if (vchData.size() < 4)
return false;
uint32_t nBuckets;
memcpy(&nBuckets, &vchData[0], 4);
if (vchData.size() < 4 + nBuckets * 8)
return false;
if (fDebugSmsg)
printf("smsgShow: peer wants to see content of %u buckets.\n", nBuckets);
std::map<int64_t, SecMsgBucket>::iterator itb;
std::set<SecMsgToken>::iterator it;
std::vector<unsigned char> vchDataOut;
int64_t time;
unsigned char* pIn = &vchData[4];
for (uint32_t i = 0; i < nBuckets; ++i, pIn += 8)
{
memcpy(&time, pIn, 8);
itb = smsgBuckets.find(time);
if (itb == smsgBuckets.end())
{
if (fDebugSmsg)
printf("Don't have bucket %"PRId64".\n", time);
continue;
};
std::set<SecMsgToken>& tokenSet = (*itb).second.setTokens;
try {
vchDataOut.resize(8 + 16 * tokenSet.size());
} catch (std::exception& e) {
printf("vchDataOut.resize %"PRIszu" threw: %s.\n", 8 + 16 * tokenSet.size(), e.what());
continue;
};
memcpy(&vchDataOut[0], &time, 8);
unsigned char* p = &vchDataOut[8];
for (it = tokenSet.begin(); it != tokenSet.end(); ++it)
{
memcpy(p, &it->timestamp, 8);
memcpy(p+8, &it->sample, 8);
p += 16;
};
pfrom->PushMessage("smsgHave", vchDataOut);
};
} else
if (strCommand == "smsgHave")
{
// -- peer has these messages in bucket
std::vector<unsigned char> vchData;
vRecv >> vchData;
if (vchData.size() < 8)
return false;
int n = (vchData.size() - 8) / 16;
int64_t time;
memcpy(&time, &vchData[0], 8);
// -- Check time valid:
int64_t now = GetTime();
if (time < now - SMSG_RETENTION)
{
if (fDebugSmsg)
printf("Not interested in peer bucket %"PRId64", has expired.\n", time);
return false;
};
if (time > now + SMSG_TIME_LEEWAY)
{
if (fDebugSmsg)
printf("Not interested in peer bucket %"PRId64", in the future.\n", time);
pfrom->Misbehaving(1);
return false;
};
if (smsgBuckets[time].nLockCount > 0)
{
if (fDebugSmsg)
printf("Bucket %"PRId64" lock count %u, waiting for message data from peer %u.\n", time, smsgBuckets[time].nLockCount, smsgBuckets[time].nLockPeerId);
return false;
};
if (fDebugSmsg)
printf("Sifting through bucket %"PRId64".\n", time);
std::vector<unsigned char> vchDataOut;
vchDataOut.resize(8);
memcpy(&vchDataOut[0], &vchData[0], 8);
std::set<SecMsgToken>& tokenSet = smsgBuckets[time].setTokens;
std::set<SecMsgToken>::iterator it;
SecMsgToken token;
unsigned char* p = &vchData[8];
for (int i = 0; i < n; ++i)
{
memcpy(&token.timestamp, p, 8);
memcpy(&token.sample, p+8, 8);
it = tokenSet.find(token);
if (it == tokenSet.end())
{
int nd = vchDataOut.size();
try {
vchDataOut.resize(nd + 16);
} catch (std::exception& e) {
printf("vchDataOut.resize %d threw: %s.\n", nd + 16, e.what());
continue;
};
memcpy(&vchDataOut[nd], p, 16);
};
p += 16;
};
if (vchDataOut.size() > 8)
{
if (fDebugSmsg)
{
printf("Asking peer for %"PRIszu" messages.\n", (vchDataOut.size() - 8) / 16);
printf("Locking bucket %"PRIszu" for peer %u.\n", time, pfrom->smsgData.nPeerId);
};
smsgBuckets[time].nLockCount = 3; // lock this bucket for at most 3 * SMSG_THREAD_DELAY seconds, unset when peer sends smsgMsg
smsgBuckets[time].nLockPeerId = pfrom->smsgData.nPeerId;
pfrom->PushMessage("smsgWant", vchDataOut);
};
} else
if (strCommand == "smsgWant")
{
std::vector<unsigned char> vchData;
vRecv >> vchData;
if (vchData.size() < 8)
return false;
std::vector<unsigned char> vchOne;
std::vector<unsigned char> vchBunch;
vchBunch.resize(4+8); // nmessages + bucketTime
int n = (vchData.size() - 8) / 16;
int64_t time;
uint32_t nBunch = 0;
memcpy(&time, &vchData[0], 8);
std::map<int64_t, SecMsgBucket>::iterator itb;
itb = smsgBuckets.find(time);
if (itb == smsgBuckets.end())
{
if (fDebugSmsg)
printf("Don't have bucket %"PRId64".\n", time);
return false;
};
std::set<SecMsgToken>& tokenSet = itb->second.setTokens;
std::set<SecMsgToken>::iterator it;
SecMsgToken token;
unsigned char* p = &vchData[8];
for (int i = 0; i < n; ++i)
{
memcpy(&token.timestamp, p, 8);
memcpy(&token.sample, p+8, 8);
it = tokenSet.find(token);
if (it == tokenSet.end())
{
if (fDebugSmsg)
printf("Don't have wanted message %"PRId64".\n", token.timestamp);
} else
{
//printf("Have message at %"PRId64".\n", it->offset); // DEBUG
token.offset = it->offset;
//printf("winb before SecureMsgRetrieve %"PRId64".\n", token.timestamp);
// -- place in vchOne so if SecureMsgRetrieve fails it won't corrupt vchBunch
if (SecureMsgRetrieve(token, vchOne) == 0)
{
nBunch++;
vchBunch.insert(vchBunch.end(), vchOne.begin(), vchOne.end()); // append
} else
{
printf("SecureMsgRetrieve failed %"PRId64".\n", token.timestamp);
};
if (nBunch >= 500
|| vchBunch.size() >= 96000)
{
if (fDebugSmsg)
printf("Break bunch %u, %"PRIszu".\n", nBunch, vchBunch.size());
break; // end here, peer will send more want messages if needed.
};
};
p += 16;
};
if (nBunch > 0)
{
if (fDebugSmsg)
printf("Sending block of %u messages for bucket %"PRId64".\n", nBunch, time);
memcpy(&vchBunch[0], &nBunch, 4);
memcpy(&vchBunch[4], &time, 8);
pfrom->PushMessage("smsgMsg", vchBunch);
};
} else
if (strCommand == "smsgMsg")
{
std::vector<unsigned char> vchData;
vRecv >> vchData;
if (fDebugSmsg)
printf("smsgMsg vchData.size() %"PRIszu".\n", vchData.size());
SecureMsgReceive(pfrom, vchData);
} else
if (strCommand == "smsgMatch")
{
std::vector<unsigned char> vchData;
vRecv >> vchData;
if (vchData.size() < 8)
{
printf("smsgMatch, not enough data %"PRIszu".\n", vchData.size());
pfrom->Misbehaving(1);
return false;
};
int64_t time;
memcpy(&time, &vchData[0], 8);
int64_t now = GetTime();
if (time > now + SMSG_TIME_LEEWAY)
{
printf("Warning: Peer buckets matched in the future: %"PRId64".\nEither this node or the peer node has the incorrect time set.\n", time);
if (fDebugSmsg)
printf("Peer match time set to now.\n");
time = now;
};
pfrom->smsgData.lastMatched = time;
if (fDebugSmsg)
printf("Peer buckets matched at %"PRId64".\n", time);
} else
if (strCommand == "smsgPing")
{
// -- smsgPing is the initial message, send reply
pfrom->PushMessage("smsgPong");
} else
if (strCommand == "smsgPong")
{
if (fDebugSmsg)
printf("Peer replied, secure messaging enabled.\n");
pfrom->smsgData.fEnabled = true;
} else
if (strCommand == "smsgDisabled")
{
// -- peer has disabled secure messaging.
pfrom->smsgData.fEnabled = false;
if (fDebugSmsg)
printf("Peer %u has disabled secure messaging.\n", pfrom->smsgData.nPeerId);
} else
if (strCommand == "smsgIgnore")
{
// -- peer is reporting that it will ignore this node until time.
// Ignore peer too
std::vector<unsigned char> vchData;
vRecv >> vchData;
if (vchData.size() < 8)
{
printf("smsgIgnore, not enough data %"PRIszu".\n", vchData.size());
pfrom->Misbehaving(1);
return false;
};
int64_t time;
memcpy(&time, &vchData[0], 8);
pfrom->smsgData.ignoreUntil = time;
if (fDebugSmsg)
printf("Peer %u is ignoring this node until %"PRId64", ignore peer too.\n", pfrom->smsgData.nPeerId, time);
} else
{
// Unknown message
};
}; // LOCK(cs_smsg);
return true;
};
bool SecureMsgSendData(CNode* pto, bool fSendTrickle)
{
/*
Called from ProcessMessage
Runs in ThreadMessageHandler2
*/
//printf("SecureMsgSendData() %s.\n", pto->addrName.c_str());
int64_t now = GetTime();
if (pto->smsgData.lastSeen == 0)
{
// -- first contact
pto->smsgData.nPeerId = nPeerIdCounter++;
if (fDebugSmsg)
printf("SecureMsgSendData() new node %s, peer id %u.\n", pto->addrName.c_str(), pto->smsgData.nPeerId);
// -- Send smsgPing once, do nothing until receive 1st smsgPong (then set fEnabled)
pto->PushMessage("smsgPing");
pto->smsgData.lastSeen = GetTime();
return true;
} else
if (!pto->smsgData.fEnabled
|| now - pto->smsgData.lastSeen < SMSG_SEND_DELAY
|| now < pto->smsgData.ignoreUntil)
{
return true;
};
// -- When nWakeCounter == 0, resend bucket inventory.
if (pto->smsgData.nWakeCounter < 1)
{
pto->smsgData.lastMatched = 0;
pto->smsgData.nWakeCounter = 10 + GetRandInt(300); // set to a random time between [10, 300] * SMSG_SEND_DELAY seconds
if (fDebugSmsg)
printf("SecureMsgSendData(): nWakeCounter expired, sending bucket inventory to %s.\n"
"Now %"PRId64" next wake counter %u\n", pto->addrName.c_str(), now, pto->smsgData.nWakeCounter);
};
pto->smsgData.nWakeCounter--;
{
LOCK(cs_smsg);
std::map<int64_t, SecMsgBucket>::iterator it;
uint32_t nBuckets = smsgBuckets.size();
if (nBuckets > 0) // no need to send keep alive pkts, coin messages already do that
{
std::vector<unsigned char> vchData;
// should reserve?
vchData.reserve(4 + nBuckets*16); // timestamp + size + hash
uint32_t nBucketsShown = 0;
vchData.resize(4);
unsigned char* p = &vchData[4];
for (it = smsgBuckets.begin(); it != smsgBuckets.end(); ++it)
{
SecMsgBucket &bkt = it->second;
uint32_t nMessages = bkt.setTokens.size();
if (bkt.timeChanged < pto->smsgData.lastMatched // peer has this bucket
|| nMessages < 1) // this bucket is empty
continue;
uint32_t hash = bkt.hash;
try {
vchData.resize(vchData.size() + 16);
} catch (std::exception& e) {
printf("vchData.resize %"PRIszu" threw: %s.\n", vchData.size() + 16, e.what());
continue;
};
memcpy(p, &it->first, 8);
memcpy(p+8, &nMessages, 4);
memcpy(p+12, &hash, 4);
p += 16;
nBucketsShown++;
//if (fDebug)
// printf("Sending bucket %"PRId64", size %d \n", it->first, it->second.size());
};
if (vchData.size() > 4)
{
memcpy(&vchData[0], &nBucketsShown, 4);
if (fDebugSmsg)
printf("Sending %d bucket headers.\n", nBucketsShown);
pto->PushMessage("smsgInv", vchData);
};
};
}
pto->smsgData.lastSeen = GetTime();
return true;
};
static int SecureMsgInsertAddress(CKeyID& hashKey, CPubKey& pubKey, SecMsgDB& addrpkdb)
{
/* insert key hash and public key to addressdb
should have LOCK(cs_smsg) where db is opened
returns
0 success
1 error
4 address is already in db
*/
if (addrpkdb.ExistsPK(hashKey))
{
//printf("DB already contains public key for address.\n");
CPubKey cpkCheck;
if (!addrpkdb.ReadPK(hashKey, cpkCheck))
{
printf("addrpkdb.Read failed.\n");
} else
{
if (cpkCheck != pubKey)
printf("DB already contains existing public key that does not match .\n");
};
return 4;
};
if (!addrpkdb.WritePK(hashKey, pubKey))
{
printf("Write pair failed.\n");
return 1;
};
return 0;
};
int SecureMsgInsertAddress(CKeyID& hashKey, CPubKey& pubKey)
{
int rv;
{
LOCK(cs_smsgDB);
SecMsgDB addrpkdb;
if (!addrpkdb.Open("cr+"))
return 1;
rv = SecureMsgInsertAddress(hashKey, pubKey, addrpkdb);
}
return rv;
};
static bool ScanBlock(CBlock& block, CTxDB& txdb, SecMsgDB& addrpkdb,
uint32_t& nTransactions, uint32_t& nInputs, uint32_t& nPubkeys, uint32_t& nDuplicates)
{
// -- should have LOCK(cs_smsg) where db is opened
BOOST_FOREACH(CTransaction& tx, block.vtx)
{
if (!tx.IsStandard())
continue; // leave out coinbase and others
/*
Look at the inputs of every tx.
If the inputs are standard, get the pubkey from scriptsig and
look for the corresponding output (the input(output of other tx) to the input of this tx)
get the address from scriptPubKey
add to db if address is unique.
Would make more sense to do this the other way around, get address first for early out.
*/
for (unsigned int i = 0; i < tx.vin.size(); i++)
{
CScript *script = &tx.vin[i].scriptSig;
opcodetype opcode;
valtype vch;
CScript::const_iterator pc = script->begin();
CScript::const_iterator pend = script->end();
uint256 prevoutHash;
CKey key;
// -- matching address is in scriptPubKey of previous tx output
while (pc < pend)
{
if (!script->GetOp(pc, opcode, vch))
break;
// -- opcode is the length of the following data, compressed public key is always 33
if (opcode == 33)
{
key.SetPubKey(vch);
key.SetCompressedPubKey(); // ensure key is compressed
CPubKey pubKey = key.GetPubKey();
if (!pubKey.IsValid()
|| !pubKey.IsCompressed())
{
printf("Public key is invalid %s.\n", ValueString(pubKey.Raw()).c_str());
continue;
};
prevoutHash = tx.vin[i].prevout.hash;
CTransaction txOfPrevOutput;
if (!txdb.ReadDiskTx(prevoutHash, txOfPrevOutput))
{
printf("Could not get transaction for hash: %s.\n", prevoutHash.ToString().c_str());
continue;
};
unsigned int nOut = tx.vin[i].prevout.n;
if (nOut >= txOfPrevOutput.vout.size())
{
printf("Output %u, not in transaction: %s.\n", nOut, prevoutHash.ToString().c_str());
continue;
};
CTxOut *txOut = &txOfPrevOutput.vout[nOut];
CTxDestination addressRet;
if (!ExtractDestination(txOut->scriptPubKey, addressRet))
{
printf("ExtractDestination failed: %s.\n", prevoutHash.ToString().c_str());
break;
};
CBitcoinAddress coinAddress(addressRet);
CKeyID hashKey;
if (!coinAddress.GetKeyID(hashKey))
{
printf("coinAddress.GetKeyID failed: %s.\n", coinAddress.ToString().c_str());
break;
};
int rv = SecureMsgInsertAddress(hashKey, pubKey, addrpkdb);
if (rv != 0)
{
if (rv == 4)
nDuplicates++;
break;
};
nPubkeys++;
break;
};
//printf("opcode %d, %s, value %s.\n", opcode, GetOpName(opcode), ValueString(vch).c_str());
};
nInputs++;
};
nTransactions++;
if (nTransactions % 10000 == 0) // for ScanChainForPublicKeys
{
printf("Scanning transaction no. %u.\n", nTransactions);
};
};
return true;
};
bool SecureMsgScanBlock(CBlock& block)
{
/*
scan block for public key addresses
called from ProcessMessage() in main where strCommand == "block"
*/
if (fDebugSmsg)
printf("SecureMsgScanBlock().\n");
uint32_t nTransactions = 0;
uint32_t nInputs = 0;
uint32_t nPubkeys = 0;
uint32_t nDuplicates = 0;
{
LOCK(cs_smsgDB);
CTxDB txdb("r");
SecMsgDB addrpkdb;
if (!addrpkdb.Open("cw")
|| !addrpkdb.TxnBegin())
return false;
ScanBlock(block, txdb, addrpkdb,
nTransactions, nInputs, nPubkeys, nDuplicates);
addrpkdb.TxnCommit();
}
if (fDebugSmsg)
printf("Found %u transactions, %u inputs, %u new public keys, %u duplicates.\n", nTransactions, nInputs, nPubkeys, nDuplicates);
return true;
};
bool ScanChainForPublicKeys(CBlockIndex* pindexStart)
{
printf("Scanning block chain for public keys.\n");
int64_t nStart = GetTimeMillis();
if (fDebugSmsg)
printf("From height %u.\n", pindexStart->nHeight);
// -- public keys are in txin.scriptSig
// matching addresses are in scriptPubKey of txin's referenced output
uint32_t nBlocks = 0;
uint32_t nTransactions = 0;
uint32_t nInputs = 0;
uint32_t nPubkeys = 0;
uint32_t nDuplicates = 0;
{
LOCK(cs_smsgDB);
CTxDB txdb("r");
SecMsgDB addrpkdb;
if (!addrpkdb.Open("cw")
|| !addrpkdb.TxnBegin())
return false;
CBlockIndex* pindex = pindexStart;
while (pindex)
{
nBlocks++;
CBlock block;
block.ReadFromDisk(pindex, true);
ScanBlock(block, txdb, addrpkdb,
nTransactions, nInputs, nPubkeys, nDuplicates);
pindex = pindex->pnext;
};
addrpkdb.TxnCommit();
};
printf("Scanned %u blocks, %u transactions, %u inputs\n", nBlocks, nTransactions, nInputs);
printf("Found %u public keys, %u duplicates.\n", nPubkeys, nDuplicates);
printf("Took %"PRId64" ms\n", GetTimeMillis() - nStart);
return true;
};
bool SecureMsgScanBlockChain()
{
TRY_LOCK(cs_main, lockMain);
if (lockMain)
{
CBlockIndex *pindexScan = pindexGenesisBlock;
if (pindexScan == NULL)
{
printf("Error: pindexGenesisBlock not set.\n");
return false;
};
try { // -- in try to catch errors opening db,
if (!ScanChainForPublicKeys(pindexScan))
return false;
} catch (std::exception& e)
{
printf("ScanChainForPublicKeys() threw: %s.\n", e.what());
return false;
};
} else
{
printf("ScanChainForPublicKeys() Could not lock main.\n");
return false;
};
return true;
};
bool SecureMsgScanBuckets()
{
if (fDebugSmsg)
printf("SecureMsgScanBuckets()\n");
if (!fSecMsgEnabled
|| pwalletMain->IsLocked())
return false;
int64_t mStart = GetTimeMillis();
int64_t now = GetTime();
uint32_t nFiles = 0;
uint32_t nMessages = 0;
uint32_t nFoundMessages = 0;
fs::path pathSmsgDir = GetDataDir() / "smsgStore";
fs::directory_iterator itend;
if (!fs::exists(pathSmsgDir)
|| !fs::is_directory(pathSmsgDir))
{
printf("Message store directory does not exist.\n");
return 0; // not an error
};
SecureMessage smsg;
std::vector<unsigned char> vchData;
for (fs::directory_iterator itd(pathSmsgDir) ; itd != itend ; ++itd)
{
if (!fs::is_regular_file(itd->status()))
continue;
std::string fileType = (*itd).path().extension().string();
if (fileType.compare(".dat") != 0)
continue;
std::string fileName = (*itd).path().filename().string();
if (fDebugSmsg)
printf("Processing file: %s.\n", fileName.c_str());
nFiles++;
// TODO files must be split if > 2GB
// time_noFile.dat
size_t sep = fileName.find_first_of("_");
if (sep == std::string::npos)
continue;
std::string stime = fileName.substr(0, sep);
int64_t fileTime = boost::lexical_cast<int64_t>(stime);
if (fileTime < now - SMSG_RETENTION)
{
printf("Dropping file %s, expired.\n", fileName.c_str());
try {
fs::remove((*itd).path());
} catch (const fs::filesystem_error& ex)
{
printf("Error removing bucket file %s, %s.\n", fileName.c_str(), ex.what());
};
continue;
};
if (boost::algorithm::ends_with(fileName, "_wl.dat"))
{
if (fDebugSmsg)
printf("Skipping wallet locked file: %s.\n", fileName.c_str());
continue;
};
{
LOCK(cs_smsg);
FILE *fp;
errno = 0;
if (!(fp = fopen((*itd).path().string().c_str(), "rb")))
{
printf("Error opening file: %s\n", strerror(errno));
continue;
};
for (;;)
{
errno = 0;
if (fread(&smsg.hash[0], sizeof(unsigned char), SMSG_HDR_LEN, fp) != (size_t)SMSG_HDR_LEN)
{
if (errno != 0)
{
printf("fread header failed: %s\n", strerror(errno));
} else
{
//printf("End of file.\n");
};
break;
};
try {
vchData.resize(smsg.nPayload);
} catch (std::exception& e)
{
printf("SecureMsgWalletUnlocked(): Could not resize vchData, %u, %s\n", smsg.nPayload, e.what());
fclose(fp);
return 1;
};
if (fread(&vchData[0], sizeof(unsigned char), smsg.nPayload, fp) != smsg.nPayload)
{
printf("fread data failed: %s\n", strerror(errno));
break;
};
// -- don't report to gui,
int rv = SecureMsgScanMessage(&smsg.hash[0], &vchData[0], smsg.nPayload, false);
if (rv == 0)
{
nFoundMessages++;
} else
if (rv != 0)
{
// SecureMsgScanMessage failed
};
nMessages ++;
};
fclose(fp);
// -- remove wl file when scanned
try {
fs::remove((*itd).path());
} catch (const boost::filesystem::filesystem_error& ex)
{
printf("Error removing wl file %s - %s\n", fileName.c_str(), ex.what());
return 1;
};
};
};
printf("Processed %u files, scanned %u messages, received %u messages.\n", nFiles, nMessages, nFoundMessages);
printf("Took %"PRId64" ms\n", GetTimeMillis() - mStart);
return true;
}
int SecureMsgWalletUnlocked()
{
/*
When the wallet is unlocked scan messages received while wallet was locked.
*/
if (!fSecMsgEnabled)
return 0;
printf("SecureMsgWalletUnlocked()\n");
if (pwalletMain->IsLocked())
{
printf("Error: Wallet is locked.\n");
return 1;
};
int64_t now = GetTime();
uint32_t nFiles = 0;
uint32_t nMessages = 0;
uint32_t nFoundMessages = 0;
fs::path pathSmsgDir = GetDataDir() / "smsgStore";
fs::directory_iterator itend;
if (!fs::exists(pathSmsgDir)
|| !fs::is_directory(pathSmsgDir))
{
printf("Message store directory does not exist.\n");
return 0; // not an error
};
SecureMessage smsg;
std::vector<unsigned char> vchData;
for (fs::directory_iterator itd(pathSmsgDir) ; itd != itend ; ++itd)
{
if (!fs::is_regular_file(itd->status()))
continue;
std::string fileName = (*itd).path().filename().string();
if (!boost::algorithm::ends_with(fileName, "_wl.dat"))
continue;
if (fDebugSmsg)
printf("Processing file: %s.\n", fileName.c_str());
nFiles++;
// TODO files must be split if > 2GB
// time_noFile_wl.dat
size_t sep = fileName.find_first_of("_");
if (sep == std::string::npos)
continue;
std::string stime = fileName.substr(0, sep);
int64_t fileTime = boost::lexical_cast<int64_t>(stime);
if (fileTime < now - SMSG_RETENTION)
{
printf("Dropping wallet locked file %s, expired.\n", fileName.c_str());
try {
fs::remove((*itd).path());
} catch (const boost::filesystem::filesystem_error& ex)
{
printf("Error removing wl file %s - %s\n", fileName.c_str(), ex.what());
return 1;
};
continue;
};
{
LOCK(cs_smsg);
FILE *fp;
errno = 0;
if (!(fp = fopen((*itd).path().string().c_str(), "rb")))
{
printf("Error opening file: %s\n", strerror(errno));
continue;
};
for (;;)
{
errno = 0;
if (fread(&smsg.hash[0], sizeof(unsigned char), SMSG_HDR_LEN, fp) != (size_t)SMSG_HDR_LEN)
{
if (errno != 0)
{
printf("fread header failed: %s\n", strerror(errno));
} else
{
//printf("End of file.\n");
};
break;
};
try {
vchData.resize(smsg.nPayload);
} catch (std::exception& e)
{
printf("SecureMsgWalletUnlocked(): Could not resize vchData, %u, %s\n", smsg.nPayload, e.what());
fclose(fp);
return 1;
};
if (fread(&vchData[0], sizeof(unsigned char), smsg.nPayload, fp) != smsg.nPayload)
{
printf("fread data failed: %s\n", strerror(errno));
break;
};
// -- don't report to gui,
int rv = SecureMsgScanMessage(&smsg.hash[0], &vchData[0], smsg.nPayload, false);
if (rv == 0)
{
nFoundMessages++;
} else
if (rv != 0)
{
// SecureMsgScanMessage failed
};
nMessages ++;
};
fclose(fp);
// -- remove wl file when scanned
try {
fs::remove((*itd).path());
} catch (const boost::filesystem::filesystem_error& ex)
{
printf("Error removing wl file %s - %s\n", fileName.c_str(), ex.what());
return 1;
};
};
};
printf("Processed %u files, scanned %u messages, received %u messages.\n", nFiles, nMessages, nFoundMessages);
// -- notify gui
NotifySecMsgWalletUnlocked();
return 0;
};
int SecureMsgWalletKeyChanged(std::string sAddress, std::string sLabel, ChangeType mode)
{
if (!fSecMsgEnabled)
return 0;
printf("SecureMsgWalletKeyChanged()\n");
// TODO: default recv and recvAnon
{
LOCK(cs_smsg);
switch(mode)
{
case CT_NEW:
smsgAddresses.push_back(SecMsgAddress(sAddress, smsgOptions.fNewAddressRecv, smsgOptions.fNewAddressAnon));
break;
case CT_DELETED:
for (std::vector<SecMsgAddress>::iterator it = smsgAddresses.begin(); it != smsgAddresses.end(); ++it)
{
if (sAddress != it->sAddress)
continue;
smsgAddresses.erase(it);
break;
};
break;
default:
break;
}
}; // LOCK(cs_smsg);
return 0;
};
int SecureMsgScanMessage(unsigned char *pHeader, unsigned char *pPayload, uint32_t nPayload, bool reportToGui)
{
/*
Check if message belongs to this node.
If so add to inbox db.
if !reportToGui don't fire NotifySecMsgInboxChanged
- loads messages received when wallet locked in bulk.
returns
0 success,
1 error
2 no match
3 wallet is locked - message stored for scanning later.
*/
if (fDebugSmsg)
printf("SecureMsgScanMessage()\n");
if (pwalletMain->IsLocked())
{
if (fDebugSmsg)
printf("ScanMessage: Wallet is locked, storing message to scan later.\n");
int rv;
if ((rv = SecureMsgStoreUnscanned(pHeader, pPayload, nPayload)) != 0)
return 1;
return 3;
};
std::string addressTo;
MessageData msg; // placeholder
bool fOwnMessage = false;
for (std::vector<SecMsgAddress>::iterator it = smsgAddresses.begin(); it != smsgAddresses.end(); ++it)
{
if (!it->fReceiveEnabled)
continue;
CBitcoinAddress coinAddress(it->sAddress);
addressTo = coinAddress.ToString();
if (!it->fReceiveAnon)
{
// -- have to do full decrypt to see address from
if (SecureMsgDecrypt(false, addressTo, pHeader, pPayload, nPayload, msg) == 0)
{
if (fDebugSmsg)
printf("Decrypted message with %s.\n", addressTo.c_str());
if (msg.sFromAddress.compare("anon") != 0)
fOwnMessage = true;
break;
};
} else
{
if (SecureMsgDecrypt(true, addressTo, pHeader, pPayload, nPayload, msg) == 0)
{
if (fDebugSmsg)
printf("Decrypted message with %s.\n", addressTo.c_str());
fOwnMessage = true;
break;
};
}
};
if (fOwnMessage)
{
// -- save to inbox
SecureMessage* psmsg = (SecureMessage*) pHeader;
std::string sPrefix("im");
unsigned char chKey[18];
memcpy(&chKey[0], sPrefix.data(), 2);
memcpy(&chKey[2], &psmsg->timestamp, 8);
memcpy(&chKey[10], pPayload, 8);
SecMsgStored smsgInbox;
smsgInbox.timeReceived = GetTime();
smsgInbox.status = (SMSG_MASK_UNREAD) & 0xFF;
smsgInbox.sAddrTo = addressTo;
// -- data may not be contiguous
try {
smsgInbox.vchMessage.resize(SMSG_HDR_LEN + nPayload);
} catch (std::exception& e) {
printf("SecureMsgScanMessage(): Could not resize vchData, %u, %s\n", SMSG_HDR_LEN + nPayload, e.what());
return 1;
};
memcpy(&smsgInbox.vchMessage[0], pHeader, SMSG_HDR_LEN);
memcpy(&smsgInbox.vchMessage[SMSG_HDR_LEN], pPayload, nPayload);
{
LOCK(cs_smsgDB);
SecMsgDB dbInbox;
if (dbInbox.Open("cw"))
{
if (dbInbox.ExistsSmesg(chKey))
{
if (fDebugSmsg)
printf("Message already exists in inbox db.\n");
} else
{
dbInbox.WriteSmesg(chKey, smsgInbox);
if (reportToGui)
NotifySecMsgInboxChanged(smsgInbox);
printf("SecureMsg saved to inbox, received with %s.\n", addressTo.c_str());
};
};
}
};
return 0;
};
int SecureMsgGetLocalKey(CKeyID& ckid, CPubKey& cpkOut)
{
if (fDebugSmsg)
printf("SecureMsgGetLocalKey()\n");
CKey key;
if (!pwalletMain->GetKey(ckid, key))
return 4;
key.SetCompressedPubKey(); // make sure key is compressed
cpkOut = key.GetPubKey();
if (!cpkOut.IsValid()
|| !cpkOut.IsCompressed())
{
printf("Public key is invalid %s.\n", ValueString(cpkOut.Raw()).c_str());
return 1;
};
return 0;
};
int SecureMsgGetLocalPublicKey(std::string& strAddress, std::string& strPublicKey)
{
/* returns
0 success,
1 error
2 invalid address
3 address does not refer to a key
4 address not in wallet
*/
CBitcoinAddress address;
if (!address.SetString(strAddress))
return 2; // Invalid coin address
CKeyID keyID;
if (!address.GetKeyID(keyID))
return 3;
int rv;
CPubKey pubKey;
if ((rv = SecureMsgGetLocalKey(keyID, pubKey)) != 0)
return rv;
strPublicKey = EncodeBase58(pubKey.Raw());
return 0;
};
int SecureMsgGetStoredKey(CKeyID& ckid, CPubKey& cpkOut)
{
/* returns
0 success,
1 error
2 public key not in database
*/
if (fDebugSmsg)
printf("SecureMsgGetStoredKey().\n");
{
LOCK(cs_smsgDB);
SecMsgDB addrpkdb;
if (!addrpkdb.Open("r"))
return 1;
if (!addrpkdb.ReadPK(ckid, cpkOut))
{
//printf("addrpkdb.Read failed: %s.\n", coinAddress.ToString().c_str());
return 2;
};
}
return 0;
};
int SecureMsgAddAddress(std::string& address, std::string& publicKey)
{
/*
Add address and matching public key to the database
address and publicKey are in base58
returns
0 success
1 error
2 publicKey is invalid
3 publicKey != address
4 address is already in db
5 address is invalid
*/
CBitcoinAddress coinAddress(address);
if (!coinAddress.IsValid())
{
printf("Address is not valid: %s.\n", address.c_str());
return 5;
};
CKeyID hashKey;
if (!coinAddress.GetKeyID(hashKey))
{
printf("coinAddress.GetKeyID failed: %s.\n", coinAddress.ToString().c_str());
return 5;
};
std::vector<unsigned char> vchTest;
DecodeBase58(publicKey, vchTest);
CPubKey pubKey(vchTest);
// -- check that public key matches address hash
CKey keyT;
if (!keyT.SetPubKey(pubKey))
{
printf("SetPubKey failed.\n");
return 2;
};
keyT.SetCompressedPubKey();
CPubKey pubKeyT = keyT.GetPubKey();
CBitcoinAddress addressT(address);
if (addressT.ToString().compare(address) != 0)
{
printf("Public key does not hash to address, addressT %s.\n", addressT.ToString().c_str());
return 3;
};
return SecureMsgInsertAddress(hashKey, pubKey);
};
int SecureMsgRetrieve(SecMsgToken &token, std::vector<unsigned char>& vchData)
{
if (fDebugSmsg)
printf("SecureMsgRetrieve() %"PRId64".\n", token.timestamp);
// -- has cs_smsg lock from SecureMsgReceiveData
fs::path pathSmsgDir = GetDataDir() / "smsgStore";
//printf("token.offset %"PRId64".\n", token.offset); // DEBUG
int64_t bucket = token.timestamp - (token.timestamp % SMSG_BUCKET_LEN);
std::string fileName = boost::lexical_cast<std::string>(bucket) + "_01.dat";
fs::path fullpath = pathSmsgDir / fileName;
//printf("bucket %"PRId64".\n", bucket);
//printf("bucket lld %lld.\n", bucket);
//printf("fileName %s.\n", fileName.c_str());
FILE *fp;
errno = 0;
if (!(fp = fopen(fullpath.string().c_str(), "rb")))
{
printf("Error opening file: %s\nPath %s\n", strerror(errno), fullpath.string().c_str());
return 1;
};
errno = 0;
if (fseek(fp, token.offset, SEEK_SET) != 0)
{
printf("fseek, strerror: %s.\n", strerror(errno));
fclose(fp);
return 1;
};
SecureMessage smsg;
errno = 0;
if (fread(&smsg.hash[0], sizeof(unsigned char), SMSG_HDR_LEN, fp) != (size_t)SMSG_HDR_LEN)
{
printf("fread header failed: %s\n", strerror(errno));
fclose(fp);
return 1;
};
try {
vchData.resize(SMSG_HDR_LEN + smsg.nPayload);
} catch (std::exception& e) {
printf("SecureMsgRetrieve(): Could not resize vchData, %u, %s\n", SMSG_HDR_LEN + smsg.nPayload, e.what());
return 1;
};
memcpy(&vchData[0], &smsg.hash[0], SMSG_HDR_LEN);
errno = 0;
if (fread(&vchData[SMSG_HDR_LEN], sizeof(unsigned char), smsg.nPayload, fp) != smsg.nPayload)
{
printf("fread data failed: %s. Wanted %u bytes.\n", strerror(errno), smsg.nPayload);
fclose(fp);
return 1;
};
fclose(fp);
return 0;
};
int SecureMsgReceive(CNode* pfrom, std::vector<unsigned char>& vchData)
{
if (fDebugSmsg)
printf("SecureMsgReceive().\n");
if (vchData.size() < 12) // nBunch4 + timestamp8
{
printf("Error: not enough data.\n");
return 1;
};
uint32_t nBunch;
int64_t bktTime;
memcpy(&nBunch, &vchData[0], 4);
memcpy(&bktTime, &vchData[4], 8);
// -- check bktTime ()
// bucket may not exist yet - will be created when messages are added
int64_t now = GetTime();
if (bktTime > now + SMSG_TIME_LEEWAY)
{
if (fDebugSmsg)
printf("bktTime > now.\n");
// misbehave?
return 1;
} else
if (bktTime < now - SMSG_RETENTION)
{
if (fDebugSmsg)
printf("bktTime < now - SMSG_RETENTION.\n");
// misbehave?
return 1;
};
std::map<int64_t, SecMsgBucket>::iterator itb;
if (nBunch == 0 || nBunch > 500)
{
printf("Error: Invalid no. messages received in bunch %u, for bucket %"PRId64".\n", nBunch, bktTime);
pfrom->Misbehaving(1);
// -- release lock on bucket if it exists
itb = smsgBuckets.find(bktTime);
if (itb != smsgBuckets.end())
itb->second.nLockCount = 0;
return 1;
};
uint32_t n = 12;
for (uint32_t i = 0; i < nBunch; ++i)
{
if (vchData.size() - n < SMSG_HDR_LEN)
{
printf("Error: not enough data sent, n = %u.\n", n);
break;
};
SecureMessage* psmsg = (SecureMessage*) &vchData[n];
int rv;
if ((rv = SecureMsgValidate(&vchData[n], &vchData[n + SMSG_HDR_LEN], psmsg->nPayload)) != 0)
{
// message dropped
if (rv == 2) // invalid proof of work
{
pfrom->Misbehaving(10);
} else
{
pfrom->Misbehaving(1);
};
continue;
};
// -- store message, but don't hash bucket
if (SecureMsgStore(&vchData[n], &vchData[n + SMSG_HDR_LEN], psmsg->nPayload, false) != 0)
{
// message dropped
break; // continue?
};
if (SecureMsgScanMessage(&vchData[n], &vchData[n + SMSG_HDR_LEN], psmsg->nPayload, true) != 0)
{
// message recipient is not this node (or failed)
};
n += SMSG_HDR_LEN + psmsg->nPayload;
};
// -- if messages have been added, bucket must exist now
itb = smsgBuckets.find(bktTime);
if (itb == smsgBuckets.end())
{
if (fDebugSmsg)
printf("Don't have bucket %"PRId64".\n", bktTime);
return 1;
};
itb->second.nLockCount = 0; // this node has received data from peer, release lock
itb->second.nLockPeerId = 0;
itb->second.hashBucket();
return 0;
};
int SecureMsgStoreUnscanned(unsigned char *pHeader, unsigned char *pPayload, uint32_t nPayload)
{
/*
When the wallet is locked a copy of each received message is stored to be scanned later if wallet is unlocked
*/
if (fDebugSmsg)
printf("SecureMsgStoreUnscanned()\n");
if (!pHeader
|| !pPayload)
{
printf("Error: null pointer to header or payload.\n");
return 1;
};
SecureMessage* psmsg = (SecureMessage*) pHeader;
fs::path pathSmsgDir;
try {
pathSmsgDir = GetDataDir() / "smsgStore";
fs::create_directory(pathSmsgDir);
} catch (const boost::filesystem::filesystem_error& ex)
{
printf("Error: Failed to create directory %s - %s\n", pathSmsgDir.string().c_str(), ex.what());
return 1;
};
int64_t now = GetTime();
if (psmsg->timestamp > now + SMSG_TIME_LEEWAY)
{
printf("Message > now.\n");
return 1;
} else
if (psmsg->timestamp < now - SMSG_RETENTION)
{
printf("Message < SMSG_RETENTION.\n");
return 1;
};
int64_t bucket = psmsg->timestamp - (psmsg->timestamp % SMSG_BUCKET_LEN);
std::string fileName = boost::lexical_cast<std::string>(bucket) + "_01_wl.dat";
fs::path fullpath = pathSmsgDir / fileName;
FILE *fp;
errno = 0;
if (!(fp = fopen(fullpath.string().c_str(), "ab")))
{
printf("Error opening file: %s\n", strerror(errno));
return 1;
};
if (fwrite(pHeader, sizeof(unsigned char), SMSG_HDR_LEN, fp) != (size_t)SMSG_HDR_LEN
|| fwrite(pPayload, sizeof(unsigned char), nPayload, fp) != nPayload)
{
printf("fwrite failed: %s\n", strerror(errno));
fclose(fp);
return 1;
};
fclose(fp);
return 0;
};
int SecureMsgStore(unsigned char *pHeader, unsigned char *pPayload, uint32_t nPayload, bool fUpdateBucket)
{
if (fDebugSmsg)
printf("SecureMsgStore()\n");
if (!pHeader
|| !pPayload)
{
printf("Error: null pointer to header or payload.\n");
return 1;
};
SecureMessage* psmsg = (SecureMessage*) pHeader;
long int ofs;
fs::path pathSmsgDir;
try {
pathSmsgDir = GetDataDir() / "smsgStore";
fs::create_directory(pathSmsgDir);
} catch (const boost::filesystem::filesystem_error& ex)
{
printf("Error: Failed to create directory %s - %s\n", pathSmsgDir.string().c_str(), ex.what());
return 1;
};
int64_t now = GetTime();
if (psmsg->timestamp > now + SMSG_TIME_LEEWAY)
{
printf("Message > now.\n");
return 1;
} else
if (psmsg->timestamp < now - SMSG_RETENTION)
{
printf("Message < SMSG_RETENTION.\n");
return 1;
};
int64_t bucket = psmsg->timestamp - (psmsg->timestamp % SMSG_BUCKET_LEN);
{
// -- must lock cs_smsg before calling
//LOCK(cs_smsg);
SecMsgToken token(psmsg->timestamp, pPayload, nPayload, 0);
std::set<SecMsgToken>& tokenSet = smsgBuckets[bucket].setTokens;
std::set<SecMsgToken>::iterator it;
it = tokenSet.find(token);
if (it != tokenSet.end())
{
printf("Already have message.\n");
if (fDebugSmsg)
{
printf("nPayload: %u\n", nPayload);
printf("bucket: %"PRId64"\n", bucket);
printf("message ts: %"PRId64, token.timestamp);
std::vector<unsigned char> vchShow;
vchShow.resize(8);
memcpy(&vchShow[0], token.sample, 8);
printf(" sample %s\n", ValueString(vchShow).c_str());
/*
printf("\nmessages in bucket:\n");
for (it = tokenSet.begin(); it != tokenSet.end(); ++it)
{
printf("message ts: %"PRId64, (*it).timestamp);
vchShow.resize(8);
memcpy(&vchShow[0], (*it).sample, 8);
printf(" sample %s\n", ValueString(vchShow).c_str());
};
*/
};
return 1;
};
std::string fileName = boost::lexical_cast<std::string>(bucket) + "_01.dat";
fs::path fullpath = pathSmsgDir / fileName;
FILE *fp;
errno = 0;
if (!(fp = fopen(fullpath.string().c_str(), "ab")))
{
printf("Error opening file: %s\n", strerror(errno));
return 1;
};
// -- on windows ftell will always return 0 after fopen(ab), call fseek to set.
errno = 0;
if (fseek(fp, 0, SEEK_END) != 0)
{
printf("Error fseek failed: %s\n", strerror(errno));
return 1;
};
ofs = ftell(fp);
if (fwrite(pHeader, sizeof(unsigned char), SMSG_HDR_LEN, fp) != (size_t)SMSG_HDR_LEN
|| fwrite(pPayload, sizeof(unsigned char), nPayload, fp) != nPayload)
{
printf("fwrite failed: %s\n", strerror(errno));
fclose(fp);
return 1;
};
fclose(fp);
token.offset = ofs;
//printf("token.offset: %"PRId64"\n", token.offset); // DEBUG
tokenSet.insert(token);
if (fUpdateBucket)
smsgBuckets[bucket].hashBucket();
};
//if (fDebugSmsg)
printf("SecureMsg added to bucket %"PRId64".\n", bucket);
return 0;
};
int SecureMsgStore(SecureMessage& smsg, bool fUpdateBucket)
{
return SecureMsgStore(&smsg.hash[0], smsg.pPayload, smsg.nPayload, fUpdateBucket);
};
int SecureMsgValidate(unsigned char *pHeader, unsigned char *pPayload, uint32_t nPayload)
{
/*
returns
0 success
1 error
2 invalid hash
3 checksum mismatch
4 invalid version
5 payload is too large
*/
SecureMessage* psmsg = (SecureMessage*) pHeader;
if (psmsg->version[0] != 1)
return 4;
if (nPayload > SMSG_MAX_MSG_WORST)
return 5;
unsigned char civ[32];
unsigned char sha256Hash[32];
int rv = 2; // invalid
uint32_t nonse;
memcpy(&nonse, &psmsg->nonse[0], 4);
if (fDebugSmsg)
printf("SecureMsgValidate() nonse %u.\n", nonse);
for (int i = 0; i < 32; i+=4)
memcpy(civ+i, &nonse, 4);
HMAC_CTX ctx;
HMAC_CTX_init(&ctx);
unsigned int nBytes;
if (!HMAC_Init_ex(&ctx, &civ[0], 32, EVP_sha256(), NULL)
|| !HMAC_Update(&ctx, (unsigned char*) pHeader+4, SMSG_HDR_LEN-4)
|| !HMAC_Update(&ctx, (unsigned char*) pPayload, nPayload)
|| !HMAC_Update(&ctx, pPayload, nPayload)
|| !HMAC_Final(&ctx, sha256Hash, &nBytes)
|| nBytes != 32)
{
if (fDebugSmsg)
printf("HMAC error.\n");
rv = 1; // error
} else
{
if (sha256Hash[31] == 0
&& sha256Hash[30] == 0
&& (~(sha256Hash[29]) & ((1<<0) || (1<<1) || (1<<2)) ))
{
if (fDebugSmsg)
printf("Hash Valid.\n");
rv = 0; // smsg is valid
};
if (memcmp(psmsg->hash, sha256Hash, 4) != 0)
{
if (fDebugSmsg)
printf("Checksum mismatch.\n");
rv = 3; // checksum mismatch
}
}
HMAC_CTX_cleanup(&ctx);
return rv;
};
int SecureMsgSetHash(unsigned char *pHeader, unsigned char *pPayload, uint32_t nPayload)
{
/* proof of work and checksum
May run in a thread, if shutdown detected, return.
returns:
0 success
1 error
2 stopped due to node shutdown
*/
SecureMessage* psmsg = (SecureMessage*) pHeader;
int64_t nStart = GetTimeMillis();
unsigned char civ[32];
unsigned char sha256Hash[32];
//std::vector<unsigned char> vchHash;
//vchHash.resize(32);
bool found = false;
HMAC_CTX ctx;
HMAC_CTX_init(&ctx);
uint32_t nonse = 0;
//CBigNum bnTarget(2);
//bnTarget = bnTarget.pow(256 - 40);
// -- break for HMAC_CTX_cleanup
for (;;)
{
if (!fSecMsgEnabled)
break;
//psmsg->timestamp = GetTime();
//memcpy(&psmsg->timestamp, &now, 8);
memcpy(&psmsg->nonse[0], &nonse, 4);
for (int i = 0; i < 32; i+=4)
memcpy(civ+i, &nonse, 4);
unsigned int nBytes;
if (!HMAC_Init_ex(&ctx, &civ[0], 32, EVP_sha256(), NULL)
|| !HMAC_Update(&ctx, (unsigned char*) pHeader+4, SMSG_HDR_LEN-4)
|| !HMAC_Update(&ctx, (unsigned char*) pPayload, nPayload)
|| !HMAC_Update(&ctx, pPayload, nPayload)
|| !HMAC_Final(&ctx, sha256Hash, &nBytes)
//|| !HMAC_Final(&ctx, &vchHash[0], &nBytes)
|| nBytes != 32)
break;
/*
if (CBigNum(vchHash) <= bnTarget)
{
found = true;
if (fDebugSmsg)
printf("Match %u\n", nonse);
break;
};
*/
if (sha256Hash[31] == 0
&& sha256Hash[30] == 0
&& (~(sha256Hash[29]) & ((1<<0) || (1<<1) || (1<<2)) ))
// && sha256Hash[29] == 0)
{
found = true;
//if (fDebugSmsg)
// printf("Match %u\n", nonse);
break;
}
//if (nonse >= UINT32_MAX)
if (nonse >= 4294967295U)
{
if (fDebugSmsg)
printf("No match %u\n", nonse);
break;
//return 1;
}
nonse++;
};
HMAC_CTX_cleanup(&ctx);
if (!fSecMsgEnabled)
{
if (fDebugSmsg)
printf("SecureMsgSetHash() stopped, shutdown detected.\n");
return 2;
};
if (!found)
{
if (fDebugSmsg)
printf("SecureMsgSetHash() failed, took %"PRId64" ms, nonse %u\n", GetTimeMillis() - nStart, nonse);
return 1;
};
memcpy(psmsg->hash, sha256Hash, 4);
//memcpy(psmsg->hash, &vchHash[0], 4);
if (fDebugSmsg)
printf("SecureMsgSetHash() took %"PRId64" ms, nonse %u\n", GetTimeMillis() - nStart, nonse);
return 0;
};
int SecureMsgEncrypt(SecureMessage& smsg, std::string& addressFrom, std::string& addressTo, std::string& message)
{
/* Create a secure message
Using similar method to bitmessage.
If bitmessage is secure this should be too.
https://bitmessage.org/wiki/Encryption
Some differences:
bitmessage seems to use curve sect283r1
*coin addresses use secp256k1
returns
2 message is too long.
3 addressFrom is invalid.
4 addressTo is invalid.
5 Could not get public key for addressTo.
6 ECDH_compute_key failed
7 Could not get private key for addressFrom.
8 Could not allocate memory.
9 Could not compress message data.
10 Could not generate MAC.
11 Encrypt failed.
*/
if (fDebugSmsg)
printf("SecureMsgEncrypt(%s, %s, ...)\n", addressFrom.c_str(), addressTo.c_str());
if (message.size() > SMSG_MAX_MSG_BYTES)
{
printf("Message is too long, %"PRIszu".\n", message.size());
return 2;
};
smsg.version[0] = 1;
smsg.version[1] = 1;
smsg.timestamp = GetTime();
bool fSendAnonymous;
CBitcoinAddress coinAddrFrom;
CKeyID ckidFrom;
CKey keyFrom;
if (addressFrom.compare("anon") == 0)
{
fSendAnonymous = true;
} else
{
fSendAnonymous = false;
if (!coinAddrFrom.SetString(addressFrom))
{
printf("addressFrom is not valid.\n");
return 3;
};
if (!coinAddrFrom.GetKeyID(ckidFrom))
{
printf("coinAddrFrom.GetKeyID failed: %s.\n", coinAddrFrom.ToString().c_str());
return 3;
};
};
CBitcoinAddress coinAddrDest;
CKeyID ckidDest;
if (!coinAddrDest.SetString(addressTo))
{
printf("addressTo is not valid.\n");
return 4;
};
if (!coinAddrDest.GetKeyID(ckidDest))
{
printf("coinAddrDest.GetKeyID failed: %s.\n", coinAddrDest.ToString().c_str());
return 4;
};
// -- public key K is the destination address
CPubKey cpkDestK;
if (SecureMsgGetStoredKey(ckidDest, cpkDestK) != 0
&& SecureMsgGetLocalKey(ckidDest, cpkDestK) != 0) // maybe it's a local key (outbox?)
{
printf("Could not get public key for destination address.\n");
return 5;
};
// -- Generate 16 random bytes as IV.
RandAddSeedPerfmon();
RAND_bytes(&smsg.iv[0], 16);
// -- Generate a new random EC key pair with private key called r and public key called R.
CKey keyR;
keyR.MakeNewKey(true); // make compressed key
// -- Do an EC point multiply with public key K and private key r. This gives you public key P.
CKey keyK;
if (!keyK.SetPubKey(cpkDestK))
{
printf("Could not set pubkey for K: %s.\n", ValueString(cpkDestK.Raw()).c_str());
return 4; // address to is invalid
};
std::vector<unsigned char> vchP;
vchP.resize(32);
EC_KEY* pkeyr = keyR.GetECKey();
EC_KEY* pkeyK = keyK.GetECKey();
// always seems to be 32, worth checking?
//int field_size = EC_GROUP_get_degree(EC_KEY_get0_group(pkeyr));
//int secret_len = (field_size+7)/8;
//printf("secret_len %d.\n", secret_len);
// -- ECDH_compute_key returns the same P if fed compressed or uncompressed public keys
ECDH_set_method(pkeyr, ECDH_OpenSSL());
int lenP = ECDH_compute_key(&vchP[0], 32, EC_KEY_get0_public_key(pkeyK), pkeyr, NULL);
if (lenP != 32)
{
printf("ECDH_compute_key failed, lenP: %d.\n", lenP);
return 6;
};
CPubKey cpkR = keyR.GetPubKey();
if (!cpkR.IsValid()
|| !cpkR.IsCompressed())
{
printf("Could not get public key for key R.\n");
return 1;
};
memcpy(smsg.cpkR, &cpkR.Raw()[0], 33);
// -- Use public key P and calculate the SHA512 hash H.
// The first 32 bytes of H are called key_e and the last 32 bytes are called key_m.
std::vector<unsigned char> vchHashed;
vchHashed.resize(64); // 512
SHA512(&vchP[0], vchP.size(), (unsigned char*)&vchHashed[0]);
std::vector<unsigned char> key_e(&vchHashed[0], &vchHashed[0]+32);
std::vector<unsigned char> key_m(&vchHashed[32], &vchHashed[32]+32);
std::vector<unsigned char> vchPayload;
std::vector<unsigned char> vchCompressed;
unsigned char* pMsgData;
uint32_t lenMsgData;
uint32_t lenMsg = message.size();
if (lenMsg > 128)
{
// -- only compress if over 128 bytes
int worstCase = LZ4_compressBound(message.size());
try {
vchCompressed.resize(worstCase);
} catch (std::exception& e) {
printf("vchCompressed.resize %u threw: %s.\n", worstCase, e.what());
return 8;
};
int lenComp = LZ4_compress((char*)message.c_str(), (char*)&vchCompressed[0], lenMsg);
if (lenComp < 1)
{
printf("Could not compress message data.\n");
return 9;
};
pMsgData = &vchCompressed[0];
lenMsgData = lenComp;
} else
{
// -- no compression
pMsgData = (unsigned char*)message.c_str();
lenMsgData = lenMsg;
};
if (fSendAnonymous)
{
try {
vchPayload.resize(9 + lenMsgData);
} catch (std::exception& e) {
printf("vchPayload.resize %u threw: %s.\n", 9 + lenMsgData, e.what());
return 8;
};
memcpy(&vchPayload[9], pMsgData, lenMsgData);
vchPayload[0] = 250; // id as anonymous message
// -- next 4 bytes are unused - there to ensure encrypted payload always > 8 bytes
memcpy(&vchPayload[5], &lenMsg, 4); // length of uncompressed plain text
} else
{
try {
vchPayload.resize(SMSG_PL_HDR_LEN + lenMsgData);
} catch (std::exception& e) {
printf("vchPayload.resize %u threw: %s.\n", SMSG_PL_HDR_LEN + lenMsgData, e.what());
return 8;
};
memcpy(&vchPayload[SMSG_PL_HDR_LEN], pMsgData, lenMsgData);
// -- compact signature proves ownership of from address and allows the public key to be recovered, recipient can always reply.
if (!pwalletMain->GetKey(ckidFrom, keyFrom))
{
printf("Could not get private key for addressFrom.\n");
return 7;
};
// -- sign the plaintext
std::vector<unsigned char> vchSignature;
vchSignature.resize(65);
keyFrom.SignCompact(Hash(message.begin(), message.end()), vchSignature);
// -- Save some bytes by sending address raw
vchPayload[0] = (static_cast<CBitcoinAddress_B*>(&coinAddrFrom))->getVersion(); // vchPayload[0] = coinAddrDest.nVersion;
memcpy(&vchPayload[1], (static_cast<CKeyID_B*>(&ckidFrom))->GetPPN(), 20); // memcpy(&vchPayload[1], ckidDest.pn, 20);
memcpy(&vchPayload[1+20], &vchSignature[0], vchSignature.size());
memcpy(&vchPayload[1+20+65], &lenMsg, 4); // length of uncompressed plain text
};
SecMsgCrypter crypter;
crypter.SetKey(key_e, smsg.iv);
std::vector<unsigned char> vchCiphertext;
if (!crypter.Encrypt(&vchPayload[0], vchPayload.size(), vchCiphertext))
{
printf("crypter.Encrypt failed.\n");
return 11;
};
try {
smsg.pPayload = new unsigned char[vchCiphertext.size()];
} catch (std::exception& e)
{
printf("Could not allocate pPayload, exception: %s.\n", e.what());
return 8;
};
memcpy(smsg.pPayload, &vchCiphertext[0], vchCiphertext.size());
smsg.nPayload = vchCiphertext.size();
// -- Calculate a 32 byte MAC with HMACSHA256, using key_m as salt
// Message authentication code, (hash of timestamp + destination + payload)
bool fHmacOk = true;
unsigned int nBytes = 32;
HMAC_CTX ctx;
HMAC_CTX_init(&ctx);
if (!HMAC_Init_ex(&ctx, &key_m[0], 32, EVP_sha256(), NULL)
|| !HMAC_Update(&ctx, (unsigned char*) &smsg.timestamp, sizeof(smsg.timestamp))
|| !HMAC_Update(&ctx, &vchCiphertext[0], vchCiphertext.size())
|| !HMAC_Final(&ctx, smsg.mac, &nBytes)
|| nBytes != 32)
fHmacOk = false;
HMAC_CTX_cleanup(&ctx);
if (!fHmacOk)
{
printf("Could not generate MAC.\n");
return 10;
};
return 0;
};
int SecureMsgSend(std::string& addressFrom, std::string& addressTo, std::string& message, std::string& sError)
{
/* Encrypt secure message, and place it on the network
Make a copy of the message to sender's first address and place in send queue db
proof of work thread will pick up messages from send queue db
*/
if (fDebugSmsg)
printf("SecureMsgSend(%s, %s, ...)\n", addressFrom.c_str(), addressTo.c_str());
if (pwalletMain->IsLocked())
{
sError = "Wallet is locked, wallet must be unlocked to send and recieve messages.";
printf("Wallet is locked, wallet must be unlocked to send and recieve messages.\n");
return 1;
};
if (message.size() > SMSG_MAX_MSG_BYTES)
{
std::ostringstream oss;
oss << message.size() << " > " << SMSG_MAX_MSG_BYTES;
sError = "Message is too long, " + oss.str();
printf("Message is too long, %"PRIszu".\n", message.size());
return 1;
};
int rv;
SecureMessage smsg;
if ((rv = SecureMsgEncrypt(smsg, addressFrom, addressTo, message)) != 0)
{
printf("SecureMsgSend(), encrypt for recipient failed.\n");
switch(rv)
{
case 2: sError = "Message is too long."; break;
case 3: sError = "Invalid addressFrom."; break;
case 4: sError = "Invalid addressTo."; break;
case 5: sError = "Could not get public key for addressTo."; break;
case 6: sError = "ECDH_compute_key failed."; break;
case 7: sError = "Could not get private key for addressFrom."; break;
case 8: sError = "Could not allocate memory."; break;
case 9: sError = "Could not compress message data."; break;
case 10: sError = "Could not generate MAC."; break;
case 11: sError = "Encrypt failed."; break;
default: sError = "Unspecified Error."; break;
};
return rv;
};
// -- Place message in send queue, proof of work will happen in a thread.
std::string sPrefix("qm");
unsigned char chKey[18];
memcpy(&chKey[0], sPrefix.data(), 2);
memcpy(&chKey[2], &smsg.timestamp, 8);
memcpy(&chKey[10], &smsg.pPayload, 8);
SecMsgStored smsgSQ;
smsgSQ.timeReceived = GetTime();
smsgSQ.sAddrTo = addressTo;
try {
smsgSQ.vchMessage.resize(SMSG_HDR_LEN + smsg.nPayload);
} catch (std::exception& e) {
printf("smsgSQ.vchMessage.resize %u threw: %s.\n", SMSG_HDR_LEN + smsg.nPayload, e.what());
sError = "Could not allocate memory.";
return 8;
};
memcpy(&smsgSQ.vchMessage[0], &smsg.hash[0], SMSG_HDR_LEN);
memcpy(&smsgSQ.vchMessage[SMSG_HDR_LEN], smsg.pPayload, smsg.nPayload);
{
LOCK(cs_smsgDB);
SecMsgDB dbSendQueue;
if (dbSendQueue.Open("cw"))
{
dbSendQueue.WriteSmesg(chKey, smsgSQ);
//NotifySecMsgSendQueueChanged(smsgOutbox);
};
}
// TODO: only update outbox when proof of work thread is done.
// -- for outbox create a copy encrypted for owned address
// if the wallet is encrypted private key needed to decrypt will be unavailable
if (fDebugSmsg)
printf("Encrypting message for outbox.\n");
std::string addressOutbox = "None";
CBitcoinAddress coinAddrOutbox;
BOOST_FOREACH(const PAIRTYPE(CTxDestination, std::string)& entry, pwalletMain->mapAddressBook)
{
// -- get first owned address
if (!IsMine(*pwalletMain, entry.first))
continue;
const CBitcoinAddress& address = entry.first;
addressOutbox = address.ToString();
if (!coinAddrOutbox.SetString(addressOutbox)) // test valid
continue;
break;
};
if (addressOutbox == "None")
{
printf("Warning: SecureMsgSend() could not find an address to encrypt outbox message with.\n");
} else
{
if (fDebugSmsg)
printf("Encrypting a copy for outbox, using address %s\n", addressOutbox.c_str());
SecureMessage smsgForOutbox;
if ((rv = SecureMsgEncrypt(smsgForOutbox, addressFrom, addressOutbox, message)) != 0)
{
printf("SecureMsgSend(), encrypt for outbox failed, %d.\n", rv);
} else
{
// -- save sent message to db
std::string sPrefix("nm");
unsigned char chKey[18];
memcpy(&chKey[0], sPrefix.data(), 2);
memcpy(&chKey[2], &smsgForOutbox.timestamp, 8);
memcpy(&chKey[10], &smsgForOutbox.pPayload, 8); // sample
SecMsgStored smsgOutbox;
smsgOutbox.timeReceived = GetTime();
smsgOutbox.sAddrTo = addressTo;
smsgOutbox.sAddrOutbox = addressOutbox;
try {
smsgOutbox.vchMessage.resize(SMSG_HDR_LEN + smsgForOutbox.nPayload);
} catch (std::exception& e) {
printf("smsgOutbox.vchMessage.resize %u threw: %s.\n", SMSG_HDR_LEN + smsgForOutbox.nPayload, e.what());
sError = "Could not allocate memory.";
return 8;
};
memcpy(&smsgOutbox.vchMessage[0], &smsgForOutbox.hash[0], SMSG_HDR_LEN);
memcpy(&smsgOutbox.vchMessage[SMSG_HDR_LEN], smsgForOutbox.pPayload, smsgForOutbox.nPayload);
{
LOCK(cs_smsgDB);
SecMsgDB dbSent;
if (dbSent.Open("cw"))
{
dbSent.WriteSmesg(chKey, smsgOutbox);
NotifySecMsgOutboxChanged(smsgOutbox);
};
}
};
};
if (fDebugSmsg)
printf("Secure message queued for sending to %s.\n", addressTo.c_str());
return 0;
};
int SecureMsgDecrypt(bool fTestOnly, std::string& address, unsigned char *pHeader, unsigned char *pPayload, uint32_t nPayload, MessageData& msg)
{
/* Decrypt secure message
address is the owned address to decrypt with.
validate first in SecureMsgValidate
returns
1 Error
2 Unknown version number
3 Decrypt address is not valid.
8 Could not allocate memory
*/
if (fDebugSmsg)
printf("SecureMsgDecrypt(), using %s, testonly %d.\n", address.c_str(), fTestOnly);
if (!pHeader
|| !pPayload)
{
printf("Error: null pointer to header or payload.\n");
return 1;
};
SecureMessage* psmsg = (SecureMessage*) pHeader;
if (psmsg->version[0] != 1)
{
printf("Unknown version number.\n");
return 2;
};
// -- Fetch private key k, used to decrypt
CBitcoinAddress coinAddrDest;
CKeyID ckidDest;
CKey keyDest;
if (!coinAddrDest.SetString(address))
{
printf("Address is not valid.\n");
return 3;
};
if (!coinAddrDest.GetKeyID(ckidDest))
{
printf("coinAddrDest.GetKeyID failed: %s.\n", coinAddrDest.ToString().c_str());
return 3;
};
if (!pwalletMain->GetKey(ckidDest, keyDest))
{
printf("Could not get private key for addressDest.\n");
return 3;
};
CKey keyR;
std::vector<unsigned char> vchR(psmsg->cpkR, psmsg->cpkR+33); // would be neater to override CPubKey() instead
CPubKey cpkR(vchR);
if (!cpkR.IsValid())
{
printf("Could not get public key for key R.\n");
return 1;
};
if (!keyR.SetPubKey(cpkR))
{
printf("Could not set pubkey for R: %s.\n", ValueString(cpkR.Raw()).c_str());
return 1;
};
cpkR = keyR.GetPubKey();
if (!cpkR.IsValid()
|| !cpkR.IsCompressed())
{
printf("Could not get compressed public key for key R.\n");
return 1;
};
// -- Do an EC point multiply with private key k and public key R. This gives you public key P.
std::vector<unsigned char> vchP;
vchP.resize(32);
EC_KEY* pkeyk = keyDest.GetECKey();
EC_KEY* pkeyR = keyR.GetECKey();
ECDH_set_method(pkeyk, ECDH_OpenSSL());
int lenPdec = ECDH_compute_key(&vchP[0], 32, EC_KEY_get0_public_key(pkeyR), pkeyk, NULL);
if (lenPdec != 32)
{
printf("ECDH_compute_key failed, lenPdec: %d.\n", lenPdec);
return 1;
};
// -- Use public key P to calculate the SHA512 hash H.
// The first 32 bytes of H are called key_e and the last 32 bytes are called key_m.
std::vector<unsigned char> vchHashedDec;
vchHashedDec.resize(64); // 512 bits
SHA512(&vchP[0], vchP.size(), (unsigned char*)&vchHashedDec[0]);
std::vector<unsigned char> key_e(&vchHashedDec[0], &vchHashedDec[0]+32);
std::vector<unsigned char> key_m(&vchHashedDec[32], &vchHashedDec[32]+32);
// -- Message authentication code, (hash of timestamp + destination + payload)
unsigned char MAC[32];
bool fHmacOk = true;
unsigned int nBytes = 32;
HMAC_CTX ctx;
HMAC_CTX_init(&ctx);
if (!HMAC_Init_ex(&ctx, &key_m[0], 32, EVP_sha256(), NULL)
|| !HMAC_Update(&ctx, (unsigned char*) &psmsg->timestamp, sizeof(psmsg->timestamp))
|| !HMAC_Update(&ctx, pPayload, nPayload)
|| !HMAC_Final(&ctx, MAC, &nBytes)
|| nBytes != 32)
fHmacOk = false;
HMAC_CTX_cleanup(&ctx);
if (!fHmacOk)
{
printf("Could not generate MAC.\n");
return 1;
};
if (memcmp(MAC, psmsg->mac, 32) != 0)
{
if (fDebugSmsg)
printf("MAC does not match.\n"); // expected if message is not to address on node
return 1;
};
if (fTestOnly)
return 0;
SecMsgCrypter crypter;
crypter.SetKey(key_e, psmsg->iv);
std::vector<unsigned char> vchPayload;
if (!crypter.Decrypt(pPayload, nPayload, vchPayload))
{
printf("Decrypt failed.\n");
return 1;
};
msg.timestamp = psmsg->timestamp;
uint32_t lenData;
uint32_t lenPlain;
unsigned char* pMsgData;
bool fFromAnonymous;
if ((uint32_t)vchPayload[0] == 250)
{
fFromAnonymous = true;
lenData = vchPayload.size() - (9);
memcpy(&lenPlain, &vchPayload[5], 4);
pMsgData = &vchPayload[9];
} else
{
fFromAnonymous = false;
lenData = vchPayload.size() - (SMSG_PL_HDR_LEN);
memcpy(&lenPlain, &vchPayload[1+20+65], 4);
pMsgData = &vchPayload[SMSG_PL_HDR_LEN];
};
try {
msg.vchMessage.resize(lenPlain + 1);
} catch (std::exception& e) {
printf("msg.vchMessage.resize %u threw: %s.\n", lenPlain + 1, e.what());
return 8;
};
if (lenPlain > 128)
{
// -- decompress
if (LZ4_decompress_safe((char*) pMsgData, (char*) &msg.vchMessage[0], lenData, lenPlain) != (int) lenPlain)
{
printf("Could not decompress message data.\n");
return 1;
};
} else
{
// -- plaintext
memcpy(&msg.vchMessage[0], pMsgData, lenPlain);
};
msg.vchMessage[lenPlain] = '\0';
if (fFromAnonymous)
{
// -- Anonymous sender
msg.sFromAddress = "anon";
} else
{
std::vector<unsigned char> vchUint160;
vchUint160.resize(20);
memcpy(&vchUint160[0], &vchPayload[1], 20);
uint160 ui160(vchUint160);
CKeyID ckidFrom(ui160);
CBitcoinAddress coinAddrFrom;
coinAddrFrom.Set(ckidFrom);
if (!coinAddrFrom.IsValid())
{
printf("From Addess is invalid.\n");
return 1;
};
std::vector<unsigned char> vchSig;
vchSig.resize(65);
memcpy(&vchSig[0], &vchPayload[1+20], 65);
CKey keyFrom;
keyFrom.SetCompactSignature(Hash(msg.vchMessage.begin(), msg.vchMessage.end()-1), vchSig);
CPubKey cpkFromSig = keyFrom.GetPubKey();
if (!cpkFromSig.IsValid())
{
printf("Signature validation failed.\n");
return 1;
};
// -- get address for the compressed public key
CBitcoinAddress coinAddrFromSig;
coinAddrFromSig.Set(cpkFromSig.GetID());
if (!(coinAddrFrom == coinAddrFromSig))
{
printf("Signature validation failed.\n");
return 1;
};
cpkFromSig = keyFrom.GetPubKey();
int rv = 5;
try {
rv = SecureMsgInsertAddress(ckidFrom, cpkFromSig);
} catch (std::exception& e) {
printf("SecureMsgInsertAddress(), exception: %s.\n", e.what());
//return 1;
};
switch(rv)
{
case 0:
printf("Sender public key added to db.\n");
break;
case 4:
printf("Sender public key already in db.\n");
break;
default:
printf("Error adding sender public key to db.\n");
break;
};
msg.sFromAddress = coinAddrFrom.ToString();
};
if (fDebugSmsg)
printf("Decrypted message for %s.\n", address.c_str());
return 0;
};
int SecureMsgDecrypt(bool fTestOnly, std::string& address, SecureMessage& smsg, MessageData& msg)
{
return SecureMsgDecrypt(fTestOnly, address, &smsg.hash[0], smsg.pPayload, smsg.nPayload, msg);
};
| [
"JBchain@users.noreply.github.com"
] | JBchain@users.noreply.github.com |
0f0d335bb4ef2ae2538e93bc79508edcdd4f4821 | 9dfbe44aa776f2da84ea7de1c9efc2ba063c73b4 | /Matrix2D.h | be8a0d9394875a9102ebbc65c2869134d5146c36 | [
"Apache-2.0"
] | permissive | mifortin/AgilePod | ca5921e229075df15c8ae70ffa72398911d8e25d | 4924fb41e47dd3a907b42b840918f0b4b36bdd3d | refs/heads/master | 2021-01-20T10:06:35.737225 | 2012-02-25T05:09:59 | 2012-02-25T05:09:59 | 744,949 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,119 | h | /*
Copyright 2011 Michael Fortin
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef MATRIX2D
#define MATRIX2D
#include "Coord2D.h"
#include "Angle.h"
//! Basic 2D matrix
class Matrix2D
{
public:
//! First row
Coord2D rows[2];
//! Initialize as rotation matrix
Matrix2D(const Angle &in_angle)
{
rows[0] = Coord2D(cosf(in_angle.radians()), -sinf(in_angle.radians()));
rows[1] = Coord2D(sinf(in_angle.radians()), cosf(in_angle.radians()));
}
//! Basic multiplication
Coord2D operator*(const Coord2D &in_c2d) const
{
return Coord2D(dot(rows[0], in_c2d), dot(rows[1], in_c2d));
}
};
#endif
| [
"michael.fortin@gmail.com"
] | michael.fortin@gmail.com |
7cf2ed7bb91da896c13ab4c0c530982746dd3694 | 3cab3eca8a34fc4e6b56ead5d033e9e6e791c33c | /day2/g.cpp | d0742f499370af24453f1cdfdf993c8b7052b0a0 | [] | no_license | AndrewMakar/inzva2019-expert | 1339eb7a64ed2d88059638c203bd53a6e5ea5f42 | e1b33a6fc7fbf3b315b92358cf89e282344ce55a | refs/heads/master | 2020-06-07T05:29:48.046511 | 2019-06-24T15:04:56 | 2019-06-24T15:04:56 | 192,936,799 | 5 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,733 | cpp | #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <memory>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
using namespace std;
typedef long long Int;
typedef pair<int,int> PII;
typedef vector<int> VInt;
#define FOR(i, a, b) for(i = a; i < b; i++)
#define RFOR(i, a, b) for(i = a - 1; i >= b; i--)
#define CLEAR(a, b) memset(a, b, sizeof(a))
#define SIZE(a) int((a).size())
#define ALL(a) (a).begin(),(a).end()
#define PB push_back
#define MP make_pair
int A[1 << 10];
Int gcd(Int a, Int b){ return a == 0 ? b : gcd(b % a, a); }
Int lcm(Int a, Int b){ return a*( b/gcd(a, b) ); }
int Lucky(int a, int b)
{
int res = 0;
int i;
FOR(i, 0, a)
{
res *= 10;
res += (b & (1 << (a - 1 - i))) ? 7 : 4;
}
return res;
}
int F(int a, Int b, int pos)
{
if(a < b || pos == -1)
return a/b;
return F(a, b, pos - 1) - F(a, lcm(b, A[pos]), pos - 1);
}
int SolveTest()
{
int cnt = 0;
int i, j, k;
FOR(i, 1, 10)
FOR(j, 0, 1 << i)
{
A[cnt] = Lucky(i, j);
FOR(k, 0, cnt)
if(A[cnt] % A[k] == 0)
break;
if(k == cnt)
++cnt;
}
int a, b;
scanf("%d%d", &a, &b);
int pos = 0;
while(A[pos] < 10000)
++pos;
set<int> Set;
FOR(i, pos, cnt)
{
FOR(j, 0, i)
if(A[i] % A[j] == 0)
break;
if(j < i)
continue;
for(j = A[i]; j <= b; j += A[i])
if(j >= a)
{
FOR(k, 0, pos)
if(j % A[k] == 0)
break;
if(k == pos)
Set.insert(j);
}
}
printf("%d\n", SIZE(Set) + (b - a + 1) - (F(b, 1, pos - 1) - F(a - 1, 1, pos - 1)));
return 0;
}
int main()
{
SolveTest();
return 0;
};
| [
"makar.a.r@gmail.com"
] | makar.a.r@gmail.com |
752fef16f5772a73451d9fe5736d64dda0faf6b2 | c69d4e212ec23964703a9e3f679da6f8bcfd308d | /C++/fhConstructor.cpp | 5f195e0c50c626d898822e318d45158b8c5372de | [] | no_license | AtulCoder01/Programming-Notes | 94740b32b19c257dca974fe8c377a4144774b461 | 66c30e765312a6c2216ad329fcf75f5d17a57848 | refs/heads/master | 2022-07-07T21:33:28.419544 | 2018-01-31T12:27:37 | 2018-01-31T12:27:37 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 485 | cpp | #include<iostream>
#include<fstream>
using namespace std;
int main()
{
char name[20];
float cost;
char name1[20];
float cost1;
/*ofstream fout;
fout.open("/root/Desktop/atul.txt");
cout<<"Enter item name :>";
cin>>name;
cout<<"Enter item cost :>";
cin>>cost;
fout<<name<<"\n";
fout<<cost<<"\n";
fout.close();*/
ifstream fin;
fin.open("/root/Desktop/atul.txt");
while(EOF){
fin>>name1;
fin>>cost1;
cout<<"\nItem name = "<<name1;
cout<<"\nItem cost = "<<cost1;}
fin.close();
return 0;
}
| [
"roboatul786@gmail.com"
] | roboatul786@gmail.com |
3b11c74d18a6d5dd0ac48047748e799b870c40b2 | debfc6e95ebf092effd970fc0afd08e685f81ab7 | /fdbserver/PaxosConfigDatabaseNode.actor.cpp | d8d4232dfe266627d6d9673712936d1aa94c8ea4 | [
"Apache-2.0"
] | permissive | CyberFlameGO/foundationdb | dbabe8ad962646cc7b5aa3ccb7d572975a44938c | 82603ff7645c7eabba320beb5d22ed6e36bd7f2a | refs/heads/master | 2023-06-29T06:06:56.282291 | 2021-07-28T01:57:22 | 2021-07-28T01:57:22 | 390,196,494 | 0 | 0 | Apache-2.0 | 2021-07-28T03:34:16 | 2021-07-28T03:12:29 | null | UTF-8 | C++ | false | false | 1,292 | cpp | /*
* PaxosConfigDatabaseNode.actor.cpp
*
* This source file is part of the FoundationDB open source project
*
* Copyright 2013-2018 Apple Inc. and the FoundationDB project authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "fdbserver/PaxosConfigDatabaseNode.h"
class PaxosConfigDatabaseNodeImpl {};
PaxosConfigDatabaseNode::PaxosConfigDatabaseNode(std::string const& folder) {
// TODO: Implement
ASSERT(false);
}
PaxosConfigDatabaseNode::~PaxosConfigDatabaseNode() = default;
Future<Void> PaxosConfigDatabaseNode::serve(ConfigTransactionInterface const& cti) {
// TODO: Implement
ASSERT(false);
return Void();
}
Future<Void> PaxosConfigDatabaseNode::serve(ConfigFollowerInterface const& cfi) {
// TODO: Implement
ASSERT(false);
return Void();
}
| [
"trevor.clinkenbeard@snowflake.com"
] | trevor.clinkenbeard@snowflake.com |
abb10e8cd2a50e9bc0b1dfc322737dbec283f6e8 | 9e0864a47932097f584cafb9606b1038d3d99fc5 | /cmake/include/irrlicht/ISceneCollisionManager.h | 963303127e9d055d91bb46d4d27c1095ca61a4a0 | [] | no_license | arzeo68/OOP_indie_studio | d7a83d6363a711fd6a27027cf8221d079f67b4a8 | 14ad93650d7fa09ac63ee0158f327b7996defe96 | refs/heads/master | 2022-12-11T22:25:29.843477 | 2020-09-04T15:16:22 | 2020-09-04T15:16:22 | 292,878,597 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,877 | h | // Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_SCENE_COLLISION_MANAGER_H_INCLUDED__
#define __I_SCENE_COLLISION_MANAGER_H_INCLUDED__
#include "IReferenceCounted.h"
#include "vector3d.h"
#include "triangle3d.h"
#include "position2d.h"
#include "line3d.h"
namespace irr
{
namespace scene
{
class ISceneNode;
class ICameraSceneNode;
class ITriangleSelector;
//! The Scene Collision Manager provides methods for performing collision tests and picking on scene nodes.
class ISceneCollisionManager : public virtual IReferenceCounted
{
public:
//! Finds the nearest collision point of a line and lots of triangles, if there is one.
/** \param ray: Line with which collisions are tested.
\param selector: TriangleSelector containing the triangles. It
can be created for example using
ISceneManager::createTriangleSelector() or
ISceneManager::createTriangleOctreeSelector().
\param outCollisionPoint: If a collision is detected, this will
contain the position of the nearest collision to the line-start.
\param outTriangle: If a collision is detected, this will
contain the triangle with which the ray collided.
\param outNode: If a collision is detected, this will contain
the scene node associated with the triangle that was hit.
\return True if a collision was detected and false if not. */
virtual bool getCollisionPoint(const core::line3d <f32> &ray, ITriangleSelector *selector, core::vector3df &outCollisionPoint,
core::triangle3df &outTriangle, ISceneNode *&outNode
) = 0;
//! Collides a moving ellipsoid with a 3d world with gravity and returns the resulting new position of the ellipsoid.
/** This can be used for moving a character in a 3d world: The
character will slide at walls and is able to walk up stairs.
The method used how to calculate the collision result position
is based on the paper "Improved Collision detection and
Response" by Kasper Fauerby.
\param selector: TriangleSelector containing the triangles of
the world. It can be created for example using
ISceneManager::createTriangleSelector() or
ISceneManager::createTriangleOctreeSelector().
\param ellipsoidPosition: Position of the ellipsoid.
\param ellipsoidRadius: Radius of the ellipsoid.
\param ellipsoidDirectionAndSpeed: Direction and speed of the
movement of the ellipsoid.
\param triout: Optional parameter where the last triangle
causing a collision is stored, if there is a collision.
\param hitPosition: Return value for the position of the collision
\param outFalling: Is set to true if the ellipsoid is falling
down, caused by gravity.
\param outNode: the node with which the ellipoid collided (if any)
\param slidingSpeed: DOCUMENTATION NEEDED.
\param gravityDirectionAndSpeed: Direction and force of gravity.
\return New position of the ellipsoid. */
virtual core::vector3df getCollisionResultPosition(ITriangleSelector *selector, const core::vector3df &ellipsoidPosition,
const core::vector3df &ellipsoidRadius, const core::vector3df &ellipsoidDirectionAndSpeed, core::triangle3df &triout,
core::vector3df &hitPosition, bool &outFalling, ISceneNode *&outNode, f32 slidingSpeed = 0.0005f,
const core::vector3df &gravityDirectionAndSpeed = core::vector3df(0.0f, 0.0f, 0.0f)) = 0;
//! Returns a 3d ray which would go through the 2d screen coodinates.
/** \param pos: Screen coordinates in pixels.
\param camera: Camera from which the ray starts. If null, the
active camera is used.
\return Ray starting from the position of the camera and ending
at a length of the far value of the camera at a position which
would be behind the 2d screen coodinates. */
virtual core::line3d <f32> getRayFromScreenCoordinates(const core::position2d <s32> &pos, ICameraSceneNode *camera = 0) = 0;
//! Calculates 2d screen position from a 3d position.
/** \param pos: 3D position in world space to be transformed
into 2d.
\param camera: Camera to be used. If null, the currently active
camera is used.
\param useViewPort: Calculate screen coordinates relative to
the current view port. Please note that unless the driver does
not take care of the view port, it is usually best to get the
result in absolute screen coordinates (flag=false).
\return 2d screen coordinates which a object in the 3d world
would have if it would be rendered to the screen. If the 3d
position is behind the camera, it is set to (-1000,-1000). In
most cases you can ignore this fact, because if you use this
method for drawing a decorator over a 3d object, it will be
clipped by the screen borders. */
virtual core::position2d <s32> getScreenCoordinatesFrom3DPosition(const core::vector3df &pos, ICameraSceneNode *camera = 0,
bool useViewPort = false
) = 0;
//! Gets the scene node, which is currently visible under the given screencoordinates, viewed from the currently active camera.
/** The collision tests are done using a bounding box for each
scene node. You can limit the recursive search so just all children of the specified root are tested.
\param pos: Position in pixel screen coordinates, under which
the returned scene node will be.
\param idBitMask: Only scene nodes with an id with bits set
like in this mask will be tested. If the BitMask is 0, this
feature is disabled.
Please note that the default node id of -1 will match with
every bitmask != 0
\param bNoDebugObjects: Doesn't take debug objects into account
when true. These are scene nodes with IsDebugObject() = true.
\param root If different from 0, the search is limited to the children of this node.
\return Visible scene node under screen coordinates with
matching bits in its id. If there is no scene node under this
position, 0 is returned. */
virtual ISceneNode *getSceneNodeFromScreenCoordinatesBB(const core::position2d <s32> &pos, s32 idBitMask = 0,
bool bNoDebugObjects = false, ISceneNode *root = 0
) = 0;
//! Returns the nearest scene node which collides with a 3d ray and whose id matches a bitmask.
/** The collision tests are done using a bounding box for each
scene node. The recursive search can be limited be specifying a scene node.
\param ray Line with which collisions are tested.
\param idBitMask Only scene nodes with an id which matches at
least one of the bits contained in this mask will be tested.
However, if this parameter is 0, then all nodes are checked.
\param bNoDebugObjects: Doesn't take debug objects into account when true. These
are scene nodes with IsDebugObject() = true.
\param root If different from 0, the search is limited to the children of this node.
\return Scene node nearest to ray.start, which collides with
the ray and matches the idBitMask, if the mask is not null. If
no scene node is found, 0 is returned. */
virtual ISceneNode *getSceneNodeFromRayBB(const core::line3d <f32> &ray, s32 idBitMask = 0, bool bNoDebugObjects = false,
ISceneNode *root = 0
) = 0;
//! Get the scene node, which the given camera is looking at and whose id matches the bitmask.
/** A ray is simply casted from the position of the camera to
the view target position, and all scene nodes are tested
against this ray. The collision tests are done using a bounding
box for each scene node.
\param camera: Camera from which the ray is casted.
\param idBitMask: Only scene nodes with an id which matches at least one of the
bits contained in this mask will be tested. However, if this parameter is 0, then
all nodes are checked.
feature is disabled.
Please note that the default node id of -1 will match with
every bitmask != 0
\param bNoDebugObjects: Doesn't take debug objects into account
when true. These are scene nodes with IsDebugObject() = true.
\return Scene node nearest to the camera, which collides with
the ray and matches the idBitMask, if the mask is not null. If
no scene node is found, 0 is returned. */
virtual ISceneNode *getSceneNodeFromCameraBB(ICameraSceneNode *camera, s32 idBitMask = 0, bool bNoDebugObjects = false) = 0;
//! Perform a ray/box and ray/triangle collision check on a heirarchy of scene nodes.
/** This checks all scene nodes under the specified one, first by ray/bounding
box, and then by accurate ray/triangle collision, finding the nearest collision,
and the scene node containg it. It returns the node hit, and (via output
parameters) the position of the collision, and the triangle that was hit.
All scene nodes in the hierarchy tree under the specified node are checked. Only
nodes that are visible, with an ID that matches at least one bit in the supplied
bitmask, and which have a triangle selector are considered as candidates for being hit.
You do not have to build a meta triangle selector; the individual triangle selectors
of each candidate scene node are used automatically.
\param ray: Line with which collisions are tested.
\param outCollisionPoint: If a collision is detected, this will contain the
position of the nearest collision.
\param outTriangle: If a collision is detected, this will contain the triangle
with which the ray collided.
\param idBitMask: Only scene nodes with an id which matches at least one of the
bits contained in this mask will be tested. However, if this parameter is 0, then
all nodes are checked.
\param collisionRootNode: the scene node at which to begin checking. Only this
node and its children will be checked. If you want to check the entire scene,
pass 0, and the root scene node will be used (this is the default).
\param noDebugObjects: when true, debug objects are not considered viable targets.
Debug objects are scene nodes with IsDebugObject() = true.
\return Returns the scene node containing the hit triangle nearest to ray.start.
If no collision is detected, then 0 is returned. */
virtual ISceneNode *getSceneNodeAndCollisionPointFromRay(core::line3df ray, core::vector3df &outCollisionPoint,
core::triangle3df &outTriangle, s32 idBitMask = 0, ISceneNode *collisionRootNode = 0, bool noDebugObjects = false
) = 0;
};
} // end namespace scene
} // end namespace irr
#endif | [
"alexis.walter@epitech.eu"
] | alexis.walter@epitech.eu |
d61a8a9488cd86647fe37a6c74ccd60b6080d1c0 | 08b8cf38e1936e8cec27f84af0d3727321cec9c4 | /data/crawl/tar/old_hunk_319.cpp | 8f0f558f89e949445e90b6ebf4e54d3ca7f3e405 | [] | no_license | ccdxc/logSurvey | eaf28e9c2d6307140b17986d5c05106d1fd8e943 | 6b80226e1667c1e0760ab39160893ee19b0e9fb1 | refs/heads/master | 2022-01-07T21:31:55.446839 | 2018-04-21T14:12:43 | 2018-04-21T14:12:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 993 | cpp | #undef CURRENT_FILE_NAME
}
/* Fix the status of all directories whose statuses need fixing. */
void
apply_delayed_set_stat (void)
{
apply_nonancestor_delayed_set_stat ("");
}
/* Fix the statuses of all directories whose statuses need fixing, and
which are not ancestors of FILE_NAME. */
void
apply_nonancestor_delayed_set_stat (char const *file_name)
{
size_t file_name_len = strlen (file_name);
while (delayed_set_stat_head)
{
struct delayed_set_stat *data = delayed_set_stat_head;
if (data->file_name_len < file_name_len
&& file_name[data->file_name_len] == '/'
&& memcmp (file_name, data->file_name, data->file_name_len) == 0)
break;
delayed_set_stat_head = data->next;
set_stat (data->file_name, &data->stat_info,
data->invert_permissions, data->permstatus, DIRTYPE);
free (data);
}
}
void
fatal_exit (void)
{
apply_delayed_set_stat ();
error (TAREXIT_FAILURE, 0, _("Error is not recoverable: exiting now"));
abort ();
}
| [
"993273596@qq.com"
] | 993273596@qq.com |
576972999af00881d40f699f84ee0b4fbbb7e56e | 5ef7887a7aefbbf536047c59052f99d9039590e3 | /src/components/utils/test/posix_thread_test.cc | d597f036d04288ec532870a32b563e85ef319168 | [] | no_license | smartdevice475/sdl_core_v4.0_winceport | 8b2ce9118635bf33700f71c5a87ceed668db1b7f | 1cdc30551eb58b0e1e3b4de8c0a0c66f975cf534 | refs/heads/master | 2021-01-24T20:52:42.830355 | 2016-11-29T06:22:16 | 2016-11-29T06:22:16 | 73,656,016 | 1 | 2 | null | 2016-11-14T01:37:46 | 2016-11-14T01:37:46 | null | UTF-8 | C++ | false | false | 12,123 | cc | /*
* Copyright (c) 2015, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the Ford Motor Company nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "gtest/gtest.h"
#include "utils/lock.h"
#include "threads/thread.h"
namespace test {
namespace components {
namespace utils {
using namespace sync_primitives;
using namespace threads;
// TODO(AByzhynar): Change this to use Gtest class to create all variables for every TEST_F
// TODO(AByzhynar): Add multithreading tests
namespace {
const uint32_t MAX_SIZE = 20;
const size_t MyStackSize = 32768;
const char *threadName("test thread");
const std::string test_thread_name("THREAD");
sync_primitives::ConditionalVariable cond_var_;
sync_primitives::Lock test_mutex_;
};
// ThreadDelegate successor
class TestThreadDelegate : public threads::ThreadDelegate {
public:
TestThreadDelegate()
: check_value_(false) {
}
void threadMain() {
AutoLock test_lock(test_mutex_);
check_value_ = true;
cond_var_.NotifyOne();
}
bool check_value() const {
return check_value_;
}
private:
bool check_value_;
};
TEST(PosixThreadTest, CreateThread_ExpectThreadCreated) {
// Arrange
threads::Thread *thread = NULL;
TestThreadDelegate *threadDelegate = new TestThreadDelegate();
// Create thread
ASSERT_NO_THROW(thread = CreateThread(threadName, threadDelegate));
EXPECT_TRUE(thread != NULL);
EXPECT_EQ(thread, threadDelegate->thread());
EXPECT_EQ(thread->delegate(), threadDelegate);
DeleteThread(thread);
delete threadDelegate;
// Check Delegate Dtor worked successfully
EXPECT_EQ(NULL, thread->delegate());
}
TEST(PosixThreadTest, CheckCreatedThreadName_ExpectCorrectName) {
// Arrange
threads::Thread *thread = NULL;
threads::ThreadDelegate *threadDelegate = new TestThreadDelegate();
// Create thread
ASSERT_NO_THROW(thread = CreateThread(threadName, threadDelegate));
// Check thread was created with correct name
EXPECT_EQ(threadName, thread->name());
DeleteThread(thread);
delete threadDelegate;
EXPECT_EQ(NULL, thread->delegate());
}
TEST(PosixThreadTest, CheckCreatedThreadNameChangeToLongName_ExpectThreadNameReduced) {
// Arrange
threads::Thread *thread = NULL;
TestThreadDelegate *threadDelegate = new TestThreadDelegate();
AutoLock test_lock(test_mutex_);
// Create thread
ASSERT_NO_THROW(thread = CreateThread(threadName, threadDelegate));
thread->start(threads::ThreadOptions(threads::Thread::kMinStackSize));
// Rename started thread. Name will be cut to 15 symbols + '\0'
// This is the limit in current POSIX thread implementation
thread->SetNameForId(thread->thread_handle(),
std::string("new thread with changed name"));
// Name must be large enough to keep 16 symbols. Read previous comment
char name[MAX_SIZE];
int result = pthread_getname_np(thread->thread_handle(), name, sizeof(name));
if (!result)
EXPECT_EQ(std::string("new thread with"), std::string(name));
cond_var_.WaitFor(test_lock, 10000);
EXPECT_TRUE(threadDelegate->check_value());
DeleteThread(thread);
delete threadDelegate;
EXPECT_EQ(NULL, thread->delegate());
}
TEST(PosixThreadTest, StartCreatedThreadWithOptionsJoinableAndMyStackSize_ExpectMyStackSizeStackAndJoinableThreadStarted) {
// Arrange
threads::Thread *thread = NULL;
TestThreadDelegate *threadDelegate = new TestThreadDelegate();
AutoLock test_lock(test_mutex_);
// Create thread
ASSERT_NO_THROW(thread = CreateThread(threadName, threadDelegate));
// Start thread with following options (Stack size = 32768 & thread is joinable)
thread->start(threads::ThreadOptions(MyStackSize));
// Check thread is joinable
EXPECT_TRUE(thread->is_joinable());
// Check thread stack size is 32768
EXPECT_EQ(MyStackSize, thread->stack_size());
cond_var_.WaitFor(test_lock, 10000);
EXPECT_TRUE(threadDelegate->check_value());
DeleteThread(thread);
delete threadDelegate;
EXPECT_EQ(NULL, thread->delegate());
}
TEST(PosixThreadTest, StartCreatedThreadWithDefaultOptions_ExpectZeroStackAndJoinableThreadStarted) {
// Arrange
threads::Thread *thread = NULL;
TestThreadDelegate *threadDelegate = new TestThreadDelegate();
AutoLock test_lock(test_mutex_);
// Create thread
ASSERT_NO_THROW(thread = CreateThread(threadName, threadDelegate));
// Start thread with default options (Stack size = 0 & thread is joinable)
thread->start(threads::ThreadOptions());
// Check thread is joinable
EXPECT_TRUE(thread->is_joinable());
// Check thread stack size is minimum value. Stack can not be 0
EXPECT_EQ(Thread::kMinStackSize, thread->stack_size());
cond_var_.WaitFor(test_lock, 10000);
EXPECT_TRUE(threadDelegate->check_value());
DeleteThread(thread);
delete threadDelegate;
EXPECT_EQ(NULL, thread->delegate());
}
TEST(PosixThreadTest, StartThreadWithZeroStackAndDetached_ExpectMinimumStackAndDetachedThreadStarted) {
// Arrange
threads::Thread *thread = NULL;
TestThreadDelegate *threadDelegate = new TestThreadDelegate();
AutoLock test_lock(test_mutex_);
// Create thread
ASSERT_NO_THROW(thread = CreateThread(threadName, threadDelegate));
// Start thread with default options (Stack size = 0 & thread is detached)
thread->start(threads::ThreadOptions(0, false));
// Check thread is detached
EXPECT_FALSE(thread->is_joinable());
// Check thread stack size is 0
EXPECT_EQ(Thread::kMinStackSize, thread->stack_size());
cond_var_.WaitFor(test_lock, 10000);
EXPECT_TRUE(threadDelegate->check_value());
DeleteThread(thread);
delete threadDelegate;
EXPECT_EQ(NULL, thread->delegate());
}
TEST(PosixThreadTest, DISABLED_CheckCreatedThreadNameChangeToEmpty_ExpectThreadNameChangedToEmpty) {
// Arrange
threads::Thread *thread = NULL;
TestThreadDelegate *threadDelegate = new TestThreadDelegate();
AutoLock test_lock(test_mutex_);
// Create thread
ASSERT_NO_THROW(thread = CreateThread(threadName, threadDelegate));
thread->start(threads::ThreadOptions(threads::Thread::kMinStackSize));
// Rename started thread. Name will be cut to 15 symbols + '\0'
// This is the limit in current POSIX thread implementation
thread->SetNameForId(thread->thread_handle(), std::string(""));
// Name must be large enough to keep 16 symbols. Read previous comment
char name[MAX_SIZE];
int result = pthread_getname_np(thread->thread_handle(), name, sizeof(name));
if (!result) {
EXPECT_EQ(std::string(""), std::string(name));
}
cond_var_.WaitFor(test_lock, 10000);
EXPECT_TRUE(threadDelegate->check_value());
DeleteThread(thread);
delete threadDelegate;
EXPECT_EQ(NULL, thread->delegate());
}
TEST(PosixThreadTest, CheckCreatedThreadNameChangeToShortName_ExpectThreadNameChangedToShort) {
// Arrange
threads::Thread *thread = NULL;
TestThreadDelegate *threadDelegate = new TestThreadDelegate();
AutoLock test_lock(test_mutex_);
// Create thread
ASSERT_NO_THROW(thread = CreateThread(threadName, threadDelegate));
// Start created thread
thread->start(threads::ThreadOptions(threads::Thread::kMinStackSize));
// Rename started thread. Name will be cut to 15 symbols + '\0'
// This is the limit in current POSIX thread implementation
thread->SetNameForId(thread->thread_handle(), test_thread_name);
// Name must be large enough to keep 16 symbols. Read previous comment
char name[MAX_SIZE];
int result = pthread_getname_np(thread->thread_handle(), name, sizeof(name));
if (!result) {
EXPECT_EQ(test_thread_name, std::string(name));
}
cond_var_.WaitFor(test_lock, 10000);
EXPECT_TRUE(threadDelegate->check_value());
DeleteThread(thread);
delete threadDelegate;
EXPECT_EQ(NULL, thread->delegate());
}
TEST(PosixThreadTest, StartThread_ExpectThreadStarted) {
// Arrange
threads::Thread *thread = NULL;
TestThreadDelegate *threadDelegate = new TestThreadDelegate();
AutoLock test_lock(test_mutex_);
// Create thread
ASSERT_NO_THROW(thread = CreateThread(threadName, threadDelegate));
// Start created thread
EXPECT_TRUE(thread->start(threads::ThreadOptions(threads::Thread::kMinStackSize)));
cond_var_.WaitFor(test_lock, 10000);
EXPECT_TRUE(threadDelegate->check_value());
DeleteThread(thread);
delete threadDelegate;
EXPECT_EQ(NULL, thread->delegate());
}
TEST(PosixThreadTest, StartOneThreadTwice_ExpectTheSameThreadStartedTwice) {
// Arrange
PlatformThreadHandle thread1_id;
PlatformThreadHandle thread2_id;
threads::Thread *thread = NULL;
TestThreadDelegate *threadDelegate = new TestThreadDelegate();
AutoLock test_lock(test_mutex_);
// Create thread
ASSERT_NO_THROW(thread = CreateThread(threadName, threadDelegate));
// Start created thread
EXPECT_TRUE(thread->start(threads::ThreadOptions(threads::Thread::kMinStackSize)));
thread1_id = thread->CurrentId();
thread->stop();
// Try to start thread again
EXPECT_TRUE(thread->start(threads::ThreadOptions(threads::Thread::kMinStackSize)));
thread2_id = thread->CurrentId();
EXPECT_EQ(thread1_id, thread2_id);
cond_var_.WaitFor(test_lock, 10000);
EXPECT_TRUE(threadDelegate->check_value());
DeleteThread(thread);
delete threadDelegate;
EXPECT_EQ(NULL, thread->delegate());
}
TEST(PosixThreadTest, StartOneThreadAgainAfterRename_ExpectRenamedThreadStarted) {
// Arrange
PlatformThreadHandle thread1_id;
PlatformThreadHandle thread2_id;
threads::Thread *thread = NULL;
TestThreadDelegate *threadDelegate = new TestThreadDelegate();
AutoLock test_lock(test_mutex_);
// Create thread
ASSERT_NO_THROW(thread = CreateThread(threadName, threadDelegate));
// Start created thread
EXPECT_TRUE(thread->start(threads::ThreadOptions(threads::Thread::kMinStackSize)));
thread1_id = thread->CurrentId();
// Rename started thread. Name will be cut to 15 symbols + '\0'
// This is the limit in current POSIX thread implementation
thread->SetNameForId(thread->thread_handle(), test_thread_name);
// Name must be large enough to keep 16 symbols. Read previous comment
char name[MAX_SIZE];
int result = pthread_getname_np(thread->thread_handle(), name, sizeof(name));
if (!result)
EXPECT_EQ(test_thread_name, std::string(name));
// Stop thread
thread->stop();
EXPECT_TRUE(thread->start(threads::ThreadOptions(threads::Thread::kMinStackSize)));
thread2_id = thread->CurrentId();
// Expect the same thread started with the the same name
EXPECT_EQ(test_thread_name, std::string(name));
EXPECT_EQ(thread1_id, thread2_id);
cond_var_.WaitFor(test_lock, 10000);
EXPECT_TRUE(threadDelegate->check_value());
DeleteThread(thread);
delete threadDelegate;
EXPECT_EQ(NULL, thread->delegate());
}
} // namespace utils
} // namespace components
} // namespace test
| [
"lovinghesl@hotmail.com"
] | lovinghesl@hotmail.com |
9a3287b94263550b3ca9e0b2b3570b64c06b8fa5 | 05b738e23c8223e86ed725f87774753ace71e9b4 | /Learn_cpp-master/0606/X.cc | 6be28f1c82ed9c6f6a5452087df1c7eeb4456d02 | [] | no_license | JiangShaoYin/Learn_cpp | dc44ef4672c3f1a44685d6b0a5e5e4377d8a2e8c | bd2e5d330428dcbd490a31a3503294338b15376a | refs/heads/master | 2020-04-09T17:24:06.634839 | 2020-03-01T15:04:45 | 2020-03-01T15:04:45 | 160,479,999 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 444 | cc | ///
/// @file point.cc
/// @author jiang(tooo_cold@163.com)
/// @date 2018-06-06 19:30:36
#include <iostream>
using std::cout;
using std::endl;
class X{
public:
X(int ix)
:x(ix)
,y(x)
{
cout<<"this is constructed function"<<endl;
}
void print(){
cout << x
<< ","
<< y << endl;
}
private:
int x;
int y;
};
int main(){
// Point p;
// p.print();
X point(666);
point.print();
return 0;
}
| [
"tooo_cold@163.com"
] | tooo_cold@163.com |
ea92ab07bdb28b099b74769a65867dd206e3f1e1 | c3f1c17b679457653584dcfc3ceaa8b77d49c198 | /common_library/include/mooon/sys/stop_watch.h | 955a86a798957ae403d6880a0b99d46b178b8c72 | [] | no_license | wljcom/mooon | 94190d20c78771c778eb5f84c67f065627856742 | 464b23a3c1c051c9b5ca7087ffa3d909c892ec44 | refs/heads/master | 2020-12-26T06:32:44.610524 | 2015-06-17T05:09:29 | 2015-06-17T05:09:29 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,150 | h | // Writed by yijian on 2015/6/17
// 秒表用于计时
#ifndef MOOON_SYS_STOP_WATCH_H
#define MOOON_SYS_STOP_WATCH_H
#include "mooon/sys/config.h"
#include <sys/time.h>
SYS_NAMESPACE_BEGIN
// 计时器
class CStopWatch
{
public:
CStopWatch()
{
restart();
_stop_time.tv_sec = 0;
_stop_time.tv_usec = 0;
}
// 重新开始计时
void restart()
{
(void)gettimeofday(&_start_time, NULL);
}
// 返回微秒级的耗时
// restart 调用之后是否重新开始计时
unsigned int get_elapsed_microseconds(bool restart)
{
(void)gettimeofday(&_stop_time, NULL);
unsigned int elapsed_microseconds = static_cast<unsigned int>((_stop_time.tv_sec - _start_time.tv_sec) * 1000000 + (_stop_time.tv_usec - _start_time.tv_usec));
// 重计时
if (restart)
{
_start_time.tv_sec = _stop_time.tv_sec;
_start_time.tv_usec = _stop_time.tv_usec;
}
return elapsed_microseconds;
}
private:
struct timeval _start_time;
struct timeval _stop_time;
};
SYS_NAMESPACE_END
#endif // MOOON_SYS_STOP_WATCH_H
| [
"eyjian@live.com"
] | eyjian@live.com |
8e0c31e14a03533e025186e56b9bd412c4eb5ca4 | a3f6dd9352207a14c3c9ded2a18575dbf277c27b | /main.cpp | 28f36d1f990868e187280933bb0bfaa62a4ab1f0 | [] | no_license | liuzd818/GUI_for_TP | 98f435e63020fffb4e402280cd9451c24902061d | c1dba2949da0a0e64ccc5a21ff03628737170ffd | refs/heads/main | 2023-03-31T19:38:31.367463 | 2021-03-25T22:33:41 | 2021-03-25T22:33:41 | 351,592,499 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 213 | cpp | #include "dialog.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Dialog w;
w.setWindowTitle("Teach Pendant");
w.showMaximized();
return a.exec();
}
| [
"noreply@github.com"
] | liuzd818.noreply@github.com |
88a951c5ed81b8ea5737ef2ede5a50a97ddbb591 | 78918391a7809832dc486f68b90455c72e95cdda | /boost_lib/boost/iostreams/detail/absolute_path.hpp | 0789fa42a44328b4dd632a9ef9bc516d240ed636 | [
"MIT"
] | permissive | kyx0r/FA_Patcher | 50681e3e8bb04745bba44a71b5fd04e1004c3845 | 3f539686955249004b4483001a9e49e63c4856ff | refs/heads/master | 2022-03-28T10:03:28.419352 | 2020-01-02T09:16:30 | 2020-01-02T09:16:30 | 141,066,396 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,572 | hpp | /*
* Distributed under the Boost Software License, Version 1.0.(See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
*
* See http://www.boost.org/libs/iostreams for documentation.
* File: boost/iostreams/detail/execute.hpp
* Date: Thu Dec 06 13:21:54 MST 2007
* Copyright: 2007-2008 CodeRage, LLC
* Author: Jonathan Turkanis
* Contact: turkanis at coderage dot com
*
* Defines the function boost::iostreams::detail::absolute_path, used for
* debug output for mapped files.
*/
#ifndef BOOST_IOSTREAMS_DETAIL_ABSOLUTE_PATH_HPP_INCLUDED
#define BOOST_IOSTREAMS_DETAIL_ABSOLUTE_PATH_HPP_INCLUDED
#include <string>
#include <boost/iostreams/detail/config/windows_posix.hpp>
#ifdef BOOST_IOSTREAMS_WINDOWS
# include <cctype>
#endif
#include <boost/iostreams/detail/current_directory.hpp>
namespace boost
{
namespace iostreams
{
namespace detail
{
// Resolves the given path relative to the current working directory
inline std::string absolute_path(const std::string& path)
{
#ifdef BOOST_IOSTREAMS_WINDOWS
return path.size() && (path[0] == '/' || path[0] == '\\') ||
path.size() > 1 && std::isalpha(path[0]) && path[1] == ':' ?
path :
current_directory() + '\\' + path;
#else // #ifdef BOOST_IOSTREAMS_WINDOWS
return path.size() && (path[0] == '/') ?
path :
current_directory() + '/' + path;
#endif // #ifdef BOOST_IOSTREAMS_WINDOWS
}
}
}
} // End namespaces detail, iostreams, boost.
#endif // #ifndef BOOST_IOSTREAMS_DETAIL_ABSOLUTE_PATH_HPP_INCLUDED
| [
"k.melekhin@gmail.com"
] | k.melekhin@gmail.com |
4e1b4fd8865ca5357992cc268410d0954cdb634d | 70ba75fc0a6ce9822913b257f3fae7d8620d3a65 | /src/cmft/base/printcallback.h | db5fb6c27510e9a83ed65f73eadca63a91b60bbb | [
"BSD-2-Clause"
] | permissive | ezhangle/cmft | 6ac5876f8e28c6e94906df1273ac677a91e6926a | 0534764a9f1fe6ebbe5d382318b27bb0e9dd4cdf | refs/heads/master | 2021-01-22T14:02:38.346189 | 2015-04-02T03:55:03 | 2015-04-02T03:55:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,649 | h | /*
* Copyright 2014-2015 Dario Manesku. All rights reserved.
* License: http://www.opensource.org/licenses/BSD-2-Clause
*/
#ifndef CMFT_PRINTCALLBACK_H_HEADER_GUARD
#define CMFT_PRINTCALLBACK_H_HEADER_GUARD
#include "macros.h"
namespace cmft
{
extern bool g_printWarnings;
#define _WARN(_format, ...) \
do \
{ \
if (g_printWarnings) \
{ \
printWarning("CMFT WARNING" _FILE_LINE_ ": " _format "\n", ##__VA_ARGS__); \
} \
} while(0)
extern bool g_printInfo;
#define _INFO(_format, ...) \
do \
{ \
if (g_printInfo) \
{ \
printInfo("CMFT info: " _format "\n", ##__VA_ARGS__); \
} \
} while(0)
void printInfo(const char* _format, ...);
void printWarning(const char* _format, ...);
} // namespace cmft
#endif //CMFT_PRINTCALLBACK_H_HEADER_GUARD
/* vim: set sw=4 ts=4 expandtab: */
| [
"dariomanesku@gmail.com"
] | dariomanesku@gmail.com |
d3ec19b754acd9cf613d60976eaeb7ee406659cc | 6f3c3d5ed7eaa6cb9ca5a2cfce59ff7bbfc1f0ed | /src/vlGraphics/GL/VL_Functions_GL.hpp | 08948f7af54d069f28390c1e2551d95aba334bcb | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-2-Clause"
] | permissive | gegenschall/visualizationlibrary | 416d8b294a158a1905a17cbf2921900a797874c1 | 940be74349c2309a583c422652ec6cf06f7bb6d5 | refs/heads/master | 2020-12-30T22:35:01.157239 | 2015-04-04T11:16:21 | 2015-04-04T11:16:21 | 33,401,863 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 27,513 | hpp | /**************************************************************************************/
/* */
/* Visualization Library */
/* http://www.visualizationlibrary.org */
/* */
/* Copyright (c) 2005-2010, Michele Bosi */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without modification, */
/* are permitted provided that the following conditions are met: */
/* */
/* - Redistributions of source code must retain the above copyright notice, this */
/* list of conditions and the following disclaimer. */
/* */
/* - Redistributions in binary form must reproduce the above copyright notice, this */
/* list of conditions and the following disclaimer in the documentation and/or */
/* other materials provided with the distribution. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND */
/* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED */
/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR */
/* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
/* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */
/* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/* */
/**************************************************************************************/
#ifndef VL_GL_FUNCTION_WRAPPERS
#define VL_GL_FUNCTION_WRAPPERS
#ifndef VL_UNSUPPORTED_FUNC
#define VL_UNSUPPORTED_FUNC() { Log::error( String().printf("The function \"%s\" is not supported by the current OpenGL implementation! (%s:%d).\n", __FUNCTION__, __FILE__, __LINE__) ); VL_TRAP(); }
#endif
namespace vl
{
inline void VL_glBindBuffer( GLenum target, GLuint buffer )
{
if (glBindBuffer)
glBindBuffer(target,buffer);
else
if (glBindBufferARB)
glBindBufferARB(target,buffer);
else
{
VL_CHECK( buffer == 0 );
}
}
inline void VL_glGenBuffers( GLsizei n, GLuint * buffers)
{
if (glGenBuffers)
glGenBuffers( n, buffers);
else
if (glGenBuffersARB)
glGenBuffersARB( n, buffers);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glDeleteBuffers( GLsizei n, const GLuint * buffers)
{
if (glDeleteBuffers)
glDeleteBuffers( n, buffers);
else
if (glDeleteBuffersARB)
glDeleteBuffersARB( n, buffers);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glBufferData( GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage)
{
if (glBufferData)
glBufferData( target, size, data, usage);
else
if (glBufferDataARB)
glBufferDataARB( target, size, data, usage);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glBufferSubData( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data)
{
if (glBufferSubData)
glBufferSubData( target, offset, size, data );
else
if (glBufferSubDataARB)
glBufferSubDataARB( target, offset, size, data);
else
VL_UNSUPPORTED_FUNC();
}
inline void* VL_glMapBuffer( GLenum target, GLenum access)
{
if (glMapBuffer)
return glMapBuffer( target, access);
else
if (glMapBufferARB)
return glMapBufferARB( target, access);
else
VL_UNSUPPORTED_FUNC();
return 0;
}
inline GLboolean VL_glUnmapBuffer(GLenum target)
{
if (glUnmapBuffer)
return glUnmapBuffer( target );
else
if (glUnmapBufferARB)
return glUnmapBufferARB( target );
else
VL_UNSUPPORTED_FUNC();
return GL_FALSE;
}
//-----------------------------------------------------------------------------
inline void VL_glSecondaryColor3f(float r, float g, float b)
{
if(glSecondaryColor3f)
glSecondaryColor3f(r,g,b);
else
if(glSecondaryColor3fEXT)
glSecondaryColor3fEXT(r,g,b);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glSecondaryColorPointer( GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
{
if(glSecondaryColorPointer)
glSecondaryColorPointer(size, type, stride, (GLvoid*)pointer);
else
if(glSecondaryColorPointerEXT)
glSecondaryColorPointerEXT(size, type, stride, (GLvoid*)pointer);
else
VL_UNSUPPORTED_FUNC();
}
//-----------------------------------------------------------------------------
inline void VL_glFogCoordPointer( GLenum type, GLsizei stride, GLvoid* pointer )
{
if (glFogCoordPointer)
glFogCoordPointer(type,stride,pointer);
else
if (glFogCoordPointerEXT)
glFogCoordPointerEXT(type,stride,pointer);
else
VL_UNSUPPORTED_FUNC();
}
//-----------------------------------------------------------------------------
inline void VL_glEnableVertexAttribArray( GLuint index )
{
if (glEnableVertexAttribArray)
glEnableVertexAttribArray(index);
else
if (glEnableVertexAttribArrayARB)
glEnableVertexAttribArrayARB(index);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glDisableVertexAttribArray( GLuint index )
{
if (glDisableVertexAttribArray)
glDisableVertexAttribArray(index);
else
if (glDisableVertexAttribArrayARB)
glDisableVertexAttribArrayARB(index);
else
VL_UNSUPPORTED_FUNC();
}
//-----------------------------------------------------------------------------
inline void VL_glVertexAttribPointer( GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer)
{
if (glVertexAttribPointer)
glVertexAttribPointer(index, size, type, normalized, stride, pointer);
else
if (glVertexAttribPointerARB)
glVertexAttribPointerARB(index, size, type, normalized, stride, pointer);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glVertexAttribIPointer(GLuint name, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
{
if(glVertexAttribIPointer)
glVertexAttribIPointer(name, size, type, stride, pointer);
else
if (glVertexAttribIPointerEXT)
glVertexAttribIPointerEXT(name, size, type, stride, pointer);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glVertexAttribLPointer(GLuint name, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
{
if(glVertexAttribLPointer)
glVertexAttribLPointer(name, size, type, stride, pointer);
else
if(glVertexAttribLPointerEXT)
glVertexAttribLPointerEXT(name, size, type, stride, pointer);
else
VL_UNSUPPORTED_FUNC();
}
//-----------------------------------------------------------------------------
inline void VL_glClientActiveTexture(GLenum texture)
{
if(glClientActiveTexture)
glClientActiveTexture(texture);
else
if (glClientActiveTextureARB)
glClientActiveTextureARB(texture);
else
{
VL_CHECK(texture == GL_TEXTURE0);
}
}
inline void VL_glActiveTexture(GLenum texture)
{
if(glActiveTexture)
glActiveTexture(texture);
else
if (glActiveTextureARB)
glActiveTextureARB(texture);
else
{
VL_CHECK(texture == GL_TEXTURE0);
}
}
//-----------------------------------------------------------------------------
inline void VL_glBlendFuncSeparate( GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
{
if (glBlendFuncSeparate)
glBlendFuncSeparate( srcRGB, dstRGB, srcAlpha, dstAlpha);
else
if (glBlendFuncSeparateEXT)
glBlendFuncSeparateEXT( srcRGB, dstRGB, srcAlpha, dstAlpha);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glBlendEquationSeparate( GLenum modeRGB, GLenum modeAlpha)
{
if (glBlendEquationSeparate)
glBlendEquationSeparate(modeRGB, modeAlpha);
else
if(glBlendEquationSeparateEXT)
glBlendEquationSeparateEXT(modeRGB, modeAlpha);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glBlendEquation(GLenum mode)
{
if (glBlendEquation)
glBlendEquation(mode);
else
if (glBlendEquationEXT)
glBlendEquationEXT(mode);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glBlendColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
{
if(glBlendColor)
glBlendColor(red,green,blue,alpha);
else
if (glBlendColorEXT)
glBlendColorEXT(red,green,blue,alpha);
else
VL_UNSUPPORTED_FUNC();
}
//-----------------------------------------------------------------------------
inline void VL_glPointParameterfv( GLenum pname, const GLfloat* params)
{
if (glPointParameterfv)
glPointParameterfv(pname,(GLfloat*)params);
else
if (glPointParameterfvARB)
glPointParameterfvARB(pname,(GLfloat*)params);
else
if (glPointParameterfvEXT)
glPointParameterfvEXT(pname,(GLfloat*)params);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glPointParameterf( GLenum pname, GLfloat param)
{
if (glPointParameterf)
glPointParameterf(pname,param);
else
if (glPointParameterfARB)
glPointParameterfARB(pname,param);
else
if (glPointParameterfEXT)
glPointParameterfEXT(pname,param);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glPointParameteri( GLenum pname, GLenum param)
{
if (glPointParameteri)
glPointParameteri(pname,param);
else
if (glPointParameteriNV)
glPointParameteriNV(pname,param);
else
VL_UNSUPPORTED_FUNC();
}
//-----------------------------------------------------------------------------
inline void VL_glStencilFuncSeparate( GLenum face, GLenum func, GLint ref, GLuint mask)
{
if (glStencilFuncSeparate)
glStencilFuncSeparate( face, func, ref, mask );
else
VL_UNSUPPORTED_FUNC();
// NOT SUPPORTED
// see also http://www.opengl.org/registry/specs/ATI/separate_stencil.txt
/*else
if ( Has_GL_ATI_separate_stencil )
glStencilFuncSeparateATI( GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask ) */
}
inline void VL_glStencilOpSeparate( GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass)
{
if (glStencilOpSeparate)
glStencilOpSeparate( face, sfail, dpfail, dppass );
else
VL_UNSUPPORTED_FUNC();
// NOT SUPPORTED
// see also http://www.opengl.org/registry/specs/ATI/separate_stencil.txt
/*else
if ( Has_GL_ATI_separate_stencil )
glStencilOpSeparateATI( GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass )*/
}
//-----------------------------------------------------------------------------
inline void VL_glSampleCoverage( GLclampf value, GLboolean invert)
{
if (glSampleCoverage)
glSampleCoverage(value,invert);
else
if (glSampleCoverageARB)
glSampleCoverageARB(value,invert);
else
VL_UNSUPPORTED_FUNC();
}
//-----------------------------------------------------------------------------
inline void VL_glBindRenderbuffer(GLenum target, GLuint renderbuffer)
{
if (glBindRenderbuffer)
glBindRenderbuffer(target, renderbuffer);
else
if (glBindRenderbufferEXT)
glBindRenderbufferEXT(target, renderbuffer);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glDeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers)
{
if (glDeleteRenderbuffers)
glDeleteRenderbuffers(n, renderbuffers);
else
if (glDeleteRenderbuffersEXT)
glDeleteRenderbuffersEXT(n, renderbuffers);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glGenRenderbuffers(GLsizei n, GLuint *renderbuffers)
{
if (glGenRenderbuffers)
glGenRenderbuffers(n, renderbuffers);
else
if (glGenRenderbuffersEXT)
glGenRenderbuffersEXT(n, renderbuffers);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
{
if (glRenderbufferStorage)
glRenderbufferStorage(target, internalformat, width, height);
else
if (glRenderbufferStorageEXT)
glRenderbufferStorageEXT(target, internalformat, width, height);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint *params)
{
if (glGetRenderbufferParameteriv)
glGetRenderbufferParameteriv(target, pname, params);
else
if (glGetRenderbufferParameterivEXT)
glGetRenderbufferParameterivEXT(target, pname, params);
else
VL_UNSUPPORTED_FUNC();
}
inline GLboolean VL_glIsFramebuffer(GLuint framebuffer)
{
if (glIsFramebuffer)
return glIsFramebuffer(framebuffer);
else
if (glIsFramebufferEXT)
return glIsFramebufferEXT(framebuffer);
else
VL_UNSUPPORTED_FUNC();
return GL_FALSE;
}
inline void VL_glBindFramebuffer(GLenum target, GLuint framebuffer)
{
if (glBindFramebuffer)
glBindFramebuffer(target, framebuffer);
else
if (glBindFramebufferEXT)
glBindFramebufferEXT(target, framebuffer);
else
{
VL_CHECK(framebuffer == 0);
}
}
inline void VL_glDeleteFramebuffers(GLsizei n, const GLuint *framebuffers)
{
if (glDeleteFramebuffers)
glDeleteFramebuffers(n, framebuffers);
else
if (glDeleteFramebuffersEXT)
glDeleteFramebuffersEXT(n, framebuffers);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glGenFramebuffers(GLsizei n, GLuint *framebuffers)
{
if (glGenFramebuffers)
glGenFramebuffers(n, framebuffers);
else
if (glGenFramebuffersEXT)
glGenFramebuffersEXT(n, framebuffers);
else
VL_UNSUPPORTED_FUNC();
}
inline GLenum VL_glCheckFramebufferStatus(GLenum target)
{
if (glCheckFramebufferStatus)
return glCheckFramebufferStatus(target);
else
if (glCheckFramebufferStatusEXT)
return glCheckFramebufferStatusEXT(target);
else
VL_UNSUPPORTED_FUNC();
return GL_FRAMEBUFFER_UNSUPPORTED;
}
inline void VL_glFramebufferTexture1D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
{
if (glFramebufferTexture1D)
glFramebufferTexture1D(target, attachment, textarget, texture, level);
else
if (glFramebufferTexture1DEXT)
glFramebufferTexture1DEXT(target, attachment, textarget, texture, level);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
{
if (glFramebufferTexture2D)
glFramebufferTexture2D(target, attachment, textarget, texture, level);
else
if (glFramebufferTexture2DEXT)
glFramebufferTexture2DEXT(target, attachment, textarget, texture, level);
else
VL_UNSUPPORTED_FUNC();
}
//inline void VL_glFramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
//{
// if (glFramebufferTexture3D)
// glFramebufferTexture3D(target, attachment, textarget, texture, level, zoffset);
// else
// if (glFramebufferTexture3DEXT)
// glFramebufferTexture3DEXT(target, attachment, textarget, texture, level, zoffset);
// else
// VL_UNSUPPORTED_FUNC();
//}
inline void VL_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
{
if (glFramebufferRenderbuffer)
glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
else
if (glFramebufferRenderbufferEXT)
glFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, renderbuffer);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint *params)
{
if (glGetFramebufferAttachmentParameteriv)
glGetFramebufferAttachmentParameteriv(target,attachment,pname,params);
else
if (glGetFramebufferAttachmentParameterivEXT)
glGetFramebufferAttachmentParameterivEXT(target,attachment,pname,params);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glGenerateMipmap(GLenum target)
{
if (glGenerateMipmap)
glGenerateMipmap(target);
else
if (glGenerateMipmapEXT)
glGenerateMipmapEXT(target);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glFramebufferTexture(GLenum target, GLenum attachment, GLuint texture, GLint level)
{
// even if this extension is signed ad ARB it does not appear in the GL 3.0 specs
if (glFramebufferTextureARB)
glFramebufferTextureARB(target,attachment,texture,level);
else
if (glFramebufferTextureEXT)
glFramebufferTextureEXT(target,attachment,texture,level);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
{
if (glFramebufferTextureLayer)
glFramebufferTextureLayer(target, attachment, texture, level, layer);
else
if (glFramebufferTextureLayerARB)
glFramebufferTextureLayerARB(target, attachment, texture, level, layer);
else
if (glFramebufferTextureLayerEXT)
glFramebufferTextureLayerEXT(target, attachment, texture, level, layer);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glRenderbufferStorageMultisample( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height )
{
if (glRenderbufferStorageMultisample)
glRenderbufferStorageMultisample(target, samples, internalformat, width, height);
else
if (glRenderbufferStorageMultisampleEXT)
glRenderbufferStorageMultisampleEXT(target, samples, internalformat, width, height);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
{
if (glBlitFramebuffer)
glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
else
if (glBlitFramebufferEXT)
glBlitFramebufferEXT(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
else
VL_UNSUPPORTED_FUNC();
}
//-----------------------------------------------------------------------------
inline void VL_glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount)
{
if (glDrawElementsInstanced)
glDrawElementsInstanced(mode, count, type, indices, primcount);
else
if (glDrawElementsInstancedARB)
glDrawElementsInstancedARB(mode, count, type, indices, primcount);
else
if (glDrawElementsInstancedEXT)
glDrawElementsInstancedEXT(mode, count, type, indices, primcount);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glDrawElementsInstancedBaseVertex(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, int basevertex)
{
if (glDrawElementsInstancedBaseVertex)
glDrawElementsInstancedBaseVertex(mode, count, type, indices, primcount, basevertex);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glDrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, int basevertex)
{
if (glDrawElementsBaseVertex)
glDrawElementsBaseVertex(mode, count, type, (void*)indices, basevertex);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glDrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, int basevertex)
{
if (glDrawRangeElementsBaseVertex)
glDrawRangeElementsBaseVertex(mode, start, end, count, type, (void*)indices, basevertex);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
{
if (glDrawArraysInstanced)
glDrawArraysInstanced(mode, first, count, primcount);
else
if (glDrawArraysInstancedARB)
glDrawArraysInstancedARB(mode, first, count, primcount);
else
if (glDrawArraysInstancedEXT)
glDrawArraysInstancedEXT(mode, first, count, primcount);
else
VL_UNSUPPORTED_FUNC();
}
//-----------------------------------------------------------------------------
inline void VL_glProgramParameteri(GLuint program, GLenum pname, GLint value)
{
if (glProgramParameteriARB)
glProgramParameteriARB(program, pname, value);
else
if (glProgramParameteriEXT)
glProgramParameteriEXT(program, pname, value);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glBindFragDataLocation(GLuint program, GLuint colorNumber, const GLchar *name)
{
if (glBindFragDataLocation)
glBindFragDataLocation(program, colorNumber, name);
else
if (glBindFragDataLocationEXT)
glBindFragDataLocationEXT(program, colorNumber, name);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glUniform1uiv(GLint location, GLsizei count, const GLuint *value)
{
if (glUniform1uiv)
glUniform1uiv(location, count, value);
else
if (glUniform1uivEXT)
glUniform1uivEXT(location, count, value);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glUniform2uiv(GLint location, GLsizei count, const GLuint *value)
{
if (glUniform2uiv)
glUniform2uiv(location, count, value);
else
if (glUniform2uivEXT)
glUniform2uivEXT(location, count, value);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glUniform3uiv(GLint location, GLsizei count, const GLuint *value)
{
if (glUniform3uiv)
glUniform3uiv(location, count, value);
else
if (glUniform3uivEXT)
glUniform3uivEXT(location, count, value);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glUniform4uiv(GLint location, GLsizei count, const GLuint *value)
{
if (glUniform4uiv)
glUniform4uiv(location, count, value);
else
if (glUniform4uivEXT)
glUniform4uivEXT(location, count, value);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glGetProgramBinary(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary)
{
if (glGetProgramBinary)
glGetProgramBinary(program, bufSize, length, binaryFormat, binary);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glProgramBinary(GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length)
{
if (glProgramBinary)
glProgramBinary(program, binaryFormat, binary, length);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
{
if (glTexImage3D)
glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels)
{
if (glTexSubImage3D)
glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
{
if (glCopyTexSubImage3D)
glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
{
if (glCompressedTexImage3D)
glCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data)
{
if (glCompressedTexSubImage3D)
glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
else
VL_UNSUPPORTED_FUNC();
}
inline void VL_glFramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
{
if (glFramebufferTexture3D)
glFramebufferTexture3D(target, attachment, textarget, texture, level, zoffset);
else
VL_UNSUPPORTED_FUNC();
}
//-----------------------------------------------------------------------------
inline std::string getOpenGLExtensions()
{
std::string ext;
if (Has_GL_Version_3_0||Has_GL_Version_4_0)
{
int count = 0;
glGetIntegerv(GL_NUM_EXTENSIONS, &count);
for( int i=0; i<count; ++i )
{
ext += std::string((char*)glGetStringi(GL_EXTENSIONS, i)) + " ";
VL_CHECK_OGL();
}
}
else
{
VL_CHECK(glGetString(GL_EXTENSIONS));
ext = (const char*)glGetString(GL_EXTENSIONS);
// make sure also the last extension ends with a space
ext.push_back(' ');
}
return ext;
}
}
#endif
| [
"michele.bosi@e3458a3e-9034-11de-b664-3b115b7b7a9b"
] | michele.bosi@e3458a3e-9034-11de-b664-3b115b7b7a9b |
51c05f5faf38f3233c6b6d2d60ac6110306faa24 | 5db78fa4cf86f2d52a02490131809823c738d93f | /node_modules/nodegit/src/diff_perfdata.cc | ecc4b0e3a780eb57d9ad0eaf408a7df9b7957969 | [
"MIT"
] | permissive | ZaiweiXiong/NodeProject | f9a5486669c2bd7d9a07d4051187c08402ecf605 | e240637e226c7e560da9cce56641a56402818101 | refs/heads/master | 2021-01-11T06:05:13.135493 | 2018-04-08T05:16:49 | 2018-04-08T05:16:49 | 69,854,403 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,503 | cc | // This is a generated file, modify: generate/templates/class_content.cc
#include <nan.h>
#include <string.h>
extern "C" {
#include <git2.h>
#include <git2/sys/diff.h>
}
#include "../include/lock_master.h"
#include "../include/functions/copy.h"
#include "../include/diff_perfdata.h"
#include "nodegit_wrapper.cc"
#include "../include/async_libgit2_queue_worker.h"
#include <iostream>
using namespace std;
using namespace v8;
using namespace node;
GitDiffPerfdata::~GitDiffPerfdata()
{
// this will cause an error if you have a non-self-freeing object that also needs
// to save values. Since the object that will eventually free the object has no
// way of knowing to free these values.
}
void GitDiffPerfdata::InitializeComponent(Local<v8::Object> target)
{
Nan::HandleScope scope;
Local<FunctionTemplate> tpl = Nan::New<FunctionTemplate>(JSNewFunction);
tpl->InstanceTemplate()->SetInternalFieldCount(1);
tpl->SetClassName(Nan::New("DiffPerfdata").ToLocalChecked());
Nan::SetPrototypeMethod(tpl, "version", Version);
Nan::SetPrototypeMethod(tpl, "statCalls", StatCalls);
Nan::SetPrototypeMethod(tpl, "oidCalculations", OidCalculations);
InitializeTemplate(tpl);
Local<Function> _constructor_template = Nan::GetFunction(tpl).ToLocalChecked();
constructor_template.Reset(_constructor_template);
Nan::Set(target, Nan::New("DiffPerfdata").ToLocalChecked(), _constructor_template);
}
NAN_METHOD(GitDiffPerfdata::Version)
{
Local<v8::Value> to;
unsigned int
version =
Nan::ObjectWrap::Unwrap<GitDiffPerfdata>(info.This())->GetValue()->version;
// start convert_to_v8 block
to = Nan::New<Number>( version);
// end convert_to_v8 block
info.GetReturnValue().Set(to);
}
NAN_METHOD(GitDiffPerfdata::StatCalls)
{
Local<v8::Value> to;
size_t
stat_calls =
Nan::ObjectWrap::Unwrap<GitDiffPerfdata>(info.This())->GetValue()->stat_calls;
// start convert_to_v8 block
to = Nan::New<Number>( stat_calls);
// end convert_to_v8 block
info.GetReturnValue().Set(to);
}
NAN_METHOD(GitDiffPerfdata::OidCalculations)
{
Local<v8::Value> to;
size_t
oid_calculations =
Nan::ObjectWrap::Unwrap<GitDiffPerfdata>(info.This())->GetValue()->oid_calculations;
// start convert_to_v8 block
to = Nan::New<Number>( oid_calculations);
// end convert_to_v8 block
info.GetReturnValue().Set(to);
}
// force base class template instantiation, to make sure we get all the
// methods, statics, etc.
template class NodeGitWrapper<GitDiffPerfdataTraits>;
| [
"Zaiwei.xiong@gmail.com"
] | Zaiwei.xiong@gmail.com |
a3202ba0f5c4a3c8a6ddd587917c42f5a1cda91c | cec510046f9328c92f5beaf137413304d3fee24d | /Engine/VkrMath.h | dff527de95713e14503e43b469a82cfcfad82b61 | [] | no_license | mholtkamp/vulkan-renderer | 8ff7511fd758d6c135604c6937e2a0172204b57c | 1630293f6524c5def8f284fd5990f2104433fd1f | refs/heads/master | 2021-07-09T09:25:01.205976 | 2020-06-16T01:30:42 | 2020-06-16T01:30:42 | 92,013,387 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 224 | h | #pragma once
#include <stdint.h>
class VkrMath
{
public:
static float RandRange(float min, float max);
static int32_t RandRange(int32_t min, int32_t max);
private:
static void SeedRand();
static bool mRandSeeded;
}; | [
"mholt012@gmail.com"
] | mholt012@gmail.com |
6f922499a9cb4152f6834541cc1f9ad1ba7ab647 | 657fdeb8cbad6c39a65fe299e9b94f569fa9086d | /Pointers/multidimarray.cpp | 77ebec17cf741fb00b82ccf9eea031ec1d73ee5e | [] | no_license | singhg11/CPP | c9a868200f14b5c95481a63c0b25a6eead876ea1 | 845b9818f61416f54a57085a05f34e449dee2e87 | refs/heads/master | 2023-06-11T03:30:32.334443 | 2021-07-04T14:55:49 | 2021-07-04T14:55:49 | 382,875,795 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 345 | cpp | #include<iostream>
using namespace std;
int main() {
int m, n;
cin >> m >> n;
int **p = new int *[m];
for (int i = 0; i < m; i++) {
p[i] = new int[i + 1];
for (int j = 0; j < n; j++) {
cin >> p[i][j];
}
}
for (int i = 0; i < m; i++) {
delete [] p[i];
}
delete[] p;
} | [
"gauravanilkumarsingh@gmail.com"
] | gauravanilkumarsingh@gmail.com |
94569374d1689f4ecf0f665e3b5d101b9a96e47b | e50b5f066628ef65fd7f79078b4b1088f9d11e87 | /llvm/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h | 7fd2a3d4bf37d97a3f155db0688f38188f739525 | [
"NCSA"
] | permissive | uzleo/coast | 1471e03b2a1ffc9883392bf80711e6159917dca1 | 04bd688ac9a18d2327c59ea0c90f72e9b49df0f4 | refs/heads/master | 2020-05-16T11:46:24.870750 | 2019-04-23T13:57:53 | 2019-04-23T13:57:53 | 183,025,687 | 0 | 0 | null | 2019-04-23T13:52:28 | 2019-04-23T13:52:27 | null | UTF-8 | C++ | false | false | 1,627 | h | //===- PDBSymbolFuncDebugEnd.h - function end bounds info -------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_DEBUGINFO_PDB_PDBSYMBOLFUNCDEBUGEND_H
#define LLVM_DEBUGINFO_PDB_PDBSYMBOLFUNCDEBUGEND_H
#include "PDBSymbol.h"
#include "PDBTypes.h"
namespace llvm {
class raw_ostream;
namespace pdb {
class PDBSymbolFuncDebugEnd : public PDBSymbol {
public:
PDBSymbolFuncDebugEnd(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> FuncDebugEndSymbol);
DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::FuncDebugEnd)
void dump(PDBSymDumper &Dumper) const override;
FORWARD_SYMBOL_METHOD(getAddressOffset)
FORWARD_SYMBOL_METHOD(getAddressSection)
FORWARD_SYMBOL_METHOD(hasCustomCallingConvention)
FORWARD_SYMBOL_METHOD(hasFarReturn)
FORWARD_SYMBOL_METHOD(hasInterruptReturn)
FORWARD_SYMBOL_METHOD(isStatic)
FORWARD_SYMBOL_METHOD(getLexicalParentId)
FORWARD_SYMBOL_METHOD(getLocationType)
FORWARD_SYMBOL_METHOD(hasNoInlineAttribute)
FORWARD_SYMBOL_METHOD(hasNoReturnAttribute)
FORWARD_SYMBOL_METHOD(isUnreached)
FORWARD_SYMBOL_METHOD(getOffset)
FORWARD_SYMBOL_METHOD(hasOptimizedCodeDebugInfo)
FORWARD_SYMBOL_METHOD(getRelativeVirtualAddress)
FORWARD_SYMBOL_METHOD(getVirtualAddress)
};
} // namespace llvm
}
#endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLFUNCDEBUGEND_H
| [
"jeffrey.goeders@gmail.com"
] | jeffrey.goeders@gmail.com |
7290476efb608625acedeef4e7f470121011c254 | 02f66bf638d673d7b3303b9a4fc698282a20daef | /Desktop/EAGLView.cpp | eddf7409f4c3a09042c7cda4676538e7d19087e0 | [] | no_license | johanekholm/hex-game | f0b6c1804ea2ee9c0c28579574bd87baf1374266 | 81de42b3aeed3c709afa3310cad3d81522b957d7 | refs/heads/master | 2020-06-04T09:27:25.959183 | 2012-08-27T20:45:27 | 2012-08-27T20:45:27 | 1,592,761 | 2 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 2,347 | cpp | #include "EAGLView.h"
#include "TextureCatalog.h"
#include "ResourceLoader.h"
#include "CentralControl.h"
#include <QMouseEvent>
#include <QTimer>
#include <QDateTime>
#include <QDebug>
class EAGLView::PrivateData {
public:
CentralControl* centralControl;
QTimer timer;
qint64 lastTime;
};
EAGLView::EAGLView(QWidget *parent)
:QGLWidget(parent)
{
d = new PrivateData;
d->timer.setInterval(1000.0 / 60.0);
connect(&d->timer, SIGNAL(timeout()), this, SLOT(mainGameLoop()));
this->setWindowTitle("HexGame");
this->resize(320, 480);
}
EAGLView::~EAGLView() {
delete d->centralControl;
delete d;
TextureCatalog::destroy();
}
void EAGLView::mainGameLoop() {
qint64 time;
float delta;
time = QDateTime::currentMSecsSinceEpoch();
delta = (time - d->lastTime);
d->centralControl->update();
// [self updateScene:delta];
this->updateGL();
d->lastTime = time;
}
void EAGLView::paintGL () {
glClear(GL_COLOR_BUFFER_BIT);
glEnable(GL_TEXTURE_2D);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glLoadIdentity();
d->centralControl->draw();
}
void EAGLView::initializeGL() {
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, this->width(), this->height(), 0, -1, 1);
glMatrixMode(GL_MODELVIEW);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_TEXTURE_2D);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glDisable(GL_DEPTH_TEST);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_BLEND_SRC);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
TextureCatalog::instance();
ResourceLoader resourceLoader(this);
resourceLoader.load();
d->centralControl = CentralControl::instance();
d->timer.start();
}
void EAGLView::mouseMoveEvent ( QMouseEvent * event ) {
d->centralControl->touchesMoved(GPointMake(event->x(), event->y()));
}
void EAGLView::mousePressEvent ( QMouseEvent * event ) {
d->centralControl->touchesBegan(GPointMake(event->x(), event->y()));
}
void EAGLView::mouseReleaseEvent ( QMouseEvent * event ) {
d->centralControl->touchesEnded(GPointMake(event->x(), event->y()));
}
| [
"micke.prag@telldus.se"
] | micke.prag@telldus.se |
b59f14d9a864abdc8ea762adf5be53af46965d46 | 850ebe7ea2b8931601a96f6d2ea63e6d23514ec2 | /src/headers/HashMapChecker.h | 53fd637c3996eeaec33406132cd6778e796c8453 | [] | no_license | oleh-on/Speller | d48ebf995c8df2686d5a83f4cc5d40204ae99c7f | df8abd084edb2d513e30b5f9d1101691c3e88ff0 | refs/heads/master | 2021-02-07T16:47:43.979922 | 2020-04-24T19:15:36 | 2020-04-24T19:15:36 | 244,052,760 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 499 | h | //
// Created by olehon on 3/1/20.
//
#ifndef SPELLER_HASHMAPCHECKER_H
#define SPELLER_HASHMAPCHECKER_H
#include <unordered_set>
#include "Checker.h"
class HashMapChecker : public Checker{
std::unordered_set<std::string> words;
public:
explicit HashMapChecker(const std::string& name) : Checker(name) {}
~HashMapChecker() override = default;
void add(const std::string& token) override ;
bool check(const std::string& token) override ;
};
#endif //SPELLER_HASHMAPCHECKER_H
| [
"olehonkaliuk@gmail.com"
] | olehonkaliuk@gmail.com |
d85fd424a09ae35c4afacee3bc5ab23f7cf6abe8 | 6126270884b40f5226391c9276885e8a260060f9 | /Trees/preOrderTraversalIterative.cpp | a894bacf941be75ff23ae4afbe72716a9c7f6395 | [] | no_license | ankitchahal20/Data-Structures | 1d69b5360e70a1e8f64849e82934cbf0a93e5bc4 | d02c51e314233a3f0c9d579e456e3dc93f7522c7 | refs/heads/master | 2023-06-29T06:16:33.109537 | 2021-08-02T18:04:09 | 2021-08-02T18:04:09 | 374,314,125 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,505 | cpp | #include <iostream>
#include <stack>
#include "BinaryTreeNode.h"
using namespace std;
// void preOrderRecurrsive(BinaryTreeNode<int> *root)
// {
// if(root==NULL) {
// return;
// }
// cout<<root->data;
// preOrderRecurrsive(root->left);
// preOrderRecurrsive(root->right);
// }
void preOrderIterative(BinaryTreeNode<int> *root){
if(root==NULL) return;
stack<BinaryTreeNode<int> *> s;
s.push(root);
while(!s.empty()){
BinaryTreeNode<int> *currentNode = s.top();
s.pop();
cout<<currentNode->data<<" ";
if(currentNode->right!=NULL) s.push(currentNode->right);
if(currentNode->left!=NULL) s.push(currentNode->left);
}
}
int main()
{
// considering root at level 1.
BinaryTreeNode<int> *root = new BinaryTreeNode<int>(0);
BinaryTreeNode<int> *node1Atlevel1 = new BinaryTreeNode<int>(1);
BinaryTreeNode<int> *node2Atlevel1 = new BinaryTreeNode<int>(2);
BinaryTreeNode<int> *node1Atlevel2 = new BinaryTreeNode<int>(3);
BinaryTreeNode<int> *node2Atlevel2 = new BinaryTreeNode<int>(4);
BinaryTreeNode<int> *node3Atlevel2 = new BinaryTreeNode<int>(5);
BinaryTreeNode<int> *node4Atlevel2 = new BinaryTreeNode<int>(6);
// At level 2.
root->left = node1Atlevel1;
root->right = node2Atlevel1;
// At level 3.
node1Atlevel1->left = node1Atlevel2;
node1Atlevel1->right = node2Atlevel2;
node2Atlevel1->left = node3Atlevel2;
node2Atlevel1->right = node4Atlevel2;
cout<<"Iterative preorder traversal is : ";
preOrderIterative(root);
}
| [
"ankit.chahal1@ibm.com"
] | ankit.chahal1@ibm.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.