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 905 values | visit_date timestamp[us]date 2015-08-09 11:21:18 2023-09-06 10:45:07 | revision_date timestamp[us]date 1997-09-14 05:04:47 2023-09-17 19:19:19 | committer_date timestamp[us]date 1997-09-14 05:04:47 2023-09-06 06:22:19 | github_id int64 3.89k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us]date 2012-06-07 00:51:45 2023-09-14 21:58:39 ⌀ | gha_created_at timestamp[us]date 2008-03-27 23:40:48 2023-08-21 23:17:38 ⌀ | gha_language stringclasses 141 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 115 values | content stringlengths 3 10.4M | authors listlengths 1 1 | author_id stringlengths 0 158 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
66fca98dbac92826b87d39853e3b7348c2d64b55 | a41e5f042c74b86000c57501341ddbd535caf640 | /src/inet/applications/tcpapp/TcpVideoStreamCliApp.cc | dd4b7568cfb99fd6cd038b62318d6878e85133a4 | [] | no_license | andersonandrei/inet | 6aee3e5492ae267891080d6f0225335945761f19 | fd9b8b2b53500d1991326fcf2afd80f1723a7f50 | refs/heads/master | 2020-03-15T14:34:28.717575 | 2018-06-09T03:07:03 | 2018-06-09T03:07:03 | 132,192,329 | 0 | 1 | null | 2018-05-04T21:50:45 | 2018-05-04T21:50:45 | null | UTF-8 | C++ | false | false | 10,277 | cc | /*
* TcpVideoStreamCliApp.cc
*
* It's an adaptation of the code of Navarro Joaquim (https://github.com/navarrojoaquin/adaptive-video-Tcp-omnet).
* Created on 8 de dez de 2017 by Anderson Andrei da Silva & Patrick Menani Abrahao at University of Sao Paulo.
*
*/
#include "TcpVideoStreamCliApp.h"
#include "inet/applications/tcpapp/GenericAppMsg_m.h"
namespace inet {
#define MSGKIND_CONNECT 0
#define MSGKIND_SEND 1
#define MSGKIND_VIDEO_PLAY 2
//Register_Class(TcpVideoStreamCliApp);
Define_Module(TcpVideoStreamCliApp);
simsignal_t TcpVideoStreamCliApp::packetReceived = registerSignal("packetReceived");
simsignal_t TcpVideoStreamCliApp::packetSent = registerSignal("packetSent");
TcpVideoStreamCliApp::~TcpVideoStreamCliApp() {
cancelAndDelete(timeoutMsg);
}
TcpVideoStreamCliApp::TcpVideoStreamCliApp() {
timeoutMsg = NULL;
}
void TcpVideoStreamCliApp::initialize(int stage) {
TcpBasicClientApp::initialize(stage);
if (stage != 3)
return;
// read Adaptive Video (AV) parameters
const char *str = par("video_packet_size_per_second").stringValue();
video_packet_size_per_second = cStringTokenizer(str).asIntVector();
video_buffer_max_length = par("video_buffer_max_length");
video_duration = par("video_duration");
manifest_size = par("manifest_size");
numRequestsToSend = video_duration;
WATCH(video_buffer);
video_buffer = 0;
DASH_buffer_length_signal = registerSignal("DASHBufferLength");
emit(DASH_buffer_length_signal, video_buffer);
video_playback_pointer = 0;
WATCH(video_playback_pointer);
DASH_playback_pointer = registerSignal("DASHVideoPlaybackPointer");
emit(DASH_playback_pointer, video_playback_pointer);
video_current_quality_index = 0; // start with min quality
DASH_quality_level_signal = registerSignal("DASHQualityLevel");
emit(DASH_quality_level_signal, video_current_quality_index);
video_is_playing = false;
DASH_video_is_playing_signal = registerSignal("DASHVideoPlaybackStatus");
//emit(DASH_video_is_playing_signal, video_is_playing);
//statistics
msgsRcvd = msgsSent = bytesRcvd = bytesSent = 0;
WATCH(msgsRcvd);
WATCH(msgsSent);
WATCH(bytesRcvd);
WATCH(bytesSent);
WATCH(numRequestsToSend);
//simtime_t startTime = par("startTime");
video_startTime = par("video_startTime").doubleValue();
stopTime = par("stopTime");
if (stopTime != 0 && stopTime <= video_startTime)
error("Invalid startTime/stopTime parameters");
timeoutMsg = new cMessage("timer");
timeoutMsg->setKind(MSGKIND_CONNECT);
//scheduleAt(startTime, timeoutMsg);
EV<< "start time: " << video_startTime << "\n";
scheduleAt(simTime()+(simtime_t)video_startTime, timeoutMsg);
}
void TcpVideoStreamCliApp::sendRequest() {
EV<< "sending request, " << numRequestsToSend-1 << " more to go\n";
// Request length
long requestLength = par("requestLength");
if (requestLength < 1) requestLength = 1;
// Reply length
long replyLength = -1;
if (manifestAlreadySent) {
replyLength = video_packet_size_per_second[video_current_quality_index] / 8 * 1000; // kbits -> bytes
// Log requested quality
emit(DASH_quality_level_signal, video_current_quality_index);
numRequestsToSend--;
// Switching algoritm
tLastPacketRequested = simTime();
} else {
replyLength = manifest_size;
EV<< "sending manifest request\n";
}
msgsSent++;
bytesSent += requestLength;
const auto& payload = makeShared<GenericAppMsg>();
Packet *packet = new Packet("data");
payload->setChunkLength(B(requestLength));
payload->setExpectedReplyLength(replyLength);
payload->setServerClose(false);
packet->insertAtBack(payload);
sendPacket(packet);
}
void TcpVideoStreamCliApp::handleTimer(cMessage *msg) {
switch (msg->getKind()) {
case MSGKIND_CONNECT:
EV<< "starting session\n";
emit(DASH_video_is_playing_signal, video_is_playing);
connect(); // active OPEN
break;
case MSGKIND_SEND:
sendRequest();
// no scheduleAt(): next request will be sent when reply to this one
// arrives (see socketDataArrived())
break;
case MSGKIND_VIDEO_PLAY:
EV<< "---------------------> Video play event";
cancelAndDelete(msg);
video_buffer--;
emit(DASH_buffer_length_signal, video_buffer);
video_playback_pointer++;
emit(DASH_playback_pointer, video_playback_pointer);
if (video_buffer == 0) {
video_is_playing = false;
//cTimestampedValue tmp(simTime() + (simtime_t) 1, (long) video_is_playing);
//emit(DASH_video_is_playing_signal, &tmp);
emit(DASH_video_is_playing_signal, video_is_playing);
}
if (video_buffer > 0) {
simtime_t d = simTime() + 1;
cMessage *videoPlaybackMsg = new cMessage("playback");
videoPlaybackMsg->setKind(MSGKIND_VIDEO_PLAY);
scheduleAt(d, videoPlaybackMsg);
//rescheduleOrDeleteTimer(d, MSGKIND_VIDEO_PLAY);
}
if (!video_is_buffering && numRequestsToSend > 0) {
// Now the buffer has some space
video_is_buffering = true;
simtime_t d = simTime();
rescheduleOrDeleteTimer(d, MSGKIND_SEND);
}
break;
default:
throw cRuntimeError("Invalid timer msg: kind=%d", msg->getKind());
}
}
void TcpVideoStreamCliApp::socketEstablished(int connId, void *ptr) {
TcpBasicClientApp::socketEstablished(connId, ptr);
// perform first request
sendRequest();
}
void TcpVideoStreamCliApp::rescheduleOrDeleteTimer(simtime_t d,
short int msgKind) {
cancelEvent (timeoutMsg);
if (stopTime == 0 || stopTime > d) {
timeoutMsg->setKind(msgKind);
scheduleAt(d, timeoutMsg);
} else {
delete timeoutMsg;
timeoutMsg = NULL;
}
}
void TcpVideoStreamCliApp::socketDataArrived(int connId, void *ptr, Packet *msg,
bool urgent) {
TcpAppBase::socketDataArrived(connId, ptr, msg, urgent);
if (!manifestAlreadySent) {
manifestAlreadySent = true;
if (timeoutMsg) {
// Send new request
simtime_t d = simTime();
rescheduleOrDeleteTimer(d, MSGKIND_SEND);
}
return;
}
// Switching algorithm
packetTimePointer = (packetTimePointer + 1) % packetTimeArrayLength;
packetTime[packetTimePointer] = simTime() - tLastPacketRequested;
video_buffer++;
emit(DASH_buffer_length_signal, video_buffer);
// Update switch timer
if(!can_switch) {
switch_timer--;
if (switch_timer == 0) {
can_switch = true;
switch_timer = switch_timeout;
}
}
// Full buffer
if (video_buffer == video_buffer_max_length) {
video_is_buffering = false;
// switch to higher quality (if possible)
if (can_switch) {
// Switching algorithm
simtime_t tSum = 0;
for (int i = 0; i < packetTimeArrayLength; i++) {
tSum = tSum + packetTime[i];
}
double estimatedBitRate = (packetTimeArrayLength * video_packet_size_per_second[video_current_quality_index]) / tSum;
EV<< "---------------------> Bit rate estimation:\n";
EV<< "---------------------> Estimated bit rate = " << estimatedBitRate << "\n";
int qmax = video_packet_size_per_second.size() -1;
if (estimatedBitRate > video_packet_size_per_second[std::min(video_current_quality_index + 1, qmax)]) {
video_current_quality_index = std::min(video_current_quality_index + 1, qmax);
can_switch = false;
}
}
// the next video fragment will be requested when the buffer gets some space, so nothing to do here.
return;
}
EV<< "---------------------> Buffer=" << video_buffer << " min= " << video_buffer_min_rebuffering << "\n";
// Exit rebuffering state and continue the video playback
if (video_buffer > video_buffer_min_rebuffering || (numRequestsToSend == 0 && video_playback_pointer < video_duration) ) {
if (!video_is_playing) {
video_is_playing = true;
emit(DASH_video_is_playing_signal, video_is_playing);
simtime_t d = simTime() + 1; // the +1 represents the time when the video fragment has been consumed and therefore has to be removed from the buffer.
cMessage *videoPlaybackMsg = new cMessage("playback");
videoPlaybackMsg->setKind(MSGKIND_VIDEO_PLAY);
scheduleAt(d, videoPlaybackMsg);
//rescheduleOrDeleteTimer(d, MSGKIND_VIDEO_PLAY);
}
} else {
video_current_quality_index = std::max(video_current_quality_index - 1, 0);
}
if (numRequestsToSend > 0) {
EV<< "reply arrived\n";
if (timeoutMsg)
{
// Send new request
simtime_t d = simTime();
rescheduleOrDeleteTimer(d, MSGKIND_SEND);
}
int recvd = video_packet_size_per_second[video_current_quality_index] / 8 * 1000;
msgsRcvd++;
bytesRcvd += recvd;
}
else
{
EV << "reply to last request arrived, closing session\n";
close();
}
}
void TcpVideoStreamCliApp::socketClosed(int connId, void *ptr) {
TcpBasicClientApp::socketClosed(connId, ptr);
// Nothing to do here...
}
void TcpVideoStreamCliApp::socketFailure(int connId, void *ptr, int code) {
TcpBasicClientApp::socketFailure(connId, ptr, code);
// reconnect after a delay
if (timeoutMsg) {
simtime_t d = simTime() + (simtime_t) par("reconnectInterval");
rescheduleOrDeleteTimer(d, MSGKIND_CONNECT);
}
}
void TcpVideoStreamCliApp::refreshDisplay() const
{
char buf[64];
sprintf(buf, "rcvd: %ld pks %ld bytes\nsent: %ld pks %ld bytes", msgsRcvd, bytesRcvd, msgsSent, bytesSent);
getDisplayString().setTagArg("t", 0, buf);
}
}
| [
"andrei@charizard.charizard"
] | andrei@charizard.charizard |
28413a37a8c0c24cdc9153293e8f8350f0ec3703 | aa0a4683001b86a946505d8c70bbf04214d9a92c | /Algorithms:ProblemSolving/hacker-rank-extra-long-factorial.cpp | 293bb67421308308dd328834a4daee0c56ff8705 | [] | no_license | iskilia/Coding-Challenges | 8b5d42572d5aff38d3fe544ae5bfc3ad26c6e29e | 7e0484e9f86c09976d4dd26a4c03adba51ea37f1 | refs/heads/master | 2021-01-16T00:42:29.563165 | 2020-03-02T01:40:50 | 2020-03-02T01:40:50 | 99,970,871 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 604 | cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> d;
d.push_back(1);
for (int i = 2; i <= n; ++i) {
for (auto it = d.begin(); it != d.end(); ++it)
*it *= i;
for (size_t j = 0; j < d.size(); ++j) {
if (d[j] < 10)
continue;
if (j == d.size() - 1)
d.push_back(0);
d[j + 1] += d[j] / 10;
d[j] %= 10;
}
}
for (auto it = d.rbegin(); it != d.rend(); ++it)
cout << *it;
return 0;
}
| [
"isaackilis@gmail.com"
] | isaackilis@gmail.com |
80668767010547f10c6eb302411c2e4c3473cdde | b9cd09bf5c88e1a11284d27e2e2b91842424a743 | /Visual_C++_MFC_examples/Part 6 기타주제/35장 디버깅에 대하여/RemoteTest/RemoteTest/RemoteTestDlg.h | 046cb12e4569318ab7dc1dfe484561f94bf06ba7 | [] | no_license | uki0327/book_source | 4bab68f90b4ec3d2e3aad72ec53877f6cc19a895 | a55750464e75e3a9b586dded1f99c3c67ff1e8c9 | refs/heads/master | 2023-02-21T07:13:11.213967 | 2021-01-29T06:16:31 | 2021-01-29T06:16:31 | 330,401,135 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 596 | h |
// RemoteTestDlg.h : header file
//
#pragma once
// CRemoteTestDlg dialog
class CRemoteTestDlg : public CDialog
{
// Construction
public:
CRemoteTestDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
enum { IDD = IDD_REMOTETEST_DIALOG };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
DECLARE_MESSAGE_MAP()
};
| [
"uki0327@gmail.com"
] | uki0327@gmail.com |
962765ea96226a5f7c407a625ea5bfd2fb238d76 | d3cb3b6792e59c17b845b7928f820f2b7a2af8d0 | /units/include/randomcat/units/unit.hpp | e574a455b43e2cfb1d7931b9e88eed06b8b28390 | [] | no_license | randomnetcat/cpp-libraries | 9d0b86a24e3d3f4a1171b15946c4a66fb13b8f41 | 228256c01ebd06bef18dc016e42a3dbce4ce4a2e | refs/heads/master | 2022-07-07T03:56:49.297537 | 2020-05-13T20:51:43 | 2020-05-13T20:51:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 421 | hpp | #pragma once
#include <ratio>
#include "randomcat/units/detail/ratio_util.hpp"
#include "randomcat/units/detail/util.hpp"
namespace randomcat::units {
// Users are not permitted to inspect the template arguments to unit
template<typename TagCountMap, typename Scale = std::ratio<1, 1>>
struct unit {
static_assert(detail::is_ratio_v<Scale>, "Scale must be an instantiation of std::ratio");
};
} | [
"jason.e.cobb@gmail.com"
] | jason.e.cobb@gmail.com |
1a2eafade0d1db46fb3c15c8d148dd3b779792f3 | 69d13da48fdf391117395d55bc3bb92ec23800c8 | /UE4Firebase/Source/UE4Firebase/UE4FirebaseHUD.cpp | ed074673abcceb6c109871281b67d2390eebbcd0 | [
"MIT"
] | permissive | skjobs3/UE4Firebase | e51a99f7e548cbafd97388df1a4612e1ba738a2b | aafebfe11ba8d1078e81126fd22552abd349c697 | refs/heads/master | 2020-05-16T09:53:50.344630 | 2019-04-23T11:16:13 | 2019-04-23T11:16:13 | 182,964,824 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,064 | cpp | // Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#include "UE4FirebaseHUD.h"
#include "Engine/Canvas.h"
#include "Engine/Texture2D.h"
#include "TextureResource.h"
#include "CanvasItem.h"
#include "UObject/ConstructorHelpers.h"
AUE4FirebaseHUD::AUE4FirebaseHUD()
{
// Set the crosshair texture
static ConstructorHelpers::FObjectFinder<UTexture2D> CrosshairTexObj(TEXT("/Game/FirstPerson/Textures/FirstPersonCrosshair"));
CrosshairTex = CrosshairTexObj.Object;
}
void AUE4FirebaseHUD::DrawHUD()
{
Super::DrawHUD();
// Draw very simple crosshair
// find center of the Canvas
const FVector2D Center(Canvas->ClipX * 0.5f, Canvas->ClipY * 0.5f);
// offset by half the texture's dimensions so that the center of the texture aligns with the center of the Canvas
const FVector2D CrosshairDrawPosition( (Center.X),
(Center.Y + 20.0f));
// draw the crosshair
FCanvasTileItem TileItem( CrosshairDrawPosition, CrosshairTex->Resource, FLinearColor::White);
TileItem.BlendMode = SE_BLEND_Translucent;
Canvas->DrawItem( TileItem );
}
| [
"skjobs3@gmail.com"
] | skjobs3@gmail.com |
a8f68d566720163c18e6e9e739c73631d7a1318d | d15d4c2932159033e7563fe0889a2874b4822ce2 | /My Templates/Standard.cpp | b485f622c6214f26e007d27416569a7cbab9ac72 | [
"MIT"
] | permissive | lxdlam/CP-Answers | fd0ee514d87856423cb31d28298c75647f163067 | cde519ef9732ff9e4e9e3f53c00fb30d07bdb306 | refs/heads/master | 2021-03-17T04:50:44.772167 | 2020-05-04T09:24:32 | 2020-05-04T09:24:32 | 86,518,969 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 3,433 | cpp | #include <bits/stdc++.h>
using namespace std;
#define TemplateVersion "3.7.1"
// Useful Marcos
//====================START=====================
// Compile use C++11 and above
#ifdef LOCAL
#define debug(args...) \
do { \
string _s = #args; \
replace(_s.begin(), _s.end(), ',', ' '); \
stringstream _ss(_s); \
istream_iterator<string> _it(_ss); \
err(_it, args); \
} while (0)
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
cerr << *it << " = " << a << endl;
err(++it, args...);
}
#define MSG cout << "Finished" << endl
#else
#define debug(args...)
#define MSG
#endif
#if __cplusplus >= 201703L
template <typename... Args>
void readln(Args&... args) {
((cin >> args), ...);
}
template <typename... Args>
void writeln(Args... args) {
((cout << args << " "), ...);
cout << endl;
}
#elif __cplusplus >= 201103L
void readln() {}
template <typename T, typename... Args>
void readln(T& a, Args&... args) {
cin >> a;
readln(args...);
}
void writeln() { cout << endl; }
template <typename T, typename... Args>
void writeln(T a, Args... args) {
cout << a << " ";
writeln(args...);
}
#endif
#if __cplusplus >= 201103L
#define FOR(_i, _begin, _end) for (auto _i = _begin; _i < _end; _i++)
#define FORR(_i, _begin, _end) for (auto _i = _begin; _i > _end; _i--)
#else
#define FOR(_i, _begin, _end) for (int _i = (int)_begin; _i < (int)_end; _i++)
#define FORR(_i, _begin, _end) for (int _i = (int)_begin; _i > (int)_end; _i--)
#define nullptr NULL
#endif
#if __cplusplus >= 201103L
#define VIS(_kind, _name, _size) \
vector<_kind> _name(_size); \
for (auto& i : _name) cin >> i;
#else
#define VIS(_kind, _name, _size) \
vector<_kind> _name; \
_name.resize(_size); \
for (int i = 0; i < _size; i++) cin >> _name[i];
#endif
// alias
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define clr(x) memset((x), 0, sizeof(x))
#define infty(x) memset((x), 0x3f, sizeof(x))
#define tcase() \
int T; \
cin >> T; \
FOR(kase, 1, T + 1)
// Swap max/min
template <typename T>
bool smax(T& a, const T& b) {
if (a > b) return false;
a = b;
return true;
}
template <typename T>
bool smin(T& a, const T& b) {
if (a < b) return false;
a = b;
return true;
}
// ceil divide
template <typename T>
T cd(T a, T b) {
return (a + b - 1) / b;
}
// min exchange
template <typename T>
bool se(T& a, T& b) {
if (a < b) return false;
swap(a, b);
return true;
}
// A better MAX choice
const int INF = 0x3f3f3f3f;
const long long INFLL = 0x3f3f3f3f3f3f3f3fLL;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef set<int> si;
typedef vector<string> cb;
//====================END=====================
// Constants here
// Pre-Build Function
inline void build() {}
// Actual Solver
inline void solve() {}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
#ifdef LOCAL
clock_t _begin = clock();
#endif
build();
solve();
#ifdef LOCAL
cerr << "Time elapsed: " << (double)(clock() - _begin) * 1000 / CLOCKS_PER_SEC << "ms." << endl;
#endif
return 0;
} | [
"lxdlam@gmail.com"
] | lxdlam@gmail.com |
7df1a30f3f606e3cd6feb307c629865b5dc53642 | 0df3aac8e0affbbd00171efe78d838c357cd854c | /code/Lecture11Final/build-Lecture11-Desktop_Qt_5_13_2_MinGW_32_bit-Debug/debug/moc_gtable.cpp | 36b8412b6c0e51023cd5c94e759febecc7936181 | [] | no_license | takohack/cs106B-2020summer | 2c14ff57c6c23227073363e8099f372e19b5b405 | d5a22c27d327f00b140d1f4063df84c460fb8817 | refs/heads/master | 2022-12-22T08:19:38.417893 | 2020-09-23T16:50:09 | 2020-09-23T16:50:09 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,261 | cpp | /****************************************************************************
** Meta object code from reading C++ file 'gtable.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.13.2)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include <memory>
#include "../../Lecture11Final/lib/StanfordCPPLib/graphics/gtable.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qmetatype.h>
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'gtable.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 67
#error "This file was generated using the moc from 5.13.2. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
struct qt_meta_stringdata__Internal_QItemDelegate_t {
QByteArrayData data[1];
char stringdata0[24];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata__Internal_QItemDelegate_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata__Internal_QItemDelegate_t qt_meta_stringdata__Internal_QItemDelegate = {
{
QT_MOC_LITERAL(0, 0, 23) // "_Internal_QItemDelegate"
},
"_Internal_QItemDelegate"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data__Internal_QItemDelegate[] = {
// content:
8, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
0 // eod
};
void _Internal_QItemDelegate::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
QT_INIT_METAOBJECT const QMetaObject _Internal_QItemDelegate::staticMetaObject = { {
&QStyledItemDelegate::staticMetaObject,
qt_meta_stringdata__Internal_QItemDelegate.data,
qt_meta_data__Internal_QItemDelegate,
qt_static_metacall,
nullptr,
nullptr
} };
const QMetaObject *_Internal_QItemDelegate::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *_Internal_QItemDelegate::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata__Internal_QItemDelegate.stringdata0))
return static_cast<void*>(this);
return QStyledItemDelegate::qt_metacast(_clname);
}
int _Internal_QItemDelegate::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QStyledItemDelegate::qt_metacall(_c, _id, _a);
return _id;
}
struct qt_meta_stringdata__Internal_QTableWidget_t {
QByteArrayData data[10];
char stringdata0[131];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata__Internal_QTableWidget_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata__Internal_QTableWidget_t qt_meta_stringdata__Internal_QTableWidget = {
{
QT_MOC_LITERAL(0, 0, 22), // "_Internal_QTableWidget"
QT_MOC_LITERAL(1, 23, 16), // "handleCellChange"
QT_MOC_LITERAL(2, 40, 0), // ""
QT_MOC_LITERAL(3, 41, 3), // "row"
QT_MOC_LITERAL(4, 45, 6), // "column"
QT_MOC_LITERAL(5, 52, 21), // "handleCellDoubleClick"
QT_MOC_LITERAL(6, 74, 21), // "handleSelectionChange"
QT_MOC_LITERAL(7, 96, 14), // "QItemSelection"
QT_MOC_LITERAL(8, 111, 8), // "selected"
QT_MOC_LITERAL(9, 120, 10) // "deselected"
},
"_Internal_QTableWidget\0handleCellChange\0"
"\0row\0column\0handleCellDoubleClick\0"
"handleSelectionChange\0QItemSelection\0"
"selected\0deselected"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data__Internal_QTableWidget[] = {
// content:
8, // revision
0, // classname
0, 0, // classinfo
3, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// slots: name, argc, parameters, tag, flags
1, 2, 29, 2, 0x0a /* Public */,
5, 2, 34, 2, 0x0a /* Public */,
6, 2, 39, 2, 0x0a /* Public */,
// slots: parameters
QMetaType::Void, QMetaType::Int, QMetaType::Int, 3, 4,
QMetaType::Void, QMetaType::Int, QMetaType::Int, 3, 4,
QMetaType::Void, 0x80000000 | 7, 0x80000000 | 7, 8, 9,
0 // eod
};
void _Internal_QTableWidget::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
auto *_t = static_cast<_Internal_QTableWidget *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->handleCellChange((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
case 1: _t->handleCellDoubleClick((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
case 2: _t->handleSelectionChange((*reinterpret_cast< const QItemSelection(*)>(_a[1])),(*reinterpret_cast< const QItemSelection(*)>(_a[2]))); break;
default: ;
}
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 2:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 1:
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QItemSelection >(); break;
}
break;
}
}
}
QT_INIT_METAOBJECT const QMetaObject _Internal_QTableWidget::staticMetaObject = { {
&QTableWidget::staticMetaObject,
qt_meta_stringdata__Internal_QTableWidget.data,
qt_meta_data__Internal_QTableWidget,
qt_static_metacall,
nullptr,
nullptr
} };
const QMetaObject *_Internal_QTableWidget::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *_Internal_QTableWidget::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata__Internal_QTableWidget.stringdata0))
return static_cast<void*>(this);
if (!strcmp(_clname, "_Internal_QWidget"))
return static_cast< _Internal_QWidget*>(this);
return QTableWidget::qt_metacast(_clname);
}
int _Internal_QTableWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QTableWidget::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 3)
qt_static_metacall(this, _c, _id, _a);
_id -= 3;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 3)
qt_static_metacall(this, _c, _id, _a);
_id -= 3;
}
return _id;
}
QT_WARNING_POP
QT_END_MOC_NAMESPACE
| [
"unclejyj@gmail.com"
] | unclejyj@gmail.com |
ae01970c4f804c087a30a36578939948f4091f78 | d420321e509b7ab7489c66818ff3fd101078f2b9 | /NES/PadEX/EXPAD_Paddle.h | bcbf0e16f5b762391cee69d2b6faf279aada5939 | [] | no_license | ivysnow/virtuanes | e46de5aebb6c6c8665146c2196c0a21d41f49de6 | 2c0fc60bc40a3c7d21894f148b2d5f953937b520 | refs/heads/master | 2023-08-04T20:06:12.411275 | 2023-07-31T14:57:04 | 2023-07-31T14:57:04 | 102,850,505 | 24 | 17 | null | null | null | null | UTF-8 | C++ | false | false | 640 | h | //////////////////////////////////////////////////////////////////////////
// Paddle //
//////////////////////////////////////////////////////////////////////////
class EXPAD_Paddle : public EXPAD
{
public:
EXPAD_Paddle( NES* parent ) : EXPAD( parent ) {}
void Reset();
BYTE Read4016();
BYTE Read4017();
void Write4016( BYTE data );
void Sync();
void SetSyncData( INT type, LONG data );
LONG GetSyncData( INT type );
protected:
BYTE paddle_bits;
BYTE paddle_data;
BYTE paddle_posold;
LONG paddle_x;
BYTE paddle_button;
private:
};
| [
"ivysnow@mac.com"
] | ivysnow@mac.com |
fb1cdd79d2ccb26722c700a2d40a651e136c49b2 | 67f988dedfd8ae049d982d1a8213bb83233d90de | /external/chromium/chrome/browser/ui/ash/app_sync_ui_state.cc | 25e44d7f39ac9b80ec45711973ddce808f8f4e99 | [
"BSD-3-Clause"
] | permissive | opensourceyouthprogramming/h5vcc | 94a668a9384cc3096a365396b5e4d1d3e02aacc4 | d55d074539ba4555e69e9b9a41e5deb9b9d26c5b | refs/heads/master | 2020-04-20T04:57:47.419922 | 2019-02-12T00:56:14 | 2019-02-12T00:56:14 | 168,643,719 | 1 | 1 | null | 2019-02-12T00:49:49 | 2019-02-01T04:47:32 | C++ | UTF-8 | C++ | false | false | 4,209 | cc | // Copyright (c) 2012 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/browser/ui/ash/app_sync_ui_state.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/extensions/pending_extension_manager.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/ui/ash/app_sync_ui_state_factory.h"
#include "chrome/browser/ui/ash/app_sync_ui_state_observer.h"
#include "chrome/common/chrome_notification_types.h"
#include "content/public/browser/notification_service.h"
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/login/user_manager.h"
#endif
namespace {
// Max loading animation time in milliseconds.
const int kMaxSyncingTimeMs = 60 * 1000;
} // namespace
// static
AppSyncUIState* AppSyncUIState::Get(Profile* profile) {
return AppSyncUIStateFactory::GetForProfile(profile);
}
// static
bool AppSyncUIState::ShouldObserveAppSyncForProfile(Profile* profile) {
#if defined(OS_CHROMEOS)
if (chromeos::UserManager::Get()->IsLoggedInAsGuest())
return false;
if (!profile || profile->IsOffTheRecord())
return false;
if (!ProfileSyncServiceFactory::HasProfileSyncService(profile))
return false;
const bool is_new_profile = profile->GetPrefs()->GetInitializationStatus() ==
PrefService::INITIALIZATION_STATUS_CREATED_NEW_PROFILE;
return is_new_profile;
#else
return false;
#endif
}
AppSyncUIState::AppSyncUIState(Profile* profile)
: profile_(profile),
sync_service_(NULL),
status_(STATUS_NORMAL) {
StartObserving();
}
AppSyncUIState::~AppSyncUIState() {
StopObserving();
}
void AppSyncUIState::AddObserver(AppSyncUIStateObserver* observer) {
observers_.AddObserver(observer);
}
void AppSyncUIState::RemoveObserver(AppSyncUIStateObserver* observer) {
observers_.RemoveObserver(observer);
}
void AppSyncUIState::StartObserving() {
DCHECK(ShouldObserveAppSyncForProfile(profile_));
DCHECK(!sync_service_);
registrar_.Add(this,
chrome::NOTIFICATION_EXTENSION_LOADED,
content::Source<Profile>(profile_));
sync_service_ = ProfileSyncServiceFactory::GetForProfile(profile_);
CHECK(sync_service_);
sync_service_->AddObserver(this);
}
void AppSyncUIState::StopObserving() {
if (!sync_service_)
return;
registrar_.RemoveAll();
sync_service_->RemoveObserver(this);
sync_service_ = NULL;
profile_ = NULL;
}
void AppSyncUIState::SetStatus(Status status) {
if (status_ == status)
return;
status_ = status;
switch (status_) {
case STATUS_SYNCING:
max_syncing_status_timer_.Start(
FROM_HERE,
base::TimeDelta::FromMilliseconds(kMaxSyncingTimeMs),
this, &AppSyncUIState::OnMaxSyncingTimer);
break;
case STATUS_NORMAL:
case STATUS_TIMED_OUT:
max_syncing_status_timer_.Stop();
StopObserving();
break;
}
FOR_EACH_OBSERVER(AppSyncUIStateObserver,
observers_,
OnAppSyncUIStatusChanged());
}
void AppSyncUIState::CheckAppSync() {
if (!sync_service_ || !sync_service_->HasSyncSetupCompleted())
return;
const bool synced = sync_service_->ShouldPushChanges();
const bool has_pending_extension =
extensions::ExtensionSystem::Get(profile_)->extension_service()->
pending_extension_manager()->HasPendingExtensionFromSync();
if (synced && !has_pending_extension)
SetStatus(STATUS_NORMAL);
else
SetStatus(STATUS_SYNCING);
}
void AppSyncUIState::OnMaxSyncingTimer() {
SetStatus(STATUS_TIMED_OUT);
}
void AppSyncUIState::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
DCHECK_EQ(chrome::NOTIFICATION_EXTENSION_LOADED, type);
CheckAppSync();
}
void AppSyncUIState::OnStateChanged() {
DCHECK(sync_service_);
CheckAppSync();
}
| [
"rjogrady@google.com"
] | rjogrady@google.com |
ee93a8a950aa0f64cc2c04a3cf376e205330cf50 | 63b780d4f90e6c7c051d516bf380f596809161a1 | /FreeEarthSDK/src/FeTriton/WakeGenerator.cpp | e1e030188688df2981bcd4036486d109b43a1610 | [] | no_license | hewuhun/OSG | 44f4a0665b4a20756303be21e71f0e026e384486 | cfea9a84711ed29c0ca0d0bfec633ec41d8b8cec | refs/heads/master | 2022-09-05T00:44:54.244525 | 2020-05-26T14:44:03 | 2020-05-26T14:44:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,749 | cpp | // Copyright (c) 2011-2015 Sundog Software LLC. All rights reserved worldwide.
#include <FeTriton/WakeGenerator.h>
#include <FeTriton/Ocean.h>
#include <FeTriton/WakeManager.h>
#include <FeTriton/Configuration.h>
using namespace Triton;
WakeGeneratorParameters::WakeGeneratorParameters()
{
sprayEffects = false;
bowSprayOffset = 50.0;
sprayVelocityScale = 1.0;
spraySizeScale = 1.0;
bowWave = true;
bowWaveOffset = 50.0;
bowWaveScale = 1.0;
bowWaveMax = -1.0;
bowSize = 0;
sternWaveOffset = -50.0;
sternWaves = true;
length = 100.0;
beamWidth = 20.0;
draft = 5.0;
propWash = true;
propWashOffset = 0.0;
propWashWidthMultiplier = 1.5;
Configuration::GetDoubleValue("prop-wash-default-width-multiplier", propWashWidthMultiplier);
propWashFadeTime = 1000.0;
Configuration::GetDoubleValue("prop-wash-default-fade-time", propWashFadeTime);
bowWakeMultiplier = 1.0;
Configuration::GetDoubleValue("bow-wake-size-multiplier", bowWakeMultiplier);
sternWakeMultiplier = 1.0;
Configuration::GetDoubleValue("stern-wake-size-multiplier", sternWakeMultiplier);
numHullSprays = 0;
hullSprayStartOffset = 40.0;
hullSprayEndOffset = -50.0;
hullSprayScale = 0.5;
hullSpraySizeScale = 1.0;
hullSprayVerticalOffset = 0.0;
}
static int numWakes = 0;
WakeGenerator::WakeGenerator(Ocean *pOcean, const WakeGeneratorParameters& pParams)
: lastSprayEmitTime(0), firstEmit(true), wakeNumber(0), lastWakeNumber(-1), registered(false),
lodDistance(0), distanceTravelled(0), lastPosition(0,0,0), registeredWakeManager(false)
{
if (!pOcean) {
Utils::DebugMsg("Null Ocean object passed into WakeGenerator!");
ocean = 0;
return;
}
ocean = pOcean;
params = pParams;
hullSpeed = 5.0 * sqrt(params.length * ocean->GetEnvironment()->GetWorldUnits()); // km/hr
hullSpeed *= (1000.0 / 3600.0); // m/s
hullSpeed /= ocean->GetEnvironment()->GetWorldUnits(); // back to native units
minPropSegmentLength = 10.0;
Configuration::GetDoubleValue("min-prop-wash-segment-length", minPropSegmentLength);
minPropSegmentLength /= ocean->GetEnvironment()->GetWorldUnits();
decayRate = 1.0 / 3.0;
Configuration::GetDoubleValue("wake-wave-decay", decayRate);
sprayPositionVariation = 2.0;
Configuration::GetDoubleValue("wake-spray-position-variation", sprayPositionVariation);
sprayPositionVariation /= ocean->GetEnvironment()->GetWorldUnits();
curveGenerationFactor = 2.0;
Configuration::GetDoubleValue("wake-wave-curve-generation-factor", curveGenerationFactor);
sprayCullDist = 1000.0;
Configuration::GetDoubleValue("wake-spray-cull-distance", sprayCullDist);
sprayCullDist /= ocean->GetEnvironment()->GetWorldUnits();
gravity = 9.81;
Configuration::GetDoubleValue("wave-gravity-force", gravity);
gravity /= ocean->GetEnvironment()->GetWorldUnits();
double maxDistance = 0;
Configuration::GetDoubleValue("max-wake-generator-distance", maxDistance);
maxDistance /= ocean->GetEnvironment()->GetWorldUnits();
maxDistanceSquared = maxDistance * maxDistance;
maxWakes = 0;
Configuration::GetIntValue("wake-generator-distance-threshold", maxWakes);
}
WakeGenerator::~WakeGenerator()
{
if (ocean && registered) {
ocean->UnregisterWakeGenerator(this);
}
ClearWakes();
numWakes--;
}
const WakeGeneratorParameters& WakeGenerator::GetParameters() const
{
return params;
}
void WakeGenerator::SetParameters(const WakeGeneratorParameters& p)
{
params = p;
}
void WakeGenerator::ClearWakes()
{
if (ocean && registeredWakeManager) {
WakeManager *wakeManager = ocean->GetWakeManager();
if (wakeManager) {
wakeManager->RemoveWakeGenerator(this);
wakeManager->RemoveLeewardDampener(this);
registeredWakeManager = false;
}
}
}
void WakeGenerator::Update(const Vector3& pPosition, const Vector3& direction, double pVelocity, double pTime)
{
if (maxDistanceSquared > 0 && numWakes > maxWakes && ocean) {
double distSq = (pPosition - ocean->GetEnvironment()->GetCameraPosition()).SquaredLength();
if (distSq > maxDistanceSquared) return;
}
if (!registered) {
if (ocean) {
ocean->RegisterWakeGenerator(this);
registered = true;
numWakes++;
}
}
if (!registeredWakeManager) {
if (ocean) {
WakeManager *wakeManager = ocean->GetWakeManager();
if (wakeManager) {
if (params.bowWave) wakeManager->AddExplicitWave(this, params.length * 0.5);
wakeManager->AddLeewardDampener(this);
registeredWakeManager = true;
}
}
}
if (lastPosition.SquaredLength() > 0) {
distanceTravelled += (pPosition - lastPosition).Length();
}
lastPosition = pPosition;
Vector3 dir = direction;
dir.Normalize();
position = pPosition;
washPosition = position + dir * (params.propWashOffset);
sternPosition = position + dir * params.sternWaveOffset;
Vector3 bowPosition = position + dir * params.bowWaveOffset;
WakeManager *wakeManager = 0;
if (ocean) wakeManager = ocean->GetWakeManager();
// Update leeward dampener
if (wakeManager) {
Vector3 bow = position + dir * params.bowSprayOffset;
if ((bow - washPosition).SquaredLength() > (bow - sternPosition).SquaredLength()) {
wakeManager->UpdateLeewardDampener(this, bow, washPosition, pVelocity);
} else {
wakeManager->UpdateLeewardDampener(this, bow, sternPosition, pVelocity);
}
}
velocity = pVelocity;
if (ocean && velocity > 0) {
if (wakeManager) {
if (params.bowWave && ocean->GetEnvironment()) {
double bowWakeWavelength = (velocity / hullSpeed) * params.length * params.bowWakeMultiplier;
if (bowWakeWavelength < params.bowSize) bowWakeWavelength = params.bowSize;
// Bow wake size reference: Bow Wave Dynamics - T. A. Waniewski, C. E. Brennen, and F. Raichlen
// Journal of Ship Research, Vol. 46, No. 1, March 2002, pp. 1?5
double mVelocity = velocity * ocean->GetEnvironment()->GetWorldUnits();
double mDraft = params.draft * ocean->GetEnvironment()->GetWorldUnits();
double U2 = mVelocity * mVelocity;
double d12 = mDraft > 0 ? sqrt(mDraft) : 0;
double amplitude = U2 * d12 * 0.01;
amplitude *= params.bowWaveScale;
amplitude /= ocean->GetEnvironment()->GetWorldUnits();
if (params.bowWaveMax > 0 && amplitude > params.bowWaveMax) {
amplitude = params.bowWaveMax;
}
wakeManager->UpdateExplicitWave(this, bowPosition, dir, amplitude, bowWakeWavelength);
}
if (lastWakeNumber >= 0 && params.propWash) {
Vector3 washDir = dir;
washDir.Normalize();
Vector3 updatedPosition = lastEmitSourcePosition + washDir * params.propWashOffset;
Vector3 updatedDelta = lastEmitPosition - washPosition;
wakeManager->UpdatePropWash(lastWakeNumber, washPosition, updatedDelta, pTime, this);
}
double distanceSinceLastWash = (lastEmitPosition - washPosition).Length();
double distanceSinceLastWake = (lastWakePosition - position).Length();
double lengthThreshold = ((TRITON_TWOPI * velocity * velocity) / gravity) * params.sternWakeMultiplier;
if ((distanceSinceLastWake > lengthThreshold) && params.sternWaves) {
lastWakePosition = position;
wakeManager->AddKelvinWake(velocity, sternPosition, pTime, decayRate, this);
}
double propWashLengthThreshold = params.length * wakeManager->GetWaveGenerationDistance();
if (!firstEmit) {
Vector3 prevVector = (lastEmitPosition - lastLastEmitPosition);
prevVector.Normalize();
Vector3 thisVector = (washPosition - lastEmitPosition);
thisVector.Normalize();
double cosAngle = prevVector.Dot(thisVector);
double angle = acos(cosAngle);
cosAngle = cos(angle * curveGenerationFactor);
propWashLengthThreshold *= cosAngle;
}
if (distanceSinceLastWash > propWashLengthThreshold && params.propWash ) {
if ( distanceSinceLastWash > minPropSegmentLength) {
Vector3 delta;
if (!firstEmit) {
delta = lastEmitPosition - washPosition;
lastLastEmitPosition = lastEmitPosition;
} else {
delta = dir * -propWashLengthThreshold;
firstEmit = false;
lastLastEmitPosition = washPosition;
}
lastEmitSourcePosition = pPosition;
lastEmitPosition = washPosition;
lastWakeNumber = wakeNumber;
wakeManager->AddPropWash(wakeNumber++, washPosition, delta, params.length,
params.beamWidth * params.propWashWidthMultiplier, pTime, params.propWashFadeTime, this);
}
}
if (params.sprayEffects) {
double period = wakeManager->GetSprayGenerationPeriod();
if ((pTime - lastSprayEmitTime) > period) {
lastSprayEmitTime = pTime;
Vector3 sprayOrigin = pPosition + dir * params.bowSprayOffset - (dir * sprayPositionVariation);
Vector3 camPos(ocean->GetEnvironment()->GetCameraPosition());
double zoomedCull = sprayCullDist * (double)ocean->GetEnvironment()->GetZoomLevel();
double sprayCullDistSq = zoomedCull * zoomedCull;
if ((camPos - sprayOrigin).SquaredLength() < sprayCullDistSq) {
wakeManager->AddSpray(velocity * params.sprayVelocityScale, sprayOrigin, pTime, params.bowSize > 0 ? params.bowSize : -1.0, params.spraySizeScale);
if (ocean->GetEnvironment() && params.numHullSprays > 0) {
// Add some particle fx on either side of the ship
Vector3 up = ocean->GetEnvironment()->GetUpVector();
Vector3 right = dir.Cross(up);
for (int i = 0; i < params.numHullSprays; i++) {
double sideSprayPosition = ocean->GetEnvironment()->GetRandomNumberGenerator()->GetRandomDouble(params.hullSprayStartOffset, params.hullSprayEndOffset);
double whichSide = ocean->GetEnvironment()->GetRandomNumberGenerator()->GetRandomInt(0, 2) == 0 ? -1.0 : 1.0;
sprayOrigin = pPosition + dir * sideSprayPosition + right * (whichSide * params.beamWidth * 0.5);
if (ocean) {
sprayOrigin = sprayOrigin + ocean->GetEnvironment()->GetUpVector() * params.hullSprayVerticalOffset;
}
wakeManager->AddSpray(velocity * params.hullSprayScale, sprayOrigin, pTime, -1.0, params.hullSpraySizeScale);
}
}
}
}
}
}
}
} | [
"Wang_123456"
] | Wang_123456 |
5489de396cf8abdbd75717a00b76d4ebdf40ffb4 | 72dae4abb89cbf1c8d2d4aef5e677dbd3d74cd6f | /android-11/external/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/extract_key.pass.cpp | 25aa24888868559067e84af346801acc73fac889 | [
"NCSA",
"MIT",
"Apache-2.0"
] | permissive | MrIkso/sdk-tools | aebb05a86e379d2883bae31f4620bcd73d832305 | 53b34cdaca0b94364446f01b5ac3455773db3029 | refs/heads/master | 2023-07-28T21:18:28.712877 | 2021-09-27T06:00:17 | 2021-09-27T06:00:17 | 309,805,035 | 7 | 3 | Apache-2.0 | 2021-09-27T06:00:18 | 2020-11-03T20:56:00 | C++ | UTF-8 | C++ | false | false | 2,255 | cpp | //===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11, c++14
// <unordered_map>
// class unordered_map
// node_type extract(key_type const&);
#include <unordered_map>
#include "min_allocator.h"
#include "Counter.h"
template <class Container, class KeyTypeIter>
void test(Container& c, KeyTypeIter first, KeyTypeIter last)
{
size_t sz = c.size();
assert((size_t)std::distance(first, last) == sz);
for (KeyTypeIter copy = first; copy != last; ++copy)
{
typename Container::node_type t = c.extract(*copy);
assert(!t.empty());
--sz;
assert(t.key() == *copy);
t.key() = *first; // We should be able to mutate key.
assert(t.key() == *first);
assert(t.get_allocator() == c.get_allocator());
assert(sz == c.size());
}
assert(c.size() == 0);
for (KeyTypeIter copy = first; copy != last; ++copy)
{
typename Container::node_type t = c.extract(*copy);
assert(t.empty());
}
}
int main()
{
{
std::unordered_map<int, int> m = {{1,1}, {2,2}, {3,3}, {4,4}, {5,5}, {6,6}};
int keys[] = {1, 2, 3, 4, 5, 6};
test(m, std::begin(keys), std::end(keys));
}
{
std::unordered_map<Counter<int>, Counter<int>> m =
{{1,1}, {2,2}, {3,3}, {4,4}, {5,5}, {6,6}};
{
Counter<int> keys[] = {1, 2, 3, 4, 5, 6};
assert(Counter_base::gConstructed == 12+6);
test(m, std::begin(keys), std::end(keys));
}
assert(Counter_base::gConstructed == 0);
}
{
using min_alloc_map =
std::unordered_map<int, int, std::hash<int>, std::equal_to<int>,
min_allocator<std::pair<const int, int>>>;
min_alloc_map m = {{1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}, {6, 6}};
int keys[] = {1, 2, 3, 4, 5, 6};
test(m, std::begin(keys), std::end(keys));
}
}
| [
"solod9362@gmail.com"
] | solod9362@gmail.com |
320dd5aed2f9a0515c5b11df9c1bf552e782303b | ceed8ee18ab314b40b3e5b170dceb9adedc39b1e | /android/external/pdfium/xfa/src/fgas/src/crt/fx_codepage.cpp | 9348d33065a7b935aaa24035af560168d65ee098 | [
"BSD-3-Clause"
] | permissive | BPI-SINOVOIP/BPI-H3-New-Android7 | c9906db06010ed6b86df53afb6e25f506ad3917c | 111cb59a0770d080de7b30eb8b6398a545497080 | refs/heads/master | 2023-02-28T20:15:21.191551 | 2018-10-08T06:51:44 | 2018-10-08T06:51:44 | 132,708,249 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 18,677 | cpp | // Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "xfa/src/fgas/src/fgas_base.h"
static const FX_CHARSET_MAP g_FXCharset2CodePageTable[] = {
{0, 1252}, {1, 0}, {2, 42}, {77, 10000}, {78, 10001},
{79, 10003}, {80, 10008}, {81, 10002}, {83, 10005}, {84, 10004},
{85, 10006}, {86, 10081}, {87, 10021}, {88, 10029}, {89, 10007},
{128, 932}, {129, 949}, {130, 1361}, {134, 936}, {136, 950},
{161, 1253}, {162, 1254}, {163, 1258}, {177, 1255}, {178, 1256},
{186, 1257}, {204, 1251}, {222, 874}, {238, 1250}, {254, 437},
{255, 850},
};
FX_WORD FX_GetCodePageFromCharset(uint8_t charset) {
int32_t iEnd = sizeof(g_FXCharset2CodePageTable) / sizeof(FX_CHARSET_MAP) - 1;
FXSYS_assert(iEnd >= 0);
int32_t iStart = 0, iMid;
do {
iMid = (iStart + iEnd) / 2;
const FX_CHARSET_MAP& cp = g_FXCharset2CodePageTable[iMid];
if (charset == cp.charset) {
return cp.codepage;
} else if (charset < cp.charset) {
iEnd = iMid - 1;
} else {
iStart = iMid + 1;
}
} while (iStart <= iEnd);
return 0xFFFF;
}
static const FX_CHARSET_MAP g_FXCodepage2CharsetTable[] = {
{1, 0}, {2, 42}, {254, 437}, {255, 850}, {222, 874},
{128, 932}, {134, 936}, {129, 949}, {136, 950}, {238, 1250},
{204, 1251}, {0, 1252}, {161, 1253}, {162, 1254}, {177, 1255},
{178, 1256}, {186, 1257}, {163, 1258}, {130, 1361}, {77, 10000},
{78, 10001}, {79, 10003}, {80, 10008}, {81, 10002}, {83, 10005},
{84, 10004}, {85, 10006}, {86, 10081}, {87, 10021}, {88, 10029},
{89, 10007},
};
FX_WORD FX_GetCharsetFromCodePage(FX_WORD codepage) {
int32_t iEnd = sizeof(g_FXCodepage2CharsetTable) / sizeof(FX_CHARSET_MAP) - 1;
FXSYS_assert(iEnd >= 0);
int32_t iStart = 0, iMid;
do {
iMid = (iStart + iEnd) / 2;
const FX_CHARSET_MAP& cp = g_FXCodepage2CharsetTable[iMid];
if (codepage == cp.codepage) {
return cp.charset;
} else if (codepage < cp.codepage) {
iEnd = iMid - 1;
} else {
iStart = iMid + 1;
}
} while (iStart <= iEnd);
return 0xFFFF;
}
const FX_LANG2CPMAP g_FXLang2CodepageTable[] = {
{FX_LANG_Arabic_SaudiArabia, FX_CODEPAGE_MSWin_Arabic},
{FX_LANG_Bulgarian_Bulgaria, FX_CODEPAGE_MSWin_Cyrillic},
{FX_LANG_Catalan_Catalan, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Chinese_Taiwan, FX_CODEPAGE_ChineseTraditional},
{FX_LANG_CzechRepublic, FX_CODEPAGE_MSWin_EasternEuropean},
{FX_LANG_Danish_Denmark, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_German_Germany, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Greek_Greece, FX_CODEPAGE_MSWin_Greek},
{FX_LANG_English_UnitedStates, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Spanish_TraditionalSort, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Finnish_Finland, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_French_France, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Hebrew_Israel, FX_CODEPAGE_MSWin_Hebrew},
{FX_LANG_Hungarian_Hungary, FX_CODEPAGE_MSWin_EasternEuropean},
{FX_LANG_Icelandic_Iceland, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Italian_Italy, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Japanese_Japan, FX_CODEPAGE_ShiftJIS},
{FX_LANG_Korean_Korea, FX_CODEPAGE_Korean},
{FX_LANG_Dutch_Netherlands, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Norwegian_Bokmal, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Polish_Poland, FX_CODEPAGE_MSWin_EasternEuropean},
{FX_LANG_Portuguese_Brazil, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Romanian_Romania, FX_CODEPAGE_MSWin_EasternEuropean},
{FX_LANG_Russian_Russia, FX_CODEPAGE_MSWin_Cyrillic},
{FX_LANG_Croatian_Croatia, FX_CODEPAGE_MSWin_EasternEuropean},
{FX_LANG_Slovak_Slovakia, FX_CODEPAGE_MSWin_EasternEuropean},
{FX_LANG_Albanian_Albania, FX_CODEPAGE_MSWin_EasternEuropean},
{FX_LANG_Swedish_Sweden, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Thai_Thailand, FX_CODEPAGE_MSDOS_Thai},
{FX_LANG_Turkish_Turkey, FX_CODEPAGE_MSWin_Turkish},
{FX_LANG_Urdu_Pakistan, FX_CODEPAGE_MSWin_Arabic},
{FX_LANG_Indonesian_Indonesia, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Ukrainian_Ukraine, FX_CODEPAGE_MSWin_Cyrillic},
{FX_LANG_Belarusian_Belarus, FX_CODEPAGE_MSWin_Cyrillic},
{FX_LANG_Slovenian_Slovenia, FX_CODEPAGE_MSWin_EasternEuropean},
{FX_LANG_Estonian_Estonia, FX_CODEPAGE_MSWin_Baltic},
{FX_LANG_Latvian_Latvia, FX_CODEPAGE_MSWin_Baltic},
{FX_LANG_Lithuanian_Lithuania, FX_CODEPAGE_MSWin_Baltic},
{FX_LANG_Persian, FX_CODEPAGE_MSWin_Arabic},
{FX_LANG_Vietnamese_Vietnam, FX_CODEPAGE_MSWin_Vietnamese},
{FX_LANG_Armenian_Armenia, FX_CODEPAGE_DefANSI},
{FX_LANG_Azerbaijan_Latin, FX_CODEPAGE_MSWin_Turkish},
{FX_LANG_Basque_Basque, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Macedonian, FX_CODEPAGE_MSWin_Cyrillic},
{FX_LANG_Afrikaans_SouthAfrica, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Georgian_Georgia, FX_CODEPAGE_DefANSI},
{FX_LANG_Faroese_FaroeIslands, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Hindi_India, FX_CODEPAGE_DefANSI},
{FX_LANG_Malay_Malaysia, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Kazakh_Kazakhstan, FX_CODEPAGE_MSWin_Cyrillic},
{FX_LANG_Kyrgyz_Kyrgyzstan, FX_CODEPAGE_MSWin_Cyrillic},
{FX_LANG_Kiswahili_Kenya, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Uzbek_LatinUzbekistan, FX_CODEPAGE_MSWin_Turkish},
{FX_LANG_Tatar_Russia, FX_CODEPAGE_MSWin_Cyrillic},
{FX_LANG_Punjabi_India, FX_CODEPAGE_DefANSI},
{FX_LANG_Gujarati_India, FX_CODEPAGE_DefANSI},
{FX_LANG_Tamil_India, FX_CODEPAGE_DefANSI},
{FX_LANG_Telugu_India, FX_CODEPAGE_DefANSI},
{FX_LANG_Kannada_India, FX_CODEPAGE_DefANSI},
{FX_LANG_Marathi_India, FX_CODEPAGE_DefANSI},
{FX_LANG_SanskritIndia, FX_CODEPAGE_DefANSI},
{FX_LANG_Mongolian_CyrillicMongolia, FX_CODEPAGE_MSWin_Cyrillic},
{FX_LANG_Galician_Galician, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Konkani_India, FX_CODEPAGE_DefANSI},
{FX_LANG_Syriac_Syria, FX_CODEPAGE_DefANSI},
{FX_LANG_Divehi_Maldives, FX_CODEPAGE_DefANSI},
{FX_LANG_Arabic_Iraq, FX_CODEPAGE_MSWin_Arabic},
{FX_LANG_Chinese_PRC, FX_CODEPAGE_ChineseSimplified},
{FX_LANG_German_Switzerland, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_English_UnitedKingdom, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Spanish_Mexico, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_French_Belgium, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Italian_Switzerland, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Dutch_Belgium, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Norwegian_Nynorsk, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Portuguese_Portugal, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_SerbianLatin_Serbia, FX_CODEPAGE_MSWin_EasternEuropean},
{FX_LANG_Swedish_Finland, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Azerbaijan_Cyrillic, FX_CODEPAGE_MSWin_Cyrillic},
{FX_LANG_Malay_BruneiDarussalam, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Uzbek_CyrillicUzbekistan, FX_CODEPAGE_MSWin_Cyrillic},
{FX_LANG_Arabic_Egypt, FX_CODEPAGE_MSWin_Arabic},
{FX_LANG_Chinese_HongKong, FX_CODEPAGE_ChineseTraditional},
{FX_LANG_German_Austria, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_English_Australia, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Spanish_InternationalSort, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_French_Canada, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_SerbianCyrillic_Serbia, FX_CODEPAGE_MSWin_Cyrillic},
{FX_LANG_Arabic_Libya, FX_CODEPAGE_MSWin_Arabic},
{FX_LANG_Chinese_Singapore, FX_CODEPAGE_ChineseSimplified},
{FX_LANG_German_Luxembourg, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_English_Canada, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Spanish_Guatemala, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_French_Switzerland, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Arabic_Algeria, FX_CODEPAGE_MSWin_Arabic},
{FX_LANG_Chinese_Macao, FX_CODEPAGE_ChineseTraditional},
{FX_LANG_German_Liechtenstein, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_English_NewZealand, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Spanish_CostaRica, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_French_Luxembourg, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Arabic_Morocco, FX_CODEPAGE_MSWin_Arabic},
{FX_LANG_English_Ireland, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Spanish_Panama, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_French_Monaco, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Arabic_Tunisia, FX_CODEPAGE_MSWin_Arabic},
{FX_LANG_English_SouthAfrica, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Spanish_DominicanRepublic, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Arabic_Oman, FX_CODEPAGE_MSWin_Arabic},
{FX_LANG_English_Jamaica, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Spanish_Venezuela, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Arabic_Yemen, FX_CODEPAGE_MSWin_Arabic},
{FX_LANG_English_Caribbean, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Spanish_Colombia, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Arabic_Syria, FX_CODEPAGE_MSWin_Arabic},
{FX_LANG_English_Belize, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Spanish_Peru, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Arabic_Jordan, FX_CODEPAGE_MSWin_Arabic},
{FX_LANG_English_TrinidadTobago, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Spanish_Argentina, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Arabic_Lebanon, FX_CODEPAGE_MSWin_Arabic},
{FX_LANG_English_Zimbabwe, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Spanish_Ecuador, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Arabic_Kuwait, FX_CODEPAGE_MSWin_Arabic},
{FX_LANG_English_Philippines, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Spanish_Chile, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Arabic_UAE, FX_CODEPAGE_MSWin_Arabic},
{FX_LANG_Spanish_Uruguay, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Arabic_Bahrain, FX_CODEPAGE_MSWin_Arabic},
{FX_LANG_Spanish_Paraguay, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Arabic_Qatar, FX_CODEPAGE_MSWin_Arabic},
{FX_LANG_Spanish_Bolivia, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Spanish_ElSalvador, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Spanish_Honduras, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Spanish_Nicaragua, FX_CODEPAGE_MSWin_WesternEuropean},
{FX_LANG_Spanish_PuertoRico, FX_CODEPAGE_MSWin_WesternEuropean},
};
FX_WORD FX_GetDefCodePageByLanguage(FX_WORD wLanguage) {
int32_t iEnd = sizeof(g_FXLang2CodepageTable) / sizeof(FX_LANG2CPMAP) - 1;
FXSYS_assert(iEnd >= 0);
int32_t iStart = 0, iMid;
do {
iMid = (iStart + iEnd) / 2;
const FX_LANG2CPMAP& cp = g_FXLang2CodepageTable[iMid];
if (wLanguage == cp.wLanguage) {
return cp.wCodepage;
} else if (wLanguage < cp.wLanguage) {
iEnd = iMid - 1;
} else {
iStart = iMid + 1;
}
} while (iStart <= iEnd);
return 0xFFFF;
}
static const FX_STR2CPHASH g_FXCPHashTable[] = {
{0xd45, 0x6faf}, {0xd46, 0x6fb0}, {0xd47, 0x6fb1},
{0xd48, 0x6fb2}, {0xd49, 0x4e6}, {0xd4d, 0x6fbd},
{0xe9e, 0x4e4}, {0xc998, 0x1b5}, {0x18ef0, 0x3a8},
{0x19f85, 0x5182}, {0x2e2335, 0x3b6}, {0x325153, 0x5182},
{0x145bded, 0x2716}, {0x3c9a5f2, 0xc6f3}, {0x4c45f2d, 0x3a4},
{0x4c45f4e, 0xc431}, {0x58caf51, 0x4e4}, {0x5a5cd7d, 0x3a8},
{0x5a6c6a7, 0x4e4}, {0x5a6ca0b, 0x1b5}, {0x5a6cd68, 0x307},
{0x5a6d8d3, 0x4e4}, {0x5a6d948, 0x354}, {0x5a6d96b, 0x362},
{0x5a6d984, 0x366}, {0x5a90e35, 0x1b5}, {0x5e0cf00, 0x6fb5},
{0x609c324, 0x551}, {0x617d97f, 0x5182}, {0x6a6fd91, 0xfde8},
{0x6a6fd92, 0xfde9}, {0x6b102de, 0xcadc}, {0x6b10f48, 0x4e89},
{0x1020805f, 0x4e4}, {0x10f0524c, 0x6fb5}, {0x11d558fe, 0x6fb0},
{0x13898d19, 0xc42d}, {0x13898d3a, 0xc431}, {0x138a319e, 0x6fb1},
{0x14679c09, 0x96c6}, {0x153f0a3d, 0x6fb2}, {0x1576eeb3, 0x4e20},
{0x169a0ce6, 0xc6f9}, {0x16f3e2dc, 0x6fb3}, {0x18a8bb7a, 0x6fb4},
{0x1a5d9419, 0x6fb5}, {0x1a847b48, 0x3a8}, {0x1b762419, 0xcec8},
{0x1b9d7847, 0x475}, {0x1c126cb9, 0x6fb6}, {0x1ccdbc7d, 0x4f42},
{0x1d330f5f, 0x2714}, {0x1dc74559, 0x4e6}, {0x1edd80da, 0x4e4},
{0x23e4b03d, 0xfde8}, {0x24f28a16, 0x4f3d}, {0x286e7a32, 0x2715},
{0x2c7c18ed, 0x3a8}, {0x2e2103b7, 0x2713}, {0x304bf479, 0x6fb4},
{0x304bf47d, 0x6fb5}, {0x309bb869, 0xfde8}, {0x309bb86a, 0xfde9},
{0x33664357, 0x3b6}, {0x352d6b49, 0x3a4}, {0x36f5661c, 0x1b5},
{0x392e8f48, 0xcadc}, {0x3dc7c64c, 0x47c}, {0x3ed2e8e1, 0x4e4},
{0x3f0c2fea, 0xcaed}, {0x3f0fef8f, 0xc6f2}, {0x3f5e130f, 0x5182},
{0x47174d1f, 0x3a8}, {0x49686b7b, 0x6fb4}, {0x4b80b0d9, 0x3a4},
{0x4dcda97a, 0x4e4}, {0x4dcda9b6, 0x4e4}, {0x4e881e6a, 0x5221},
{0x4ffdf5a1, 0x36a}, {0x4ffdf5a5, 0x6fbd}, {0x5241ce16, 0x4e8b},
{0x546bab9d, 0x4e4}, {0x54a3d64e, 0x6fb6}, {0x562179bd, 0x5161},
{0x57c1df15, 0xc6f7}, {0x61ff6e62, 0x4f36}, {0x6359c7d8, 0x4f35},
{0x63f3c335, 0x3a8}, {0x645a0f78, 0x477}, {0x691ac2fd, 0x275f},
{0x6dc2eab0, 0x2d0}, {0x6dc2eeef, 0x35e}, {0x6dc2ef10, 0x36a},
{0x7103138a, 0x47d}, {0x710dfbd0, 0xc6f5}, {0x7319f6cb, 0x36a},
{0x745096ad, 0x3a8}, {0x74866229, 0x4e8c}, {0x77185fa5, 0x3a8},
{0x7953f002, 0x6faf}, {0x7953f003, 0x6fb0}, {0x7953f004, 0x6fb1},
{0x7953f005, 0x6fb2}, {0x7953f006, 0x6fb7}, {0x7953f00a, 0x6fbd},
{0x7c577571, 0x2761}, {0x7e8c8ff1, 0x479}, {0x8031f47f, 0x3b5},
{0x8031f481, 0x3b5}, {0x80c4a710, 0x5187}, {0x857c7e14, 0xfde8},
{0x857c7e15, 0xfde9}, {0x86b59c90, 0x4e4}, {0x86b59c91, 0x6fb0},
{0x86b59c92, 0x6fb1}, {0x86b59c93, 0x6fb2}, {0x86b59c94, 0x6fb3},
{0x86b59c95, 0x6fb4}, {0x86b59c96, 0x6fb5}, {0x86b59c97, 0x4e7},
{0x86b59c98, 0x4e6}, {0x8b4b24ec, 0x5190}, {0x8face362, 0x4e4},
{0x8ff9ec2a, 0xfde9}, {0x919d3989, 0xcadc}, {0x9967e5ad, 0x4e22},
{0x99f8b933, 0x6fbd}, {0x9bd2a380, 0x4fc7}, {0x9befad23, 0x4f38},
{0x9c7ac649, 0x4f3c}, {0xa02468db, 0xdeae}, {0xa02468ec, 0xdeab},
{0xa024692a, 0xdeaa}, {0xa0246997, 0xdeb2}, {0xa02469ff, 0xdeb0},
{0xa0246a3d, 0xdeb1}, {0xa0246a8c, 0xdeaf}, {0xa0246a9a, 0xdeb3},
{0xa0246b16, 0xdeac}, {0xa0246b1a, 0xdead}, {0xa071addc, 0x4b1},
{0xa38b62dc, 0x474}, {0xa4c09fed, 0x3a8}, {0xa51e86e5, 0x4e7},
{0xa67ab13e, 0x3a4}, {0xa7414244, 0x51a9}, {0xa9ddbead, 0xc6fb},
{0xab24ffab, 0x4e8a}, {0xabef8ac4, 0x2710}, {0xabfa20ac, 0x6fb4},
{0xad36895e, 0x4e2}, {0xad36895f, 0x4e3}, {0xaf310e90, 0x402},
{0xaf31166f, 0x4e8}, {0xaf7277a5, 0x3b6}, {0xafc0d8b3, 0x96c6},
{0xb0fd5dba, 0xcae0}, {0xb0fd5e95, 0xcadc}, {0xb1052893, 0x7149},
{0xb1e98745, 0x36a}, {0xb277e91c, 0x5166}, {0xb2f7eac5, 0xcae0},
{0xb2f7eba0, 0xcadc}, {0xb2f7ebc1, 0x3b5}, {0xb53fa77d, 0x3a8},
{0xb6391138, 0x6fb5}, {0xb7358b7f, 0x6fb6}, {0xb8c42b40, 0x4e4},
{0xb8c42ea4, 0x1b5}, {0xb8c439e7, 0x2e1}, {0xb8c43a61, 0x307},
{0xb8c43d6c, 0x4e4}, {0xb8c43ddf, 0x352}, {0xb8c43de1, 0x354},
{0xb8c43de6, 0x359}, {0xb8c43dff, 0x35d}, {0xb8c43e04, 0x362},
{0xb8c43e07, 0x365}, {0xbcd29a7f, 0x3a8}, {0xbce34e78, 0x5182},
{0xbce34e7b, 0x556a}, {0xbce81504, 0x3b5}, {0xbd8a4c95, 0x272d},
{0xbdd89dad, 0x4e4}, {0xbdd89dae, 0x6fb0}, {0xbdd89daf, 0x6fb1},
{0xbdd89db0, 0x6fb2}, {0xbdd89db1, 0x4e6}, {0xbdd89db5, 0x6fbd},
{0xc1756e9f, 0x36b}, {0xc7482444, 0x47a}, {0xc9281c18, 0x4e4},
{0xc9ef95df, 0x47b}, {0xccc9db0d, 0x4e4}, {0xccc9db0e, 0x6fb0},
{0xcd73425f, 0x3b6}, {0xce38b40b, 0x4b0}, {0xce99e549, 0x25},
{0xcf598740, 0x4e7}, {0xcf6d6f78, 0x4e4}, {0xcf758df6, 0x3a4},
{0xd1266e51, 0x6fb5}, {0xd2910213, 0x2718}, {0xd29196bb, 0x2712},
{0xd3eb2fc2, 0x476}, {0xd442dc2c, 0x4fc4}, {0xd9da4da4, 0x2711},
{0xdbad2f42, 0x4e4}, {0xdbad2f43, 0x6fb0}, {0xdbad2f44, 0x6fb1},
{0xdbad2f45, 0x6fb2}, {0xdbad2f46, 0x6fb3}, {0xdbad2f47, 0x6fb4},
{0xdbad2f48, 0x6fb5}, {0xdbad2f49, 0x6fb6}, {0xdbad2f4a, 0x4e6},
{0xdc438033, 0x4f31}, {0xdccb439b, 0x477}, {0xdccdc626, 0x3b5},
{0xdd80a595, 0x4e4}, {0xdd80a596, 0x6fb0}, {0xdd80a59e, 0x6fb1},
{0xdd80a5b4, 0x6fb2}, {0xdd80a5d9, 0x6fb5}, {0xdd80a5da, 0x6fb4},
{0xdd80a5fa, 0x6fb6}, {0xdd80a615, 0x6fb3}, {0xdd80a619, 0x4e6},
{0xdd80a61a, 0x3b5}, {0xdd80c0f8, 0x4e9f}, {0xdf7e46ff, 0x4fc8},
{0xdf8680fd, 0x556a}, {0xdfb0bd6e, 0xc42d}, {0xdff05486, 0x2c4},
{0xe3323399, 0x3a4}, {0xe60412dd, 0x3b5}, {0xeee47add, 0x4b0},
{0xf021a186, 0x4e2}, {0xf021a187, 0x4e3}, {0xf021a188, 0x4e4},
{0xf021a189, 0x4e5}, {0xf021a18a, 0x4e6}, {0xf021a18b, 0x4e7},
{0xf021a18c, 0x4e8}, {0xf021a18d, 0x4e9}, {0xf021a18e, 0x4ea},
{0xf0700456, 0x6fb3}, {0xf274f175, 0x3b5}, {0xf2a9730b, 0x3a8},
{0xf3d463c2, 0x3a4}, {0xf52a70a3, 0xc42e}, {0xf5693147, 0x6fb3},
{0xf637e157, 0x478}, {0xfc213f3a, 0x2717}, {0xff654d14, 0x3b5},
};
FX_WORD FX_GetCodePageFromStringA(const FX_CHAR* pStr, int32_t iLength) {
FXSYS_assert(pStr != NULL);
if (iLength < 0) {
iLength = FXSYS_strlen(pStr);
}
if (iLength == 0) {
return 0xFFFF;
}
uint32_t uHash = FX_HashCode_String_GetA(pStr, iLength, TRUE);
int32_t iStart = 0, iMid;
int32_t iEnd = sizeof(g_FXCPHashTable) / sizeof(FX_STR2CPHASH) - 1;
FXSYS_assert(iEnd >= 0);
do {
iMid = (iStart + iEnd) / 2;
const FX_STR2CPHASH& cp = g_FXCPHashTable[iMid];
if (uHash == cp.uHash) {
return (FX_WORD)cp.uCodePage;
} else if (uHash < cp.uHash) {
iEnd = iMid - 1;
} else {
iStart = iMid + 1;
}
} while (iStart <= iEnd);
return 0xFFFF;
}
FX_WORD FX_GetCodePageFormStringW(const FX_WCHAR* pStr, int32_t iLength) {
if (iLength < 0) {
iLength = FXSYS_wcslen(pStr);
}
if (iLength == 0) {
return 0xFFFF;
}
CFX_ByteString csStr;
FX_CHAR* pBuf = csStr.GetBuffer(iLength + 1);
for (int32_t i = 0; i < iLength; ++i) {
*pBuf++ = (FX_CHAR)*pStr++;
}
csStr.ReleaseBuffer(iLength);
return FX_GetCodePageFromStringA(csStr, iLength);
}
| [
"Justin"
] | Justin |
c764feb11f1f7acde3bcc43ee6730e137440f90f | 823a65076ff32c77a16d9c172a0d794dc0a95081 | /kernel/h/IVTEn.h | cc28d92be02a45c9130f06542d369282660ddef6 | [] | no_license | lazarbeloica/OS_kernel | da7a0711cdbb850b1fb8555773f328b6cb370cb5 | 15d8b701394a5b757f0d459f5682cf4262682dbb | refs/heads/master | 2021-01-10T22:20:04.295388 | 2016-10-08T09:13:34 | 2016-10-08T09:13:34 | 70,319,314 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 528 | h | /*
* IVTEn.h
*
* Created on: Aug 11, 2015
* Author: OS1
*/
#ifndef IVTEN_H_
#define IVTEN_H_
#include <DOS.H>
#include "def.h"
#include "event.h"
#include "KernelEv.h"
class IVTEntry
{
private:
IVTNo myIVTNo;
KernelEv *myKernelEv;
Routine oldRoutine, newRoutine;
public:
IVTEntry(IVTNo, Routine);
~IVTEntry();
static IVTEntry *IVT[256];
void setKernelEvent(KernelEv*);
void removeKernelEvent();
void callOldRoutine();
void signalEvent();
};
#endif /* IVTEN_H_ */
| [
"lazarbeloica@gmail.com"
] | lazarbeloica@gmail.com |
8713795751007de2f0125583082444dacb45c1f6 | ab261c6ef92b3af072aac4d4edce669e652b7987 | /thrift/compiler/test/fixtures/types/gen-cpp2/SomeService_client.cpp | 7fc799dbe446a01423190ac93e89414318758aae | [
"Apache-2.0"
] | permissive | ambikabohra/fbthrift | 747c41e775b72a2b0da7692f1e04d6cc3b7e4fe5 | 2f0c98fc33d5a466ec3eebf49e25558e559f94c2 | refs/heads/master | 2021-08-17T01:48:34.471448 | 2017-11-20T16:34:52 | 2017-11-20T16:40:38 | 111,459,658 | 1 | 0 | null | 2017-11-20T20:30:46 | 2017-11-20T20:30:46 | null | UTF-8 | C++ | false | false | 8,125 | cpp | /**
* Autogenerated by Thrift
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
#include "src/gen-cpp2/SomeServiceAsyncClient.h"
#include <folly/io/IOBuf.h>
#include <folly/io/IOBufQueue.h>
#include <thrift/lib/cpp/TApplicationException.h>
#include <thrift/lib/cpp/transport/THeader.h>
#include <thrift/lib/cpp2/protocol/BinaryProtocol.h>
#include <thrift/lib/cpp2/protocol/CompactProtocol.h>
#include <thrift/lib/cpp2/server/Cpp2ConnContext.h>
#include <thrift/lib/cpp2/GeneratedCodeHelper.h>
#include <thrift/lib/cpp2/GeneratedSerializationCodeHelper.h>
namespace apache { namespace thrift { namespace fixtures { namespace types {
typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, apache::thrift::protocol::T_MAP, ::apache::thrift::fixtures::types::SomeMap*>> SomeService_bounce_map_pargs;
typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, apache::thrift::protocol::T_MAP, ::apache::thrift::fixtures::types::SomeMap*>> SomeService_bounce_map_presult;
template <typename Protocol_>
void SomeServiceAsyncClient::bounce_mapT(Protocol_* prot, bool useSync, apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback, const ::apache::thrift::fixtures::types::SomeMap& m) {
auto header = std::make_shared<apache::thrift::transport::THeader>(apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
header->setProtocolId(getChannel()->getProtocolId());
header->setHeaders(rpcOptions.releaseWriteHeaders());
connectionContext_->setRequestHeader(header.get());
std::unique_ptr<apache::thrift::ContextStack> ctx = this->getContextStack(this->getServiceName(), "SomeService.bounce_map", connectionContext_.get());
SomeService_bounce_map_pargs args;
args.get<0>().value = const_cast< ::apache::thrift::fixtures::types::SomeMap*>(&m);
auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
auto writer = [&](Protocol_* p) { args.write(p); };
apache::thrift::clientSendT<Protocol_>(prot, rpcOptions, std::move(callback), std::move(ctx), header, channel_.get(), "bounce_map", writer, sizer, false, useSync);
connectionContext_->setRequestHeader(nullptr);
}
void SomeServiceAsyncClient::bounce_map(std::unique_ptr<apache::thrift::RequestCallback> callback, const ::apache::thrift::fixtures::types::SomeMap& m) {
::apache::thrift::RpcOptions rpcOptions;
bounce_mapImpl(false, rpcOptions, std::move(callback), m);
}
void SomeServiceAsyncClient::bounce_map(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback, const ::apache::thrift::fixtures::types::SomeMap& m) {
bounce_mapImpl(false, rpcOptions, std::move(callback), m);
}
void SomeServiceAsyncClient::bounce_mapImpl(bool useSync, apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback, const ::apache::thrift::fixtures::types::SomeMap& m) {
switch(getChannel()->getProtocolId()) {
case apache::thrift::protocol::T_BINARY_PROTOCOL:
{
apache::thrift::BinaryProtocolWriter writer;
bounce_mapT(&writer, useSync, rpcOptions, std::move(callback), m);
break;
}
case apache::thrift::protocol::T_COMPACT_PROTOCOL:
{
apache::thrift::CompactProtocolWriter writer;
bounce_mapT(&writer, useSync, rpcOptions, std::move(callback), m);
break;
}
default:
{
apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
}
}
}
void SomeServiceAsyncClient::sync_bounce_map( ::apache::thrift::fixtures::types::SomeMap& _return, const ::apache::thrift::fixtures::types::SomeMap& m) {
::apache::thrift::RpcOptions rpcOptions;
sync_bounce_map(rpcOptions, _return, m);
}
void SomeServiceAsyncClient::sync_bounce_map(apache::thrift::RpcOptions& rpcOptions, ::apache::thrift::fixtures::types::SomeMap& _return, const ::apache::thrift::fixtures::types::SomeMap& m) {
apache::thrift::ClientReceiveState _returnState;
auto callback = std::make_unique<apache::thrift::ClientSyncCallback>(&_returnState, false);
bounce_mapImpl(true, rpcOptions, std::move(callback), m);
SCOPE_EXIT {
if (_returnState.header() && !_returnState.header()->getHeaders().empty()) {
rpcOptions.setReadHeaders(_returnState.header()->releaseHeaders());
}
};
if (!_returnState.buf()) {
assert(_returnState.exception());
_returnState.exception().throw_exception();
}
recv_bounce_map(_return, _returnState);
}
folly::Future< ::apache::thrift::fixtures::types::SomeMap> SomeServiceAsyncClient::future_bounce_map(const ::apache::thrift::fixtures::types::SomeMap& m) {
::apache::thrift::RpcOptions rpcOptions;
return future_bounce_map(rpcOptions, m);
}
folly::Future< ::apache::thrift::fixtures::types::SomeMap> SomeServiceAsyncClient::future_bounce_map(apache::thrift::RpcOptions& rpcOptions, const ::apache::thrift::fixtures::types::SomeMap& m) {
folly::Promise< ::apache::thrift::fixtures::types::SomeMap> _promise;
auto _future = _promise.getFuture();
auto callback = std::make_unique<apache::thrift::FutureCallback< ::apache::thrift::fixtures::types::SomeMap>>(std::move(_promise), recv_wrapped_bounce_map, channel_);
bounce_map(rpcOptions, std::move(callback), m);
return _future;
}
folly::Future<std::pair< ::apache::thrift::fixtures::types::SomeMap, std::unique_ptr<apache::thrift::transport::THeader>>> SomeServiceAsyncClient::header_future_bounce_map(apache::thrift::RpcOptions& rpcOptions, const ::apache::thrift::fixtures::types::SomeMap& m) {
folly::Promise<std::pair< ::apache::thrift::fixtures::types::SomeMap, std::unique_ptr<apache::thrift::transport::THeader>>> _promise;
auto _future = _promise.getFuture();
auto callback = std::make_unique<apache::thrift::HeaderFutureCallback< ::apache::thrift::fixtures::types::SomeMap>>(std::move(_promise), recv_wrapped_bounce_map, channel_);
bounce_map(rpcOptions, std::move(callback), m);
return _future;
}
void SomeServiceAsyncClient::bounce_map(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback, const ::apache::thrift::fixtures::types::SomeMap& m) {
bounce_map(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)), m);
}
folly::exception_wrapper SomeServiceAsyncClient::recv_wrapped_bounce_map( ::apache::thrift::fixtures::types::SomeMap& _return, ::apache::thrift::ClientReceiveState& state) {
if (state.isException()) {
return std::move(state.exception());
}
if (!state.buf()) {
return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
}
using result = SomeService_bounce_map_presult;
constexpr auto const fname = "bounce_map";
switch (state.protocolId()) {
case apache::thrift::protocol::T_BINARY_PROTOCOL:
{
apache::thrift::BinaryProtocolReader reader;
return apache::thrift::detail::ac::recv_wrapped<result>(
fname, &reader, state, _return);
}
case apache::thrift::protocol::T_COMPACT_PROTOCOL:
{
apache::thrift::CompactProtocolReader reader;
return apache::thrift::detail::ac::recv_wrapped<result>(
fname, &reader, state, _return);
}
default:
{
}
}
return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
}
void SomeServiceAsyncClient::recv_bounce_map( ::apache::thrift::fixtures::types::SomeMap& _return, ::apache::thrift::ClientReceiveState& state) {
auto ew = recv_wrapped_bounce_map(_return, state);
if (ew) {
ew.throw_exception();
}
}
void SomeServiceAsyncClient::recv_instance_bounce_map( ::apache::thrift::fixtures::types::SomeMap& _return, ::apache::thrift::ClientReceiveState& state) {
return recv_bounce_map(_return, state);
}
folly::exception_wrapper SomeServiceAsyncClient::recv_instance_wrapped_bounce_map( ::apache::thrift::fixtures::types::SomeMap& _return, ::apache::thrift::ClientReceiveState& state) {
return recv_wrapped_bounce_map(_return, state);
}
}}}} // apache::thrift::fixtures::types
namespace apache { namespace thrift {
}} // apache::thrift
| [
"facebook-github-bot@users.noreply.github.com"
] | facebook-github-bot@users.noreply.github.com |
d7cbb6a01f13142e30df7253d662c0ebaac464fc | dc933e6c4af6db8e5938612935bb51ead04da9b3 | /android-x86/external/opencore/fileformats/mp4/composer/src/trackreferencetypeatom.cpp | 74ad669c0fb47c00ca8435f25da810a558a617de | [] | no_license | leotfrancisco/patch-hosting-for-android-x86-support | 213f0b28a7171570a77a3cec48a747087f700928 | e932645af3ff9515bd152b124bb55479758c2344 | refs/heads/master | 2021-01-10T08:40:36.731838 | 2009-05-28T04:29:43 | 2009-05-28T04:29:43 | 51,474,005 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,787 | cpp | /* ------------------------------------------------------------------
* Copyright (C) 2008 PacketVideo
*
* 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.
* -------------------------------------------------------------------
*/
/*********************************************************************************/
/*
This PVA_FF_TrackReferenceTypeAtom Class provides a reference from the containing stream
to another stream in the MPEG-4 presentation.
*/
#define IMPLEMENT_TrackReferenceTypeAtom
#include "trackreferencetypeatom.h"
#include "atomutils.h"
#include "a_atomdefs.h"
typedef Oscl_Vector<uint32, OsclMemAllocator> uint32VecType;
// Constructor
PVA_FF_TrackReferenceTypeAtom::PVA_FF_TrackReferenceTypeAtom(uint32 refType)
: PVA_FF_Atom(refType)
{
PV_MP4_FF_NEW(fp->auditCB, uint32VecType, (), _trackIDs);
recomputeSize();
}
// Destructor
PVA_FF_TrackReferenceTypeAtom::~PVA_FF_TrackReferenceTypeAtom()
{
// Clean up vector of track reference ids
PV_MP4_FF_TEMPLATED_DELETE(NULL, uint32VecType, Oscl_Vector, _trackIDs);
}
int32
PVA_FF_TrackReferenceTypeAtom::addTrackReference(uint32 ref)
{
_trackIDs->push_back(ref);
recomputeSize();
return _trackIDs->size();
}
uint32
PVA_FF_TrackReferenceTypeAtom::getTrackReferenceAt(int32 index) const
{
if (index < (int32)_trackIDs->size())
{
return (*_trackIDs)[index];
}
// cerr << "ERROR: invalid track reference index" << endl;
return 0; // ERROR condition
}
void
PVA_FF_TrackReferenceTypeAtom::recomputeSize()
{
int32 size = getDefaultSize();
size += 4 * _trackIDs->size();
_size = size;
// Update size of parent atom
if (_pparent != NULL)
{
_pparent->recomputeSize();
}
}
// Rendering the PVA_FF_Atom in proper format (bitlengths, etc.) to an ostream
bool
PVA_FF_TrackReferenceTypeAtom::renderToFileStream(MP4_AUTHOR_FF_FILE_IO_WRAP *fp)
{
int32 rendered = 0;
if (!renderAtomBaseMembers(fp))
{
return false;
}
rendered += getDefaultSize();
for (uint32 i = 0; i < _trackIDs->size(); i++)
{
if (!PVA_FF_AtomUtils::render32(fp, (*_trackIDs)[i]))
{
return false;
}
}
rendered += (4 * _trackIDs->size());
return true;
}
| [
"beyounn@8848914e-2522-11de-9896-099eabac0e35"
] | beyounn@8848914e-2522-11de-9896-099eabac0e35 |
cdb9fa6c66548fb24aeaa2584ed743b81fec56ae | 7b7dc5d29dd13df680d54ab4754fe2f4fd05be77 | /OTGW-firmware.ino | 476782934bccfcb080e255f52544cea3fa0aa5b0 | [
"MIT"
] | permissive | sjorsjuhmaniac/OTGW-firmware | 8b604a405d4ba77780270a4b46425eb2abb14a09 | d7e70b4d7424f93cdd4100073003060b0cf47798 | refs/heads/main | 2023-04-02T22:34:19.445805 | 2021-03-14T14:03:52 | 2021-03-14T14:03:52 | 348,834,300 | 0 | 0 | MIT | 2021-04-02T21:42:56 | 2021-03-17T19:51:40 | null | UTF-8 | C++ | false | false | 7,226 | ino | /*
***************************************************************************
** Program : OTGW-firmware.ino
** Version : v0.8.1
**
** Copyright (c) 2021 Robert van den Breemen
**
** TERMS OF USE: MIT License. See bottom of file.
***************************************************************************
*/
/*
* How to install the OTGW on your nodeMCU:
* Read this: https://github.com/rvdbreemen/OTGW-firmware/wiki/How-to-compile-OTGW-firmware-yourself
*
* How to upload to your LittleFS?
* Read this: https://github.com/rvdbreemen/OTGW-firmware/wiki/Upload-files-to-LittleFS-(filesystem)
*
* How to compile this firmware?
* - NodeMCU v1.0
* - Flashsize (4MB - FS:2MB - OTA ~1019KB)
* - CPU frequentcy: 160MHz
* - Normal defaults should work fine.
* First time: Make sure to flash sketch + wifi or flash ALL contents.
*
*/
#include "version.h"
#define _FW_VERSION _VERSION
#include "OTGW-firmware.h"
#define ON LOW
#define OFF HIGH
//=====================================================================
void setup() {
// Serial is initialized by OTGWSerial. It resets the pic and opens serialdevice.
// OTGWSerial.begin();//OTGW Serial device that knows about OTGW PIC
// while (!Serial) {} //Wait for OK
OTGWSerial.println(F("\r\n[OTGW firmware - Nodoshop version]\r\n"));
OTGWSerial.printf("Booting....[%s]\r\n\r\n", String(_FW_VERSION).c_str());
rebootCount = updateRebootCount();
//setup randomseed the right way
randomSeed(RANDOM_REG32); //This is 8266 HWRNG used to seed the Random PRNG: Read more: https://config9.com/arduino/getting-a-truly-random-number-in-arduino/
lastReset = ESP.getResetReason();
OTGWSerial.printf("Last reset reason: [%s]\r\n", CSTR(ESP.getResetReason()));
//setup the status LED
setLed(LED1, ON);
setLed(LED2, ON);
LittleFS.begin();
readSettings(true);
// Connect to and initialise WiFi network
OTGWSerial.println(F("Attempting to connect to WiFi network\r"));
setLed(LED1, ON);
startWiFi(_HOSTNAME, 240); // timeout 240 seconds
blinkLED(LED1, 3, 100);
setLed(LED1, OFF);
startTelnet(); // start the debug port 23
startMDNS(CSTR(settingHostname));
startLLMNR(CSTR(settingHostname));
startMQTT();
startNTP();
setupFSexplorer();
startWebserver();
OTGWSerial.println(F("Setup finished!\r\n"));
// After resetting the OTGW PIC never send anything to Serial for debug
// and switch to telnet port 23 for debug purposed.
// Setup the OTGW PIC
resetOTGW(); // reset the OTGW pic
startOTGWstream(); // start port 25238
checkOTWGpicforupdate();
initSensors(); // init DS18B20
initWatchDog(); // setup the WatchDog
//Blink LED2 to signal setup done
setLed(LED1, OFF);
blinkLED(LED2, 3, 100);
setLed(LED2, OFF);
}
//=====================================================================
//===[ blink status led ]===
void setLed(uint8_t led, uint8_t status){
pinMode(led, OUTPUT);
digitalWrite(led, status);
}
void blinkLEDms(uint32_t delay){
//blink the statusled, when time passed
DECLARE_TIMER_MS(timerBlink, delay);
if (DUE(timerBlink)) {
blinkLEDnow();
}
}
void blinkLED(uint8_t led, int nr, uint32_t waittime_ms){
for (int i = nr; i>0; i--){
blinkLEDnow(led);
delayms(waittime_ms);
blinkLEDnow(led);
delayms(waittime_ms);
}
}
void blinkLEDnow(uint8_t led = LED1){
pinMode(led, OUTPUT);
digitalWrite(led, !digitalRead(led));
}
//===[ no-blocking delay with running background tasks in ms ]===
void delayms(unsigned long delay_ms)
{
DECLARE_TIMER_MS(timerDelayms, delay_ms);
while (DUE(timerDelayms))
doBackgroundTasks();
}
//=====================================================================
//===[ Do task every 1s ]===
void doTaskEvery1s(){
//== do tasks ==
upTimeSeconds++;
}
//===[ Do task every 5s ]===
void doTaskEvery5s(){
//== do tasks ==
pollSensors();
}
//===[ Do task every 30s ]===
void doTaskEvery30s(){
//== do tasks ==
}
//===[ Do task every 60s ]===
void doTaskEvery60s(){
//== do tasks ==
//if no wifi, try reconnecting (once a minute)
if (WiFi.status() != WL_CONNECTED)
{
//disconnected, try to reconnect then...
startWiFi(_HOSTNAME, 240);
//check OTGW and telnet
startTelnet();
startOTGWstream();
}
}
//===[ Do task every 5min ]===
void do5minevent(){
DebugTf("Uptime seconds: %d", upTimeSeconds);
String sUptime = String(upTimeSeconds);
sendMQTTData("otgw-firmware/uptime", sUptime, false);
}
//===[ check for new pic version ]===
void docheckforpic(){
String latest = checkforupdatepic("gateway.hex");
if (!bOTGWonline) {
sMessage = sPICfwversion;
} else if (latest != sPICfwversion) {
sMessage = "New PIC version " + latest + " available!";
}
}
//===[ Do the background tasks ]===
void doBackgroundTasks()
{
feedWatchDog(); // Feed the dog before it bites!
handleMQTT(); // MQTT transmissions
handleOTGW(); // OTGW handling
httpServer.handleClient();
MDNS.update();
events(); // trigger ezTime update etc.
// // 'blink' the status led every x ms
// if (settingLEDblink) blinkLEDms(1000);
delay(1);
handleDebug();
}
void loop()
{
DECLARE_TIMER_SEC(timer1s, 1, CATCH_UP_MISSED_TICKS);
DECLARE_TIMER_SEC(timer5s, 5, CATCH_UP_MISSED_TICKS);
DECLARE_TIMER_SEC(timer30s, 30, CATCH_UP_MISSED_TICKS);
DECLARE_TIMER_SEC(timer60s, 60, CATCH_UP_MISSED_TICKS);
DECLARE_TIMER_MIN(tmrcheckpic, 1440, CATCH_UP_MISSED_TICKS);
DECLARE_TIMER_MIN(timer5min, 5, CATCH_UP_MISSED_TICKS);
if (DUE(timer1s)) doTaskEvery1s();
if (DUE(timer5s)) doTaskEvery5s();
if (DUE(timer30s)) doTaskEvery30s();
if (DUE(timer60s)) doTaskEvery60s();
if (DUE(tmrcheckpic)) docheckforpic();
if (DUE(timer5min)) do5minevent();
doBackgroundTasks();
}
/***************************************************************************
*
* 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.
*
****************************************************************************
*/
| [
"robert@vandenbreemen.net"
] | robert@vandenbreemen.net |
bb16e7c13ea7de2c0405adcab406938582678e5c | e8334331ba241464bc7e6b35ba8257dce94f6abd | /src/lib/cert/x509/certstor_sql/certstor_sql.cpp | b80c063dae407981429e18573968be3b1b46da7d | [
"BSD-2-Clause"
] | permissive | slaviber/botan | a8a3580fed93ef7209c921be9c2d35b4312a580d | bd3a91bdc492ba1b2fabede888d7634d089de684 | refs/heads/master | 2021-01-21T20:49:31.212727 | 2016-10-04T09:06:24 | 2016-10-04T09:06:24 | 70,276,001 | 0 | 0 | null | 2016-10-07T19:17:53 | 2016-10-07T19:17:53 | null | UTF-8 | C++ | false | false | 9,565 | cpp | /*
* Certificate Store in SQL
* (C) 2016 Kai Michaelis, Rohde & Schwarz Cybersecurity
*
* Botan is released under the Simplified BSD License (see license.txt)
*/
#include <botan/certstor_sql.h>
#include <botan/ber_dec.h>
#include <botan/der_enc.h>
#include <botan/internal/filesystem.h>
#include <botan/pkcs8.h>
#include <botan/data_src.h>
#include <botan/auto_rng.h>
#include <botan/hash.h>
#include <botan/hex.h>
namespace Botan {
Certificate_Store_In_SQL::Certificate_Store_In_SQL(std::shared_ptr<SQL_Database> db,
const std::string& passwd,
const std::string& table_prefix)
: m_database(db), m_prefix(table_prefix), m_password(passwd)
{
m_database->create_table("CREATE TABLE IF NOT EXISTS " +
m_prefix + "certificates ( \
fingerprint BLOB PRIMARY KEY, \
subject_dn BLOB, \
key_id BLOB, \
priv_fingerprint BLOB, \
certificate BLOB UNIQUE NOT NULL\
)");
m_database->create_table("CREATE TABLE IF NOT EXISTS " + m_prefix + "keys (\
fingerprint BLOB PRIMARY KEY, \
key BLOB UNIQUE NOT NULL \
)");
m_database->create_table("CREATE TABLE IF NOT EXISTS " + m_prefix + "revoked (\
fingerprint BLOB PRIMARY KEY, \
reason BLOB NOT NULL, \
time BLOB NOT NULL \
)");
}
// Certificate handling
std::shared_ptr<const X509_Certificate>
Certificate_Store_In_SQL::find_cert(const X509_DN& subject_dn, const std::vector<byte>& key_id) const
{
DER_Encoder enc;
std::shared_ptr<SQL_Database::Statement> stmt;
subject_dn.encode_into(enc);
if(key_id.empty())
{
stmt = m_database->new_statement("SELECT certificate FROM " + m_prefix + "certificates WHERE subject_dn == ?1");
stmt->bind(1,enc.get_contents_unlocked());
}
else
{
stmt = m_database->new_statement("SELECT certificate FROM " + m_prefix + "certificates WHERE\
subject_dn == ?1 AND (key_id == NULL OR key_id == ?2)");
stmt->bind(1,enc.get_contents_unlocked());
stmt->bind(2,key_id);
}
std::shared_ptr<const X509_Certificate> cert;
while(stmt->step())
{
auto blob = stmt->get_blob(0);
cert = std::make_shared<X509_Certificate>(
std::vector<byte>(blob.first,blob.first + blob.second));
}
return cert;
}
std::shared_ptr<const X509_CRL>
Certificate_Store_In_SQL::find_crl_for(const X509_Certificate& subject) const
{
auto all_crls = generate_crls();
for(auto crl: all_crls)
{
if(!crl.get_revoked().empty() && crl.issuer_dn() == subject.issuer_dn())
return std::shared_ptr<X509_CRL>(new X509_CRL(crl));
}
return std::shared_ptr<X509_CRL>();
}
std::vector<X509_DN> Certificate_Store_In_SQL::all_subjects() const
{
std::vector<X509_DN> ret;
auto stmt = m_database->new_statement("SELECT subject_dn FROM " + m_prefix + "certificates");
while(stmt->step())
{
auto blob = stmt->get_blob(0);
BER_Decoder dec(blob.first,blob.second);
X509_DN dn;
dn.decode_from(dec);
ret.push_back(dn);
}
return ret;
}
bool Certificate_Store_In_SQL::insert_cert(const X509_Certificate& cert)
{
if(find_cert(cert.subject_dn(),cert.subject_key_id()))
return false;
DER_Encoder enc;
auto stmt = m_database->new_statement("INSERT OR REPLACE INTO " +
m_prefix + "certificates (\
fingerprint, \
subject_dn, \
key_id, \
priv_fingerprint, \
certificate \
) VALUES ( ?1, ?2, ?3, ?4, ?5 )");
stmt->bind(1,cert.fingerprint("SHA-256"));
cert.subject_dn().encode_into(enc);
stmt->bind(2,enc.get_contents_unlocked());
stmt->bind(3,cert.subject_key_id());
stmt->bind(4,std::vector<byte>());
enc = DER_Encoder();
cert.encode_into(enc);
stmt->bind(5,enc.get_contents_unlocked());
stmt->spin();
return true;
}
bool Certificate_Store_In_SQL::remove_cert(const X509_Certificate& cert)
{
if(!find_cert(cert.subject_dn(),cert.subject_key_id()))
return false;
auto stmt = m_database->new_statement("DELETE FROM " + m_prefix + "certificates WHERE fingerprint == ?1");
stmt->bind(1,cert.fingerprint("SHA-256"));
stmt->spin();
return true;
}
// Private key handling
std::shared_ptr<const Private_Key> Certificate_Store_In_SQL::find_key(const X509_Certificate& cert) const
{
auto stmt = m_database->new_statement("SELECT key FROM " + m_prefix + "keys "
"JOIN " + m_prefix + "certificates ON " +
m_prefix + "keys.fingerprint == " + m_prefix + "certificates.priv_fingerprint "
"WHERE " + m_prefix + "certificates.fingerprint == ?1");
stmt->bind(1,cert.fingerprint("SHA-256"));
std::shared_ptr<const Private_Key> key;
while(stmt->step())
{
auto blob = stmt->get_blob(0);
AutoSeeded_RNG rng;
DataSource_Memory src(blob.first,blob.second);
key.reset(PKCS8::load_key(src,rng,m_password));
}
return key;
}
std::vector<std::shared_ptr<const X509_Certificate>>
Certificate_Store_In_SQL::find_certs_for_key(const Private_Key& key) const
{
AutoSeeded_RNG rng;
auto fpr = key.fingerprint("SHA-256");
auto stmt = m_database->new_statement("SELECT certificate FROM " + m_prefix + "certificates WHERE priv_fingerprint == ?1");
stmt->bind(1,fpr);
std::vector<std::shared_ptr<const X509_Certificate>> certs;
while(stmt->step())
{
auto blob = stmt->get_blob(0);
certs.push_back(std::make_shared<X509_Certificate>(
std::vector<byte>(blob.first,blob.first + blob.second)));
}
return certs;
}
bool Certificate_Store_In_SQL::insert_key(const X509_Certificate& cert, const Private_Key& key) {
insert_cert(cert);
if(find_key(cert))
return false;
AutoSeeded_RNG rng;
auto pkcs8 = PKCS8::BER_encode(key,rng,m_password);
auto fpr = key.fingerprint("SHA-256");
auto stmt1 = m_database->new_statement(
"INSERT OR REPLACE INTO " + m_prefix + "keys ( fingerprint, key ) VALUES ( ?1, ?2 )");
stmt1->bind(1,fpr);
stmt1->bind(2,pkcs8.data(),pkcs8.size());
stmt1->spin();
auto stmt2 = m_database->new_statement(
"UPDATE " + m_prefix + "certificates SET priv_fingerprint = ?1 WHERE fingerprint == ?2");
stmt2->bind(1,fpr);
stmt2->bind(2,cert.fingerprint("SHA-256"));
stmt2->spin();
return true;
}
void Certificate_Store_In_SQL::remove_key(const Private_Key& key)
{
AutoSeeded_RNG rng;
auto fpr = key.fingerprint("SHA-256");
auto stmt = m_database->new_statement("DELETE FROM " + m_prefix + "keys WHERE fingerprint == ?1");
stmt->bind(1,fpr);
stmt->spin();
}
// Revocation
void Certificate_Store_In_SQL::revoke_cert(const X509_Certificate& cert, CRL_Code code, const X509_Time& time)
{
insert_cert(cert);
auto stmt1 = m_database->new_statement(
"INSERT OR REPLACE INTO " + m_prefix + "revoked ( fingerprint, reason, time ) VALUES ( ?1, ?2, ?3 )");
stmt1->bind(1,cert.fingerprint("SHA-256"));
stmt1->bind(2,code);
if(time.time_is_set())
{
DER_Encoder der;
time.encode_into(der);
stmt1->bind(3,der.get_contents_unlocked());
}
else
{
stmt1->bind(3,-1);
}
stmt1->spin();
}
void Certificate_Store_In_SQL::affirm_cert(const X509_Certificate& cert)
{
auto stmt = m_database->new_statement("DELETE FROM " + m_prefix + "revoked WHERE fingerprint == ?1");
stmt->bind(1,cert.fingerprint("SHA-256"));
stmt->spin();
}
std::vector<X509_CRL> Certificate_Store_In_SQL::generate_crls() const
{
auto stmt = m_database->new_statement(
"SELECT certificate,reason,time FROM " + m_prefix + "revoked "
"JOIN " + m_prefix + "certificates ON " +
m_prefix + "certificates.fingerprint == " + m_prefix + "revoked.fingerprint");
std::map<X509_DN,std::vector<CRL_Entry>> crls;
while(stmt->step())
{
auto blob = stmt->get_blob(0);
auto cert = X509_Certificate(
std::vector<byte>(blob.first,blob.first + blob.second));
auto code = static_cast<CRL_Code>(stmt->get_size_t(1));
auto ent = CRL_Entry(cert,code);
auto i = crls.find(cert.issuer_dn());
if(i == crls.end())
{
crls.insert(std::make_pair(cert.issuer_dn(),std::vector<CRL_Entry>({ent})));
}
else
{
i->second.push_back(ent);
}
}
std::vector<X509_CRL> ret;
X509_Time t(std::chrono::system_clock::now());
for(auto p: crls)
{
ret.push_back(X509_CRL(p.first,t,t,p.second));
}
return ret;
}
}
| [
"seu@panopticon.re"
] | seu@panopticon.re |
e8f3b95bb4163a84e0e7e86a8acdf8c76de846ff | 4352b5c9e6719d762e6a80e7a7799630d819bca3 | /tutorials/eulerVortex.twitch/eulerVortex.cyclic.twitch.test.test/processor2/1.26/p | fe33e318e8f9fea2cdca435151cba94a1876c8e3 | [] | no_license | dashqua/epicProject | d6214b57c545110d08ad053e68bc095f1d4dc725 | 54afca50a61c20c541ef43e3d96408ef72f0bcbc | refs/heads/master | 2022-02-28T17:20:20.291864 | 2019-10-28T13:33:16 | 2019-10-28T13:33:16 | 184,294,390 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 22,826 | /*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "1.26";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField nonuniform List<scalar>
5625
(
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999999
0.999999
0.999999
0.999999
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999999
0.999999
0.999999
0.999999
0.999999
0.999999
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999999
0.999999
0.999999
0.999999
0.999999
0.999999
0.999998
0.999998
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999999
0.999999
0.999999
0.999998
0.999998
0.999998
0.999998
0.999997
0.999997
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
1
0.999999
0.999999
0.999999
0.999998
0.999998
0.999998
0.999997
0.999997
0.999996
0.999996
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
1
0.999999
0.999999
0.999999
0.999998
0.999998
0.999998
0.999997
0.999996
0.999996
0.999995
0.999995
0.999995
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999999
0.999999
0.999999
0.999999
0.999998
0.999998
0.999998
0.999996
0.999996
0.999995
0.999994
0.999994
0.999993
0.999993
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999999
0.999999
0.999998
0.999998
0.999997
0.999996
0.999995
0.999994
0.999993
0.999992
0.999991
0.999991
0.99999
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999999
0.999998
0.999998
0.999997
0.999996
0.999994
0.999994
0.999992
0.999991
0.999989
0.999988
0.999987
0.999987
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999998
0.999998
0.999997
0.999996
0.999995
0.999993
0.999991
0.99999
0.999988
0.999986
0.999984
0.999983
0.999981
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999999
0.999998
0.999997
0.999996
0.999995
0.999993
0.999991
0.999988
0.999986
0.999983
0.999981
0.999979
0.999978
0.999976
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
1
0.999999
0.999998
0.999997
0.999997
0.999995
0.999993
0.999991
0.999988
0.999985
0.999981
0.999978
0.999975
0.999972
0.99997
0.999968
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999998
0.999997
0.999996
0.999994
0.999991
0.999988
0.999985
0.999981
0.999976
0.999972
0.999968
0.999964
0.999962
0.99996
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999998
0.999996
0.999995
0.999992
0.999989
0.999985
0.99998
0.999975
0.99997
0.999965
0.999959
0.999955
0.999951
0.999949
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999998
0.999996
0.999994
0.99999
0.999987
0.999981
0.999975
0.999969
0.999963
0.999956
0.99995
0.999944
0.99994
0.999938
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999998
0.999995
0.999992
0.999988
0.999984
0.999977
0.99997
0.999963
0.999954
0.999946
0.999938
0.999931
0.999927
0.999925
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999997
0.999995
0.999991
0.999986
0.999981
0.999973
0.999964
0.999955
0.999945
0.999935
0.999926
0.999919
0.999914
0.999913
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999998
0.999995
0.99999
0.999984
0.999977
0.999968
0.999958
0.999947
0.999935
0.999924
0.999914
0.999907
0.999902
0.999903
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999998
0.999995
0.99999
0.999983
0.999974
0.999964
0.999952
0.999939
0.999926
0.999914
0.999903
0.999898
0.999895
0.999899
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999996
0.99999
0.999983
0.999972
0.99996
0.999947
0.999933
0.999919
0.999907
0.999898
0.999894
0.999896
0.999905
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00001
1
1
0.999997
0.999991
0.999982
0.999971
0.999958
0.999944
0.999929
0.999916
0.999905
0.9999
0.999901
0.999911
0.999932
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00001
1.00001
1.00001
1.00001
1.00001
1
0.999994
0.999984
0.999973
0.999959
0.999945
0.999931
0.99992
0.999914
0.999916
0.999927
0.999951
0.999988
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00001
1.00001
1.00001
1.00001
1.00001
1.00001
1.00001
0.999999
0.99999
0.999978
0.999965
0.999952
0.999942
0.999936
0.999939
0.999953
0.999981
1.00003
1.00009
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00001
1.00001
1.00002
1.00002
1.00002
1.00002
1.00002
1.00001
1.00001
0.999998
0.999989
0.999978
0.99997
0.999966
0.999972
0.999989
1.00002
1.00008
1.00016
1.00026
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00002
1.00002
1.00002
1.00003
1.00003
1.00003
1.00003
1.00002
1.00002
1.00001
1.00001
1
1
1.00001
1.00003
1.00008
1.00014
1.00024
1.00036
1.00052
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00002
1.00002
1.00002
1.00003
1.00003
1.00004
1.00004
1.00004
1.00004
1.00004
1.00004
1.00004
1.00004
1.00005
1.00008
1.00013
1.00021
1.00033
1.00048
1.00068
1.00092
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00001
1.00002
1.00002
1.00003
1.00004
1.00004
1.00005
1.00005
1.00006
1.00006
1.00006
1.00007
1.00008
1.0001
1.00014
1.0002
1.00029
1.00042
1.00061
1.00084
1.00114
1.00148
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00002
1.00002
1.00003
1.00004
1.00005
1.00006
1.00006
1.00007
1.00008
1.00009
1.0001
1.00012
1.00014
1.00019
1.00026
1.00036
1.00052
1.00073
1.001
1.00135
1.00178
1.00226
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00002
1.00002
1.00003
1.00004
1.00005
1.00006
1.00007
1.00008
1.0001
1.00011
1.00013
1.00015
1.00018
1.00023
1.00031
1.00043
1.0006
1.00083
1.00115
1.00156
1.00206
1.00265
1.00331
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00002
1.00003
1.00004
1.00005
1.00006
1.00007
1.00009
1.00011
1.00013
1.00015
1.00018
1.00021
1.00027
1.00036
1.00048
1.00066
1.00092
1.00127
1.00173
1.0023
1.00299
1.0038
1.00469
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00002
1.00002
1.00003
1.00004
1.00006
1.00007
1.00009
1.00011
1.00013
1.00016
1.00019
1.00024
1.0003
1.00039
1.00052
1.00071
1.00098
1.00136
1.00186
1.0025
1.00328
1.00421
1.00527
1.00642
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00002
1.00003
1.00004
1.00005
1.00007
1.00009
1.00011
1.00014
1.00017
1.0002
1.00025
1.00032
1.00041
1.00054
1.00074
1.00101
1.0014
1.00193
1.00262
1.00348
1.00453
1.00574
1.0071
1.00855
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00002
1.00002
1.00003
1.00005
1.00006
1.00008
1.0001
1.00013
1.00016
1.0002
1.00025
1.00032
1.00041
1.00055
1.00074
1.00101
1.00141
1.00194
1.00266
1.00359
1.00473
1.00608
1.00762
1.00929
1.01104
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00002
1.00003
1.00004
1.00005
1.00007
1.0001
1.00012
1.00016
1.0002
1.00025
1.00032
1.00041
1.00053
1.00072
1.00099
1.00137
1.0019
1.00262
1.00358
1.00478
1.00625
1.00795
1.00983
1.01183
1.01385
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00002
1.00002
1.00003
1.00005
1.00006
1.00008
1.00011
1.00014
1.00018
1.00024
1.0003
1.00039
1.00051
1.00068
1.00093
1.00129
1.0018
1.00251
1.00346
1.0047
1.00623
1.00806
1.01013
1.01236
1.01464
1.01682
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00002
1.00003
1.00004
1.00005
1.00007
1.0001
1.00013
1.00017
1.00021
1.00028
1.00036
1.00047
1.00063
1.00086
1.00119
1.00166
1.00234
1.00326
1.00448
1.00603
1.00794
1.01015
1.01259
1.01512
1.01757
1.01974
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00002
1.00003
1.00004
1.00006
1.00008
1.00011
1.00014
1.00019
1.00025
1.00032
1.00043
1.00057
1.00077
1.00107
1.0015
1.00211
1.00297
1.00414
1.00567
1.00759
1.00989
1.0125
1.01526
1.01797
1.02039
1.02224
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00002
1.00002
1.00003
1.00005
1.00007
1.00009
1.00012
1.00016
1.00021
1.00028
1.00037
1.0005
1.00068
1.00094
1.00131
1.00186
1.00264
1.00372
1.00517
1.00705
1.00936
1.01207
1.01503
1.01801
1.02071
1.02278
1.02387
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00002
1.00002
1.00004
1.00005
1.00007
1.0001
1.00013
1.00018
1.00024
1.00032
1.00043
1.00058
1.0008
1.00112
1.00159
1.00228
1.00324
1.00458
1.00635
1.0086
1.01132
1.01441
1.01764
1.02066
1.02305
1.02432
1.02405
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00002
1.00003
1.00004
1.00006
1.00008
1.00011
1.00015
1.0002
1.00027
1.00036
1.00049
1.00067
1.00094
1.00133
1.00191
1.00275
1.00393
1.00555
1.00766
1.01031
1.01343
1.01684
1.02019
1.023
1.02465
1.02453
1.02213
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00002
1.00003
1.00004
1.00006
1.00008
1.00012
1.00016
1.00022
1.00029
1.0004
1.00055
1.00077
1.00109
1.00157
1.00227
1.00328
1.0047
1.00662
1.0091
1.01214
1.01562
1.01925
1.02252
1.02475
1.02513
1.02289
1.01745
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00002
1.00003
1.00004
1.00006
1.00009
1.00012
1.00017
1.00023
1.00032
1.00044
1.00061
1.00087
1.00125
1.00182
1.00266
1.00386
1.00553
1.00777
1.01063
1.01405
1.01783
1.02152
1.02442
1.02563
1.0241
1.01889
1.00941
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00002
1.00003
1.00005
1.00007
1.00009
1.00013
1.00018
1.00025
1.00034
1.00048
1.00068
1.00098
1.00142
1.00209
1.00307
1.00448
1.00643
1.009
1.01222
1.01598
1.01995
1.0235
1.0257
1.02536
1.0212
1.01214
0.997599
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00002
1.00003
1.00005
1.00007
1.0001
1.00014
1.00019
1.00026
1.00037
1.00052
1.00074
1.00109
1.0016
1.00238
1.00352
1.00514
1.00736
1.01026
1.01383
1.01787
1.0219
1.02508
1.02618
1.02373
1.0162
1.0024
0.981858
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00002
1.00003
1.00005
1.00007
1.0001
1.00014
1.00019
1.00027
1.00038
1.00055
1.00081
1.00119
1.00179
1.00267
1.00397
1.00581
1.00831
1.01154
1.01543
1.01966
1.02359
1.02613
1.02573
1.0206
1.00899
0.98968
0.962353
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00002
1.00003
1.00005
1.00007
1.0001
1.00014
1.0002
1.00028
1.0004
1.00058
1.00087
1.0013
1.00197
1.00297
1.00443
1.00649
1.00927
1.0128
1.01695
1.02129
1.02496
1.02657
1.02428
1.01595
0.999671
0.974225
0.939593
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00002
1.00003
1.00005
1.00007
1.0001
1.00014
1.0002
1.00028
1.00041
1.00061
1.00092
1.0014
1.00214
1.00326
1.00488
1.00716
1.0102
1.014
1.01836
1.02271
1.02594
1.02639
1.02185
1.00991
0.988518
0.956559
0.914398
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00002
1.00003
1.00005
1.00007
1.00009
1.00013
1.0002
1.00028
1.00042
1.00063
1.00097
1.0015
1.00231
1.00354
1.00532
1.0078
1.01108
1.01513
1.01964
1.02388
1.02653
1.0256
1.01856
1.00274
0.975998
0.937419
0.88782
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00002
1.00003
1.00004
1.00006
1.00009
1.00013
1.00019
1.00028
1.00042
1.00065
1.00101
1.00158
1.00246
1.00379
1.00572
1.00839
1.0119
1.01614
1.02075
1.02481
1.02675
1.0243
1.01461
0.994806
0.96272
0.91769
0.861047
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00002
1.00003
1.00004
1.00006
1.00008
1.00012
1.00018
1.00027
1.00042
1.00065
1.00104
1.00165
1.00259
1.00402
1.00608
1.00893
1.01262
1.01703
1.02167
1.02548
1.02666
1.02262
1.01027
0.98657
0.949378
0.898328
0.835291
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00002
1.00002
1.00003
1.00005
1.00007
1.00011
1.00017
1.00026
1.00041
1.00065
1.00105
1.00169
1.0027
1.00421
1.00639
1.00939
1.01324
1.01778
1.02241
1.02593
1.02632
1.02074
1.00586
0.978534
0.936692
0.880281
0.811689
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00002
1.00003
1.00004
1.00006
1.0001
1.00015
1.00024
1.00039
1.00064
1.00106
1.00172
1.00277
1.00436
1.00664
1.00976
1.01374
1.01837
1.02297
1.0262
1.02584
1.01885
1.00171
0.971192
0.925347
0.864412
0.791242
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00001
1.00002
1.00003
1.00005
1.00008
1.00013
1.00022
1.00037
1.00062
1.00104
1.00173
1.00282
1.00445
1.00681
1.01003
1.01412
1.01881
1.02336
1.02633
1.02533
1.01714
0.998116
0.965001
0.915947
0.851455
0.774761
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00001
1.00002
1.00003
1.00004
1.00007
1.00011
1.00019
1.00034
1.00059
1.00102
1.00172
1.00282
1.0045
1.00692
1.0102
1.01436
1.01909
1.0236
1.02636
1.02487
1.01578
0.99536
0.960338
0.908974
0.841976
0.762846
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00002
1.00003
1.00005
1.00009
1.00017
1.0003
1.00055
1.00098
1.00168
1.0028
1.00449
1.00694
1.01027
1.01446
1.01922
1.0237
1.02633
1.02454
1.01491
0.993643
0.957483
0.904773
0.836356
0.755887
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1.00001
1.00003
1.00007
1.00014
1.00027
1.00051
1.00092
1.00162
1.00273
1.00443
1.00688
1.01022
1.01443
1.0192
1.02368
1.02627
1.0244
1.01461
0.993093
0.9566
0.903534
0.834794
0.75407
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999999
0.999999
0.999998
0.999997
0.999995
0.999994
0.999996
0.999999
1.00001
1.00004
1.0001
1.00022
1.00045
1.00086
1.00154
1.00264
1.00431
1.00675
1.01007
1.01427
1.01903
1.02353
1.02618
1.02445
1.01491
0.993749
0.957742
0.905301
0.837314
0.757383
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999999
0.999999
0.999999
0.999998
0.999997
0.999996
0.999993
0.999991
0.999988
0.999986
0.999985
0.999992
1.00001
1.00007
1.00018
1.00039
1.00078
1.00144
1.00251
1.00415
1.00654
1.00981
1.01397
1.01871
1.02326
1.02607
1.02469
1.01577
0.995566
0.96084
0.909976
0.843774
0.765653
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999999
0.999998
0.999999
0.999997
0.999996
0.999993
0.999991
0.999986
0.999981
0.999977
0.999971
0.999974
0.999989
1.00003
1.00013
1.00033
1.00069
1.00132
1.00235
1.00393
1.00626
1.00946
1.01354
1.01826
1.02286
1.02591
1.02507
1.01712
0.998402
0.965709
0.917324
0.853889
0.778559
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999999
0.999999
0.999998
0.999996
0.999995
0.999992
0.999987
0.999982
0.999975
0.999967
0.999959
0.999956
0.999965
0.999999
1.00009
1.00026
1.0006
1.00119
1.00217
1.00368
1.00592
1.00901
1.013
1.01766
1.02233
1.02567
1.02551
1.01881
1.00206
0.972057
0.926989
0.867238
0.795636
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999999
0.999999
0.999998
0.999996
0.999993
0.99999
0.999985
0.999978
0.999968
0.999959
0.999948
0.99994
0.999942
0.999968
1.00004
1.0002
1.00051
1.00105
1.00197
1.00339
1.00552
1.00849
1.01235
1.01693
1.02165
1.02531
1.02593
1.02068
1.00626
0.979503
0.938485
0.883275
0.816287
)
;
boundaryField
{
emptyPatches_empt
{
type empty;
}
top_cyc
{
type cyclic;
}
bottom_cyc
{
type cyclic;
}
inlet_cyc
{
type cyclic;
}
outlet_cyc
{
type cyclic;
}
procBoundary2to0
{
type processor;
value nonuniform List<scalar>
75
(
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999998
0.999997
0.999995
0.999993
0.999989
0.999983
0.999975
0.999964
0.999952
0.999938
0.999926
0.999921
0.999937
0.999995
1.00013
1.00041
1.00091
1.00175
1.00309
1.00508
1.0079
1.0116
1.01607
1.02081
1.02479
1.02623
1.02256
1.0107
0.987605
0.951224
0.901311
0.839784
)
;
}
procBoundary2to0throughtop_cyc
{
type processorCyclic;
value nonuniform List<scalar>
75
(
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
)
;
}
procBoundary2to3
{
type processor;
value nonuniform List<scalar>
75
(
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999999
0.999999
0.999998
0.999997
0.999996
0.999995
0.999993
0.99999
0.999986
0.999981
0.999975
0.999968
0.999959
0.999949
0.999937
0.999926
0.999915
0.999908
0.999909
0.999924
0.999963
1.00004
1.00017
1.00039
1.00071
1.00119
1.00187
1.0028
1.00405
1.00565
1.00764
1.01003
1.01278
1.01577
1.01878
1.02146
1.02333
1.02376
1.02199
1.01721
1.00861
0.995569
0.977694
0.95498
0.927845
0.89712
0.863975
0.829803
0.796071
0.764199
0.735453
0.710887
0.691315
0.677311
0.669228
0.667218
0.671253
0.681135
0.696528
0.716973
0.74187
)
;
}
procBoundary2to3throughinlet_cyc
{
type processorCyclic;
value nonuniform List<scalar>
75
(
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
)
;
}
}
// ************************************************************************* //
| [
"tdg@debian"
] | tdg@debian | |
23c1ff6ea4ff3d4386cc05c85c9f3b6c9b7bf6fc | 2bec5a52ce1fb3266e72f8fbeb5226b025584a16 | /landscapeR/src/hidden.cpp | 0ea0441b5a23388d45b94b7bbf051e8962eedaa4 | [] | no_license | akhikolla/InformationHouse | 4e45b11df18dee47519e917fcf0a869a77661fce | c0daab1e3f2827fd08aa5c31127fadae3f001948 | refs/heads/master | 2023-02-12T19:00:20.752555 | 2020-12-31T20:59:23 | 2020-12-31T20:59:23 | 325,589,503 | 9 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 2,612 | cpp | #include <Rcpp.h>
using namespace Rcpp;
// Get contiguous cells (rook case only)
// [[Rcpp::export(name = ".contigCells")]]
IntegerVector contigCells_cpp(int pt, int bgr, NumericMatrix mtx) {
int rr;
int cc;
int dim1 = mtx.nrow();
int dim2 = mtx.ncol();
IntegerVector r(4);
IntegerVector c(4);
IntegerVector ad;
int idx;
if (pt % dim1 == 0) {
rr = dim1;
cc = pt / dim1;
} else {
cc = trunc(pt / dim1) + 1;
rr = pt - (cc-1) * dim1;
}
r[0] = rr-1;
r[1] = rr+1;
r[2] = rr;
r[3] = rr;
c[0] = cc;
c[1] = cc;
c[2] = cc-1;
c[3] = cc+1;
for (int i = 0; i < 4; i++){
if(r[i] > 0 && r[i] <= dim1 && c[i] > 0 && c[i] <= dim2){
idx = r[i] + (c[i] - 1) * dim1;
if(mtx[idx-1] == bgr){
ad.push_back(idx);
}
}
}
return(ad);
}
// Assign values
// [[Rcpp::export(name = ".assignValues")]]
NumericMatrix assignValues_cpp(int val, IntegerVector ad, NumericMatrix mtx) {
for (int i = 0; i < ad.length(); i++){
mtx[ad[i]-1] = val;
}
return(mtx);
}
// Transpose index of input cells
// [[Rcpp::export(name = ".indexTranspose")]]
IntegerVector indexTranspose_cpp(IntegerVector id, int dim1, int dim2) {
int n = id.size();
int rr = 0;
int cc = 0;
IntegerVector out(n);
for (int i = 0; i < n; i++){
if(id[i] % dim1 == 0){
rr = dim1;
cc = id[i] / dim1;
} else {
cc = trunc(id[i] / dim1) + 1;
rr = id[i] - (cc - 1) * dim1;
}
out[i] = cc + (rr-1) * dim2;
}
return(out);
}
// Remove single tones
// // [[Rcpp::export(name = "rmSingle")]]
// IntegerVector rmSingle_cpp(NumericMatrix mtx, bool rm) {
// int dim1 = mtx.ncol();
// int dim2 = mtx.nrow();
// int singles;
// int v;
// int vval;
// //
// int n = mtx.length();
// for (int i = 0; i < n; i++){
// v[i] = mtx[i];
// vval[i] = mtx[i];
// v <- which(is.finite(v))
// for (pt in v){ ## Faster than sapply or vapply!
// if(pt %% dim2 == 0){
// cc <- dim2
// rr <- pt / dim2
// } else {
// rr <- trunc(pt / dim2) + 1
// cc <- pt - (rr-1) * dim2
// }
// ad <- c(rr-1,rr+1,rr,rr,cc,cc,cc-1,cc+1)
// ad[ad <= 0 | c(ad[1:4] > dim1, ad[5:8] > dim2)] <- NA
// ad <- ad[5:8] + (ad[1:4]-1)*dim2
// ad <- ad[is.finite(ad)]
// if(all(.subset(vval, ad) != .subset(vval, pt))){
// if(rm == TRUE){
// vval[pt] <- sample(.subset(vval, ad), 1)
// } else {
// singles <- c(singles, pt)
// }
// }
// }
// if(rm == TRUE){
// rst[] <- vval
// return(rst)
// } else {
// return(singles)
// }
// }
| [
"akhilakollasrinu424jf@gmail.com"
] | akhilakollasrinu424jf@gmail.com |
5982132a6ab3d727a711f8f23ac9312d85d700cb | 96c69558996d44572c6fb9c259a76996a9d021c1 | /Greedy_Algorithm/JobSequencing_Problem.cpp | bf1db743924f0450889f53f73e5f923b46c17bb9 | [] | no_license | iamrajukumar/DataStructures_And_Algorithms | 53b6ca4cadf994ea0e481a89b6dbc62118c73513 | b7da057d15fe1583d91a553640df3b26ef99cbda | refs/heads/main | 2023-02-10T04:53:30.624902 | 2020-12-15T08:36:57 | 2020-12-15T08:36:57 | 321,603,542 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,061 | cpp | #include<bits/stdc++.h>
using namespace std;
bool mycompare(pair<int,int> p1,pair<int,int> p2){
return p1.first>p2.first;
}
int main()
{
//code
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int id,dl,pr;
vector<pair<int,int>> v;
map<int,int> m;
for(int i=0;i<n;i++){
cin>>id>>dl>>pr;
m[dl]=pr;
v.push_back(make_pair(pr,dl));
}
sort(v.begin(),v.end(),mycompare);
int profit=0;
int task=0;
bool slots[n];
for(int i=0;i<n;i++)
slots[i]=false;
for(int i=0;i<n;i++){
for(int j=min(v[i].second-1,n-1);j>=0;j--){
if(!slots[j]){
slots[j]=true;
task++;
profit+=v[i].first;
break;
}
}
}
cout<<task<<" "<<profit<<endl;
}
return 0;
} | [
"rajukumarbhui@gmail.com"
] | rajukumarbhui@gmail.com |
eb73ea5aba6bec7dba6bfa43910359f969c836f8 | e64b5c5f7b9a1df7ef9d79d7d594882b8b4b51cc | /VirtualKeyboard/Macro.h | 726eeee96452fccfce064bb14eb093f36425b361 | [] | no_license | extramask93/temp | 52cd30498d5d5e342739dcb9565e574981343ce0 | cfcde3710f5f6bdd63351df5922bfd9bc1ade244 | refs/heads/master | 2021-01-20T10:50:36.306829 | 2017-08-30T14:55:07 | 2017-08-30T14:55:07 | 101,652,155 | 0 | 0 | null | null | null | null | WINDOWS-1250 | C++ | false | false | 806 | h | #pragma once
#include <vector>
#include <functional>
#include <memory>
#include "BlockingQueue.h"
#include "IMessage.h"
#include "IRunMode.h"
#include "boost/program_options.hpp"
#include "ShortParser.h"
#include "LongParser.h"
using CallbackType = std::function<void()>;
class Macro:public IRunMode
{
public:
explicit Macro(BlockingQueue<std::shared_ptr<IMessage>> &que,boost::program_options::variables_map const &vm);
int Load(std::string const &fname);
// Odziedziczono za pośrednictwem elementu IRunMode
virtual void Run() override;
~Macro();
private:
void LoadFile(std::string name);
std::vector<std::string> lines;
std::vector<CallbackType> requests;
BlockingQueue<std::shared_ptr<IMessage>> &bque;
LongParser *longParser;
ShortParser *shortParser;
};
| [
"abaniuszewicz@gmail.com"
] | abaniuszewicz@gmail.com |
95d1498dde78e555d106445e6689ad402a54cacf | 5cc95b40257628c232f07909f7d23c0af2cfa24f | /FrameWorkDirectX/cParticleMuzzleEmitter.cpp | c1d9067fb96e020077614c8d98f05c7d08f35198 | [] | no_license | whateveruwant/Borderlands_v.copy | daf39c4e7dfd988117f66a1c64b7ab01b65adc52 | d16ebf9556e755ae3254b8cc2d05a02ffba612ce | refs/heads/master | 2020-03-13T20:57:06.314530 | 2018-05-01T18:46:05 | 2018-05-01T18:46:05 | 131,285,192 | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 14,024 | cpp | #include "StdAfx.h"
#include "cParticleMuzzling.h"
cParticleMuzzlingEitter::cParticleMuzzlingEitter(void)
{
}
cParticleMuzzlingEitter::~cParticleMuzzlingEitter(void)
{
}
void cParticleMuzzlingEitter::Init(
DWORD partcleNum, //총 파티클 량
float emission, //초당 발생량
float liveTimeMin, //파티클하나의 시간
float liveTimeMax,
const D3DXVECTOR3& velocityMin, //파티클 시작 속도
const D3DXVECTOR3& velocityMax,
const D3DXVECTOR3& accelMin, //파티클 가속
const D3DXVECTOR3& accelMax,
const VEC_COLOR& colors, //파티클 컬러 벡터배열
const VEC_SCALE& scales, //파티클 스케일 컬러배열
float scaleMin, //파티클 스케일
float scaleMax,
LPDIRECT3DTEXTURE9 pPaticleTexture, //파티클 Texture
bool bLocal //이게 true 면 파티클의 움직임이 나의Transform Local 기준으로 움직인다.
)
{
//해당 파티클 랜더의 총 파티클 수
m_PaticleNum = partcleNum;
//총파티클 수만큼 버텍스 배열을 만든다.
m_ParticleVerticles = new PARTICLE_VERTEX[m_PaticleNum];
//파티클 객체 생성
m_pParticlesMuzzle = new cParticleMuzzling[m_PaticleNum];
//초당 생성량
m_fEmissionPerSec = emission;
//초당 생성량 따른 발생 간격
m_fEmisionIntervalTime = 1.0f / m_fEmissionPerSec;
//지난 시간도 0
m_fEmisionDeltaTime = 0.0f;
//발생 여부 false
m_bEmission = false;
//컬러 대입
//m_Colors = colors;
m_Colors.clear();
for (int i = 0; i < colors.size(); i++)
m_Colors.push_back(colors[i]);
//사이즈 대입
//m_Scales = scales;
m_Scales.clear();
for (int i = 0; i < scales.size(); i++)
m_Scales.push_back(scales[i]);
//시작 라이브 타임 대입
m_fStartLiveTimeMin = liveTimeMin;
m_fStartLiveTimeMax = liveTimeMax;
//시작 속도 대입
m_StartVelocityMin = velocityMin;
m_StartVelocityMax = velocityMax;
//시작 가속 대입
m_StartAccelateMin = accelMin;
m_StartAccelateMax = accelMax;
//시작 스케일 대입
m_fStartScaleMin = scaleMin;
m_fStartScaleMax = scaleMax;
//시작순번 초기화
m_dwParticleCount = 0;
//Texture 참조
m_pTex = pPaticleTexture;
m_bLocal = bLocal;
EmissionType = PZERO;
}
void cParticleMuzzlingEitter::Release()
{
SAFE_DELETE_ARR(m_pParticlesMuzzle);
SAFE_DELETE_ARR(m_ParticleVerticles);
}
//사방 팔방으로 입자 퍼트린다.
void cParticleMuzzlingEitter::Burst(int num, float minSpeed, float maxSpeed, float maxLife, float minLife)
{
for (int i = 0; i < num; i++)
{
D3DXVECTOR3 randVec(
RandomFloatRange(-1.0f, 1.0f),
RandomFloatRange(-1.0f, 1.0f),
RandomFloatRange(-1.0f, 1.0f));
D3DXVec3Normalize(&randVec, &randVec);
randVec *= RandomFloatRange(minSpeed, maxSpeed);
StartOneParticle(randVec, RandomFloatRange(maxLife, minLife));
}
}
void cParticleMuzzlingEitter::ParticleBurst(int num, float minX, float maxX, float minY, float maxY, float minZ, float maxZ, float minSpeed, float maxSpeed, float maxLife, float minLife)
{
for (int i = 0; i < num; i++)
{
D3DXVECTOR3 randVec(
RandomFloatRange(minX, maxX), //-0.5f, 0.5f),
RandomFloatRange(minY, maxY), //-0.5f, 0.5f ),
RandomFloatRange(minZ, maxZ)); //-0.5f,0.5f ) );
D3DXVec3Normalize(&randVec, &randVec);
randVec *= 100;// RandomFloatRange(minSpeed, maxSpeed);
StartOneParticle(randVec, RandomFloatRange(maxLife, minLife));
}
}
void cParticleMuzzlingEitter::BaseObjectUpdate(float timeDelta)
{
//모든 파티클 업데이트
for (int i = 0; i < m_PaticleNum; i++) {
m_pParticlesMuzzle[i].Update(timeDelta);
}
//너가 지금 발생 상태니?
if (m_bEmission) {
//하나 발생하고 지난시간
m_fEmisionDeltaTime += timeDelta;
while (m_fEmisionDeltaTime >= m_fEmisionIntervalTime) {
m_fEmisionDeltaTime -= m_fEmisionIntervalTime;
//파티클 하나 발사
StartOneParticleMuzle();
}
}
}
void cParticleMuzzlingEitter::BaseObjectRender()
{
//그릴 파티클 수
DWORD drawParticleNum = 0;
for (int i = 0; i < m_PaticleNum; i++) {
//해당파티클이 활성화 중이니?
//if( m_pPaticles[i].isLive() ){
//
// //해당 파티클의 정보를 얻는다.
// m_pPaticles[i].GetParticleVertex(
// m_ParticleVerticles + drawParticleNum,
// m_Colors, m_Scales );
//
//
// drawParticleNum++;
//
//}
if (m_pParticlesMuzzle[i].isLive()) {
//해당 파티클의 정보를 얻는다.
m_pParticlesMuzzle[i].GetParticleVertex(
m_ParticleVerticles + drawParticleNum,
m_Colors, m_Scales);
drawParticleNum++;
}
}
Device->SetRenderState(D3DRS_LIGHTING, false); //라이팅을 끈다.
Device->SetRenderState(D3DRS_POINTSPRITEENABLE, true); //포인트 스플라이트 활성화
Device->SetRenderState(D3DRS_POINTSCALEENABLE, true); //포인트의 스케일값 먹이겠다.
Device->SetRenderState(D3DRS_POINTSIZE_MIN, FloatToDWORD(0.0f)); //포인트의 최소 크기 ( 화면기준 )
Device->SetRenderState(D3DRS_POINTSIZE_MAX, FloatToDWORD(500.0f)); //포인트의 최대 크기 ( 화면기준 )
//Device->SetRenderState( D3DRS_POINTSIZE, FloatToDWORD( 10.0f ) ); //포인트 기준 사이즈 ( 정점의 포인트 사이즈가 있으면 무시되는듯 );
Device->SetRenderState(D3DRS_ZWRITEENABLE, false); //z 버퍼의 쓰기를 막는다.
//출력되는 POINT size
//finalSize = viewportHeight * pointSize * sqrt( 1 / ( A + B(D) + C(D^2) ) );
//아래와 같이 하면 자연스러운 거리에 따른 스케일이 나타남
Device->SetRenderState(D3DRS_POINTSCALE_A, FloatToDWORD(0.0f));
Device->SetRenderState(D3DRS_POINTSCALE_B, FloatToDWORD(0.0f));
Device->SetRenderState(D3DRS_POINTSCALE_C, FloatToDWORD(1.0f));
//알파 블렌딩 셋팅
Device->SetRenderState(D3DRS_ALPHABLENDENABLE, true);
Device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
Device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE);
//Texture 의 값과 Diffuse 여기서는 정점컬러의 알파값 을 섞어 최종 출력을 한다.
Device->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
Device->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE);
Device->SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_TEXTURE);
D3DXMATRIXA16 matWorld;
if (m_bLocal == false)
D3DXMatrixIdentity(&matWorld);
else
matWorld = this->pTransform->GetFinalMatrix();
Device->SetTransform(D3DTS_WORLD, &matWorld);
//파티클 Texture 셋팅
Device->SetTexture(0, m_pTex);
//파티클 정점 출력
Device->SetFVF(PARTICLE_VERTEX::FVF);
Device->DrawPrimitiveUP(
D3DPT_POINTLIST,
drawParticleNum,
m_ParticleVerticles,
sizeof(PARTICLE_VERTEX));
//파티클 그리고 난후 후처리
Device->SetRenderState(D3DRS_LIGHTING, true);
Device->SetRenderState(D3DRS_POINTSPRITEENABLE, false);
Device->SetRenderState(D3DRS_POINTSCALEENABLE, false);
Device->SetRenderState(D3DRS_ALPHABLENDENABLE, false);
Device->SetRenderState(D3DRS_ZWRITEENABLE, true);
Device->SetTexture(0, NULL);
}
//파티클 생성 시작
void cParticleMuzzlingEitter::StartEmission()
{
m_bEmission = true;
}
//파티클 생성 중지
void cParticleMuzzlingEitter::StopEmission()
{
m_bEmission = false;
}
///////////////////////////////////////////////////
//파티클 하나 생성
void cParticleMuzzlingEitter::StartOneParticle()
{
//라이브 타임 랜덤
float liveTime = RandomFloatRange(
m_fStartLiveTimeMin, m_fStartLiveTimeMax);
//파티클이 생성될 위치
D3DXVECTOR3 position;
//로컬이 아닌경우 자신의 월드 위치에서 시작하고
if (this->m_bLocal == false)
position = this->pTransform->GetWorldPosition();
//로컬인 경우 0 에서 시작한다.
else
position = D3DXVECTOR3(0, 0, 0);
//생성 범위에 따른 추가 위치....
if (EmissionType == PATICLE_EMISSION_TYPE::SPHERE)
{
//랜덤벡터
D3DXVECTOR3 randDir(
RandomFloatRange(-1.0f, 1.0f),
RandomFloatRange(-1.0f, 1.0f),
RandomFloatRange(-1.0f, 1.0f));
D3DXVec3Normalize(&randDir, &randDir);
//랜덤거리
float randDistance = RandomFloatRange(0, SphereEmissionRange);
//추가위치
position += randDir * randDistance;
}
else if (EmissionType == PATICLE_EMISSION_TYPE::SPHERE_OUTLINE)
{
//랜덤벡터
D3DXVECTOR3 randDir(
RandomFloatRange(-1.0f, 1.0f),
RandomFloatRange(-1.0f, 1.0f),
RandomFloatRange(-1.0f, 1.0f));
D3DXVec3Normalize(&randDir, &randDir);
//추가위치
position += randDir * SphereEmissionRange;
}
else if (EmissionType == PATICLE_EMISSION_TYPE::BOX)
{
//랜덤벡터
D3DXVECTOR3 randDir(
RandomFloatRange(MinEmissionRangeX, MaxEmissionRangeX),
RandomFloatRange(MinEmissionRangeY, MaxEmissionRangeY),
RandomFloatRange(MinEmissionRangeZ, MaxEmissionRangeZ));
//추가위치
position += randDir;
}
//벡터 랜덤
D3DXVECTOR3 velocity;
velocity.x = RandomFloatRange(m_StartVelocityMin.x, m_StartVelocityMax.x);
velocity.y = RandomFloatRange(m_StartVelocityMin.y, m_StartVelocityMax.y);
velocity.z = RandomFloatRange(m_StartVelocityMin.z, m_StartVelocityMax.z);
D3DXVECTOR3 accelation;
accelation.x = RandomFloatRange(m_StartAccelateMin.x, m_StartAccelateMax.x);
accelation.y = RandomFloatRange(m_StartAccelateMin.y, m_StartAccelateMax.y);
accelation.z = RandomFloatRange(m_StartAccelateMin.z, m_StartAccelateMax.z);
//자신의 월드 매트릭스를 가지고 온다.
if (m_bLocal == false)
{
D3DXMATRIXA16 matWorld = this->pTransform->GetFinalMatrix();
D3DXVec3TransformNormal(&velocity, &velocity, &matWorld);
D3DXVec3TransformNormal(&accelation, &accelation, &matWorld);
}
//스케일도 랜덤
float scale = RandomFloatRange(m_fStartScaleMin, m_fStartScaleMax);
//순번대로 발생시킨다
m_pParticlesMuzzle[m_dwParticleCount].Start(
liveTime,
&position, &velocity, &accelation, scale, pTransform);
//다음 파티클을 위한 순번 증가
m_dwParticleCount++;
if (m_dwParticleCount == this->m_PaticleNum)
m_dwParticleCount = 0;
}
void cParticleMuzzlingEitter::StartOneParticleMuzle()
{
//라이브 타임 랜덤
float liveTime = RandomFloatRange(
m_fStartLiveTimeMin, m_fStartLiveTimeMax);
//파티클이 생성될 위치
D3DXVECTOR3 position;
//로컬이 아닌경우 자신의 월드 위치에서 시작하고
if (this->m_bLocal == false)
position = this->pTransform->GetWorldPosition();
//로컬인 경우 0 에서 시작한다.
else
position = D3DXVECTOR3(0, 0, 0);
//생성 범위에 따른 추가 위치....
if (EmissionType == PATICLE_EMISSION_TYPE::SPHERE)
{
//랜덤벡터
D3DXVECTOR3 randDir(
RandomFloatRange(-1.0f, 1.0f),
RandomFloatRange(-1.0f, 1.0f),
RandomFloatRange(-1.0f, 1.0f));
D3DXVec3Normalize(&randDir, &randDir);
//랜덤거리
float randDistance = RandomFloatRange(0, SphereEmissionRange);
//추가위치
position += randDir * randDistance;
}
else if (EmissionType == PATICLE_EMISSION_TYPE::SPHERE_OUTLINE)
{
//랜덤벡터
D3DXVECTOR3 randDir(
RandomFloatRange(-1.0f, 1.0f),
RandomFloatRange(-1.0f, 1.0f),
RandomFloatRange(-1.0f, 1.0f));
D3DXVec3Normalize(&randDir, &randDir);
//추가위치
position += randDir * SphereEmissionRange;
}
else if (EmissionType == PATICLE_EMISSION_TYPE::BOX)
{
//랜덤벡터
D3DXVECTOR3 randDir(
RandomFloatRange(MinEmissionRangeX, MaxEmissionRangeX),
RandomFloatRange(MinEmissionRangeY, MaxEmissionRangeY),
RandomFloatRange(MinEmissionRangeZ, MaxEmissionRangeZ));
//추가위치
position += randDir;
}
//벡터 랜덤
D3DXVECTOR3 velocity;
velocity.x = RandomFloatRange(m_StartVelocityMin.x, m_StartVelocityMax.x);
velocity.y = RandomFloatRange(m_StartVelocityMin.y, m_StartVelocityMax.y);
velocity.z = RandomFloatRange(m_StartVelocityMin.z, m_StartVelocityMax.z);
D3DXVECTOR3 accelation;
accelation.x = RandomFloatRange(m_StartAccelateMin.x, m_StartAccelateMax.x);
accelation.y = RandomFloatRange(m_StartAccelateMin.y, m_StartAccelateMax.y);
accelation.z = RandomFloatRange(m_StartAccelateMin.z, m_StartAccelateMax.z);
//자신의 월드 매트릭스를 가지고 온다.
if (m_bLocal == false)
{
D3DXMATRIXA16 matWorld = this->pTransform->GetFinalMatrix();
D3DXVec3TransformNormal(&velocity, &velocity, &matWorld);
D3DXVec3TransformNormal(&accelation, &accelation, &matWorld);
}
//스케일도 랜덤
float scale = RandomFloatRange(m_fStartScaleMin, m_fStartScaleMax);
//순번대로 발생시킨다
m_pParticlesMuzzle[m_dwParticleCount].Start(
liveTime,
&position, &velocity, &accelation, scale, pTransform);
//다음 파티클을 위한 순번 증가
m_dwParticleCount++;
if (m_dwParticleCount == this->m_PaticleNum)
m_dwParticleCount = 0;
}
//파티클 하나 생성 ( 방향 넣어서 )
void cParticleMuzzlingEitter::StartOneParticle(D3DXVECTOR3 dir, float life)
{
float liveTime = life;
//파티클이 생성될 위치
D3DXVECTOR3 position;
if (this->m_bLocal == false)
position = pTransform->GetWorldPosition();
else
position = D3DXVECTOR3(0, 0, 0);
//벡터 랜덤
D3DXVECTOR3 velocity;
velocity.x = dir.x;
velocity.y = dir.y;
velocity.z = dir.z;
D3DXVECTOR3 accelation;
accelation.x = RandomFloatRange(m_StartAccelateMin.x, m_StartAccelateMax.x);
accelation.y = RandomFloatRange(m_StartAccelateMin.y, m_StartAccelateMax.y);
accelation.z = RandomFloatRange(m_StartAccelateMin.z, m_StartAccelateMax.z);
//자신의 월드 매트릭스를 가지고 온다.
if (m_bLocal == false)
{
D3DXMATRIXA16 matWorld = this->pTransform->GetFinalMatrix();
D3DXVec3TransformNormal(&velocity, &velocity, &matWorld);
D3DXVec3TransformNormal(&accelation, &accelation, &matWorld);
}
//스케일도 랜덤
float scale = RandomFloatRange(m_fStartScaleMin, m_fStartScaleMax);
//발생시킨다
m_pParticlesMuzzle[m_dwParticleCount].Start(
liveTime,
&position, &velocity, &accelation, scale, pTransform);
m_dwParticleCount++;
if (m_dwParticleCount == this->m_PaticleNum)
m_dwParticleCount = 0;
} | [
"qkrdbals1630@khu.ac.kr"
] | qkrdbals1630@khu.ac.kr |
a8e10a9c31ff98687d80072385364abcbe936a45 | dd29c697874af163c0bc5dbc33eeb115374c0d30 | /dateoperate/stdafx.cpp | 056897385f1eeb1c5ccd2e0a8ca32bd978afa480 | [] | no_license | amoylel/excelop | b14be68fe8b8df9f1e854a33c9950d81bf75b765 | df976c2c188ccd0337a4dea52d7e21a20fdb61b4 | refs/heads/master | 2021-01-18T05:01:04.116977 | 2015-01-20T10:23:16 | 2015-01-20T10:23:16 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 166 | cpp |
// stdafx.cpp : 只包括标准包含文件的源文件
// dateoperate.pch 将作为预编译头
// stdafx.obj 将包含预编译类型信息
#include "stdafx.h"
| [
"466921396@163.com"
] | 466921396@163.com |
74dd792a20204482940b923f4034986bc1285867 | 6b8325aedb956175071e93f005a98057095dbb3d | /Tutorials/01_09_DelayExamples/MainComponent.h | b676e3d848376b50324982f5937a492112798550 | [] | no_license | 0x4d52/ugen | 73bdf090d8328e469977991cb9b662c8031cf467 | 590c03ba6e1e9caa20992327189dfcd74438ac86 | refs/heads/master | 2021-07-13T16:55:20.969401 | 2016-09-27T10:53:32 | 2016-09-27T10:53:32 | 34,687,605 | 22 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 455 | h | #ifndef _MAINCOMPONENT_H_
#define _MAINCOMPONENT_H_
#include <juce/juce.h>
#include "../../UGen/UGen.h"
class MainComponent : public Component,
public JuceIOHost
{
public:
MainComponent () : JuceIOHost(2, 2) { }
UGen constructGraph(UGen const& input)
{
const float maximumDelay = 5.0;
UGen mix = input.mix();
UGen delay = DelayN::AR(mix, maximumDelay, 1.0);
return U(mix, delay);
}
};
#endif //_MAINCOMPONENT_H_ | [
"Martin2.Robinson@uwe.ac.uk@7b043cfa-1675-11df-a4dd-1934c9c2caca"
] | Martin2.Robinson@uwe.ac.uk@7b043cfa-1675-11df-a4dd-1934c9c2caca |
7d08b0d4b44a0a06d0b7652f9443de1448a12d77 | 8f2e62c96094541f8d5a2c9bad4579e52de28a24 | /Module5/part3/Lab3.5.4/Lab3.5.4/Lab354.cpp | e0d93d2f26a9ac2de8723d002cb61a3c62b2b323 | [] | no_license | volodimirgoloshivskiy/CPA-Programing-Essentials-in-C-Page | 0e23f4cb39e126b2685b14344c283cf521369e1b | e7a0c58e6d6385a03d072e7c89872ff898928d60 | refs/heads/master | 2021-05-15T20:51:19.191275 | 2017-12-20T09:56:07 | 2017-12-20T09:56:07 | 107,803,555 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,886 | cpp | // Lab354.cpp: определяет точку входа для консольного приложения.
//
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
class Subscription
{
public:
Subscription()
{
this->id = 0;
this->ownerName = "Unknown";
this->validityInMonths = 0;
}
Subscription(int id, int validityInMonths, string ownerName)
{
if (id < 0)
id = 0;
this->id = id;
if (validityInMonths < 0)
validityInMonths = 0;
this->validityInMonths = validityInMonths;
if (ownerName.length() == 0)
ownerName = "Unknown";
this->ownerName = ownerName;
}
private:
int id;
int validityInMonths;
string ownerName;
public:
int GetId()
{
return this->id;
}
bool Extend(int numOfMonths)
{
if (numOfMonths <= 0)
return false;
validityInMonths += numOfMonths;
return true;
}
bool Cancel()
{
if (validityInMonths == 0)
return false;
validityInMonths = 0;
return true;
}
string GetInfo()
{
return "Subscription ID: " + to_string(this->id) + ". Valid for "
+ to_string(this->validityInMonths) + " months. Owner is "
+ this->ownerName + ".";
}
};
void ShowAllSubscriptions(Subscription*subscriptions, int count)
{
bool subscriptionsNotFound = true;
for (int i = 0; i < count; i++)
{
if (subscriptions[i].GetId() != 0)
{
subscriptionsNotFound = false;
cout << subscriptions[i].GetInfo() << endl;
}
}
if (subscriptionsNotFound)
{
cout << "There are no subscriptions in the system!" << endl;
}
}
string Trim(string str)
{
while (str[0] == ' ')
str.erase(0, 1);
while (str[str.length() - 1] == ' ')
str.erase(str.length() - 1, 1);
return str;
}
string RemoveExtraSpaces(string str)
{
int index = 0;
while ((index = str.find(" "), index) != -1)
str = str.replace(index, 2, " ");
return str;
}
string* SplitBySpace(string str, int &wordsCount)
{
int begin = 0, end, index = -1;
string* words;
wordsCount = 0;
str = Trim(str);
str = RemoveExtraSpaces(str);
while ((index = str.find(' ', index + 1)) != -1)
wordsCount++;
wordsCount++;
words = new string[wordsCount];
index = 0;
while ((end = str.find(' ', begin)) != -1)
{
words[index] = str.substr(begin, end - begin);
index++;
begin = end + 1;
}
words[index] = str.substr(begin);
return words;
}
int SearchById(Subscription*subscriptions, int id)
{
for (int i = 0; i < 10; i++)
{
if (subscriptions[i].GetId() == id)
{
return i;
}
}
return -1;
}
int main()
{
Subscription subscriptions[10];
Subscription nonExisting;
string command;
string* splitedCommand;
int wordsCount = 0;
int idInArray;
while (command != "quit")
{
ShowAllSubscriptions(subscriptions, 10);
cout << "Enter command: ";
getline(cin, command);
splitedCommand = SplitBySpace(command, wordsCount);
if (splitedCommand[0] == "extend")
{
if (wordsCount < 3)
{
cout << "Invalid paramters!" << std::endl;
continue;
}
idInArray = SearchById(subscriptions, stoi(splitedCommand[1]));
if (idInArray != -1)
{
if (!subscriptions[idInArray].Extend(stoi(splitedCommand[2])))
{
cout << "Invalid month count parameter!" << endl;
}
}
else
{
cout << "Subscription with ID " << splitedCommand[1]
<< " was not found!" << endl;
}
}
else if (splitedCommand[0] == "cancel")
{
if (wordsCount < 2)
{
cout << "Invalid paramters!" << endl;
continue;
}
idInArray = SearchById(subscriptions, stoi(splitedCommand[1]));
if (idInArray != -1)
{
if (!subscriptions[idInArray].Cancel())
{
cout << "Validity month count was 0 before operation!" << endl;
}
}
else
{
cout << "Subscription with ID " << splitedCommand[1]
<< " was not found!" << endl;
}
}
else if (splitedCommand[0] == "delete")
{
if (wordsCount < 2)
{
cout << "Invalid paramters!" << endl;
continue;
}
idInArray = SearchById(subscriptions, stoi(splitedCommand[1]));
if (idInArray != -1)
{
subscriptions[idInArray] = nonExisting;
}
else
{
cout << "Subscription with ID " << splitedCommand[1]
<< " was not found!" << endl;
}
}
else if (splitedCommand[0] == "create")
{
if (wordsCount < 4)
{
cout << "Invalid paramters!" << endl;
continue;
}
idInArray = SearchById(subscriptions, std::stoi(splitedCommand[1]));
if (idInArray != -1)
{
std::cout << "Subscription with ID " << splitedCommand[1]
<< " already exists!" << std::endl;
}
else
{
idInArray = SearchById(subscriptions, 0);
if (idInArray == -1)
{
cout << "Unfortunately, all subscriptions are used!" << endl;
}
else
{
subscriptions[idInArray] = Subscription
(
stoi(splitedCommand[1]),
0,
splitedCommand[2] + " " + splitedCommand[3]
);
}
}
}
}
return 0;
} | [
"32980294+volodimirgoloshivskiy@users.noreply.github.com"
] | 32980294+volodimirgoloshivskiy@users.noreply.github.com |
73bbfd3ca6cb76bae39e42d280eb2cc805a99601 | 0c3cab2c212c510448b35cc421c5083ee8028548 | /sampleCode/Extras/renderFace.hpp | b193043da76f0369e8d8b1bdead390ddef3f8083 | [] | no_license | bigvisionai/docker-course-2 | fc886376a3b1a92bef1586a54a088779fd31a7cd | 31a284468dd9c68c534256dc5b5df0a3bb69de13 | refs/heads/master | 2023-01-21T14:45:04.329978 | 2020-11-19T12:25:50 | 2020-11-19T12:25:50 | 293,062,709 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,133 | hpp | /*
Copyright 2017 BIG VISION LLC ALL RIGHTS RESERVED
This code is made available to the students of
the online course titled "Computer Vision for Faces"
by Satya Mallick for personal non-commercial use.
Sharing this code is strictly prohibited without written
permission from Big Vision LLC.
For licensing and other inquiries, please email
spmallick@bigvisionllc.com
*/
#ifndef BIGVISION_renderFace_H_
#define BIGVISION_renderFace_H_
#include <dlib/image_processing/frontal_face_detector.h>
#include <opencv2/opencv.hpp>
// Draw an open or closed polygon between
// start and end indices of full_object_detection
void drawPolyline
(
cv::Mat &img,
const dlib::full_object_detection& landmarks,
const int start,
const int end,
bool isClosed = false
)
{
std::vector <cv::Point> points;
for (int i = start; i <= end; ++i)
{
points.push_back(cv::Point(landmarks.part(i).x(), landmarks.part(i).y()));
}
cv::polylines(img, points, isClosed, cv::Scalar(255, 200,0), 2, 16);
}
// Draw face for the 68-point model.
void renderFace(cv::Mat &img, const dlib::full_object_detection& landmarks)
{
drawPolyline(img, landmarks, 0, 16); // Jaw line
drawPolyline(img, landmarks, 17, 21); // Left eyebrow
drawPolyline(img, landmarks, 22, 26); // Right eyebrow
drawPolyline(img, landmarks, 27, 30); // Nose bridge
drawPolyline(img, landmarks, 30, 35, true); // Lower nose
drawPolyline(img, landmarks, 36, 41, true); // Left eye
drawPolyline(img, landmarks, 42, 47, true); // Right Eye
drawPolyline(img, landmarks, 48, 59, true); // Outer lip
drawPolyline(img, landmarks, 60, 67, true); // Inner lip
}
// Draw points on an image.
// Works for any number of points.
void renderFace
(
cv::Mat &img, // Image to draw the points on
const std::vector<cv::Point2f> &points, // Vector of points
cv::Scalar color, // color points
int radius = 3) // Radius of points.
{
for (int i = 0; i < points.size(); i++)
{
cv::circle(img, points[i], radius, color, -1);
}
}
#endif // BIGVISION_renderFace_H_ | [
"labheshvalechha@gmail.com"
] | labheshvalechha@gmail.com |
7273935886362fcc3f42ec1910cc96b89c708d9c | 17adb0e72c9dd190124a8d21171d9c8fcb23e333 | /ui/CxDrawShapes/DataLinkGenPage.h | e7cf77f791f3f4ae5a4b6b18b5fa6a4f773916f1 | [
"MIT"
] | permissive | jafo2128/SuperCxHMI | 16dc0abb56da80db0f207d9194a37258575276b5 | 5a5afe2de68dc9a0c06e2eec945a579467ef51ff | refs/heads/master | 2020-04-01T16:30:20.771434 | 2016-02-06T00:40:53 | 2016-02-06T00:40:53 | 48,529,344 | 1 | 0 | null | 2015-12-24T06:45:45 | 2015-12-24T06:45:45 | null | UTF-8 | C++ | false | false | 3,163 | h | // DataLinkGenPage.h : Declaration of the DataLinkGenPage
#ifndef __CXDATALINKGENPAGE_H_
#define __CXDATALINKGENPAGE_H_
#include "resource.h" // main symbols
#include "../CxDynObjs/PropInfo.h"
#include "../CxDynObjs/CxDynObjs.h"
EXTERN_C const CLSID CLSID_CxDataLinkGenPage;
//////////////////////////////////////////
template <class T>
class ATL_NO_VTABLE IPropertyPageSiteImpl : public IPropertyPageSite
{
public:
STDMETHOD(GetLocaleID)(LCID* pLocaleID)
{
*pLocaleID = ::GetThreadLocale();
return (HRESULT)NOERROR;
}
STDMETHOD(OnStatusChange)(DWORD dwFlags)
{
T* pT = static_cast<T*>(this);
return pT->PropertyChange();
}
STDMETHOD(GetPageContainer)(IUnknown **ppUnk)
{
return (HRESULT)E_NOTIMPL;
}
STDMETHOD(TranslateAccelerator)(MSG *pMsg)
{
return (HRESULT)E_NOTIMPL;
}
CComPtr<IUnknown> m_spUnkSite;
};
/////////////////////////////////////////////////////////////////////////////
// CDataLinkGenPage
class ATL_NO_VTABLE CDataLinkGenPage :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CDataLinkGenPage, &CLSID_CxDataLinkGenPage>,
public IPropertyPageImpl<CDataLinkGenPage>,
public CDialogImpl<CDataLinkGenPage>,
public IPropertyPageSiteImpl<CDataLinkGenPage>,
public IDynamicFrm
{
public:
CDataLinkGenPage()
{
m_dwTitleID = IDS_TITLECxDataLinkGenPage;
m_dwHelpFileID = IDS_HELPFILECxDataLinkGenPage;
m_dwDocStringID = IDS_DOCSTRINGCxDataLinkGenPage;
m_bObjectIsFormmatDynamic = FALSE;
}
enum {IDD = IDD_CXDATALINKGENPAGE};
DECLARE_REGISTRY_RESOURCEID(IDR_CXDATALINKGENPAGE)
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(CDataLinkGenPage)
COM_INTERFACE_ENTRY(IPropertyPage)
COM_INTERFACE_ENTRY(IPropertyPageSite)
COM_INTERFACE_ENTRY(IDynamicFrm)
END_COM_MAP()
BEGIN_MSG_MAP(CDataLinkGenPage)
CHAIN_MSG_MAP(IPropertyPageImpl<CDataLinkGenPage>)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
COMMAND_HANDLER(IDC_CREATE_EXPRESSION, BN_CLICKED, OnClickedCreateExpression)
END_MSG_MAP()
// Handler prototypes:
// LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
// LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
// LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
LRESULT OnInitDialog(UINT, WPARAM wParam, LPARAM lParam, BOOL&);
LRESULT OnClickedCreateExpression(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
// IDynamicFrm
public:
STDMETHOD(EditDynamic)(long hParent, long X, long Y);
STDMETHOD(get_Source)(/*[out, retval]*/ BSTR *pVal);
STDMETHOD(put_Source)(/*[in]*/ BSTR newVal);
STDMETHOD(get_PropertyInfo)(/*[out, retval]*/ long *pVal);
STDMETHOD(put_PropertyInfo)(/*[in]*/ long newVal);
STDMETHOD(OnCreateExpression)(BSTR* pbstr);
STDMETHOD(Apply)(void);
void OnFinalMessage(HWND hWnd);
HRESULT PropertyChange()
{
m_pPageSite->OnStatusChange(PROPPAGESTATUS_DIRTY);
return S_OK;
}
private:
BOOL m_bObjectIsFormmatDynamic; //
CComPtr<IFormatDynamic> m_spFormatDynamic;
CComPtr<IPropertyPage> m_spFormatDynamicPage;
CDynamicPropInfo m_propinfo;
};
#endif //__CXDATALINKGENPAGE_H_
| [
"qinyong99@126.com"
] | qinyong99@126.com |
3c172946b8d208061504d0aeb692b5a21b41c86d | 088e000eb5f16e6d0d56c19833b37de4e67d1097 | /inference-engine/thirdparty/clDNN/kernel_selector/core/actual_kernels/index_select/index_select_kernel_ref.cpp | 47f4a7554d29a801393e6230b1516f50f3a4a30b | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | projectceladon/dldt | 614ba719a428cbb46d64ab8d1e845ac25e85a53e | ba6e22b1b5ee4cbefcc30e8d9493cddb0bb3dfdf | refs/heads/2019 | 2022-11-24T10:22:34.693033 | 2019-08-09T16:02:42 | 2019-08-09T16:02:42 | 204,383,002 | 1 | 1 | Apache-2.0 | 2022-11-22T04:06:09 | 2019-08-26T02:48:52 | C++ | UTF-8 | C++ | false | false | 1,848 | cpp | // Copyright (c) 2018 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.
#include "index_select_kernel_ref.h"
namespace kernel_selector {
ParamsKey IndexSelectKernelRef::GetSupportedKey() const {
ParamsKey k;
k.EnableInputDataType(Datatype::F16);
k.EnableInputDataType(Datatype::F32);
k.EnableInputDataType(Datatype::INT8);
k.EnableInputDataType(Datatype::UINT8);
k.EnableInputDataType(Datatype::INT32);
k.EnableOutputDataType(Datatype::F32);
k.EnableOutputDataType(Datatype::F16);
k.EnableOutputDataType(Datatype::INT8);
k.EnableOutputDataType(Datatype::UINT8);
k.EnableOutputDataType(Datatype::INT32);
k.EnableInputLayout(DataLayout::bfyx);
k.EnableInputLayout(DataLayout::yxfb);
k.EnableOutputLayout(DataLayout::bfyx);
k.EnableOutputLayout(DataLayout::yxfb);
k.EnableBatching();
k.EnableIndexSelectAxis(IndexSelectAxis::BATCH);
k.EnableIndexSelectAxis(IndexSelectAxis::FEATURE);
k.EnableIndexSelectAxis(IndexSelectAxis::Y);
k.EnableIndexSelectAxis(IndexSelectAxis::X);
k.EnableDifferentTypes();
return k;
}
KernelsData IndexSelectKernelRef::GetKernelsData(const Params& params, const optional_params& options) const {
return GetCommonKernelsData(params, options, FORCE_PRIORITY_9);
}
} // namespace kernel_selector
| [
"44090433+openvino-pushbot@users.noreply.github.com"
] | 44090433+openvino-pushbot@users.noreply.github.com |
589181eebc3a7ba4bf40182d24dce29fd09c69e5 | d48d2091a648afe0cfc1a33e5c0c09f4b1c693c9 | /Hypodermic/Registration.h | 1e9fdeba7577532d9685a8510791132db9e5c771 | [
"MIT"
] | permissive | an9bit/Hypodermic | e1210a88a3b268f7914d6a4ca98231bf75ad6f59 | f74ff291b254e53bfeca7c659a011e90a3f1afd6 | refs/heads/master | 2021-01-17T23:31:31.392469 | 2016-04-15T15:57:36 | 2016-04-15T15:57:36 | 56,907,147 | 0 | 0 | null | 2016-04-23T07:47:32 | 2016-04-23T07:47:31 | null | UTF-8 | C++ | false | false | 6,694 | h | #pragma once
#include <functional>
#include <memory>
#include <mutex>
#include <unordered_map>
#include <boost/signals2.hpp>
#include "Hypodermic/CircularDependencyException.h"
#include "Hypodermic/DependencyActivationException.h"
#include "Hypodermic/InstanceAlreadyActivatingException.h"
#include "Hypodermic/InvokeAtScopeExit.h"
#include "Hypodermic/IRegistration.h"
#include "Hypodermic/Log.h"
#include "Hypodermic/TypeAliasKey.h"
#include "Hypodermic/TypeInfo.h"
namespace Hypodermic
{
class Container;
class Registration : public IRegistration
{
public:
Registration(const TypeInfo& instanceType,
const std::unordered_map< TypeAliasKey, std::function< std::shared_ptr< void >(const std::shared_ptr< void >&) > >& typeAliases,
const std::function< std::shared_ptr< void >(Container&) >& instanceFactory,
const std::unordered_map< TypeInfo, std::function< std::shared_ptr< void >(Container&) > >& dependencyFactories,
const std::vector< std::function< void(Container&, const std::shared_ptr< void >&) > >& activationHandlers)
: m_instanceType(instanceType)
, m_typeAliases(typeAliases)
, m_instanceFactory(instanceFactory)
, m_dependencyFactories(dependencyFactories)
, m_activating(false)
{
for (auto&& handler : activationHandlers)
m_activated.connect(handler);
}
const TypeInfo& instanceType() const override
{
return m_instanceType;
}
const std::unordered_map< TypeAliasKey, std::function< std::shared_ptr< void >(const std::shared_ptr< void >&) > >& typeAliases() const override
{
return m_typeAliases;
}
std::function< std::shared_ptr< void >(Container&) > getDependencyFactory(const TypeInfo& dependencyType) const override
{
auto factoryIt = m_dependencyFactories.find(dependencyType);
if (factoryIt == std::end(m_dependencyFactories))
return nullptr;
return factoryIt->second;
}
std::shared_ptr< void > activate(Container& container, const TypeAliasKey& typeAliasKey) override
{
HYPODERMIC_LOG_INFO("Activating type " << instanceType().fullyQualifiedName());
Utils::InvokeAtScopeExit atScopeExit([this]() { this->m_activating = false; });
auto&& typeInfo = typeAliasKey.typeAlias().typeInfo();
{
std::lock_guard< decltype(m_mutex) > lock(m_mutex);
if (m_activating)
{
if (m_instanceType == typeInfo)
{
HYPODERMIC_LOG_ERROR("Already activating '" << typeInfo.fullyQualifiedName() << "', unwinding...");
HYPODERMIC_THROW_INSTANCE_ALREADY_ACTIVATING_EXCEPTION("Already activating '" << typeInfo.fullyQualifiedName() << "', unwinding...");
}
else
{
HYPODERMIC_LOG_ERROR("Already activating '" << typeInfo.fullyQualifiedName() << "' (base of '" << m_instanceType.fullyQualifiedName() << "'), unwinding...");
HYPODERMIC_THROW_INSTANCE_ALREADY_ACTIVATING_EXCEPTION("Already activating '" << typeInfo.fullyQualifiedName() <<
"' (base of '" << m_instanceType.fullyQualifiedName() << "'), unwinding...");
}
}
m_activating = true;
}
if (!m_instanceFactory)
{
HYPODERMIC_LOG_WARN("No instance factory provided to activate type " << m_instanceType.fullyQualifiedName());
return nullptr;
}
try
{
auto&& instance = m_instanceFactory(container);
m_activated(container, instance);
auto it = m_typeAliases.find(typeAliasKey);
if (it != std::end(m_typeAliases) && it->second != nullptr)
{
auto&& alignPointersFunc = it->second;
instance = alignPointersFunc(instance);
}
if (instance == nullptr)
HYPODERMIC_LOG_WARN("Instance of type " << m_instanceType.fullyQualifiedName() << " is null");
return instance;
}
catch (CircularDependencyException& ex)
{
HYPODERMIC_LOG_ERROR("Circular dependency detected while activating type " << m_instanceType.fullyQualifiedName() << ": " << ex.what());
HYPODERMIC_THROW_CIRCULAR_DEPENDENCY_EXCEPTION("'" << m_instanceType.fullyQualifiedName() << "' -> " << ex.what());
}
catch (InstanceAlreadyActivatingException& ex)
{
HYPODERMIC_LOG_ERROR("Circular dependency detected while activating type " << m_instanceType.fullyQualifiedName() << ": " << ex.what());
HYPODERMIC_THROW_CIRCULAR_DEPENDENCY_EXCEPTION("'" << m_instanceType.fullyQualifiedName() << "': " << ex.what());
}
catch (DependencyActivationException& ex)
{
HYPODERMIC_LOG_ERROR("Unable to activate instance of type " << m_instanceType.fullyQualifiedName() << " because one dependency cannot be activated: " << ex.what());
HYPODERMIC_THROW_DEPENDENCY_ACTIVATION_EXCEPTION("Unable to activate instance of type " << m_instanceType.fullyQualifiedName() << " because one dependency cannot be activated: " << ex.what());
}
catch (std::exception& ex)
{
HYPODERMIC_LOG_ERROR("Unable to activate instance of type " << m_instanceType.fullyQualifiedName() << ": " << ex.what());
HYPODERMIC_THROW_DEPENDENCY_ACTIVATION_EXCEPTION("Unable to activate instance of type " << m_instanceType.fullyQualifiedName() << ": " << ex.what());
}
}
private:
TypeInfo m_instanceType;
std::unordered_map< TypeAliasKey, std::function< std::shared_ptr< void >(const std::shared_ptr< void >&) > > m_typeAliases;
std::function< std::shared_ptr< void >(Container&) > m_instanceFactory;
std::unordered_map< TypeInfo, std::function< std::shared_ptr< void >(Container&) > > m_dependencyFactories;
boost::signals2::signal< void(Container&, const std::shared_ptr< void >&) > m_activated;
bool m_activating;
std::recursive_mutex m_mutex;
};
} // namespace Hypodermic | [
"y.bainier@abc-arbitrage.com"
] | y.bainier@abc-arbitrage.com |
4ea2e425483e2b247beda89ee76f25435bd77f47 | 17b0d361fe060246b80be9675ec84cd8f96344d8 | /of_v0.7.4_win_cb_release/addons/ofxOpenCv/src/ofxCvConstants.h | 5c87cee93b18328985969a650593ac7ba361ca08 | [
"MIT"
] | permissive | manunapo/eye-chess | 88099b72336733bc4adc87d04d1cff1aef70f313 | 754bdccee88a2baf73cfda0af7d281d5210ca060 | refs/heads/master | 2021-01-10T07:54:26.903117 | 2015-07-10T22:55:30 | 2015-07-10T22:55:30 | 36,328,709 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 264 | h | #ifndef OFX_CV_CONSTANTS_H
#define OFX_CV_CONSTANTS_H
#ifdef MIN
#undef MIN
#endif
#ifdef MAX
#undef MAX
#endif
#include "cv.h"
#include <vector>
#include "ofMain.h"
enum ofxCvRoiMode
{
OFX_CV_ROI_MODE_INTERSECT,
OFX_CV_ROI_MODE_NONINTERSECT
};
#endif
| [
"napolimanuel@gmaill.com"
] | napolimanuel@gmaill.com |
a3b858c3ff4e350524c34090fc74cf911ef95d1a | b22588340d7925b614a735bbbde1b351ad657ffc | /athena/LArCalorimeter/LArCnv/LArTPCnv/LArTPCnv/LArRawChannelContainerCnv_p3.h | 20f7800fc3c43fcd38b4c5ae369cd14b1264e1d9 | [] | 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 | 968 | h | /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef LARTPCNV_LARRAWCHANNELCONTAINERCNV_P3_H
#define LARTPCNV_LARRAWCHANNELCONTAINERCNV_P3_H
// LArRawChannelContainerCnv_p3, T/P separation of LArRawChannel
// author Walter Lampl
#include "LArRawEvent/LArRawChannelContainer.h"
#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h"
#include "LArTPCnv/LArRawChannelContainer_p3.h"
#include "LArTPCnv/LArRawChannelCnv_p1.h"
class LArRawChannelContainerCnv_p3 : public T_AthenaPoolTPCnvBase<LArRawChannelContainer, LArRawChannelContainer_p3>
{
public:
LArRawChannelContainerCnv_p3() {};
virtual void persToTrans(const LArRawChannelContainer_p3* persColl,
LArRawChannelContainer* transColl,
MsgStream &log) ;
virtual void transToPers(const LArRawChannelContainer* transColl,
LArRawChannelContainer_p3* persColl,
MsgStream &log) ;
private:
LArRawChannelCnv_p1 m_larRawChannelCnv_p1;
};
#endif
| [
"rushioda@lxplus754.cern.ch"
] | rushioda@lxplus754.cern.ch |
0e67c5ad3c9687a378917ecbd702090337108174 | 293dbce9da06a57ce1592316dd83325b07b54a0a | /Classes/cc/Hall.cpp | 29ace9450a8383e3974e4c90edf3fb6d3206bb99 | [] | no_license | hackerlank/GameClient | c2249a21d766582bed2e1f4ad0ecbdd80e19b8bc | 6489391323c47562bbafec991ad57511d8841c7d | refs/heads/master | 2020-03-12T06:09:59.595082 | 2018-04-21T13:17:57 | 2018-04-21T13:17:57 | 130,479,366 | 1 | 0 | null | 2018-04-21T14:04:54 | 2018-04-21T14:04:54 | null | UTF-8 | C++ | false | true | 511,672 | cpp | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: Hall.proto
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "Hall.h"
#include <algorithm>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/once.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
namespace protocol {
namespace {
const ::google::protobuf::Descriptor* CRank_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CRank_reflection_ = NULL;
const ::google::protobuf::Descriptor* SRank_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SRank_reflection_ = NULL;
const ::google::protobuf::Descriptor* CShop_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CShop_reflection_ = NULL;
const ::google::protobuf::Descriptor* SShop_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SShop_reflection_ = NULL;
const ::google::protobuf::Descriptor* CMail_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CMail_reflection_ = NULL;
const ::google::protobuf::Descriptor* SMail_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SMail_reflection_ = NULL;
const ::google::protobuf::Descriptor* CFriend_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CFriend_reflection_ = NULL;
const ::google::protobuf::Descriptor* SFriend_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SFriend_reflection_ = NULL;
const ::google::protobuf::Descriptor* CFindFriend_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CFindFriend_reflection_ = NULL;
const ::google::protobuf::Descriptor* SFindFriend_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SFindFriend_reflection_ = NULL;
const ::google::protobuf::Descriptor* CGiveFriend_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CGiveFriend_reflection_ = NULL;
const ::google::protobuf::Descriptor* SGiveFriend_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SGiveFriend_reflection_ = NULL;
const ::google::protobuf::Descriptor* CAddFriend_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CAddFriend_reflection_ = NULL;
const ::google::protobuf::Descriptor* SAddFriend_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SAddFriend_reflection_ = NULL;
const ::google::protobuf::Descriptor* CAddFriendList_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CAddFriendList_reflection_ = NULL;
const ::google::protobuf::Descriptor* SAddFriendList_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SAddFriendList_reflection_ = NULL;
const ::google::protobuf::Descriptor* CActive_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CActive_reflection_ = NULL;
const ::google::protobuf::Descriptor* SActive_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SActive_reflection_ = NULL;
const ::google::protobuf::Descriptor* CTask_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CTask_reflection_ = NULL;
const ::google::protobuf::Descriptor* STask_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
STask_reflection_ = NULL;
const ::google::protobuf::Descriptor* CReward_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CReward_reflection_ = NULL;
const ::google::protobuf::Descriptor* SReward_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SReward_reflection_ = NULL;
const ::google::protobuf::Descriptor* CAgreeFriend_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CAgreeFriend_reflection_ = NULL;
const ::google::protobuf::Descriptor* SAgreeFriend_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SAgreeFriend_reflection_ = NULL;
const ::google::protobuf::Descriptor* CExchangeReward_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CExchangeReward_reflection_ = NULL;
const ::google::protobuf::Descriptor* SExchangeReward_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SExchangeReward_reflection_ = NULL;
const ::google::protobuf::Descriptor* CExchangeCode_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CExchangeCode_reflection_ = NULL;
const ::google::protobuf::Descriptor* SExchangeCode_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SExchangeCode_reflection_ = NULL;
const ::google::protobuf::Descriptor* CExchangeRecord_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CExchangeRecord_reflection_ = NULL;
const ::google::protobuf::Descriptor* SExchangeRecord_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SExchangeRecord_reflection_ = NULL;
const ::google::protobuf::Descriptor* CExchange_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CExchange_reflection_ = NULL;
const ::google::protobuf::Descriptor* SExchange_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SExchange_reflection_ = NULL;
const ::google::protobuf::Descriptor* CApplePay_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CApplePay_reflection_ = NULL;
const ::google::protobuf::Descriptor* SApplePay_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SApplePay_reflection_ = NULL;
const ::google::protobuf::Descriptor* CWxpayOrder_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CWxpayOrder_reflection_ = NULL;
const ::google::protobuf::Descriptor* SWxpayOrder_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SWxpayOrder_reflection_ = NULL;
const ::google::protobuf::Descriptor* CAliPayOrder_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CAliPayOrder_reflection_ = NULL;
const ::google::protobuf::Descriptor* SAliPayOrder_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SAliPayOrder_reflection_ = NULL;
const ::google::protobuf::Descriptor* CAliPayResult_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CAliPayResult_reflection_ = NULL;
const ::google::protobuf::Descriptor* SAliPayResult_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SAliPayResult_reflection_ = NULL;
const ::google::protobuf::Descriptor* CWxpayQuery_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CWxpayQuery_reflection_ = NULL;
const ::google::protobuf::Descriptor* SWxpayQuery_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SWxpayQuery_reflection_ = NULL;
const ::google::protobuf::Descriptor* CFirstBuy_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CFirstBuy_reflection_ = NULL;
const ::google::protobuf::Descriptor* SFirstBuy_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SFirstBuy_reflection_ = NULL;
const ::google::protobuf::Descriptor* CFeedBack_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CFeedBack_reflection_ = NULL;
const ::google::protobuf::Descriptor* SFeedBack_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SFeedBack_reflection_ = NULL;
const ::google::protobuf::Descriptor* CSign_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CSign_reflection_ = NULL;
const ::google::protobuf::Descriptor* SSign_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SSign_reflection_ = NULL;
const ::google::protobuf::Descriptor* CSignList_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CSignList_reflection_ = NULL;
const ::google::protobuf::Descriptor* SSignList_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SSignList_reflection_ = NULL;
const ::google::protobuf::Descriptor* CMailAward_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
CMailAward_reflection_ = NULL;
const ::google::protobuf::Descriptor* SMailAward_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
SMailAward_reflection_ = NULL;
} // namespace
void protobuf_AssignDesc_Hall_2eproto() {
protobuf_AddDesc_Hall_2eproto();
const ::google::protobuf::FileDescriptor* file =
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
"Hall.proto");
GOOGLE_CHECK(file != NULL);
CRank_descriptor_ = file->message_type(0);
static const int CRank_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CRank, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CRank, type_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CRank, index_),
};
CRank_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CRank_descriptor_,
CRank::default_instance_,
CRank_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CRank, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CRank, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CRank));
SRank_descriptor_ = file->message_type(1);
static const int SRank_offsets_[4] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SRank, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SRank, type_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SRank, list_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SRank, err_),
};
SRank_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SRank_descriptor_,
SRank::default_instance_,
SRank_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SRank, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SRank, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SRank));
CShop_descriptor_ = file->message_type(2);
static const int CShop_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CShop, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CShop, type_),
};
CShop_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CShop_descriptor_,
CShop::default_instance_,
CShop_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CShop, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CShop, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CShop));
SShop_descriptor_ = file->message_type(3);
static const int SShop_offsets_[4] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SShop, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SShop, type_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SShop, list_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SShop, err_),
};
SShop_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SShop_descriptor_,
SShop::default_instance_,
SShop_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SShop, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SShop, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SShop));
CMail_descriptor_ = file->message_type(4);
static const int CMail_offsets_[1] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMail, cmd_),
};
CMail_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CMail_descriptor_,
CMail::default_instance_,
CMail_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMail, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMail, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CMail));
SMail_descriptor_ = file->message_type(5);
static const int SMail_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SMail, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SMail, list_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SMail, err_),
};
SMail_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SMail_descriptor_,
SMail::default_instance_,
SMail_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SMail, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SMail, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SMail));
CFriend_descriptor_ = file->message_type(6);
static const int CFriend_offsets_[1] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CFriend, cmd_),
};
CFriend_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CFriend_descriptor_,
CFriend::default_instance_,
CFriend_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CFriend, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CFriend, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CFriend));
SFriend_descriptor_ = file->message_type(7);
static const int SFriend_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SFriend, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SFriend, list_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SFriend, err_),
};
SFriend_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SFriend_descriptor_,
SFriend::default_instance_,
SFriend_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SFriend, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SFriend, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SFriend));
CFindFriend_descriptor_ = file->message_type(8);
static const int CFindFriend_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CFindFriend, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CFindFriend, uid_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CFindFriend, type_),
};
CFindFriend_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CFindFriend_descriptor_,
CFindFriend::default_instance_,
CFindFriend_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CFindFriend, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CFindFriend, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CFindFriend));
SFindFriend_descriptor_ = file->message_type(9);
static const int SFindFriend_offsets_[4] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SFindFriend, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SFindFriend, list_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SFindFriend, type_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SFindFriend, err_),
};
SFindFriend_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SFindFriend_descriptor_,
SFindFriend::default_instance_,
SFindFriend_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SFindFriend, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SFindFriend, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SFindFriend));
CGiveFriend_descriptor_ = file->message_type(10);
static const int CGiveFriend_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CGiveFriend, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CGiveFriend, uid_),
};
CGiveFriend_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CGiveFriend_descriptor_,
CGiveFriend::default_instance_,
CGiveFriend_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CGiveFriend, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CGiveFriend, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CGiveFriend));
SGiveFriend_descriptor_ = file->message_type(11);
static const int SGiveFriend_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SGiveFriend, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SGiveFriend, uid_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SGiveFriend, err_),
};
SGiveFriend_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SGiveFriend_descriptor_,
SGiveFriend::default_instance_,
SGiveFriend_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SGiveFriend, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SGiveFriend, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SGiveFriend));
CAddFriend_descriptor_ = file->message_type(12);
static const int CAddFriend_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CAddFriend, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CAddFriend, uid_),
};
CAddFriend_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CAddFriend_descriptor_,
CAddFriend::default_instance_,
CAddFriend_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CAddFriend, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CAddFriend, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CAddFriend));
SAddFriend_descriptor_ = file->message_type(13);
static const int SAddFriend_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAddFriend, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAddFriend, uid_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAddFriend, err_),
};
SAddFriend_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SAddFriend_descriptor_,
SAddFriend::default_instance_,
SAddFriend_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAddFriend, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAddFriend, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SAddFriend));
CAddFriendList_descriptor_ = file->message_type(14);
static const int CAddFriendList_offsets_[1] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CAddFriendList, cmd_),
};
CAddFriendList_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CAddFriendList_descriptor_,
CAddFriendList::default_instance_,
CAddFriendList_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CAddFriendList, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CAddFriendList, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CAddFriendList));
SAddFriendList_descriptor_ = file->message_type(15);
static const int SAddFriendList_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAddFriendList, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAddFriendList, list_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAddFriendList, err_),
};
SAddFriendList_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SAddFriendList_descriptor_,
SAddFriendList::default_instance_,
SAddFriendList_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAddFriendList, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAddFriendList, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SAddFriendList));
CActive_descriptor_ = file->message_type(16);
static const int CActive_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CActive, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CActive, type_),
};
CActive_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CActive_descriptor_,
CActive::default_instance_,
CActive_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CActive, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CActive, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CActive));
SActive_descriptor_ = file->message_type(17);
static const int SActive_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SActive, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SActive, list_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SActive, err_),
};
SActive_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SActive_descriptor_,
SActive::default_instance_,
SActive_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SActive, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SActive, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SActive));
CTask_descriptor_ = file->message_type(18);
static const int CTask_offsets_[1] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CTask, cmd_),
};
CTask_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CTask_descriptor_,
CTask::default_instance_,
CTask_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CTask, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CTask, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CTask));
STask_descriptor_ = file->message_type(19);
static const int STask_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(STask, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(STask, list_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(STask, err_),
};
STask_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
STask_descriptor_,
STask::default_instance_,
STask_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(STask, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(STask, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(STask));
CReward_descriptor_ = file->message_type(20);
static const int CReward_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CReward, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CReward, id_),
};
CReward_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CReward_descriptor_,
CReward::default_instance_,
CReward_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CReward, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CReward, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CReward));
SReward_descriptor_ = file->message_type(21);
static const int SReward_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SReward, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SReward, reward_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SReward, err_),
};
SReward_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SReward_descriptor_,
SReward::default_instance_,
SReward_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SReward, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SReward, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SReward));
CAgreeFriend_descriptor_ = file->message_type(22);
static const int CAgreeFriend_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CAgreeFriend, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CAgreeFriend, agree_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CAgreeFriend, userid_),
};
CAgreeFriend_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CAgreeFriend_descriptor_,
CAgreeFriend::default_instance_,
CAgreeFriend_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CAgreeFriend, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CAgreeFriend, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CAgreeFriend));
SAgreeFriend_descriptor_ = file->message_type(23);
static const int SAgreeFriend_offsets_[4] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAgreeFriend, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAgreeFriend, agree_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAgreeFriend, userid_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAgreeFriend, err_),
};
SAgreeFriend_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SAgreeFriend_descriptor_,
SAgreeFriend::default_instance_,
SAgreeFriend_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAgreeFriend, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAgreeFriend, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SAgreeFriend));
CExchangeReward_descriptor_ = file->message_type(24);
static const int CExchangeReward_offsets_[1] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CExchangeReward, cmd_),
};
CExchangeReward_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CExchangeReward_descriptor_,
CExchangeReward::default_instance_,
CExchangeReward_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CExchangeReward, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CExchangeReward, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CExchangeReward));
SExchangeReward_descriptor_ = file->message_type(25);
static const int SExchangeReward_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SExchangeReward, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SExchangeReward, list_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SExchangeReward, err_),
};
SExchangeReward_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SExchangeReward_descriptor_,
SExchangeReward::default_instance_,
SExchangeReward_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SExchangeReward, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SExchangeReward, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SExchangeReward));
CExchangeCode_descriptor_ = file->message_type(26);
static const int CExchangeCode_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CExchangeCode, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CExchangeCode, excode_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CExchangeCode, yzcode_),
};
CExchangeCode_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CExchangeCode_descriptor_,
CExchangeCode::default_instance_,
CExchangeCode_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CExchangeCode, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CExchangeCode, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CExchangeCode));
SExchangeCode_descriptor_ = file->message_type(27);
static const int SExchangeCode_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SExchangeCode, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SExchangeCode, success_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SExchangeCode, err_),
};
SExchangeCode_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SExchangeCode_descriptor_,
SExchangeCode::default_instance_,
SExchangeCode_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SExchangeCode, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SExchangeCode, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SExchangeCode));
CExchangeRecord_descriptor_ = file->message_type(28);
static const int CExchangeRecord_offsets_[1] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CExchangeRecord, cmd_),
};
CExchangeRecord_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CExchangeRecord_descriptor_,
CExchangeRecord::default_instance_,
CExchangeRecord_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CExchangeRecord, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CExchangeRecord, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CExchangeRecord));
SExchangeRecord_descriptor_ = file->message_type(29);
static const int SExchangeRecord_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SExchangeRecord, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SExchangeRecord, list_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SExchangeRecord, err_),
};
SExchangeRecord_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SExchangeRecord_descriptor_,
SExchangeRecord::default_instance_,
SExchangeRecord_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SExchangeRecord, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SExchangeRecord, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SExchangeRecord));
CExchange_descriptor_ = file->message_type(30);
static const int CExchange_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CExchange, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CExchange, id_),
};
CExchange_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CExchange_descriptor_,
CExchange::default_instance_,
CExchange_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CExchange, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CExchange, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CExchange));
SExchange_descriptor_ = file->message_type(31);
static const int SExchange_offsets_[4] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SExchange, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SExchange, id_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SExchange, code_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SExchange, err_),
};
SExchange_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SExchange_descriptor_,
SExchange::default_instance_,
SExchange_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SExchange, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SExchange, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SExchange));
CApplePay_descriptor_ = file->message_type(32);
static const int CApplePay_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CApplePay, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CApplePay, id_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CApplePay, receipt_),
};
CApplePay_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CApplePay_descriptor_,
CApplePay::default_instance_,
CApplePay_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CApplePay, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CApplePay, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CApplePay));
SApplePay_descriptor_ = file->message_type(33);
static const int SApplePay_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SApplePay, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SApplePay, id_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SApplePay, err_),
};
SApplePay_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SApplePay_descriptor_,
SApplePay::default_instance_,
SApplePay_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SApplePay, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SApplePay, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SApplePay));
CWxpayOrder_descriptor_ = file->message_type(34);
static const int CWxpayOrder_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CWxpayOrder, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CWxpayOrder, id_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CWxpayOrder, body_),
};
CWxpayOrder_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CWxpayOrder_descriptor_,
CWxpayOrder::default_instance_,
CWxpayOrder_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CWxpayOrder, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CWxpayOrder, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CWxpayOrder));
SWxpayOrder_descriptor_ = file->message_type(35);
static const int SWxpayOrder_offsets_[6] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SWxpayOrder, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SWxpayOrder, noncestr_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SWxpayOrder, payreq_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SWxpayOrder, timestamp_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SWxpayOrder, sign_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SWxpayOrder, err_),
};
SWxpayOrder_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SWxpayOrder_descriptor_,
SWxpayOrder::default_instance_,
SWxpayOrder_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SWxpayOrder, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SWxpayOrder, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SWxpayOrder));
CAliPayOrder_descriptor_ = file->message_type(36);
static const int CAliPayOrder_offsets_[4] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CAliPayOrder, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CAliPayOrder, id_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CAliPayOrder, body_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CAliPayOrder, type_),
};
CAliPayOrder_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CAliPayOrder_descriptor_,
CAliPayOrder::default_instance_,
CAliPayOrder_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CAliPayOrder, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CAliPayOrder, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CAliPayOrder));
SAliPayOrder_descriptor_ = file->message_type(37);
static const int SAliPayOrder_offsets_[6] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAliPayOrder, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAliPayOrder, orderinfo_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAliPayOrder, appid_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAliPayOrder, timestamp_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAliPayOrder, privatekey_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAliPayOrder, err_),
};
SAliPayOrder_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SAliPayOrder_descriptor_,
SAliPayOrder::default_instance_,
SAliPayOrder_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAliPayOrder, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAliPayOrder, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SAliPayOrder));
CAliPayResult_descriptor_ = file->message_type(38);
static const int CAliPayResult_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CAliPayResult, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CAliPayResult, content_),
};
CAliPayResult_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CAliPayResult_descriptor_,
CAliPayResult::default_instance_,
CAliPayResult_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CAliPayResult, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CAliPayResult, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CAliPayResult));
SAliPayResult_descriptor_ = file->message_type(39);
static const int SAliPayResult_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAliPayResult, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAliPayResult, err_),
};
SAliPayResult_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SAliPayResult_descriptor_,
SAliPayResult::default_instance_,
SAliPayResult_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAliPayResult, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SAliPayResult, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SAliPayResult));
CWxpayQuery_descriptor_ = file->message_type(40);
static const int CWxpayQuery_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CWxpayQuery, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CWxpayQuery, transid_),
};
CWxpayQuery_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CWxpayQuery_descriptor_,
CWxpayQuery::default_instance_,
CWxpayQuery_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CWxpayQuery, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CWxpayQuery, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CWxpayQuery));
SWxpayQuery_descriptor_ = file->message_type(41);
static const int SWxpayQuery_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SWxpayQuery, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SWxpayQuery, transid_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SWxpayQuery, err_),
};
SWxpayQuery_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SWxpayQuery_descriptor_,
SWxpayQuery::default_instance_,
SWxpayQuery_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SWxpayQuery, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SWxpayQuery, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SWxpayQuery));
CFirstBuy_descriptor_ = file->message_type(42);
static const int CFirstBuy_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CFirstBuy, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CFirstBuy, type_),
};
CFirstBuy_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CFirstBuy_descriptor_,
CFirstBuy::default_instance_,
CFirstBuy_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CFirstBuy, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CFirstBuy, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CFirstBuy));
SFirstBuy_descriptor_ = file->message_type(43);
static const int SFirstBuy_offsets_[4] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SFirstBuy, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SFirstBuy, id_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SFirstBuy, transid_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SFirstBuy, err_),
};
SFirstBuy_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SFirstBuy_descriptor_,
SFirstBuy::default_instance_,
SFirstBuy_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SFirstBuy, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SFirstBuy, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SFirstBuy));
CFeedBack_descriptor_ = file->message_type(44);
static const int CFeedBack_offsets_[4] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CFeedBack, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CFeedBack, uid_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CFeedBack, uname_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CFeedBack, content_),
};
CFeedBack_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CFeedBack_descriptor_,
CFeedBack::default_instance_,
CFeedBack_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CFeedBack, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CFeedBack, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CFeedBack));
SFeedBack_descriptor_ = file->message_type(45);
static const int SFeedBack_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SFeedBack, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SFeedBack, err_),
};
SFeedBack_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SFeedBack_descriptor_,
SFeedBack::default_instance_,
SFeedBack_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SFeedBack, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SFeedBack, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SFeedBack));
CSign_descriptor_ = file->message_type(46);
static const int CSign_offsets_[1] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSign, cmd_),
};
CSign_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CSign_descriptor_,
CSign::default_instance_,
CSign_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSign, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSign, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CSign));
SSign_descriptor_ = file->message_type(47);
static const int SSign_offsets_[4] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SSign, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SSign, index_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SSign, count_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SSign, err_),
};
SSign_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SSign_descriptor_,
SSign::default_instance_,
SSign_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SSign, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SSign, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SSign));
CSignList_descriptor_ = file->message_type(48);
static const int CSignList_offsets_[1] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSignList, cmd_),
};
CSignList_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CSignList_descriptor_,
CSignList::default_instance_,
CSignList_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSignList, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSignList, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CSignList));
SSignList_descriptor_ = file->message_type(49);
static const int SSignList_offsets_[5] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SSignList, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SSignList, sign_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SSignList, count_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SSignList, reward_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SSignList, err_),
};
SSignList_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SSignList_descriptor_,
SSignList::default_instance_,
SSignList_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SSignList, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SSignList, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SSignList));
CMailAward_descriptor_ = file->message_type(50);
static const int CMailAward_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMailAward, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMailAward, id_),
};
CMailAward_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
CMailAward_descriptor_,
CMailAward::default_instance_,
CMailAward_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMailAward, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMailAward, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(CMailAward));
SMailAward_descriptor_ = file->message_type(51);
static const int SMailAward_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SMailAward, cmd_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SMailAward, id_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SMailAward, err_),
};
SMailAward_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
SMailAward_descriptor_,
SMailAward::default_instance_,
SMailAward_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SMailAward, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SMailAward, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(SMailAward));
}
namespace {
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
inline void protobuf_AssignDescriptorsOnce() {
::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
&protobuf_AssignDesc_Hall_2eproto);
}
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CRank_descriptor_, &CRank::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SRank_descriptor_, &SRank::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CShop_descriptor_, &CShop::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SShop_descriptor_, &SShop::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CMail_descriptor_, &CMail::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SMail_descriptor_, &SMail::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CFriend_descriptor_, &CFriend::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SFriend_descriptor_, &SFriend::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CFindFriend_descriptor_, &CFindFriend::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SFindFriend_descriptor_, &SFindFriend::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CGiveFriend_descriptor_, &CGiveFriend::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SGiveFriend_descriptor_, &SGiveFriend::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CAddFriend_descriptor_, &CAddFriend::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SAddFriend_descriptor_, &SAddFriend::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CAddFriendList_descriptor_, &CAddFriendList::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SAddFriendList_descriptor_, &SAddFriendList::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CActive_descriptor_, &CActive::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SActive_descriptor_, &SActive::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CTask_descriptor_, &CTask::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
STask_descriptor_, &STask::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CReward_descriptor_, &CReward::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SReward_descriptor_, &SReward::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CAgreeFriend_descriptor_, &CAgreeFriend::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SAgreeFriend_descriptor_, &SAgreeFriend::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CExchangeReward_descriptor_, &CExchangeReward::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SExchangeReward_descriptor_, &SExchangeReward::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CExchangeCode_descriptor_, &CExchangeCode::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SExchangeCode_descriptor_, &SExchangeCode::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CExchangeRecord_descriptor_, &CExchangeRecord::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SExchangeRecord_descriptor_, &SExchangeRecord::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CExchange_descriptor_, &CExchange::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SExchange_descriptor_, &SExchange::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CApplePay_descriptor_, &CApplePay::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SApplePay_descriptor_, &SApplePay::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CWxpayOrder_descriptor_, &CWxpayOrder::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SWxpayOrder_descriptor_, &SWxpayOrder::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CAliPayOrder_descriptor_, &CAliPayOrder::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SAliPayOrder_descriptor_, &SAliPayOrder::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CAliPayResult_descriptor_, &CAliPayResult::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SAliPayResult_descriptor_, &SAliPayResult::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CWxpayQuery_descriptor_, &CWxpayQuery::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SWxpayQuery_descriptor_, &SWxpayQuery::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CFirstBuy_descriptor_, &CFirstBuy::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SFirstBuy_descriptor_, &SFirstBuy::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CFeedBack_descriptor_, &CFeedBack::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SFeedBack_descriptor_, &SFeedBack::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CSign_descriptor_, &CSign::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SSign_descriptor_, &SSign::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CSignList_descriptor_, &CSignList::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SSignList_descriptor_, &SSignList::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
CMailAward_descriptor_, &CMailAward::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
SMailAward_descriptor_, &SMailAward::default_instance());
}
} // namespace
void protobuf_ShutdownFile_Hall_2eproto() {
delete CRank::default_instance_;
delete CRank_reflection_;
delete SRank::default_instance_;
delete SRank_reflection_;
delete CShop::default_instance_;
delete CShop_reflection_;
delete SShop::default_instance_;
delete SShop_reflection_;
delete CMail::default_instance_;
delete CMail_reflection_;
delete SMail::default_instance_;
delete SMail_reflection_;
delete CFriend::default_instance_;
delete CFriend_reflection_;
delete SFriend::default_instance_;
delete SFriend_reflection_;
delete CFindFriend::default_instance_;
delete CFindFriend_reflection_;
delete SFindFriend::default_instance_;
delete SFindFriend_reflection_;
delete CGiveFriend::default_instance_;
delete CGiveFriend_reflection_;
delete SGiveFriend::default_instance_;
delete SGiveFriend_reflection_;
delete CAddFriend::default_instance_;
delete CAddFriend_reflection_;
delete SAddFriend::default_instance_;
delete SAddFriend_reflection_;
delete CAddFriendList::default_instance_;
delete CAddFriendList_reflection_;
delete SAddFriendList::default_instance_;
delete SAddFriendList_reflection_;
delete CActive::default_instance_;
delete CActive_reflection_;
delete SActive::default_instance_;
delete SActive_reflection_;
delete CTask::default_instance_;
delete CTask_reflection_;
delete STask::default_instance_;
delete STask_reflection_;
delete CReward::default_instance_;
delete CReward_reflection_;
delete SReward::default_instance_;
delete SReward_reflection_;
delete CAgreeFriend::default_instance_;
delete CAgreeFriend_reflection_;
delete SAgreeFriend::default_instance_;
delete SAgreeFriend_reflection_;
delete CExchangeReward::default_instance_;
delete CExchangeReward_reflection_;
delete SExchangeReward::default_instance_;
delete SExchangeReward_reflection_;
delete CExchangeCode::default_instance_;
delete CExchangeCode_reflection_;
delete SExchangeCode::default_instance_;
delete SExchangeCode_reflection_;
delete CExchangeRecord::default_instance_;
delete CExchangeRecord_reflection_;
delete SExchangeRecord::default_instance_;
delete SExchangeRecord_reflection_;
delete CExchange::default_instance_;
delete CExchange_reflection_;
delete SExchange::default_instance_;
delete SExchange_reflection_;
delete CApplePay::default_instance_;
delete CApplePay_reflection_;
delete SApplePay::default_instance_;
delete SApplePay_reflection_;
delete CWxpayOrder::default_instance_;
delete CWxpayOrder_reflection_;
delete SWxpayOrder::default_instance_;
delete SWxpayOrder_reflection_;
delete CAliPayOrder::default_instance_;
delete CAliPayOrder_reflection_;
delete SAliPayOrder::default_instance_;
delete SAliPayOrder_reflection_;
delete CAliPayResult::default_instance_;
delete CAliPayResult_reflection_;
delete SAliPayResult::default_instance_;
delete SAliPayResult_reflection_;
delete CWxpayQuery::default_instance_;
delete CWxpayQuery_reflection_;
delete SWxpayQuery::default_instance_;
delete SWxpayQuery_reflection_;
delete CFirstBuy::default_instance_;
delete CFirstBuy_reflection_;
delete SFirstBuy::default_instance_;
delete SFirstBuy_reflection_;
delete CFeedBack::default_instance_;
delete CFeedBack_reflection_;
delete SFeedBack::default_instance_;
delete SFeedBack_reflection_;
delete CSign::default_instance_;
delete CSign_reflection_;
delete SSign::default_instance_;
delete SSign_reflection_;
delete CSignList::default_instance_;
delete CSignList_reflection_;
delete SSignList::default_instance_;
delete SSignList_reflection_;
delete CMailAward::default_instance_;
delete CMailAward_reflection_;
delete SMailAward::default_instance_;
delete SMailAward_reflection_;
}
void protobuf_AddDesc_Hall_2eproto() {
static bool already_here = false;
if (already_here) return;
already_here = true;
GOOGLE_PROTOBUF_VERIFY_VERSION;
::protocol::protobuf_AddDesc_Vo_2eproto();
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
"\n\nHall.proto\022\010protocol\032\010Vo.proto\"8\n\005CRan"
"k\022\022\n\003cmd\030\001 \002(\r:\00520480\022\014\n\004type\030\002 \001(\r\022\r\n\005i"
"ndex\030\003 \001(\r\"T\n\005SRank\022\022\n\003cmd\030\001 \002(\r:\00520480\022"
"\014\n\004type\030\002 \001(\r\022\034\n\004list\030\003 \003(\0132\016.protocol.R"
"ank\022\013\n\003err\030\004 \001(\r\")\n\005CShop\022\022\n\003cmd\030\001 \002(\r:\005"
"20481\022\014\n\004type\030\002 \001(\r\"X\n\005SShop\022\022\n\003cmd\030\001 \002("
"\r:\00520481\022\014\n\004type\030\002 \001(\r\022 \n\004list\030\003 \003(\0132\022.p"
"rotocol.ShopItem\022\013\n\003err\030\004 \001(\r\"\033\n\005CMail\022\022"
"\n\003cmd\030\001 \002(\r:\00520482\"F\n\005SMail\022\022\n\003cmd\030\001 \002(\r"
":\00520482\022\034\n\004list\030\002 \003(\0132\016.protocol.Mail\022\013\n"
"\003err\030\003 \001(\r\"\035\n\007CFriend\022\022\n\003cmd\030\001 \002(\r:\0052048"
"3\"J\n\007SFriend\022\022\n\003cmd\030\001 \002(\r:\00520483\022\036\n\004list"
"\030\002 \003(\0132\020.protocol.Friend\022\013\n\003err\030\003 \001(\r\"<\n"
"\013CFindFriend\022\022\n\003cmd\030\001 \002(\r:\00520484\022\013\n\003uid\030"
"\002 \001(\t\022\014\n\004type\030\003 \001(\r\"\\\n\013SFindFriend\022\022\n\003cm"
"d\030\001 \002(\r:\00520484\022\036\n\004list\030\002 \003(\0132\020.protocol."
"Friend\022\014\n\004type\030\003 \001(\r\022\013\n\003err\030\004 \001(\r\".\n\013CGi"
"veFriend\022\022\n\003cmd\030\001 \002(\r:\00520485\022\013\n\003uid\030\002 \002("
"\t\";\n\013SGiveFriend\022\022\n\003cmd\030\001 \002(\r:\00520485\022\013\n\003"
"uid\030\002 \001(\t\022\013\n\003err\030\003 \001(\r\"-\n\nCAddFriend\022\022\n\003"
"cmd\030\001 \002(\r:\00520486\022\013\n\003uid\030\002 \002(\t\":\n\nSAddFri"
"end\022\022\n\003cmd\030\001 \002(\r:\00520486\022\013\n\003uid\030\002 \001(\t\022\013\n\003"
"err\030\003 \001(\r\"$\n\016CAddFriendList\022\022\n\003cmd\030\001 \002(\r"
":\00520487\"W\n\016SAddFriendList\022\022\n\003cmd\030\001 \002(\r:\005"
"20487\022$\n\004list\030\002 \003(\0132\026.protocol.FriendNot"
"ice\022\013\n\003err\030\003 \001(\r\"+\n\007CActive\022\022\n\003cmd\030\001 \002(\r"
":\00520488\022\014\n\004type\030\002 \002(\r\"J\n\007SActive\022\022\n\003cmd\030"
"\001 \002(\r:\00520488\022\036\n\004list\030\002 \003(\0132\020.protocol.Ac"
"tive\022\013\n\003err\030\003 \001(\r\"\033\n\005CTask\022\022\n\003cmd\030\001 \002(\r:"
"\00520489\"F\n\005STask\022\022\n\003cmd\030\001 \002(\r:\00520489\022\034\n\004l"
"ist\030\002 \003(\0132\016.protocol.Task\022\013\n\003err\030\003 \001(\r\")"
"\n\007CReward\022\022\n\003cmd\030\001 \002(\r:\00520490\022\n\n\002id\030\003 \001("
"\r\"L\n\007SReward\022\022\n\003cmd\030\001 \002(\r:\00520490\022 \n\006rewa"
"rd\030\004 \003(\0132\020.protocol.Reward\022\013\n\003err\030\005 \001(\r\""
"A\n\014CAgreeFriend\022\022\n\003cmd\030\001 \002(\r:\00520491\022\r\n\005a"
"gree\030\002 \001(\010\022\016\n\006userid\030\003 \001(\t\"N\n\014SAgreeFrie"
"nd\022\022\n\003cmd\030\001 \002(\r:\00520491\022\r\n\005agree\030\002 \001(\010\022\016\n"
"\006userid\030\003 \001(\t\022\013\n\003err\030\004 \001(\r\"%\n\017CExchangeR"
"eward\022\022\n\003cmd\030\001 \002(\r:\00520492\"S\n\017SExchangeRe"
"ward\022\022\n\003cmd\030\001 \002(\r:\00520492\022\037\n\004list\030\002 \003(\0132\021"
".protocol.ExAward\022\013\n\003err\030\003 \001(\r\"C\n\rCExcha"
"ngeCode\022\022\n\003cmd\030\001 \002(\r:\00520493\022\016\n\006excode\030\002 "
"\001(\t\022\016\n\006yzcode\030\003 \001(\t\"A\n\rSExchangeCode\022\022\n\003"
"cmd\030\001 \002(\r:\00520493\022\017\n\007success\030\002 \001(\010\022\013\n\003err"
"\030\003 \001(\r\"%\n\017CExchangeRecord\022\022\n\003cmd\030\001 \002(\r:\005"
"20494\"T\n\017SExchangeRecord\022\022\n\003cmd\030\001 \002(\r:\0052"
"0494\022 \n\004list\030\002 \003(\0132\022.protocol.ExRecord\022\013"
"\n\003err\030\003 \001(\r\"+\n\tCExchange\022\022\n\003cmd\030\001 \002(\r:\0052"
"0495\022\n\n\002id\030\002 \001(\r\"F\n\tSExchange\022\022\n\003cmd\030\001 \002"
"(\r:\00520495\022\n\n\002id\030\002 \001(\r\022\014\n\004code\030\003 \001(\t\022\013\n\003e"
"rr\030\004 \001(\r\"<\n\tCApplePay\022\022\n\003cmd\030\001 \002(\r:\0052049"
"6\022\n\n\002id\030\002 \001(\r\022\017\n\007receipt\030\003 \001(\t\"8\n\tSApple"
"Pay\022\022\n\003cmd\030\001 \002(\r:\00520496\022\n\n\002id\030\002 \001(\r\022\013\n\003e"
"rr\030\003 \001(\r\";\n\013CWxpayOrder\022\022\n\003cmd\030\001 \002(\r:\00520"
"497\022\n\n\002id\030\002 \001(\r\022\014\n\004body\030\003 \001(\t\"q\n\013SWxpayO"
"rder\022\022\n\003cmd\030\001 \002(\r:\00520497\022\020\n\010noncestr\030\002 \001"
"(\t\022\016\n\006payreq\030\003 \001(\t\022\021\n\ttimestamp\030\004 \001(\t\022\014\n"
"\004sign\030\005 \001(\t\022\013\n\003err\030\006 \001(\r\"J\n\014CAliPayOrder"
"\022\022\n\003cmd\030\001 \002(\r:\00520504\022\n\n\002id\030\002 \001(\r\022\014\n\004body"
"\030\003 \001(\t\022\014\n\004type\030\004 \001(\r\"x\n\014SAliPayOrder\022\022\n\003"
"cmd\030\001 \002(\r:\00520504\022\021\n\torderinfo\030\002 \001(\t\022\r\n\005a"
"ppid\030\003 \001(\t\022\021\n\ttimestamp\030\004 \001(\t\022\022\n\nprivate"
"key\030\005 \001(\t\022\013\n\003err\030\006 \001(\r\"4\n\rCAliPayResult\022"
"\022\n\003cmd\030\001 \002(\r:\00520505\022\017\n\007content\030\002 \001(\t\"0\n\r"
"SAliPayResult\022\022\n\003cmd\030\001 \002(\r:\00520505\022\013\n\003err"
"\030\006 \001(\r\"2\n\013CWxpayQuery\022\022\n\003cmd\030\001 \002(\r:\0052049"
"8\022\017\n\007transid\030\002 \001(\t\"\?\n\013SWxpayQuery\022\022\n\003cmd"
"\030\001 \002(\r:\00520498\022\017\n\007transid\030\002 \001(\t\022\013\n\003err\030\003 "
"\001(\r\"-\n\tCFirstBuy\022\022\n\003cmd\030\001 \002(\r:\00520499\022\014\n\004"
"type\030\002 \001(\r\"I\n\tSFirstBuy\022\022\n\003cmd\030\001 \002(\r:\00520"
"499\022\n\n\002id\030\002 \001(\r\022\017\n\007transid\030\003 \001(\t\022\013\n\003err\030"
"\004 \001(\r\"L\n\tCFeedBack\022\022\n\003cmd\030\001 \002(\r:\00520500\022\013"
"\n\003uid\030\002 \001(\t\022\r\n\005uname\030\003 \001(\t\022\017\n\007content\030\004 "
"\001(\t\",\n\tSFeedBack\022\022\n\003cmd\030\001 \002(\r:\00520500\022\013\n\003"
"err\030\002 \001(\r\"\033\n\005CSign\022\022\n\003cmd\030\001 \002(\r:\00520501\"F"
"\n\005SSign\022\022\n\003cmd\030\001 \002(\r:\00520501\022\r\n\005index\030\002 \001"
"(\r\022\r\n\005count\030\003 \001(\r\022\013\n\003err\030\004 \001(\r\"\037\n\tCSignL"
"ist\022\022\n\003cmd\030\001 \002(\r:\00520502\"n\n\tSSignList\022\022\n\003"
"cmd\030\001 \002(\r:\00520502\022\014\n\004sign\030\002 \001(\r\022\r\n\005count\030"
"\003 \001(\r\022#\n\006reward\030\004 \003(\0132\023.protocol.SignAwa"
"rd\022\013\n\003err\030\005 \001(\r\",\n\nCMailAward\022\022\n\003cmd\030\001 \002"
"(\r:\00520503\022\n\n\002id\030\002 \002(\r\"9\n\nSMailAward\022\022\n\003c"
"md\030\001 \002(\r:\00520503\022\n\n\002id\030\002 \001(\r\022\013\n\003err\030\003 \001(\r", 3320);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"Hall.proto", &protobuf_RegisterTypes);
CRank::default_instance_ = new CRank();
SRank::default_instance_ = new SRank();
CShop::default_instance_ = new CShop();
SShop::default_instance_ = new SShop();
CMail::default_instance_ = new CMail();
SMail::default_instance_ = new SMail();
CFriend::default_instance_ = new CFriend();
SFriend::default_instance_ = new SFriend();
CFindFriend::default_instance_ = new CFindFriend();
SFindFriend::default_instance_ = new SFindFriend();
CGiveFriend::default_instance_ = new CGiveFriend();
SGiveFriend::default_instance_ = new SGiveFriend();
CAddFriend::default_instance_ = new CAddFriend();
SAddFriend::default_instance_ = new SAddFriend();
CAddFriendList::default_instance_ = new CAddFriendList();
SAddFriendList::default_instance_ = new SAddFriendList();
CActive::default_instance_ = new CActive();
SActive::default_instance_ = new SActive();
CTask::default_instance_ = new CTask();
STask::default_instance_ = new STask();
CReward::default_instance_ = new CReward();
SReward::default_instance_ = new SReward();
CAgreeFriend::default_instance_ = new CAgreeFriend();
SAgreeFriend::default_instance_ = new SAgreeFriend();
CExchangeReward::default_instance_ = new CExchangeReward();
SExchangeReward::default_instance_ = new SExchangeReward();
CExchangeCode::default_instance_ = new CExchangeCode();
SExchangeCode::default_instance_ = new SExchangeCode();
CExchangeRecord::default_instance_ = new CExchangeRecord();
SExchangeRecord::default_instance_ = new SExchangeRecord();
CExchange::default_instance_ = new CExchange();
SExchange::default_instance_ = new SExchange();
CApplePay::default_instance_ = new CApplePay();
SApplePay::default_instance_ = new SApplePay();
CWxpayOrder::default_instance_ = new CWxpayOrder();
SWxpayOrder::default_instance_ = new SWxpayOrder();
CAliPayOrder::default_instance_ = new CAliPayOrder();
SAliPayOrder::default_instance_ = new SAliPayOrder();
CAliPayResult::default_instance_ = new CAliPayResult();
SAliPayResult::default_instance_ = new SAliPayResult();
CWxpayQuery::default_instance_ = new CWxpayQuery();
SWxpayQuery::default_instance_ = new SWxpayQuery();
CFirstBuy::default_instance_ = new CFirstBuy();
SFirstBuy::default_instance_ = new SFirstBuy();
CFeedBack::default_instance_ = new CFeedBack();
SFeedBack::default_instance_ = new SFeedBack();
CSign::default_instance_ = new CSign();
SSign::default_instance_ = new SSign();
CSignList::default_instance_ = new CSignList();
SSignList::default_instance_ = new SSignList();
CMailAward::default_instance_ = new CMailAward();
SMailAward::default_instance_ = new SMailAward();
CRank::default_instance_->InitAsDefaultInstance();
SRank::default_instance_->InitAsDefaultInstance();
CShop::default_instance_->InitAsDefaultInstance();
SShop::default_instance_->InitAsDefaultInstance();
CMail::default_instance_->InitAsDefaultInstance();
SMail::default_instance_->InitAsDefaultInstance();
CFriend::default_instance_->InitAsDefaultInstance();
SFriend::default_instance_->InitAsDefaultInstance();
CFindFriend::default_instance_->InitAsDefaultInstance();
SFindFriend::default_instance_->InitAsDefaultInstance();
CGiveFriend::default_instance_->InitAsDefaultInstance();
SGiveFriend::default_instance_->InitAsDefaultInstance();
CAddFriend::default_instance_->InitAsDefaultInstance();
SAddFriend::default_instance_->InitAsDefaultInstance();
CAddFriendList::default_instance_->InitAsDefaultInstance();
SAddFriendList::default_instance_->InitAsDefaultInstance();
CActive::default_instance_->InitAsDefaultInstance();
SActive::default_instance_->InitAsDefaultInstance();
CTask::default_instance_->InitAsDefaultInstance();
STask::default_instance_->InitAsDefaultInstance();
CReward::default_instance_->InitAsDefaultInstance();
SReward::default_instance_->InitAsDefaultInstance();
CAgreeFriend::default_instance_->InitAsDefaultInstance();
SAgreeFriend::default_instance_->InitAsDefaultInstance();
CExchangeReward::default_instance_->InitAsDefaultInstance();
SExchangeReward::default_instance_->InitAsDefaultInstance();
CExchangeCode::default_instance_->InitAsDefaultInstance();
SExchangeCode::default_instance_->InitAsDefaultInstance();
CExchangeRecord::default_instance_->InitAsDefaultInstance();
SExchangeRecord::default_instance_->InitAsDefaultInstance();
CExchange::default_instance_->InitAsDefaultInstance();
SExchange::default_instance_->InitAsDefaultInstance();
CApplePay::default_instance_->InitAsDefaultInstance();
SApplePay::default_instance_->InitAsDefaultInstance();
CWxpayOrder::default_instance_->InitAsDefaultInstance();
SWxpayOrder::default_instance_->InitAsDefaultInstance();
CAliPayOrder::default_instance_->InitAsDefaultInstance();
SAliPayOrder::default_instance_->InitAsDefaultInstance();
CAliPayResult::default_instance_->InitAsDefaultInstance();
SAliPayResult::default_instance_->InitAsDefaultInstance();
CWxpayQuery::default_instance_->InitAsDefaultInstance();
SWxpayQuery::default_instance_->InitAsDefaultInstance();
CFirstBuy::default_instance_->InitAsDefaultInstance();
SFirstBuy::default_instance_->InitAsDefaultInstance();
CFeedBack::default_instance_->InitAsDefaultInstance();
SFeedBack::default_instance_->InitAsDefaultInstance();
CSign::default_instance_->InitAsDefaultInstance();
SSign::default_instance_->InitAsDefaultInstance();
CSignList::default_instance_->InitAsDefaultInstance();
SSignList::default_instance_->InitAsDefaultInstance();
CMailAward::default_instance_->InitAsDefaultInstance();
SMailAward::default_instance_->InitAsDefaultInstance();
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_Hall_2eproto);
}
// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_Hall_2eproto {
StaticDescriptorInitializer_Hall_2eproto() {
protobuf_AddDesc_Hall_2eproto();
}
} static_descriptor_initializer_Hall_2eproto_;
// ===================================================================
#ifndef _MSC_VER
const int CRank::kCmdFieldNumber;
const int CRank::kTypeFieldNumber;
const int CRank::kIndexFieldNumber;
#endif // !_MSC_VER
CRank::CRank()
: ::google::protobuf::Message() {
SharedCtor();
}
void CRank::InitAsDefaultInstance() {
}
CRank::CRank(const CRank& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CRank::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20480u;
type_ = 0u;
index_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CRank::~CRank() {
SharedDtor();
}
void CRank::SharedDtor() {
if (this != default_instance_) {
}
}
void CRank::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CRank::descriptor() {
protobuf_AssignDescriptorsOnce();
return CRank_descriptor_;
}
const CRank& CRank::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CRank* CRank::default_instance_ = NULL;
CRank* CRank::New() const {
return new CRank;
}
void CRank::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20480u;
type_ = 0u;
index_ = 0u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CRank::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20480];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_type;
break;
}
// optional uint32 type = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_type:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &type_)));
set_has_type();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(24)) goto parse_index;
break;
}
// optional uint32 index = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_index:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &index_)));
set_has_index();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CRank::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20480];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional uint32 type = 2;
if (has_type()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->type(), output);
}
// optional uint32 index = 3;
if (has_index()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->index(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CRank::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20480];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional uint32 type = 2;
if (has_type()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->type(), target);
}
// optional uint32 index = 3;
if (has_index()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->index(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CRank::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20480];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 type = 2;
if (has_type()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->type());
}
// optional uint32 index = 3;
if (has_index()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->index());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CRank::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CRank* source =
::google::protobuf::internal::dynamic_cast_if_available<const CRank*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CRank::MergeFrom(const CRank& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_type()) {
set_type(from.type());
}
if (from.has_index()) {
set_index(from.index());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CRank::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CRank::CopyFrom(const CRank& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CRank::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void CRank::Swap(CRank* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(type_, other->type_);
std::swap(index_, other->index_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CRank::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CRank_descriptor_;
metadata.reflection = CRank_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SRank::kCmdFieldNumber;
const int SRank::kTypeFieldNumber;
const int SRank::kListFieldNumber;
const int SRank::kErrFieldNumber;
#endif // !_MSC_VER
SRank::SRank()
: ::google::protobuf::Message() {
SharedCtor();
}
void SRank::InitAsDefaultInstance() {
}
SRank::SRank(const SRank& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SRank::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20480u;
type_ = 0u;
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SRank::~SRank() {
SharedDtor();
}
void SRank::SharedDtor() {
if (this != default_instance_) {
}
}
void SRank::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SRank::descriptor() {
protobuf_AssignDescriptorsOnce();
return SRank_descriptor_;
}
const SRank& SRank::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SRank* SRank::default_instance_ = NULL;
SRank* SRank::New() const {
return new SRank;
}
void SRank::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20480u;
type_ = 0u;
err_ = 0u;
}
list_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SRank::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20480];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_type;
break;
}
// optional uint32 type = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_type:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &type_)));
set_has_type();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(26)) goto parse_list;
break;
}
// repeated .protocol.Rank list = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_list:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_list()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(26)) goto parse_list;
if (input->ExpectTag(32)) goto parse_err;
break;
}
// optional uint32 err = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SRank::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20480];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional uint32 type = 2;
if (has_type()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->type(), output);
}
// repeated .protocol.Rank list = 3;
for (int i = 0; i < this->list_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
3, this->list(i), output);
}
// optional uint32 err = 4;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SRank::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20480];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional uint32 type = 2;
if (has_type()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->type(), target);
}
// repeated .protocol.Rank list = 3;
for (int i = 0; i < this->list_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
3, this->list(i), target);
}
// optional uint32 err = 4;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SRank::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20480];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 type = 2;
if (has_type()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->type());
}
// optional uint32 err = 4;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
// repeated .protocol.Rank list = 3;
total_size += 1 * this->list_size();
for (int i = 0; i < this->list_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->list(i));
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SRank::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SRank* source =
::google::protobuf::internal::dynamic_cast_if_available<const SRank*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SRank::MergeFrom(const SRank& from) {
GOOGLE_CHECK_NE(&from, this);
list_.MergeFrom(from.list_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_type()) {
set_type(from.type());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SRank::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SRank::CopyFrom(const SRank& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SRank::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SRank::Swap(SRank* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(type_, other->type_);
list_.Swap(&other->list_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SRank::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SRank_descriptor_;
metadata.reflection = SRank_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CShop::kCmdFieldNumber;
const int CShop::kTypeFieldNumber;
#endif // !_MSC_VER
CShop::CShop()
: ::google::protobuf::Message() {
SharedCtor();
}
void CShop::InitAsDefaultInstance() {
}
CShop::CShop(const CShop& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CShop::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20481u;
type_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CShop::~CShop() {
SharedDtor();
}
void CShop::SharedDtor() {
if (this != default_instance_) {
}
}
void CShop::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CShop::descriptor() {
protobuf_AssignDescriptorsOnce();
return CShop_descriptor_;
}
const CShop& CShop::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CShop* CShop::default_instance_ = NULL;
CShop* CShop::New() const {
return new CShop;
}
void CShop::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20481u;
type_ = 0u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CShop::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20481];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_type;
break;
}
// optional uint32 type = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_type:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &type_)));
set_has_type();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CShop::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20481];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional uint32 type = 2;
if (has_type()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->type(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CShop::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20481];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional uint32 type = 2;
if (has_type()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->type(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CShop::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20481];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 type = 2;
if (has_type()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->type());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CShop::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CShop* source =
::google::protobuf::internal::dynamic_cast_if_available<const CShop*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CShop::MergeFrom(const CShop& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_type()) {
set_type(from.type());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CShop::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CShop::CopyFrom(const CShop& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CShop::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void CShop::Swap(CShop* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(type_, other->type_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CShop::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CShop_descriptor_;
metadata.reflection = CShop_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SShop::kCmdFieldNumber;
const int SShop::kTypeFieldNumber;
const int SShop::kListFieldNumber;
const int SShop::kErrFieldNumber;
#endif // !_MSC_VER
SShop::SShop()
: ::google::protobuf::Message() {
SharedCtor();
}
void SShop::InitAsDefaultInstance() {
}
SShop::SShop(const SShop& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SShop::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20481u;
type_ = 0u;
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SShop::~SShop() {
SharedDtor();
}
void SShop::SharedDtor() {
if (this != default_instance_) {
}
}
void SShop::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SShop::descriptor() {
protobuf_AssignDescriptorsOnce();
return SShop_descriptor_;
}
const SShop& SShop::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SShop* SShop::default_instance_ = NULL;
SShop* SShop::New() const {
return new SShop;
}
void SShop::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20481u;
type_ = 0u;
err_ = 0u;
}
list_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SShop::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20481];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_type;
break;
}
// optional uint32 type = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_type:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &type_)));
set_has_type();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(26)) goto parse_list;
break;
}
// repeated .protocol.ShopItem list = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_list:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_list()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(26)) goto parse_list;
if (input->ExpectTag(32)) goto parse_err;
break;
}
// optional uint32 err = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SShop::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20481];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional uint32 type = 2;
if (has_type()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->type(), output);
}
// repeated .protocol.ShopItem list = 3;
for (int i = 0; i < this->list_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
3, this->list(i), output);
}
// optional uint32 err = 4;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SShop::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20481];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional uint32 type = 2;
if (has_type()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->type(), target);
}
// repeated .protocol.ShopItem list = 3;
for (int i = 0; i < this->list_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
3, this->list(i), target);
}
// optional uint32 err = 4;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SShop::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20481];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 type = 2;
if (has_type()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->type());
}
// optional uint32 err = 4;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
// repeated .protocol.ShopItem list = 3;
total_size += 1 * this->list_size();
for (int i = 0; i < this->list_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->list(i));
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SShop::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SShop* source =
::google::protobuf::internal::dynamic_cast_if_available<const SShop*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SShop::MergeFrom(const SShop& from) {
GOOGLE_CHECK_NE(&from, this);
list_.MergeFrom(from.list_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_type()) {
set_type(from.type());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SShop::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SShop::CopyFrom(const SShop& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SShop::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SShop::Swap(SShop* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(type_, other->type_);
list_.Swap(&other->list_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SShop::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SShop_descriptor_;
metadata.reflection = SShop_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CMail::kCmdFieldNumber;
#endif // !_MSC_VER
CMail::CMail()
: ::google::protobuf::Message() {
SharedCtor();
}
void CMail::InitAsDefaultInstance() {
}
CMail::CMail(const CMail& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CMail::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20482u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CMail::~CMail() {
SharedDtor();
}
void CMail::SharedDtor() {
if (this != default_instance_) {
}
}
void CMail::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CMail::descriptor() {
protobuf_AssignDescriptorsOnce();
return CMail_descriptor_;
}
const CMail& CMail::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CMail* CMail::default_instance_ = NULL;
CMail* CMail::New() const {
return new CMail;
}
void CMail::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20482u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CMail::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20482];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CMail::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20482];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CMail::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20482];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CMail::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20482];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CMail::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CMail* source =
::google::protobuf::internal::dynamic_cast_if_available<const CMail*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CMail::MergeFrom(const CMail& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CMail::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CMail::CopyFrom(const CMail& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CMail::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void CMail::Swap(CMail* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CMail::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CMail_descriptor_;
metadata.reflection = CMail_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SMail::kCmdFieldNumber;
const int SMail::kListFieldNumber;
const int SMail::kErrFieldNumber;
#endif // !_MSC_VER
SMail::SMail()
: ::google::protobuf::Message() {
SharedCtor();
}
void SMail::InitAsDefaultInstance() {
}
SMail::SMail(const SMail& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SMail::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20482u;
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SMail::~SMail() {
SharedDtor();
}
void SMail::SharedDtor() {
if (this != default_instance_) {
}
}
void SMail::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SMail::descriptor() {
protobuf_AssignDescriptorsOnce();
return SMail_descriptor_;
}
const SMail& SMail::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SMail* SMail::default_instance_ = NULL;
SMail* SMail::New() const {
return new SMail;
}
void SMail::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20482u;
err_ = 0u;
}
list_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SMail::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20482];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_list;
break;
}
// repeated .protocol.Mail list = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_list:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_list()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_list;
if (input->ExpectTag(24)) goto parse_err;
break;
}
// optional uint32 err = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SMail::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20482];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// repeated .protocol.Mail list = 2;
for (int i = 0; i < this->list_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2, this->list(i), output);
}
// optional uint32 err = 3;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SMail::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20482];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// repeated .protocol.Mail list = 2;
for (int i = 0; i < this->list_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
2, this->list(i), target);
}
// optional uint32 err = 3;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SMail::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20482];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 err = 3;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
// repeated .protocol.Mail list = 2;
total_size += 1 * this->list_size();
for (int i = 0; i < this->list_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->list(i));
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SMail::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SMail* source =
::google::protobuf::internal::dynamic_cast_if_available<const SMail*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SMail::MergeFrom(const SMail& from) {
GOOGLE_CHECK_NE(&from, this);
list_.MergeFrom(from.list_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SMail::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SMail::CopyFrom(const SMail& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SMail::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SMail::Swap(SMail* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
list_.Swap(&other->list_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SMail::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SMail_descriptor_;
metadata.reflection = SMail_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CFriend::kCmdFieldNumber;
#endif // !_MSC_VER
CFriend::CFriend()
: ::google::protobuf::Message() {
SharedCtor();
}
void CFriend::InitAsDefaultInstance() {
}
CFriend::CFriend(const CFriend& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CFriend::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20483u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CFriend::~CFriend() {
SharedDtor();
}
void CFriend::SharedDtor() {
if (this != default_instance_) {
}
}
void CFriend::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CFriend::descriptor() {
protobuf_AssignDescriptorsOnce();
return CFriend_descriptor_;
}
const CFriend& CFriend::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CFriend* CFriend::default_instance_ = NULL;
CFriend* CFriend::New() const {
return new CFriend;
}
void CFriend::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20483u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CFriend::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20483];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CFriend::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20483];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CFriend::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20483];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CFriend::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20483];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CFriend::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CFriend* source =
::google::protobuf::internal::dynamic_cast_if_available<const CFriend*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CFriend::MergeFrom(const CFriend& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CFriend::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CFriend::CopyFrom(const CFriend& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CFriend::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void CFriend::Swap(CFriend* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CFriend::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CFriend_descriptor_;
metadata.reflection = CFriend_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SFriend::kCmdFieldNumber;
const int SFriend::kListFieldNumber;
const int SFriend::kErrFieldNumber;
#endif // !_MSC_VER
SFriend::SFriend()
: ::google::protobuf::Message() {
SharedCtor();
}
void SFriend::InitAsDefaultInstance() {
}
SFriend::SFriend(const SFriend& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SFriend::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20483u;
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SFriend::~SFriend() {
SharedDtor();
}
void SFriend::SharedDtor() {
if (this != default_instance_) {
}
}
void SFriend::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SFriend::descriptor() {
protobuf_AssignDescriptorsOnce();
return SFriend_descriptor_;
}
const SFriend& SFriend::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SFriend* SFriend::default_instance_ = NULL;
SFriend* SFriend::New() const {
return new SFriend;
}
void SFriend::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20483u;
err_ = 0u;
}
list_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SFriend::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20483];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_list;
break;
}
// repeated .protocol.Friend list = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_list:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_list()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_list;
if (input->ExpectTag(24)) goto parse_err;
break;
}
// optional uint32 err = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SFriend::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20483];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// repeated .protocol.Friend list = 2;
for (int i = 0; i < this->list_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2, this->list(i), output);
}
// optional uint32 err = 3;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SFriend::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20483];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// repeated .protocol.Friend list = 2;
for (int i = 0; i < this->list_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
2, this->list(i), target);
}
// optional uint32 err = 3;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SFriend::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20483];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 err = 3;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
// repeated .protocol.Friend list = 2;
total_size += 1 * this->list_size();
for (int i = 0; i < this->list_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->list(i));
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SFriend::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SFriend* source =
::google::protobuf::internal::dynamic_cast_if_available<const SFriend*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SFriend::MergeFrom(const SFriend& from) {
GOOGLE_CHECK_NE(&from, this);
list_.MergeFrom(from.list_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SFriend::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SFriend::CopyFrom(const SFriend& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SFriend::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SFriend::Swap(SFriend* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
list_.Swap(&other->list_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SFriend::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SFriend_descriptor_;
metadata.reflection = SFriend_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CFindFriend::kCmdFieldNumber;
const int CFindFriend::kUidFieldNumber;
const int CFindFriend::kTypeFieldNumber;
#endif // !_MSC_VER
CFindFriend::CFindFriend()
: ::google::protobuf::Message() {
SharedCtor();
}
void CFindFriend::InitAsDefaultInstance() {
}
CFindFriend::CFindFriend(const CFindFriend& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CFindFriend::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20484u;
uid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
type_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CFindFriend::~CFindFriend() {
SharedDtor();
}
void CFindFriend::SharedDtor() {
if (uid_ != &::google::protobuf::internal::kEmptyString) {
delete uid_;
}
if (this != default_instance_) {
}
}
void CFindFriend::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CFindFriend::descriptor() {
protobuf_AssignDescriptorsOnce();
return CFindFriend_descriptor_;
}
const CFindFriend& CFindFriend::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CFindFriend* CFindFriend::default_instance_ = NULL;
CFindFriend* CFindFriend::New() const {
return new CFindFriend;
}
void CFindFriend::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20484u;
if (has_uid()) {
if (uid_ != &::google::protobuf::internal::kEmptyString) {
uid_->clear();
}
}
type_ = 0u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CFindFriend::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20484];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_uid;
break;
}
// optional string uid = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_uid:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_uid()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uid().data(), this->uid().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(24)) goto parse_type;
break;
}
// optional uint32 type = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_type:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &type_)));
set_has_type();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CFindFriend::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20484];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional string uid = 2;
if (has_uid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uid().data(), this->uid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
2, this->uid(), output);
}
// optional uint32 type = 3;
if (has_type()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->type(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CFindFriend::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20484];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional string uid = 2;
if (has_uid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uid().data(), this->uid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2, this->uid(), target);
}
// optional uint32 type = 3;
if (has_type()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->type(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CFindFriend::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20484];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional string uid = 2;
if (has_uid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->uid());
}
// optional uint32 type = 3;
if (has_type()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->type());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CFindFriend::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CFindFriend* source =
::google::protobuf::internal::dynamic_cast_if_available<const CFindFriend*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CFindFriend::MergeFrom(const CFindFriend& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_uid()) {
set_uid(from.uid());
}
if (from.has_type()) {
set_type(from.type());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CFindFriend::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CFindFriend::CopyFrom(const CFindFriend& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CFindFriend::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void CFindFriend::Swap(CFindFriend* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(uid_, other->uid_);
std::swap(type_, other->type_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CFindFriend::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CFindFriend_descriptor_;
metadata.reflection = CFindFriend_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SFindFriend::kCmdFieldNumber;
const int SFindFriend::kListFieldNumber;
const int SFindFriend::kTypeFieldNumber;
const int SFindFriend::kErrFieldNumber;
#endif // !_MSC_VER
SFindFriend::SFindFriend()
: ::google::protobuf::Message() {
SharedCtor();
}
void SFindFriend::InitAsDefaultInstance() {
}
SFindFriend::SFindFriend(const SFindFriend& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SFindFriend::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20484u;
type_ = 0u;
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SFindFriend::~SFindFriend() {
SharedDtor();
}
void SFindFriend::SharedDtor() {
if (this != default_instance_) {
}
}
void SFindFriend::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SFindFriend::descriptor() {
protobuf_AssignDescriptorsOnce();
return SFindFriend_descriptor_;
}
const SFindFriend& SFindFriend::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SFindFriend* SFindFriend::default_instance_ = NULL;
SFindFriend* SFindFriend::New() const {
return new SFindFriend;
}
void SFindFriend::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20484u;
type_ = 0u;
err_ = 0u;
}
list_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SFindFriend::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20484];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_list;
break;
}
// repeated .protocol.Friend list = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_list:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_list()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_list;
if (input->ExpectTag(24)) goto parse_type;
break;
}
// optional uint32 type = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_type:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &type_)));
set_has_type();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(32)) goto parse_err;
break;
}
// optional uint32 err = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SFindFriend::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20484];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// repeated .protocol.Friend list = 2;
for (int i = 0; i < this->list_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2, this->list(i), output);
}
// optional uint32 type = 3;
if (has_type()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->type(), output);
}
// optional uint32 err = 4;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SFindFriend::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20484];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// repeated .protocol.Friend list = 2;
for (int i = 0; i < this->list_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
2, this->list(i), target);
}
// optional uint32 type = 3;
if (has_type()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->type(), target);
}
// optional uint32 err = 4;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SFindFriend::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20484];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 type = 3;
if (has_type()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->type());
}
// optional uint32 err = 4;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
// repeated .protocol.Friend list = 2;
total_size += 1 * this->list_size();
for (int i = 0; i < this->list_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->list(i));
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SFindFriend::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SFindFriend* source =
::google::protobuf::internal::dynamic_cast_if_available<const SFindFriend*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SFindFriend::MergeFrom(const SFindFriend& from) {
GOOGLE_CHECK_NE(&from, this);
list_.MergeFrom(from.list_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_type()) {
set_type(from.type());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SFindFriend::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SFindFriend::CopyFrom(const SFindFriend& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SFindFriend::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SFindFriend::Swap(SFindFriend* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
list_.Swap(&other->list_);
std::swap(type_, other->type_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SFindFriend::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SFindFriend_descriptor_;
metadata.reflection = SFindFriend_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CGiveFriend::kCmdFieldNumber;
const int CGiveFriend::kUidFieldNumber;
#endif // !_MSC_VER
CGiveFriend::CGiveFriend()
: ::google::protobuf::Message() {
SharedCtor();
}
void CGiveFriend::InitAsDefaultInstance() {
}
CGiveFriend::CGiveFriend(const CGiveFriend& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CGiveFriend::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20485u;
uid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CGiveFriend::~CGiveFriend() {
SharedDtor();
}
void CGiveFriend::SharedDtor() {
if (uid_ != &::google::protobuf::internal::kEmptyString) {
delete uid_;
}
if (this != default_instance_) {
}
}
void CGiveFriend::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CGiveFriend::descriptor() {
protobuf_AssignDescriptorsOnce();
return CGiveFriend_descriptor_;
}
const CGiveFriend& CGiveFriend::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CGiveFriend* CGiveFriend::default_instance_ = NULL;
CGiveFriend* CGiveFriend::New() const {
return new CGiveFriend;
}
void CGiveFriend::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20485u;
if (has_uid()) {
if (uid_ != &::google::protobuf::internal::kEmptyString) {
uid_->clear();
}
}
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CGiveFriend::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20485];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_uid;
break;
}
// required string uid = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_uid:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_uid()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uid().data(), this->uid().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CGiveFriend::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20485];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// required string uid = 2;
if (has_uid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uid().data(), this->uid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
2, this->uid(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CGiveFriend::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20485];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// required string uid = 2;
if (has_uid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uid().data(), this->uid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2, this->uid(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CGiveFriend::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20485];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// required string uid = 2;
if (has_uid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->uid());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CGiveFriend::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CGiveFriend* source =
::google::protobuf::internal::dynamic_cast_if_available<const CGiveFriend*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CGiveFriend::MergeFrom(const CGiveFriend& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_uid()) {
set_uid(from.uid());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CGiveFriend::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CGiveFriend::CopyFrom(const CGiveFriend& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CGiveFriend::IsInitialized() const {
if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
return true;
}
void CGiveFriend::Swap(CGiveFriend* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(uid_, other->uid_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CGiveFriend::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CGiveFriend_descriptor_;
metadata.reflection = CGiveFriend_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SGiveFriend::kCmdFieldNumber;
const int SGiveFriend::kUidFieldNumber;
const int SGiveFriend::kErrFieldNumber;
#endif // !_MSC_VER
SGiveFriend::SGiveFriend()
: ::google::protobuf::Message() {
SharedCtor();
}
void SGiveFriend::InitAsDefaultInstance() {
}
SGiveFriend::SGiveFriend(const SGiveFriend& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SGiveFriend::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20485u;
uid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SGiveFriend::~SGiveFriend() {
SharedDtor();
}
void SGiveFriend::SharedDtor() {
if (uid_ != &::google::protobuf::internal::kEmptyString) {
delete uid_;
}
if (this != default_instance_) {
}
}
void SGiveFriend::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SGiveFriend::descriptor() {
protobuf_AssignDescriptorsOnce();
return SGiveFriend_descriptor_;
}
const SGiveFriend& SGiveFriend::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SGiveFriend* SGiveFriend::default_instance_ = NULL;
SGiveFriend* SGiveFriend::New() const {
return new SGiveFriend;
}
void SGiveFriend::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20485u;
if (has_uid()) {
if (uid_ != &::google::protobuf::internal::kEmptyString) {
uid_->clear();
}
}
err_ = 0u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SGiveFriend::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20485];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_uid;
break;
}
// optional string uid = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_uid:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_uid()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uid().data(), this->uid().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(24)) goto parse_err;
break;
}
// optional uint32 err = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SGiveFriend::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20485];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional string uid = 2;
if (has_uid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uid().data(), this->uid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
2, this->uid(), output);
}
// optional uint32 err = 3;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SGiveFriend::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20485];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional string uid = 2;
if (has_uid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uid().data(), this->uid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2, this->uid(), target);
}
// optional uint32 err = 3;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SGiveFriend::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20485];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional string uid = 2;
if (has_uid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->uid());
}
// optional uint32 err = 3;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SGiveFriend::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SGiveFriend* source =
::google::protobuf::internal::dynamic_cast_if_available<const SGiveFriend*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SGiveFriend::MergeFrom(const SGiveFriend& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_uid()) {
set_uid(from.uid());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SGiveFriend::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SGiveFriend::CopyFrom(const SGiveFriend& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SGiveFriend::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SGiveFriend::Swap(SGiveFriend* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(uid_, other->uid_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SGiveFriend::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SGiveFriend_descriptor_;
metadata.reflection = SGiveFriend_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CAddFriend::kCmdFieldNumber;
const int CAddFriend::kUidFieldNumber;
#endif // !_MSC_VER
CAddFriend::CAddFriend()
: ::google::protobuf::Message() {
SharedCtor();
}
void CAddFriend::InitAsDefaultInstance() {
}
CAddFriend::CAddFriend(const CAddFriend& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CAddFriend::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20486u;
uid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CAddFriend::~CAddFriend() {
SharedDtor();
}
void CAddFriend::SharedDtor() {
if (uid_ != &::google::protobuf::internal::kEmptyString) {
delete uid_;
}
if (this != default_instance_) {
}
}
void CAddFriend::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CAddFriend::descriptor() {
protobuf_AssignDescriptorsOnce();
return CAddFriend_descriptor_;
}
const CAddFriend& CAddFriend::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CAddFriend* CAddFriend::default_instance_ = NULL;
CAddFriend* CAddFriend::New() const {
return new CAddFriend;
}
void CAddFriend::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20486u;
if (has_uid()) {
if (uid_ != &::google::protobuf::internal::kEmptyString) {
uid_->clear();
}
}
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CAddFriend::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20486];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_uid;
break;
}
// required string uid = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_uid:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_uid()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uid().data(), this->uid().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CAddFriend::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20486];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// required string uid = 2;
if (has_uid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uid().data(), this->uid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
2, this->uid(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CAddFriend::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20486];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// required string uid = 2;
if (has_uid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uid().data(), this->uid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2, this->uid(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CAddFriend::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20486];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// required string uid = 2;
if (has_uid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->uid());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CAddFriend::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CAddFriend* source =
::google::protobuf::internal::dynamic_cast_if_available<const CAddFriend*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CAddFriend::MergeFrom(const CAddFriend& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_uid()) {
set_uid(from.uid());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CAddFriend::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CAddFriend::CopyFrom(const CAddFriend& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CAddFriend::IsInitialized() const {
if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
return true;
}
void CAddFriend::Swap(CAddFriend* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(uid_, other->uid_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CAddFriend::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CAddFriend_descriptor_;
metadata.reflection = CAddFriend_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SAddFriend::kCmdFieldNumber;
const int SAddFriend::kUidFieldNumber;
const int SAddFriend::kErrFieldNumber;
#endif // !_MSC_VER
SAddFriend::SAddFriend()
: ::google::protobuf::Message() {
SharedCtor();
}
void SAddFriend::InitAsDefaultInstance() {
}
SAddFriend::SAddFriend(const SAddFriend& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SAddFriend::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20486u;
uid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SAddFriend::~SAddFriend() {
SharedDtor();
}
void SAddFriend::SharedDtor() {
if (uid_ != &::google::protobuf::internal::kEmptyString) {
delete uid_;
}
if (this != default_instance_) {
}
}
void SAddFriend::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SAddFriend::descriptor() {
protobuf_AssignDescriptorsOnce();
return SAddFriend_descriptor_;
}
const SAddFriend& SAddFriend::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SAddFriend* SAddFriend::default_instance_ = NULL;
SAddFriend* SAddFriend::New() const {
return new SAddFriend;
}
void SAddFriend::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20486u;
if (has_uid()) {
if (uid_ != &::google::protobuf::internal::kEmptyString) {
uid_->clear();
}
}
err_ = 0u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SAddFriend::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20486];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_uid;
break;
}
// optional string uid = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_uid:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_uid()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uid().data(), this->uid().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(24)) goto parse_err;
break;
}
// optional uint32 err = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SAddFriend::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20486];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional string uid = 2;
if (has_uid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uid().data(), this->uid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
2, this->uid(), output);
}
// optional uint32 err = 3;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SAddFriend::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20486];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional string uid = 2;
if (has_uid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uid().data(), this->uid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2, this->uid(), target);
}
// optional uint32 err = 3;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SAddFriend::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20486];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional string uid = 2;
if (has_uid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->uid());
}
// optional uint32 err = 3;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SAddFriend::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SAddFriend* source =
::google::protobuf::internal::dynamic_cast_if_available<const SAddFriend*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SAddFriend::MergeFrom(const SAddFriend& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_uid()) {
set_uid(from.uid());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SAddFriend::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SAddFriend::CopyFrom(const SAddFriend& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SAddFriend::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SAddFriend::Swap(SAddFriend* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(uid_, other->uid_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SAddFriend::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SAddFriend_descriptor_;
metadata.reflection = SAddFriend_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CAddFriendList::kCmdFieldNumber;
#endif // !_MSC_VER
CAddFriendList::CAddFriendList()
: ::google::protobuf::Message() {
SharedCtor();
}
void CAddFriendList::InitAsDefaultInstance() {
}
CAddFriendList::CAddFriendList(const CAddFriendList& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CAddFriendList::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20487u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CAddFriendList::~CAddFriendList() {
SharedDtor();
}
void CAddFriendList::SharedDtor() {
if (this != default_instance_) {
}
}
void CAddFriendList::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CAddFriendList::descriptor() {
protobuf_AssignDescriptorsOnce();
return CAddFriendList_descriptor_;
}
const CAddFriendList& CAddFriendList::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CAddFriendList* CAddFriendList::default_instance_ = NULL;
CAddFriendList* CAddFriendList::New() const {
return new CAddFriendList;
}
void CAddFriendList::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20487u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CAddFriendList::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20487];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CAddFriendList::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20487];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CAddFriendList::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20487];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CAddFriendList::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20487];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CAddFriendList::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CAddFriendList* source =
::google::protobuf::internal::dynamic_cast_if_available<const CAddFriendList*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CAddFriendList::MergeFrom(const CAddFriendList& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CAddFriendList::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CAddFriendList::CopyFrom(const CAddFriendList& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CAddFriendList::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void CAddFriendList::Swap(CAddFriendList* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CAddFriendList::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CAddFriendList_descriptor_;
metadata.reflection = CAddFriendList_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SAddFriendList::kCmdFieldNumber;
const int SAddFriendList::kListFieldNumber;
const int SAddFriendList::kErrFieldNumber;
#endif // !_MSC_VER
SAddFriendList::SAddFriendList()
: ::google::protobuf::Message() {
SharedCtor();
}
void SAddFriendList::InitAsDefaultInstance() {
}
SAddFriendList::SAddFriendList(const SAddFriendList& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SAddFriendList::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20487u;
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SAddFriendList::~SAddFriendList() {
SharedDtor();
}
void SAddFriendList::SharedDtor() {
if (this != default_instance_) {
}
}
void SAddFriendList::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SAddFriendList::descriptor() {
protobuf_AssignDescriptorsOnce();
return SAddFriendList_descriptor_;
}
const SAddFriendList& SAddFriendList::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SAddFriendList* SAddFriendList::default_instance_ = NULL;
SAddFriendList* SAddFriendList::New() const {
return new SAddFriendList;
}
void SAddFriendList::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20487u;
err_ = 0u;
}
list_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SAddFriendList::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20487];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_list;
break;
}
// repeated .protocol.FriendNotice list = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_list:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_list()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_list;
if (input->ExpectTag(24)) goto parse_err;
break;
}
// optional uint32 err = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SAddFriendList::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20487];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// repeated .protocol.FriendNotice list = 2;
for (int i = 0; i < this->list_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2, this->list(i), output);
}
// optional uint32 err = 3;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SAddFriendList::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20487];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// repeated .protocol.FriendNotice list = 2;
for (int i = 0; i < this->list_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
2, this->list(i), target);
}
// optional uint32 err = 3;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SAddFriendList::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20487];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 err = 3;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
// repeated .protocol.FriendNotice list = 2;
total_size += 1 * this->list_size();
for (int i = 0; i < this->list_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->list(i));
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SAddFriendList::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SAddFriendList* source =
::google::protobuf::internal::dynamic_cast_if_available<const SAddFriendList*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SAddFriendList::MergeFrom(const SAddFriendList& from) {
GOOGLE_CHECK_NE(&from, this);
list_.MergeFrom(from.list_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SAddFriendList::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SAddFriendList::CopyFrom(const SAddFriendList& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SAddFriendList::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SAddFriendList::Swap(SAddFriendList* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
list_.Swap(&other->list_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SAddFriendList::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SAddFriendList_descriptor_;
metadata.reflection = SAddFriendList_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CActive::kCmdFieldNumber;
const int CActive::kTypeFieldNumber;
#endif // !_MSC_VER
CActive::CActive()
: ::google::protobuf::Message() {
SharedCtor();
}
void CActive::InitAsDefaultInstance() {
}
CActive::CActive(const CActive& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CActive::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20488u;
type_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CActive::~CActive() {
SharedDtor();
}
void CActive::SharedDtor() {
if (this != default_instance_) {
}
}
void CActive::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CActive::descriptor() {
protobuf_AssignDescriptorsOnce();
return CActive_descriptor_;
}
const CActive& CActive::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CActive* CActive::default_instance_ = NULL;
CActive* CActive::New() const {
return new CActive;
}
void CActive::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20488u;
type_ = 0u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CActive::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20488];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_type;
break;
}
// required uint32 type = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_type:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &type_)));
set_has_type();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CActive::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20488];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// required uint32 type = 2;
if (has_type()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->type(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CActive::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20488];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// required uint32 type = 2;
if (has_type()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->type(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CActive::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20488];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// required uint32 type = 2;
if (has_type()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->type());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CActive::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CActive* source =
::google::protobuf::internal::dynamic_cast_if_available<const CActive*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CActive::MergeFrom(const CActive& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_type()) {
set_type(from.type());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CActive::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CActive::CopyFrom(const CActive& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CActive::IsInitialized() const {
if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
return true;
}
void CActive::Swap(CActive* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(type_, other->type_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CActive::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CActive_descriptor_;
metadata.reflection = CActive_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SActive::kCmdFieldNumber;
const int SActive::kListFieldNumber;
const int SActive::kErrFieldNumber;
#endif // !_MSC_VER
SActive::SActive()
: ::google::protobuf::Message() {
SharedCtor();
}
void SActive::InitAsDefaultInstance() {
}
SActive::SActive(const SActive& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SActive::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20488u;
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SActive::~SActive() {
SharedDtor();
}
void SActive::SharedDtor() {
if (this != default_instance_) {
}
}
void SActive::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SActive::descriptor() {
protobuf_AssignDescriptorsOnce();
return SActive_descriptor_;
}
const SActive& SActive::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SActive* SActive::default_instance_ = NULL;
SActive* SActive::New() const {
return new SActive;
}
void SActive::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20488u;
err_ = 0u;
}
list_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SActive::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20488];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_list;
break;
}
// repeated .protocol.Active list = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_list:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_list()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_list;
if (input->ExpectTag(24)) goto parse_err;
break;
}
// optional uint32 err = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SActive::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20488];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// repeated .protocol.Active list = 2;
for (int i = 0; i < this->list_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2, this->list(i), output);
}
// optional uint32 err = 3;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SActive::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20488];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// repeated .protocol.Active list = 2;
for (int i = 0; i < this->list_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
2, this->list(i), target);
}
// optional uint32 err = 3;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SActive::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20488];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 err = 3;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
// repeated .protocol.Active list = 2;
total_size += 1 * this->list_size();
for (int i = 0; i < this->list_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->list(i));
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SActive::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SActive* source =
::google::protobuf::internal::dynamic_cast_if_available<const SActive*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SActive::MergeFrom(const SActive& from) {
GOOGLE_CHECK_NE(&from, this);
list_.MergeFrom(from.list_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SActive::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SActive::CopyFrom(const SActive& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SActive::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SActive::Swap(SActive* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
list_.Swap(&other->list_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SActive::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SActive_descriptor_;
metadata.reflection = SActive_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CTask::kCmdFieldNumber;
#endif // !_MSC_VER
CTask::CTask()
: ::google::protobuf::Message() {
SharedCtor();
}
void CTask::InitAsDefaultInstance() {
}
CTask::CTask(const CTask& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CTask::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20489u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CTask::~CTask() {
SharedDtor();
}
void CTask::SharedDtor() {
if (this != default_instance_) {
}
}
void CTask::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CTask::descriptor() {
protobuf_AssignDescriptorsOnce();
return CTask_descriptor_;
}
const CTask& CTask::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CTask* CTask::default_instance_ = NULL;
CTask* CTask::New() const {
return new CTask;
}
void CTask::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20489u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CTask::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20489];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CTask::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20489];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CTask::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20489];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CTask::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20489];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CTask::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CTask* source =
::google::protobuf::internal::dynamic_cast_if_available<const CTask*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CTask::MergeFrom(const CTask& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CTask::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CTask::CopyFrom(const CTask& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CTask::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void CTask::Swap(CTask* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CTask::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CTask_descriptor_;
metadata.reflection = CTask_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int STask::kCmdFieldNumber;
const int STask::kListFieldNumber;
const int STask::kErrFieldNumber;
#endif // !_MSC_VER
STask::STask()
: ::google::protobuf::Message() {
SharedCtor();
}
void STask::InitAsDefaultInstance() {
}
STask::STask(const STask& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void STask::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20489u;
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
STask::~STask() {
SharedDtor();
}
void STask::SharedDtor() {
if (this != default_instance_) {
}
}
void STask::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* STask::descriptor() {
protobuf_AssignDescriptorsOnce();
return STask_descriptor_;
}
const STask& STask::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
STask* STask::default_instance_ = NULL;
STask* STask::New() const {
return new STask;
}
void STask::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20489u;
err_ = 0u;
}
list_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool STask::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20489];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_list;
break;
}
// repeated .protocol.Task list = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_list:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_list()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_list;
if (input->ExpectTag(24)) goto parse_err;
break;
}
// optional uint32 err = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void STask::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20489];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// repeated .protocol.Task list = 2;
for (int i = 0; i < this->list_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2, this->list(i), output);
}
// optional uint32 err = 3;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* STask::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20489];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// repeated .protocol.Task list = 2;
for (int i = 0; i < this->list_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
2, this->list(i), target);
}
// optional uint32 err = 3;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int STask::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20489];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 err = 3;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
// repeated .protocol.Task list = 2;
total_size += 1 * this->list_size();
for (int i = 0; i < this->list_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->list(i));
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void STask::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const STask* source =
::google::protobuf::internal::dynamic_cast_if_available<const STask*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void STask::MergeFrom(const STask& from) {
GOOGLE_CHECK_NE(&from, this);
list_.MergeFrom(from.list_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void STask::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void STask::CopyFrom(const STask& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool STask::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void STask::Swap(STask* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
list_.Swap(&other->list_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata STask::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = STask_descriptor_;
metadata.reflection = STask_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CReward::kCmdFieldNumber;
const int CReward::kIdFieldNumber;
#endif // !_MSC_VER
CReward::CReward()
: ::google::protobuf::Message() {
SharedCtor();
}
void CReward::InitAsDefaultInstance() {
}
CReward::CReward(const CReward& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CReward::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20490u;
id_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CReward::~CReward() {
SharedDtor();
}
void CReward::SharedDtor() {
if (this != default_instance_) {
}
}
void CReward::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CReward::descriptor() {
protobuf_AssignDescriptorsOnce();
return CReward_descriptor_;
}
const CReward& CReward::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CReward* CReward::default_instance_ = NULL;
CReward* CReward::New() const {
return new CReward;
}
void CReward::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20490u;
id_ = 0u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CReward::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20490];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(24)) goto parse_id;
break;
}
// optional uint32 id = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_id:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &id_)));
set_has_id();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CReward::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20490];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional uint32 id = 3;
if (has_id()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->id(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CReward::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20490];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional uint32 id = 3;
if (has_id()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->id(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CReward::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20490];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 id = 3;
if (has_id()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->id());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CReward::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CReward* source =
::google::protobuf::internal::dynamic_cast_if_available<const CReward*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CReward::MergeFrom(const CReward& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_id()) {
set_id(from.id());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CReward::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CReward::CopyFrom(const CReward& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CReward::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void CReward::Swap(CReward* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(id_, other->id_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CReward::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CReward_descriptor_;
metadata.reflection = CReward_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SReward::kCmdFieldNumber;
const int SReward::kRewardFieldNumber;
const int SReward::kErrFieldNumber;
#endif // !_MSC_VER
SReward::SReward()
: ::google::protobuf::Message() {
SharedCtor();
}
void SReward::InitAsDefaultInstance() {
}
SReward::SReward(const SReward& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SReward::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20490u;
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SReward::~SReward() {
SharedDtor();
}
void SReward::SharedDtor() {
if (this != default_instance_) {
}
}
void SReward::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SReward::descriptor() {
protobuf_AssignDescriptorsOnce();
return SReward_descriptor_;
}
const SReward& SReward::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SReward* SReward::default_instance_ = NULL;
SReward* SReward::New() const {
return new SReward;
}
void SReward::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20490u;
err_ = 0u;
}
reward_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SReward::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20490];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(34)) goto parse_reward;
break;
}
// repeated .protocol.Reward reward = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_reward:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_reward()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(34)) goto parse_reward;
if (input->ExpectTag(40)) goto parse_err;
break;
}
// optional uint32 err = 5;
case 5: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SReward::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20490];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// repeated .protocol.Reward reward = 4;
for (int i = 0; i < this->reward_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
4, this->reward(i), output);
}
// optional uint32 err = 5;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SReward::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20490];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// repeated .protocol.Reward reward = 4;
for (int i = 0; i < this->reward_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
4, this->reward(i), target);
}
// optional uint32 err = 5;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SReward::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20490];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 err = 5;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
// repeated .protocol.Reward reward = 4;
total_size += 1 * this->reward_size();
for (int i = 0; i < this->reward_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->reward(i));
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SReward::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SReward* source =
::google::protobuf::internal::dynamic_cast_if_available<const SReward*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SReward::MergeFrom(const SReward& from) {
GOOGLE_CHECK_NE(&from, this);
reward_.MergeFrom(from.reward_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SReward::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SReward::CopyFrom(const SReward& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SReward::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SReward::Swap(SReward* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
reward_.Swap(&other->reward_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SReward::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SReward_descriptor_;
metadata.reflection = SReward_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CAgreeFriend::kCmdFieldNumber;
const int CAgreeFriend::kAgreeFieldNumber;
const int CAgreeFriend::kUseridFieldNumber;
#endif // !_MSC_VER
CAgreeFriend::CAgreeFriend()
: ::google::protobuf::Message() {
SharedCtor();
}
void CAgreeFriend::InitAsDefaultInstance() {
}
CAgreeFriend::CAgreeFriend(const CAgreeFriend& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CAgreeFriend::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20491u;
agree_ = false;
userid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CAgreeFriend::~CAgreeFriend() {
SharedDtor();
}
void CAgreeFriend::SharedDtor() {
if (userid_ != &::google::protobuf::internal::kEmptyString) {
delete userid_;
}
if (this != default_instance_) {
}
}
void CAgreeFriend::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CAgreeFriend::descriptor() {
protobuf_AssignDescriptorsOnce();
return CAgreeFriend_descriptor_;
}
const CAgreeFriend& CAgreeFriend::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CAgreeFriend* CAgreeFriend::default_instance_ = NULL;
CAgreeFriend* CAgreeFriend::New() const {
return new CAgreeFriend;
}
void CAgreeFriend::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20491u;
agree_ = false;
if (has_userid()) {
if (userid_ != &::google::protobuf::internal::kEmptyString) {
userid_->clear();
}
}
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CAgreeFriend::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20491];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_agree;
break;
}
// optional bool agree = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_agree:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
input, &agree_)));
set_has_agree();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(26)) goto parse_userid;
break;
}
// optional string userid = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_userid:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_userid()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->userid().data(), this->userid().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CAgreeFriend::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20491];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional bool agree = 2;
if (has_agree()) {
::google::protobuf::internal::WireFormatLite::WriteBool(2, this->agree(), output);
}
// optional string userid = 3;
if (has_userid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->userid().data(), this->userid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
3, this->userid(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CAgreeFriend::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20491];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional bool agree = 2;
if (has_agree()) {
target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->agree(), target);
}
// optional string userid = 3;
if (has_userid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->userid().data(), this->userid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
3, this->userid(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CAgreeFriend::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20491];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional bool agree = 2;
if (has_agree()) {
total_size += 1 + 1;
}
// optional string userid = 3;
if (has_userid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->userid());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CAgreeFriend::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CAgreeFriend* source =
::google::protobuf::internal::dynamic_cast_if_available<const CAgreeFriend*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CAgreeFriend::MergeFrom(const CAgreeFriend& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_agree()) {
set_agree(from.agree());
}
if (from.has_userid()) {
set_userid(from.userid());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CAgreeFriend::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CAgreeFriend::CopyFrom(const CAgreeFriend& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CAgreeFriend::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void CAgreeFriend::Swap(CAgreeFriend* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(agree_, other->agree_);
std::swap(userid_, other->userid_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CAgreeFriend::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CAgreeFriend_descriptor_;
metadata.reflection = CAgreeFriend_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SAgreeFriend::kCmdFieldNumber;
const int SAgreeFriend::kAgreeFieldNumber;
const int SAgreeFriend::kUseridFieldNumber;
const int SAgreeFriend::kErrFieldNumber;
#endif // !_MSC_VER
SAgreeFriend::SAgreeFriend()
: ::google::protobuf::Message() {
SharedCtor();
}
void SAgreeFriend::InitAsDefaultInstance() {
}
SAgreeFriend::SAgreeFriend(const SAgreeFriend& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SAgreeFriend::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20491u;
agree_ = false;
userid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SAgreeFriend::~SAgreeFriend() {
SharedDtor();
}
void SAgreeFriend::SharedDtor() {
if (userid_ != &::google::protobuf::internal::kEmptyString) {
delete userid_;
}
if (this != default_instance_) {
}
}
void SAgreeFriend::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SAgreeFriend::descriptor() {
protobuf_AssignDescriptorsOnce();
return SAgreeFriend_descriptor_;
}
const SAgreeFriend& SAgreeFriend::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SAgreeFriend* SAgreeFriend::default_instance_ = NULL;
SAgreeFriend* SAgreeFriend::New() const {
return new SAgreeFriend;
}
void SAgreeFriend::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20491u;
agree_ = false;
if (has_userid()) {
if (userid_ != &::google::protobuf::internal::kEmptyString) {
userid_->clear();
}
}
err_ = 0u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SAgreeFriend::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20491];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_agree;
break;
}
// optional bool agree = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_agree:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
input, &agree_)));
set_has_agree();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(26)) goto parse_userid;
break;
}
// optional string userid = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_userid:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_userid()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->userid().data(), this->userid().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(32)) goto parse_err;
break;
}
// optional uint32 err = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SAgreeFriend::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20491];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional bool agree = 2;
if (has_agree()) {
::google::protobuf::internal::WireFormatLite::WriteBool(2, this->agree(), output);
}
// optional string userid = 3;
if (has_userid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->userid().data(), this->userid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
3, this->userid(), output);
}
// optional uint32 err = 4;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SAgreeFriend::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20491];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional bool agree = 2;
if (has_agree()) {
target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->agree(), target);
}
// optional string userid = 3;
if (has_userid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->userid().data(), this->userid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
3, this->userid(), target);
}
// optional uint32 err = 4;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SAgreeFriend::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20491];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional bool agree = 2;
if (has_agree()) {
total_size += 1 + 1;
}
// optional string userid = 3;
if (has_userid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->userid());
}
// optional uint32 err = 4;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SAgreeFriend::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SAgreeFriend* source =
::google::protobuf::internal::dynamic_cast_if_available<const SAgreeFriend*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SAgreeFriend::MergeFrom(const SAgreeFriend& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_agree()) {
set_agree(from.agree());
}
if (from.has_userid()) {
set_userid(from.userid());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SAgreeFriend::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SAgreeFriend::CopyFrom(const SAgreeFriend& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SAgreeFriend::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SAgreeFriend::Swap(SAgreeFriend* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(agree_, other->agree_);
std::swap(userid_, other->userid_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SAgreeFriend::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SAgreeFriend_descriptor_;
metadata.reflection = SAgreeFriend_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CExchangeReward::kCmdFieldNumber;
#endif // !_MSC_VER
CExchangeReward::CExchangeReward()
: ::google::protobuf::Message() {
SharedCtor();
}
void CExchangeReward::InitAsDefaultInstance() {
}
CExchangeReward::CExchangeReward(const CExchangeReward& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CExchangeReward::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20492u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CExchangeReward::~CExchangeReward() {
SharedDtor();
}
void CExchangeReward::SharedDtor() {
if (this != default_instance_) {
}
}
void CExchangeReward::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CExchangeReward::descriptor() {
protobuf_AssignDescriptorsOnce();
return CExchangeReward_descriptor_;
}
const CExchangeReward& CExchangeReward::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CExchangeReward* CExchangeReward::default_instance_ = NULL;
CExchangeReward* CExchangeReward::New() const {
return new CExchangeReward;
}
void CExchangeReward::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20492u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CExchangeReward::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20492];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CExchangeReward::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20492];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CExchangeReward::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20492];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CExchangeReward::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20492];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CExchangeReward::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CExchangeReward* source =
::google::protobuf::internal::dynamic_cast_if_available<const CExchangeReward*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CExchangeReward::MergeFrom(const CExchangeReward& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CExchangeReward::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CExchangeReward::CopyFrom(const CExchangeReward& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CExchangeReward::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void CExchangeReward::Swap(CExchangeReward* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CExchangeReward::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CExchangeReward_descriptor_;
metadata.reflection = CExchangeReward_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SExchangeReward::kCmdFieldNumber;
const int SExchangeReward::kListFieldNumber;
const int SExchangeReward::kErrFieldNumber;
#endif // !_MSC_VER
SExchangeReward::SExchangeReward()
: ::google::protobuf::Message() {
SharedCtor();
}
void SExchangeReward::InitAsDefaultInstance() {
}
SExchangeReward::SExchangeReward(const SExchangeReward& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SExchangeReward::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20492u;
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SExchangeReward::~SExchangeReward() {
SharedDtor();
}
void SExchangeReward::SharedDtor() {
if (this != default_instance_) {
}
}
void SExchangeReward::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SExchangeReward::descriptor() {
protobuf_AssignDescriptorsOnce();
return SExchangeReward_descriptor_;
}
const SExchangeReward& SExchangeReward::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SExchangeReward* SExchangeReward::default_instance_ = NULL;
SExchangeReward* SExchangeReward::New() const {
return new SExchangeReward;
}
void SExchangeReward::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20492u;
err_ = 0u;
}
list_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SExchangeReward::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20492];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_list;
break;
}
// repeated .protocol.ExAward list = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_list:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_list()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_list;
if (input->ExpectTag(24)) goto parse_err;
break;
}
// optional uint32 err = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SExchangeReward::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20492];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// repeated .protocol.ExAward list = 2;
for (int i = 0; i < this->list_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2, this->list(i), output);
}
// optional uint32 err = 3;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SExchangeReward::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20492];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// repeated .protocol.ExAward list = 2;
for (int i = 0; i < this->list_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
2, this->list(i), target);
}
// optional uint32 err = 3;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SExchangeReward::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20492];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 err = 3;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
// repeated .protocol.ExAward list = 2;
total_size += 1 * this->list_size();
for (int i = 0; i < this->list_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->list(i));
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SExchangeReward::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SExchangeReward* source =
::google::protobuf::internal::dynamic_cast_if_available<const SExchangeReward*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SExchangeReward::MergeFrom(const SExchangeReward& from) {
GOOGLE_CHECK_NE(&from, this);
list_.MergeFrom(from.list_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SExchangeReward::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SExchangeReward::CopyFrom(const SExchangeReward& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SExchangeReward::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SExchangeReward::Swap(SExchangeReward* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
list_.Swap(&other->list_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SExchangeReward::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SExchangeReward_descriptor_;
metadata.reflection = SExchangeReward_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CExchangeCode::kCmdFieldNumber;
const int CExchangeCode::kExcodeFieldNumber;
const int CExchangeCode::kYzcodeFieldNumber;
#endif // !_MSC_VER
CExchangeCode::CExchangeCode()
: ::google::protobuf::Message() {
SharedCtor();
}
void CExchangeCode::InitAsDefaultInstance() {
}
CExchangeCode::CExchangeCode(const CExchangeCode& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CExchangeCode::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20493u;
excode_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
yzcode_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CExchangeCode::~CExchangeCode() {
SharedDtor();
}
void CExchangeCode::SharedDtor() {
if (excode_ != &::google::protobuf::internal::kEmptyString) {
delete excode_;
}
if (yzcode_ != &::google::protobuf::internal::kEmptyString) {
delete yzcode_;
}
if (this != default_instance_) {
}
}
void CExchangeCode::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CExchangeCode::descriptor() {
protobuf_AssignDescriptorsOnce();
return CExchangeCode_descriptor_;
}
const CExchangeCode& CExchangeCode::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CExchangeCode* CExchangeCode::default_instance_ = NULL;
CExchangeCode* CExchangeCode::New() const {
return new CExchangeCode;
}
void CExchangeCode::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20493u;
if (has_excode()) {
if (excode_ != &::google::protobuf::internal::kEmptyString) {
excode_->clear();
}
}
if (has_yzcode()) {
if (yzcode_ != &::google::protobuf::internal::kEmptyString) {
yzcode_->clear();
}
}
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CExchangeCode::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20493];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_excode;
break;
}
// optional string excode = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_excode:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_excode()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->excode().data(), this->excode().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(26)) goto parse_yzcode;
break;
}
// optional string yzcode = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_yzcode:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_yzcode()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->yzcode().data(), this->yzcode().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CExchangeCode::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20493];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional string excode = 2;
if (has_excode()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->excode().data(), this->excode().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
2, this->excode(), output);
}
// optional string yzcode = 3;
if (has_yzcode()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->yzcode().data(), this->yzcode().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
3, this->yzcode(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CExchangeCode::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20493];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional string excode = 2;
if (has_excode()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->excode().data(), this->excode().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2, this->excode(), target);
}
// optional string yzcode = 3;
if (has_yzcode()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->yzcode().data(), this->yzcode().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
3, this->yzcode(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CExchangeCode::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20493];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional string excode = 2;
if (has_excode()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->excode());
}
// optional string yzcode = 3;
if (has_yzcode()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->yzcode());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CExchangeCode::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CExchangeCode* source =
::google::protobuf::internal::dynamic_cast_if_available<const CExchangeCode*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CExchangeCode::MergeFrom(const CExchangeCode& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_excode()) {
set_excode(from.excode());
}
if (from.has_yzcode()) {
set_yzcode(from.yzcode());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CExchangeCode::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CExchangeCode::CopyFrom(const CExchangeCode& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CExchangeCode::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void CExchangeCode::Swap(CExchangeCode* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(excode_, other->excode_);
std::swap(yzcode_, other->yzcode_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CExchangeCode::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CExchangeCode_descriptor_;
metadata.reflection = CExchangeCode_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SExchangeCode::kCmdFieldNumber;
const int SExchangeCode::kSuccessFieldNumber;
const int SExchangeCode::kErrFieldNumber;
#endif // !_MSC_VER
SExchangeCode::SExchangeCode()
: ::google::protobuf::Message() {
SharedCtor();
}
void SExchangeCode::InitAsDefaultInstance() {
}
SExchangeCode::SExchangeCode(const SExchangeCode& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SExchangeCode::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20493u;
success_ = false;
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SExchangeCode::~SExchangeCode() {
SharedDtor();
}
void SExchangeCode::SharedDtor() {
if (this != default_instance_) {
}
}
void SExchangeCode::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SExchangeCode::descriptor() {
protobuf_AssignDescriptorsOnce();
return SExchangeCode_descriptor_;
}
const SExchangeCode& SExchangeCode::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SExchangeCode* SExchangeCode::default_instance_ = NULL;
SExchangeCode* SExchangeCode::New() const {
return new SExchangeCode;
}
void SExchangeCode::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20493u;
success_ = false;
err_ = 0u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SExchangeCode::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20493];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_success;
break;
}
// optional bool success = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_success:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
input, &success_)));
set_has_success();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(24)) goto parse_err;
break;
}
// optional uint32 err = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SExchangeCode::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20493];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional bool success = 2;
if (has_success()) {
::google::protobuf::internal::WireFormatLite::WriteBool(2, this->success(), output);
}
// optional uint32 err = 3;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SExchangeCode::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20493];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional bool success = 2;
if (has_success()) {
target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->success(), target);
}
// optional uint32 err = 3;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SExchangeCode::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20493];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional bool success = 2;
if (has_success()) {
total_size += 1 + 1;
}
// optional uint32 err = 3;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SExchangeCode::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SExchangeCode* source =
::google::protobuf::internal::dynamic_cast_if_available<const SExchangeCode*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SExchangeCode::MergeFrom(const SExchangeCode& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_success()) {
set_success(from.success());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SExchangeCode::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SExchangeCode::CopyFrom(const SExchangeCode& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SExchangeCode::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SExchangeCode::Swap(SExchangeCode* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(success_, other->success_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SExchangeCode::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SExchangeCode_descriptor_;
metadata.reflection = SExchangeCode_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CExchangeRecord::kCmdFieldNumber;
#endif // !_MSC_VER
CExchangeRecord::CExchangeRecord()
: ::google::protobuf::Message() {
SharedCtor();
}
void CExchangeRecord::InitAsDefaultInstance() {
}
CExchangeRecord::CExchangeRecord(const CExchangeRecord& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CExchangeRecord::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20494u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CExchangeRecord::~CExchangeRecord() {
SharedDtor();
}
void CExchangeRecord::SharedDtor() {
if (this != default_instance_) {
}
}
void CExchangeRecord::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CExchangeRecord::descriptor() {
protobuf_AssignDescriptorsOnce();
return CExchangeRecord_descriptor_;
}
const CExchangeRecord& CExchangeRecord::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CExchangeRecord* CExchangeRecord::default_instance_ = NULL;
CExchangeRecord* CExchangeRecord::New() const {
return new CExchangeRecord;
}
void CExchangeRecord::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20494u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CExchangeRecord::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20494];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CExchangeRecord::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20494];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CExchangeRecord::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20494];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CExchangeRecord::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20494];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CExchangeRecord::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CExchangeRecord* source =
::google::protobuf::internal::dynamic_cast_if_available<const CExchangeRecord*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CExchangeRecord::MergeFrom(const CExchangeRecord& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CExchangeRecord::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CExchangeRecord::CopyFrom(const CExchangeRecord& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CExchangeRecord::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void CExchangeRecord::Swap(CExchangeRecord* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CExchangeRecord::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CExchangeRecord_descriptor_;
metadata.reflection = CExchangeRecord_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SExchangeRecord::kCmdFieldNumber;
const int SExchangeRecord::kListFieldNumber;
const int SExchangeRecord::kErrFieldNumber;
#endif // !_MSC_VER
SExchangeRecord::SExchangeRecord()
: ::google::protobuf::Message() {
SharedCtor();
}
void SExchangeRecord::InitAsDefaultInstance() {
}
SExchangeRecord::SExchangeRecord(const SExchangeRecord& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SExchangeRecord::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20494u;
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SExchangeRecord::~SExchangeRecord() {
SharedDtor();
}
void SExchangeRecord::SharedDtor() {
if (this != default_instance_) {
}
}
void SExchangeRecord::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SExchangeRecord::descriptor() {
protobuf_AssignDescriptorsOnce();
return SExchangeRecord_descriptor_;
}
const SExchangeRecord& SExchangeRecord::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SExchangeRecord* SExchangeRecord::default_instance_ = NULL;
SExchangeRecord* SExchangeRecord::New() const {
return new SExchangeRecord;
}
void SExchangeRecord::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20494u;
err_ = 0u;
}
list_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SExchangeRecord::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20494];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_list;
break;
}
// repeated .protocol.ExRecord list = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_list:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_list()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_list;
if (input->ExpectTag(24)) goto parse_err;
break;
}
// optional uint32 err = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SExchangeRecord::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20494];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// repeated .protocol.ExRecord list = 2;
for (int i = 0; i < this->list_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2, this->list(i), output);
}
// optional uint32 err = 3;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SExchangeRecord::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20494];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// repeated .protocol.ExRecord list = 2;
for (int i = 0; i < this->list_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
2, this->list(i), target);
}
// optional uint32 err = 3;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SExchangeRecord::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20494];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 err = 3;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
// repeated .protocol.ExRecord list = 2;
total_size += 1 * this->list_size();
for (int i = 0; i < this->list_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->list(i));
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SExchangeRecord::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SExchangeRecord* source =
::google::protobuf::internal::dynamic_cast_if_available<const SExchangeRecord*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SExchangeRecord::MergeFrom(const SExchangeRecord& from) {
GOOGLE_CHECK_NE(&from, this);
list_.MergeFrom(from.list_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SExchangeRecord::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SExchangeRecord::CopyFrom(const SExchangeRecord& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SExchangeRecord::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SExchangeRecord::Swap(SExchangeRecord* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
list_.Swap(&other->list_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SExchangeRecord::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SExchangeRecord_descriptor_;
metadata.reflection = SExchangeRecord_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CExchange::kCmdFieldNumber;
const int CExchange::kIdFieldNumber;
#endif // !_MSC_VER
CExchange::CExchange()
: ::google::protobuf::Message() {
SharedCtor();
}
void CExchange::InitAsDefaultInstance() {
}
CExchange::CExchange(const CExchange& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CExchange::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20495u;
id_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CExchange::~CExchange() {
SharedDtor();
}
void CExchange::SharedDtor() {
if (this != default_instance_) {
}
}
void CExchange::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CExchange::descriptor() {
protobuf_AssignDescriptorsOnce();
return CExchange_descriptor_;
}
const CExchange& CExchange::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CExchange* CExchange::default_instance_ = NULL;
CExchange* CExchange::New() const {
return new CExchange;
}
void CExchange::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20495u;
id_ = 0u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CExchange::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20495];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_id;
break;
}
// optional uint32 id = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_id:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &id_)));
set_has_id();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CExchange::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20495];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional uint32 id = 2;
if (has_id()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->id(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CExchange::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20495];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional uint32 id = 2;
if (has_id()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->id(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CExchange::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20495];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 id = 2;
if (has_id()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->id());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CExchange::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CExchange* source =
::google::protobuf::internal::dynamic_cast_if_available<const CExchange*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CExchange::MergeFrom(const CExchange& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_id()) {
set_id(from.id());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CExchange::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CExchange::CopyFrom(const CExchange& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CExchange::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void CExchange::Swap(CExchange* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(id_, other->id_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CExchange::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CExchange_descriptor_;
metadata.reflection = CExchange_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SExchange::kCmdFieldNumber;
const int SExchange::kIdFieldNumber;
const int SExchange::kCodeFieldNumber;
const int SExchange::kErrFieldNumber;
#endif // !_MSC_VER
SExchange::SExchange()
: ::google::protobuf::Message() {
SharedCtor();
}
void SExchange::InitAsDefaultInstance() {
}
SExchange::SExchange(const SExchange& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SExchange::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20495u;
id_ = 0u;
code_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SExchange::~SExchange() {
SharedDtor();
}
void SExchange::SharedDtor() {
if (code_ != &::google::protobuf::internal::kEmptyString) {
delete code_;
}
if (this != default_instance_) {
}
}
void SExchange::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SExchange::descriptor() {
protobuf_AssignDescriptorsOnce();
return SExchange_descriptor_;
}
const SExchange& SExchange::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SExchange* SExchange::default_instance_ = NULL;
SExchange* SExchange::New() const {
return new SExchange;
}
void SExchange::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20495u;
id_ = 0u;
if (has_code()) {
if (code_ != &::google::protobuf::internal::kEmptyString) {
code_->clear();
}
}
err_ = 0u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SExchange::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20495];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_id;
break;
}
// optional uint32 id = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_id:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &id_)));
set_has_id();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(26)) goto parse_code;
break;
}
// optional string code = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_code:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_code()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->code().data(), this->code().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(32)) goto parse_err;
break;
}
// optional uint32 err = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SExchange::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20495];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional uint32 id = 2;
if (has_id()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->id(), output);
}
// optional string code = 3;
if (has_code()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->code().data(), this->code().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
3, this->code(), output);
}
// optional uint32 err = 4;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SExchange::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20495];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional uint32 id = 2;
if (has_id()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->id(), target);
}
// optional string code = 3;
if (has_code()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->code().data(), this->code().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
3, this->code(), target);
}
// optional uint32 err = 4;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SExchange::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20495];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 id = 2;
if (has_id()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->id());
}
// optional string code = 3;
if (has_code()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->code());
}
// optional uint32 err = 4;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SExchange::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SExchange* source =
::google::protobuf::internal::dynamic_cast_if_available<const SExchange*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SExchange::MergeFrom(const SExchange& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_id()) {
set_id(from.id());
}
if (from.has_code()) {
set_code(from.code());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SExchange::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SExchange::CopyFrom(const SExchange& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SExchange::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SExchange::Swap(SExchange* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(id_, other->id_);
std::swap(code_, other->code_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SExchange::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SExchange_descriptor_;
metadata.reflection = SExchange_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CApplePay::kCmdFieldNumber;
const int CApplePay::kIdFieldNumber;
const int CApplePay::kReceiptFieldNumber;
#endif // !_MSC_VER
CApplePay::CApplePay()
: ::google::protobuf::Message() {
SharedCtor();
}
void CApplePay::InitAsDefaultInstance() {
}
CApplePay::CApplePay(const CApplePay& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CApplePay::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20496u;
id_ = 0u;
receipt_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CApplePay::~CApplePay() {
SharedDtor();
}
void CApplePay::SharedDtor() {
if (receipt_ != &::google::protobuf::internal::kEmptyString) {
delete receipt_;
}
if (this != default_instance_) {
}
}
void CApplePay::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CApplePay::descriptor() {
protobuf_AssignDescriptorsOnce();
return CApplePay_descriptor_;
}
const CApplePay& CApplePay::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CApplePay* CApplePay::default_instance_ = NULL;
CApplePay* CApplePay::New() const {
return new CApplePay;
}
void CApplePay::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20496u;
id_ = 0u;
if (has_receipt()) {
if (receipt_ != &::google::protobuf::internal::kEmptyString) {
receipt_->clear();
}
}
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CApplePay::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20496];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_id;
break;
}
// optional uint32 id = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_id:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &id_)));
set_has_id();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(26)) goto parse_receipt;
break;
}
// optional string receipt = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_receipt:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_receipt()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->receipt().data(), this->receipt().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CApplePay::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20496];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional uint32 id = 2;
if (has_id()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->id(), output);
}
// optional string receipt = 3;
if (has_receipt()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->receipt().data(), this->receipt().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
3, this->receipt(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CApplePay::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20496];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional uint32 id = 2;
if (has_id()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->id(), target);
}
// optional string receipt = 3;
if (has_receipt()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->receipt().data(), this->receipt().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
3, this->receipt(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CApplePay::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20496];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 id = 2;
if (has_id()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->id());
}
// optional string receipt = 3;
if (has_receipt()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->receipt());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CApplePay::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CApplePay* source =
::google::protobuf::internal::dynamic_cast_if_available<const CApplePay*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CApplePay::MergeFrom(const CApplePay& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_id()) {
set_id(from.id());
}
if (from.has_receipt()) {
set_receipt(from.receipt());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CApplePay::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CApplePay::CopyFrom(const CApplePay& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CApplePay::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void CApplePay::Swap(CApplePay* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(id_, other->id_);
std::swap(receipt_, other->receipt_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CApplePay::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CApplePay_descriptor_;
metadata.reflection = CApplePay_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SApplePay::kCmdFieldNumber;
const int SApplePay::kIdFieldNumber;
const int SApplePay::kErrFieldNumber;
#endif // !_MSC_VER
SApplePay::SApplePay()
: ::google::protobuf::Message() {
SharedCtor();
}
void SApplePay::InitAsDefaultInstance() {
}
SApplePay::SApplePay(const SApplePay& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SApplePay::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20496u;
id_ = 0u;
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SApplePay::~SApplePay() {
SharedDtor();
}
void SApplePay::SharedDtor() {
if (this != default_instance_) {
}
}
void SApplePay::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SApplePay::descriptor() {
protobuf_AssignDescriptorsOnce();
return SApplePay_descriptor_;
}
const SApplePay& SApplePay::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SApplePay* SApplePay::default_instance_ = NULL;
SApplePay* SApplePay::New() const {
return new SApplePay;
}
void SApplePay::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20496u;
id_ = 0u;
err_ = 0u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SApplePay::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20496];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_id;
break;
}
// optional uint32 id = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_id:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &id_)));
set_has_id();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(24)) goto parse_err;
break;
}
// optional uint32 err = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SApplePay::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20496];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional uint32 id = 2;
if (has_id()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->id(), output);
}
// optional uint32 err = 3;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SApplePay::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20496];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional uint32 id = 2;
if (has_id()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->id(), target);
}
// optional uint32 err = 3;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SApplePay::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20496];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 id = 2;
if (has_id()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->id());
}
// optional uint32 err = 3;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SApplePay::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SApplePay* source =
::google::protobuf::internal::dynamic_cast_if_available<const SApplePay*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SApplePay::MergeFrom(const SApplePay& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_id()) {
set_id(from.id());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SApplePay::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SApplePay::CopyFrom(const SApplePay& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SApplePay::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SApplePay::Swap(SApplePay* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(id_, other->id_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SApplePay::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SApplePay_descriptor_;
metadata.reflection = SApplePay_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CWxpayOrder::kCmdFieldNumber;
const int CWxpayOrder::kIdFieldNumber;
const int CWxpayOrder::kBodyFieldNumber;
#endif // !_MSC_VER
CWxpayOrder::CWxpayOrder()
: ::google::protobuf::Message() {
SharedCtor();
}
void CWxpayOrder::InitAsDefaultInstance() {
}
CWxpayOrder::CWxpayOrder(const CWxpayOrder& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CWxpayOrder::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20497u;
id_ = 0u;
body_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CWxpayOrder::~CWxpayOrder() {
SharedDtor();
}
void CWxpayOrder::SharedDtor() {
if (body_ != &::google::protobuf::internal::kEmptyString) {
delete body_;
}
if (this != default_instance_) {
}
}
void CWxpayOrder::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CWxpayOrder::descriptor() {
protobuf_AssignDescriptorsOnce();
return CWxpayOrder_descriptor_;
}
const CWxpayOrder& CWxpayOrder::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CWxpayOrder* CWxpayOrder::default_instance_ = NULL;
CWxpayOrder* CWxpayOrder::New() const {
return new CWxpayOrder;
}
void CWxpayOrder::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20497u;
id_ = 0u;
if (has_body()) {
if (body_ != &::google::protobuf::internal::kEmptyString) {
body_->clear();
}
}
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CWxpayOrder::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20497];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_id;
break;
}
// optional uint32 id = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_id:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &id_)));
set_has_id();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(26)) goto parse_body;
break;
}
// optional string body = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_body:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_body()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->body().data(), this->body().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CWxpayOrder::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20497];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional uint32 id = 2;
if (has_id()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->id(), output);
}
// optional string body = 3;
if (has_body()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->body().data(), this->body().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
3, this->body(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CWxpayOrder::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20497];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional uint32 id = 2;
if (has_id()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->id(), target);
}
// optional string body = 3;
if (has_body()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->body().data(), this->body().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
3, this->body(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CWxpayOrder::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20497];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 id = 2;
if (has_id()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->id());
}
// optional string body = 3;
if (has_body()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->body());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CWxpayOrder::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CWxpayOrder* source =
::google::protobuf::internal::dynamic_cast_if_available<const CWxpayOrder*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CWxpayOrder::MergeFrom(const CWxpayOrder& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_id()) {
set_id(from.id());
}
if (from.has_body()) {
set_body(from.body());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CWxpayOrder::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CWxpayOrder::CopyFrom(const CWxpayOrder& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CWxpayOrder::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void CWxpayOrder::Swap(CWxpayOrder* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(id_, other->id_);
std::swap(body_, other->body_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CWxpayOrder::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CWxpayOrder_descriptor_;
metadata.reflection = CWxpayOrder_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SWxpayOrder::kCmdFieldNumber;
const int SWxpayOrder::kNoncestrFieldNumber;
const int SWxpayOrder::kPayreqFieldNumber;
const int SWxpayOrder::kTimestampFieldNumber;
const int SWxpayOrder::kSignFieldNumber;
const int SWxpayOrder::kErrFieldNumber;
#endif // !_MSC_VER
SWxpayOrder::SWxpayOrder()
: ::google::protobuf::Message() {
SharedCtor();
}
void SWxpayOrder::InitAsDefaultInstance() {
}
SWxpayOrder::SWxpayOrder(const SWxpayOrder& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SWxpayOrder::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20497u;
noncestr_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
payreq_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
timestamp_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
sign_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SWxpayOrder::~SWxpayOrder() {
SharedDtor();
}
void SWxpayOrder::SharedDtor() {
if (noncestr_ != &::google::protobuf::internal::kEmptyString) {
delete noncestr_;
}
if (payreq_ != &::google::protobuf::internal::kEmptyString) {
delete payreq_;
}
if (timestamp_ != &::google::protobuf::internal::kEmptyString) {
delete timestamp_;
}
if (sign_ != &::google::protobuf::internal::kEmptyString) {
delete sign_;
}
if (this != default_instance_) {
}
}
void SWxpayOrder::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SWxpayOrder::descriptor() {
protobuf_AssignDescriptorsOnce();
return SWxpayOrder_descriptor_;
}
const SWxpayOrder& SWxpayOrder::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SWxpayOrder* SWxpayOrder::default_instance_ = NULL;
SWxpayOrder* SWxpayOrder::New() const {
return new SWxpayOrder;
}
void SWxpayOrder::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20497u;
if (has_noncestr()) {
if (noncestr_ != &::google::protobuf::internal::kEmptyString) {
noncestr_->clear();
}
}
if (has_payreq()) {
if (payreq_ != &::google::protobuf::internal::kEmptyString) {
payreq_->clear();
}
}
if (has_timestamp()) {
if (timestamp_ != &::google::protobuf::internal::kEmptyString) {
timestamp_->clear();
}
}
if (has_sign()) {
if (sign_ != &::google::protobuf::internal::kEmptyString) {
sign_->clear();
}
}
err_ = 0u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SWxpayOrder::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20497];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_noncestr;
break;
}
// optional string noncestr = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_noncestr:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_noncestr()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->noncestr().data(), this->noncestr().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(26)) goto parse_payreq;
break;
}
// optional string payreq = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_payreq:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_payreq()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->payreq().data(), this->payreq().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(34)) goto parse_timestamp;
break;
}
// optional string timestamp = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_timestamp:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_timestamp()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->timestamp().data(), this->timestamp().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(42)) goto parse_sign;
break;
}
// optional string sign = 5;
case 5: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_sign:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_sign()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->sign().data(), this->sign().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(48)) goto parse_err;
break;
}
// optional uint32 err = 6;
case 6: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SWxpayOrder::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20497];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional string noncestr = 2;
if (has_noncestr()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->noncestr().data(), this->noncestr().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
2, this->noncestr(), output);
}
// optional string payreq = 3;
if (has_payreq()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->payreq().data(), this->payreq().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
3, this->payreq(), output);
}
// optional string timestamp = 4;
if (has_timestamp()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->timestamp().data(), this->timestamp().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
4, this->timestamp(), output);
}
// optional string sign = 5;
if (has_sign()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->sign().data(), this->sign().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
5, this->sign(), output);
}
// optional uint32 err = 6;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SWxpayOrder::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20497];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional string noncestr = 2;
if (has_noncestr()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->noncestr().data(), this->noncestr().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2, this->noncestr(), target);
}
// optional string payreq = 3;
if (has_payreq()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->payreq().data(), this->payreq().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
3, this->payreq(), target);
}
// optional string timestamp = 4;
if (has_timestamp()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->timestamp().data(), this->timestamp().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
4, this->timestamp(), target);
}
// optional string sign = 5;
if (has_sign()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->sign().data(), this->sign().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
5, this->sign(), target);
}
// optional uint32 err = 6;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SWxpayOrder::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20497];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional string noncestr = 2;
if (has_noncestr()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->noncestr());
}
// optional string payreq = 3;
if (has_payreq()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->payreq());
}
// optional string timestamp = 4;
if (has_timestamp()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->timestamp());
}
// optional string sign = 5;
if (has_sign()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->sign());
}
// optional uint32 err = 6;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SWxpayOrder::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SWxpayOrder* source =
::google::protobuf::internal::dynamic_cast_if_available<const SWxpayOrder*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SWxpayOrder::MergeFrom(const SWxpayOrder& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_noncestr()) {
set_noncestr(from.noncestr());
}
if (from.has_payreq()) {
set_payreq(from.payreq());
}
if (from.has_timestamp()) {
set_timestamp(from.timestamp());
}
if (from.has_sign()) {
set_sign(from.sign());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SWxpayOrder::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SWxpayOrder::CopyFrom(const SWxpayOrder& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SWxpayOrder::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SWxpayOrder::Swap(SWxpayOrder* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(noncestr_, other->noncestr_);
std::swap(payreq_, other->payreq_);
std::swap(timestamp_, other->timestamp_);
std::swap(sign_, other->sign_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SWxpayOrder::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SWxpayOrder_descriptor_;
metadata.reflection = SWxpayOrder_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CAliPayOrder::kCmdFieldNumber;
const int CAliPayOrder::kIdFieldNumber;
const int CAliPayOrder::kBodyFieldNumber;
const int CAliPayOrder::kTypeFieldNumber;
#endif // !_MSC_VER
CAliPayOrder::CAliPayOrder()
: ::google::protobuf::Message() {
SharedCtor();
}
void CAliPayOrder::InitAsDefaultInstance() {
}
CAliPayOrder::CAliPayOrder(const CAliPayOrder& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CAliPayOrder::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20504u;
id_ = 0u;
body_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
type_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CAliPayOrder::~CAliPayOrder() {
SharedDtor();
}
void CAliPayOrder::SharedDtor() {
if (body_ != &::google::protobuf::internal::kEmptyString) {
delete body_;
}
if (this != default_instance_) {
}
}
void CAliPayOrder::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CAliPayOrder::descriptor() {
protobuf_AssignDescriptorsOnce();
return CAliPayOrder_descriptor_;
}
const CAliPayOrder& CAliPayOrder::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CAliPayOrder* CAliPayOrder::default_instance_ = NULL;
CAliPayOrder* CAliPayOrder::New() const {
return new CAliPayOrder;
}
void CAliPayOrder::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20504u;
id_ = 0u;
if (has_body()) {
if (body_ != &::google::protobuf::internal::kEmptyString) {
body_->clear();
}
}
type_ = 0u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CAliPayOrder::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20504];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_id;
break;
}
// optional uint32 id = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_id:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &id_)));
set_has_id();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(26)) goto parse_body;
break;
}
// optional string body = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_body:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_body()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->body().data(), this->body().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(32)) goto parse_type;
break;
}
// optional uint32 type = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_type:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &type_)));
set_has_type();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CAliPayOrder::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20504];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional uint32 id = 2;
if (has_id()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->id(), output);
}
// optional string body = 3;
if (has_body()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->body().data(), this->body().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
3, this->body(), output);
}
// optional uint32 type = 4;
if (has_type()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->type(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CAliPayOrder::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20504];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional uint32 id = 2;
if (has_id()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->id(), target);
}
// optional string body = 3;
if (has_body()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->body().data(), this->body().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
3, this->body(), target);
}
// optional uint32 type = 4;
if (has_type()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->type(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CAliPayOrder::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20504];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 id = 2;
if (has_id()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->id());
}
// optional string body = 3;
if (has_body()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->body());
}
// optional uint32 type = 4;
if (has_type()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->type());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CAliPayOrder::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CAliPayOrder* source =
::google::protobuf::internal::dynamic_cast_if_available<const CAliPayOrder*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CAliPayOrder::MergeFrom(const CAliPayOrder& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_id()) {
set_id(from.id());
}
if (from.has_body()) {
set_body(from.body());
}
if (from.has_type()) {
set_type(from.type());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CAliPayOrder::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CAliPayOrder::CopyFrom(const CAliPayOrder& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CAliPayOrder::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void CAliPayOrder::Swap(CAliPayOrder* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(id_, other->id_);
std::swap(body_, other->body_);
std::swap(type_, other->type_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CAliPayOrder::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CAliPayOrder_descriptor_;
metadata.reflection = CAliPayOrder_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SAliPayOrder::kCmdFieldNumber;
const int SAliPayOrder::kOrderinfoFieldNumber;
const int SAliPayOrder::kAppidFieldNumber;
const int SAliPayOrder::kTimestampFieldNumber;
const int SAliPayOrder::kPrivatekeyFieldNumber;
const int SAliPayOrder::kErrFieldNumber;
#endif // !_MSC_VER
SAliPayOrder::SAliPayOrder()
: ::google::protobuf::Message() {
SharedCtor();
}
void SAliPayOrder::InitAsDefaultInstance() {
}
SAliPayOrder::SAliPayOrder(const SAliPayOrder& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SAliPayOrder::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20504u;
orderinfo_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
appid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
timestamp_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
privatekey_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SAliPayOrder::~SAliPayOrder() {
SharedDtor();
}
void SAliPayOrder::SharedDtor() {
if (orderinfo_ != &::google::protobuf::internal::kEmptyString) {
delete orderinfo_;
}
if (appid_ != &::google::protobuf::internal::kEmptyString) {
delete appid_;
}
if (timestamp_ != &::google::protobuf::internal::kEmptyString) {
delete timestamp_;
}
if (privatekey_ != &::google::protobuf::internal::kEmptyString) {
delete privatekey_;
}
if (this != default_instance_) {
}
}
void SAliPayOrder::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SAliPayOrder::descriptor() {
protobuf_AssignDescriptorsOnce();
return SAliPayOrder_descriptor_;
}
const SAliPayOrder& SAliPayOrder::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SAliPayOrder* SAliPayOrder::default_instance_ = NULL;
SAliPayOrder* SAliPayOrder::New() const {
return new SAliPayOrder;
}
void SAliPayOrder::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20504u;
if (has_orderinfo()) {
if (orderinfo_ != &::google::protobuf::internal::kEmptyString) {
orderinfo_->clear();
}
}
if (has_appid()) {
if (appid_ != &::google::protobuf::internal::kEmptyString) {
appid_->clear();
}
}
if (has_timestamp()) {
if (timestamp_ != &::google::protobuf::internal::kEmptyString) {
timestamp_->clear();
}
}
if (has_privatekey()) {
if (privatekey_ != &::google::protobuf::internal::kEmptyString) {
privatekey_->clear();
}
}
err_ = 0u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SAliPayOrder::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20504];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_orderinfo;
break;
}
// optional string orderinfo = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_orderinfo:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_orderinfo()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->orderinfo().data(), this->orderinfo().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(26)) goto parse_appid;
break;
}
// optional string appid = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_appid:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_appid()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->appid().data(), this->appid().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(34)) goto parse_timestamp;
break;
}
// optional string timestamp = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_timestamp:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_timestamp()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->timestamp().data(), this->timestamp().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(42)) goto parse_privatekey;
break;
}
// optional string privatekey = 5;
case 5: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_privatekey:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_privatekey()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->privatekey().data(), this->privatekey().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(48)) goto parse_err;
break;
}
// optional uint32 err = 6;
case 6: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SAliPayOrder::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20504];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional string orderinfo = 2;
if (has_orderinfo()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->orderinfo().data(), this->orderinfo().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
2, this->orderinfo(), output);
}
// optional string appid = 3;
if (has_appid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->appid().data(), this->appid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
3, this->appid(), output);
}
// optional string timestamp = 4;
if (has_timestamp()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->timestamp().data(), this->timestamp().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
4, this->timestamp(), output);
}
// optional string privatekey = 5;
if (has_privatekey()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->privatekey().data(), this->privatekey().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
5, this->privatekey(), output);
}
// optional uint32 err = 6;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SAliPayOrder::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20504];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional string orderinfo = 2;
if (has_orderinfo()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->orderinfo().data(), this->orderinfo().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2, this->orderinfo(), target);
}
// optional string appid = 3;
if (has_appid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->appid().data(), this->appid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
3, this->appid(), target);
}
// optional string timestamp = 4;
if (has_timestamp()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->timestamp().data(), this->timestamp().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
4, this->timestamp(), target);
}
// optional string privatekey = 5;
if (has_privatekey()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->privatekey().data(), this->privatekey().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
5, this->privatekey(), target);
}
// optional uint32 err = 6;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SAliPayOrder::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20504];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional string orderinfo = 2;
if (has_orderinfo()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->orderinfo());
}
// optional string appid = 3;
if (has_appid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->appid());
}
// optional string timestamp = 4;
if (has_timestamp()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->timestamp());
}
// optional string privatekey = 5;
if (has_privatekey()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->privatekey());
}
// optional uint32 err = 6;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SAliPayOrder::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SAliPayOrder* source =
::google::protobuf::internal::dynamic_cast_if_available<const SAliPayOrder*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SAliPayOrder::MergeFrom(const SAliPayOrder& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_orderinfo()) {
set_orderinfo(from.orderinfo());
}
if (from.has_appid()) {
set_appid(from.appid());
}
if (from.has_timestamp()) {
set_timestamp(from.timestamp());
}
if (from.has_privatekey()) {
set_privatekey(from.privatekey());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SAliPayOrder::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SAliPayOrder::CopyFrom(const SAliPayOrder& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SAliPayOrder::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SAliPayOrder::Swap(SAliPayOrder* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(orderinfo_, other->orderinfo_);
std::swap(appid_, other->appid_);
std::swap(timestamp_, other->timestamp_);
std::swap(privatekey_, other->privatekey_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SAliPayOrder::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SAliPayOrder_descriptor_;
metadata.reflection = SAliPayOrder_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CAliPayResult::kCmdFieldNumber;
const int CAliPayResult::kContentFieldNumber;
#endif // !_MSC_VER
CAliPayResult::CAliPayResult()
: ::google::protobuf::Message() {
SharedCtor();
}
void CAliPayResult::InitAsDefaultInstance() {
}
CAliPayResult::CAliPayResult(const CAliPayResult& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CAliPayResult::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20505u;
content_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CAliPayResult::~CAliPayResult() {
SharedDtor();
}
void CAliPayResult::SharedDtor() {
if (content_ != &::google::protobuf::internal::kEmptyString) {
delete content_;
}
if (this != default_instance_) {
}
}
void CAliPayResult::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CAliPayResult::descriptor() {
protobuf_AssignDescriptorsOnce();
return CAliPayResult_descriptor_;
}
const CAliPayResult& CAliPayResult::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CAliPayResult* CAliPayResult::default_instance_ = NULL;
CAliPayResult* CAliPayResult::New() const {
return new CAliPayResult;
}
void CAliPayResult::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20505u;
if (has_content()) {
if (content_ != &::google::protobuf::internal::kEmptyString) {
content_->clear();
}
}
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CAliPayResult::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20505];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_content;
break;
}
// optional string content = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_content:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_content()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->content().data(), this->content().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CAliPayResult::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20505];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional string content = 2;
if (has_content()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->content().data(), this->content().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
2, this->content(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CAliPayResult::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20505];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional string content = 2;
if (has_content()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->content().data(), this->content().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2, this->content(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CAliPayResult::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20505];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional string content = 2;
if (has_content()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->content());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CAliPayResult::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CAliPayResult* source =
::google::protobuf::internal::dynamic_cast_if_available<const CAliPayResult*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CAliPayResult::MergeFrom(const CAliPayResult& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_content()) {
set_content(from.content());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CAliPayResult::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CAliPayResult::CopyFrom(const CAliPayResult& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CAliPayResult::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void CAliPayResult::Swap(CAliPayResult* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(content_, other->content_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CAliPayResult::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CAliPayResult_descriptor_;
metadata.reflection = CAliPayResult_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SAliPayResult::kCmdFieldNumber;
const int SAliPayResult::kErrFieldNumber;
#endif // !_MSC_VER
SAliPayResult::SAliPayResult()
: ::google::protobuf::Message() {
SharedCtor();
}
void SAliPayResult::InitAsDefaultInstance() {
}
SAliPayResult::SAliPayResult(const SAliPayResult& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SAliPayResult::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20505u;
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SAliPayResult::~SAliPayResult() {
SharedDtor();
}
void SAliPayResult::SharedDtor() {
if (this != default_instance_) {
}
}
void SAliPayResult::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SAliPayResult::descriptor() {
protobuf_AssignDescriptorsOnce();
return SAliPayResult_descriptor_;
}
const SAliPayResult& SAliPayResult::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SAliPayResult* SAliPayResult::default_instance_ = NULL;
SAliPayResult* SAliPayResult::New() const {
return new SAliPayResult;
}
void SAliPayResult::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20505u;
err_ = 0u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SAliPayResult::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20505];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(48)) goto parse_err;
break;
}
// optional uint32 err = 6;
case 6: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SAliPayResult::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20505];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional uint32 err = 6;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SAliPayResult::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20505];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional uint32 err = 6;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SAliPayResult::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20505];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 err = 6;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SAliPayResult::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SAliPayResult* source =
::google::protobuf::internal::dynamic_cast_if_available<const SAliPayResult*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SAliPayResult::MergeFrom(const SAliPayResult& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SAliPayResult::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SAliPayResult::CopyFrom(const SAliPayResult& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SAliPayResult::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SAliPayResult::Swap(SAliPayResult* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SAliPayResult::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SAliPayResult_descriptor_;
metadata.reflection = SAliPayResult_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CWxpayQuery::kCmdFieldNumber;
const int CWxpayQuery::kTransidFieldNumber;
#endif // !_MSC_VER
CWxpayQuery::CWxpayQuery()
: ::google::protobuf::Message() {
SharedCtor();
}
void CWxpayQuery::InitAsDefaultInstance() {
}
CWxpayQuery::CWxpayQuery(const CWxpayQuery& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CWxpayQuery::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20498u;
transid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CWxpayQuery::~CWxpayQuery() {
SharedDtor();
}
void CWxpayQuery::SharedDtor() {
if (transid_ != &::google::protobuf::internal::kEmptyString) {
delete transid_;
}
if (this != default_instance_) {
}
}
void CWxpayQuery::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CWxpayQuery::descriptor() {
protobuf_AssignDescriptorsOnce();
return CWxpayQuery_descriptor_;
}
const CWxpayQuery& CWxpayQuery::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CWxpayQuery* CWxpayQuery::default_instance_ = NULL;
CWxpayQuery* CWxpayQuery::New() const {
return new CWxpayQuery;
}
void CWxpayQuery::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20498u;
if (has_transid()) {
if (transid_ != &::google::protobuf::internal::kEmptyString) {
transid_->clear();
}
}
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CWxpayQuery::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20498];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_transid;
break;
}
// optional string transid = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_transid:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_transid()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->transid().data(), this->transid().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CWxpayQuery::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20498];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional string transid = 2;
if (has_transid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->transid().data(), this->transid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
2, this->transid(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CWxpayQuery::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20498];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional string transid = 2;
if (has_transid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->transid().data(), this->transid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2, this->transid(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CWxpayQuery::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20498];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional string transid = 2;
if (has_transid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->transid());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CWxpayQuery::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CWxpayQuery* source =
::google::protobuf::internal::dynamic_cast_if_available<const CWxpayQuery*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CWxpayQuery::MergeFrom(const CWxpayQuery& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_transid()) {
set_transid(from.transid());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CWxpayQuery::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CWxpayQuery::CopyFrom(const CWxpayQuery& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CWxpayQuery::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void CWxpayQuery::Swap(CWxpayQuery* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(transid_, other->transid_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CWxpayQuery::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CWxpayQuery_descriptor_;
metadata.reflection = CWxpayQuery_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SWxpayQuery::kCmdFieldNumber;
const int SWxpayQuery::kTransidFieldNumber;
const int SWxpayQuery::kErrFieldNumber;
#endif // !_MSC_VER
SWxpayQuery::SWxpayQuery()
: ::google::protobuf::Message() {
SharedCtor();
}
void SWxpayQuery::InitAsDefaultInstance() {
}
SWxpayQuery::SWxpayQuery(const SWxpayQuery& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SWxpayQuery::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20498u;
transid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SWxpayQuery::~SWxpayQuery() {
SharedDtor();
}
void SWxpayQuery::SharedDtor() {
if (transid_ != &::google::protobuf::internal::kEmptyString) {
delete transid_;
}
if (this != default_instance_) {
}
}
void SWxpayQuery::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SWxpayQuery::descriptor() {
protobuf_AssignDescriptorsOnce();
return SWxpayQuery_descriptor_;
}
const SWxpayQuery& SWxpayQuery::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SWxpayQuery* SWxpayQuery::default_instance_ = NULL;
SWxpayQuery* SWxpayQuery::New() const {
return new SWxpayQuery;
}
void SWxpayQuery::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20498u;
if (has_transid()) {
if (transid_ != &::google::protobuf::internal::kEmptyString) {
transid_->clear();
}
}
err_ = 0u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SWxpayQuery::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20498];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_transid;
break;
}
// optional string transid = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_transid:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_transid()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->transid().data(), this->transid().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(24)) goto parse_err;
break;
}
// optional uint32 err = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SWxpayQuery::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20498];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional string transid = 2;
if (has_transid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->transid().data(), this->transid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
2, this->transid(), output);
}
// optional uint32 err = 3;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SWxpayQuery::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20498];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional string transid = 2;
if (has_transid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->transid().data(), this->transid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2, this->transid(), target);
}
// optional uint32 err = 3;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SWxpayQuery::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20498];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional string transid = 2;
if (has_transid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->transid());
}
// optional uint32 err = 3;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SWxpayQuery::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SWxpayQuery* source =
::google::protobuf::internal::dynamic_cast_if_available<const SWxpayQuery*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SWxpayQuery::MergeFrom(const SWxpayQuery& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_transid()) {
set_transid(from.transid());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SWxpayQuery::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SWxpayQuery::CopyFrom(const SWxpayQuery& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SWxpayQuery::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SWxpayQuery::Swap(SWxpayQuery* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(transid_, other->transid_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SWxpayQuery::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SWxpayQuery_descriptor_;
metadata.reflection = SWxpayQuery_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CFirstBuy::kCmdFieldNumber;
const int CFirstBuy::kTypeFieldNumber;
#endif // !_MSC_VER
CFirstBuy::CFirstBuy()
: ::google::protobuf::Message() {
SharedCtor();
}
void CFirstBuy::InitAsDefaultInstance() {
}
CFirstBuy::CFirstBuy(const CFirstBuy& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CFirstBuy::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20499u;
type_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CFirstBuy::~CFirstBuy() {
SharedDtor();
}
void CFirstBuy::SharedDtor() {
if (this != default_instance_) {
}
}
void CFirstBuy::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CFirstBuy::descriptor() {
protobuf_AssignDescriptorsOnce();
return CFirstBuy_descriptor_;
}
const CFirstBuy& CFirstBuy::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CFirstBuy* CFirstBuy::default_instance_ = NULL;
CFirstBuy* CFirstBuy::New() const {
return new CFirstBuy;
}
void CFirstBuy::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20499u;
type_ = 0u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CFirstBuy::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20499];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_type;
break;
}
// optional uint32 type = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_type:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &type_)));
set_has_type();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CFirstBuy::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20499];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional uint32 type = 2;
if (has_type()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->type(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CFirstBuy::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20499];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional uint32 type = 2;
if (has_type()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->type(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CFirstBuy::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20499];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 type = 2;
if (has_type()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->type());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CFirstBuy::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CFirstBuy* source =
::google::protobuf::internal::dynamic_cast_if_available<const CFirstBuy*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CFirstBuy::MergeFrom(const CFirstBuy& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_type()) {
set_type(from.type());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CFirstBuy::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CFirstBuy::CopyFrom(const CFirstBuy& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CFirstBuy::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void CFirstBuy::Swap(CFirstBuy* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(type_, other->type_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CFirstBuy::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CFirstBuy_descriptor_;
metadata.reflection = CFirstBuy_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SFirstBuy::kCmdFieldNumber;
const int SFirstBuy::kIdFieldNumber;
const int SFirstBuy::kTransidFieldNumber;
const int SFirstBuy::kErrFieldNumber;
#endif // !_MSC_VER
SFirstBuy::SFirstBuy()
: ::google::protobuf::Message() {
SharedCtor();
}
void SFirstBuy::InitAsDefaultInstance() {
}
SFirstBuy::SFirstBuy(const SFirstBuy& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SFirstBuy::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20499u;
id_ = 0u;
transid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SFirstBuy::~SFirstBuy() {
SharedDtor();
}
void SFirstBuy::SharedDtor() {
if (transid_ != &::google::protobuf::internal::kEmptyString) {
delete transid_;
}
if (this != default_instance_) {
}
}
void SFirstBuy::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SFirstBuy::descriptor() {
protobuf_AssignDescriptorsOnce();
return SFirstBuy_descriptor_;
}
const SFirstBuy& SFirstBuy::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SFirstBuy* SFirstBuy::default_instance_ = NULL;
SFirstBuy* SFirstBuy::New() const {
return new SFirstBuy;
}
void SFirstBuy::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20499u;
id_ = 0u;
if (has_transid()) {
if (transid_ != &::google::protobuf::internal::kEmptyString) {
transid_->clear();
}
}
err_ = 0u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SFirstBuy::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20499];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_id;
break;
}
// optional uint32 id = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_id:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &id_)));
set_has_id();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(26)) goto parse_transid;
break;
}
// optional string transid = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_transid:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_transid()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->transid().data(), this->transid().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(32)) goto parse_err;
break;
}
// optional uint32 err = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SFirstBuy::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20499];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional uint32 id = 2;
if (has_id()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->id(), output);
}
// optional string transid = 3;
if (has_transid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->transid().data(), this->transid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
3, this->transid(), output);
}
// optional uint32 err = 4;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SFirstBuy::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20499];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional uint32 id = 2;
if (has_id()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->id(), target);
}
// optional string transid = 3;
if (has_transid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->transid().data(), this->transid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
3, this->transid(), target);
}
// optional uint32 err = 4;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SFirstBuy::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20499];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 id = 2;
if (has_id()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->id());
}
// optional string transid = 3;
if (has_transid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->transid());
}
// optional uint32 err = 4;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SFirstBuy::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SFirstBuy* source =
::google::protobuf::internal::dynamic_cast_if_available<const SFirstBuy*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SFirstBuy::MergeFrom(const SFirstBuy& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_id()) {
set_id(from.id());
}
if (from.has_transid()) {
set_transid(from.transid());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SFirstBuy::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SFirstBuy::CopyFrom(const SFirstBuy& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SFirstBuy::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SFirstBuy::Swap(SFirstBuy* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(id_, other->id_);
std::swap(transid_, other->transid_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SFirstBuy::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SFirstBuy_descriptor_;
metadata.reflection = SFirstBuy_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CFeedBack::kCmdFieldNumber;
const int CFeedBack::kUidFieldNumber;
const int CFeedBack::kUnameFieldNumber;
const int CFeedBack::kContentFieldNumber;
#endif // !_MSC_VER
CFeedBack::CFeedBack()
: ::google::protobuf::Message() {
SharedCtor();
}
void CFeedBack::InitAsDefaultInstance() {
}
CFeedBack::CFeedBack(const CFeedBack& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CFeedBack::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20500u;
uid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
uname_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
content_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CFeedBack::~CFeedBack() {
SharedDtor();
}
void CFeedBack::SharedDtor() {
if (uid_ != &::google::protobuf::internal::kEmptyString) {
delete uid_;
}
if (uname_ != &::google::protobuf::internal::kEmptyString) {
delete uname_;
}
if (content_ != &::google::protobuf::internal::kEmptyString) {
delete content_;
}
if (this != default_instance_) {
}
}
void CFeedBack::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CFeedBack::descriptor() {
protobuf_AssignDescriptorsOnce();
return CFeedBack_descriptor_;
}
const CFeedBack& CFeedBack::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CFeedBack* CFeedBack::default_instance_ = NULL;
CFeedBack* CFeedBack::New() const {
return new CFeedBack;
}
void CFeedBack::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20500u;
if (has_uid()) {
if (uid_ != &::google::protobuf::internal::kEmptyString) {
uid_->clear();
}
}
if (has_uname()) {
if (uname_ != &::google::protobuf::internal::kEmptyString) {
uname_->clear();
}
}
if (has_content()) {
if (content_ != &::google::protobuf::internal::kEmptyString) {
content_->clear();
}
}
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CFeedBack::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20500];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_uid;
break;
}
// optional string uid = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_uid:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_uid()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uid().data(), this->uid().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(26)) goto parse_uname;
break;
}
// optional string uname = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_uname:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_uname()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uname().data(), this->uname().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(34)) goto parse_content;
break;
}
// optional string content = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_content:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_content()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->content().data(), this->content().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CFeedBack::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20500];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional string uid = 2;
if (has_uid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uid().data(), this->uid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
2, this->uid(), output);
}
// optional string uname = 3;
if (has_uname()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uname().data(), this->uname().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
3, this->uname(), output);
}
// optional string content = 4;
if (has_content()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->content().data(), this->content().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
4, this->content(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CFeedBack::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20500];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional string uid = 2;
if (has_uid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uid().data(), this->uid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2, this->uid(), target);
}
// optional string uname = 3;
if (has_uname()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uname().data(), this->uname().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
3, this->uname(), target);
}
// optional string content = 4;
if (has_content()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->content().data(), this->content().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
4, this->content(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CFeedBack::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20500];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional string uid = 2;
if (has_uid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->uid());
}
// optional string uname = 3;
if (has_uname()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->uname());
}
// optional string content = 4;
if (has_content()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->content());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CFeedBack::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CFeedBack* source =
::google::protobuf::internal::dynamic_cast_if_available<const CFeedBack*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CFeedBack::MergeFrom(const CFeedBack& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_uid()) {
set_uid(from.uid());
}
if (from.has_uname()) {
set_uname(from.uname());
}
if (from.has_content()) {
set_content(from.content());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CFeedBack::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CFeedBack::CopyFrom(const CFeedBack& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CFeedBack::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void CFeedBack::Swap(CFeedBack* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(uid_, other->uid_);
std::swap(uname_, other->uname_);
std::swap(content_, other->content_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CFeedBack::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CFeedBack_descriptor_;
metadata.reflection = CFeedBack_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SFeedBack::kCmdFieldNumber;
const int SFeedBack::kErrFieldNumber;
#endif // !_MSC_VER
SFeedBack::SFeedBack()
: ::google::protobuf::Message() {
SharedCtor();
}
void SFeedBack::InitAsDefaultInstance() {
}
SFeedBack::SFeedBack(const SFeedBack& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SFeedBack::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20500u;
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SFeedBack::~SFeedBack() {
SharedDtor();
}
void SFeedBack::SharedDtor() {
if (this != default_instance_) {
}
}
void SFeedBack::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SFeedBack::descriptor() {
protobuf_AssignDescriptorsOnce();
return SFeedBack_descriptor_;
}
const SFeedBack& SFeedBack::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SFeedBack* SFeedBack::default_instance_ = NULL;
SFeedBack* SFeedBack::New() const {
return new SFeedBack;
}
void SFeedBack::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20500u;
err_ = 0u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SFeedBack::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20500];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_err;
break;
}
// optional uint32 err = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SFeedBack::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20500];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional uint32 err = 2;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SFeedBack::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20500];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional uint32 err = 2;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SFeedBack::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20500];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 err = 2;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SFeedBack::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SFeedBack* source =
::google::protobuf::internal::dynamic_cast_if_available<const SFeedBack*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SFeedBack::MergeFrom(const SFeedBack& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SFeedBack::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SFeedBack::CopyFrom(const SFeedBack& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SFeedBack::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SFeedBack::Swap(SFeedBack* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SFeedBack::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SFeedBack_descriptor_;
metadata.reflection = SFeedBack_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CSign::kCmdFieldNumber;
#endif // !_MSC_VER
CSign::CSign()
: ::google::protobuf::Message() {
SharedCtor();
}
void CSign::InitAsDefaultInstance() {
}
CSign::CSign(const CSign& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CSign::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20501u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CSign::~CSign() {
SharedDtor();
}
void CSign::SharedDtor() {
if (this != default_instance_) {
}
}
void CSign::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CSign::descriptor() {
protobuf_AssignDescriptorsOnce();
return CSign_descriptor_;
}
const CSign& CSign::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CSign* CSign::default_instance_ = NULL;
CSign* CSign::New() const {
return new CSign;
}
void CSign::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20501u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CSign::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20501];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CSign::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20501];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CSign::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20501];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CSign::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20501];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CSign::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CSign* source =
::google::protobuf::internal::dynamic_cast_if_available<const CSign*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CSign::MergeFrom(const CSign& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CSign::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CSign::CopyFrom(const CSign& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CSign::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void CSign::Swap(CSign* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CSign::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CSign_descriptor_;
metadata.reflection = CSign_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SSign::kCmdFieldNumber;
const int SSign::kIndexFieldNumber;
const int SSign::kCountFieldNumber;
const int SSign::kErrFieldNumber;
#endif // !_MSC_VER
SSign::SSign()
: ::google::protobuf::Message() {
SharedCtor();
}
void SSign::InitAsDefaultInstance() {
}
SSign::SSign(const SSign& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SSign::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20501u;
index_ = 0u;
count_ = 0u;
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SSign::~SSign() {
SharedDtor();
}
void SSign::SharedDtor() {
if (this != default_instance_) {
}
}
void SSign::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SSign::descriptor() {
protobuf_AssignDescriptorsOnce();
return SSign_descriptor_;
}
const SSign& SSign::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SSign* SSign::default_instance_ = NULL;
SSign* SSign::New() const {
return new SSign;
}
void SSign::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20501u;
index_ = 0u;
count_ = 0u;
err_ = 0u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SSign::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20501];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_index;
break;
}
// optional uint32 index = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_index:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &index_)));
set_has_index();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(24)) goto parse_count;
break;
}
// optional uint32 count = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_count:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &count_)));
set_has_count();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(32)) goto parse_err;
break;
}
// optional uint32 err = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SSign::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20501];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional uint32 index = 2;
if (has_index()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->index(), output);
}
// optional uint32 count = 3;
if (has_count()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->count(), output);
}
// optional uint32 err = 4;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SSign::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20501];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional uint32 index = 2;
if (has_index()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->index(), target);
}
// optional uint32 count = 3;
if (has_count()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->count(), target);
}
// optional uint32 err = 4;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SSign::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20501];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 index = 2;
if (has_index()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->index());
}
// optional uint32 count = 3;
if (has_count()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->count());
}
// optional uint32 err = 4;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SSign::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SSign* source =
::google::protobuf::internal::dynamic_cast_if_available<const SSign*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SSign::MergeFrom(const SSign& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_index()) {
set_index(from.index());
}
if (from.has_count()) {
set_count(from.count());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SSign::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SSign::CopyFrom(const SSign& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SSign::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SSign::Swap(SSign* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(index_, other->index_);
std::swap(count_, other->count_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SSign::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SSign_descriptor_;
metadata.reflection = SSign_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CSignList::kCmdFieldNumber;
#endif // !_MSC_VER
CSignList::CSignList()
: ::google::protobuf::Message() {
SharedCtor();
}
void CSignList::InitAsDefaultInstance() {
}
CSignList::CSignList(const CSignList& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CSignList::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20502u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CSignList::~CSignList() {
SharedDtor();
}
void CSignList::SharedDtor() {
if (this != default_instance_) {
}
}
void CSignList::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CSignList::descriptor() {
protobuf_AssignDescriptorsOnce();
return CSignList_descriptor_;
}
const CSignList& CSignList::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CSignList* CSignList::default_instance_ = NULL;
CSignList* CSignList::New() const {
return new CSignList;
}
void CSignList::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20502u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CSignList::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20502];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CSignList::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20502];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CSignList::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20502];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CSignList::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20502];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CSignList::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CSignList* source =
::google::protobuf::internal::dynamic_cast_if_available<const CSignList*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CSignList::MergeFrom(const CSignList& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CSignList::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CSignList::CopyFrom(const CSignList& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CSignList::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void CSignList::Swap(CSignList* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CSignList::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CSignList_descriptor_;
metadata.reflection = CSignList_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SSignList::kCmdFieldNumber;
const int SSignList::kSignFieldNumber;
const int SSignList::kCountFieldNumber;
const int SSignList::kRewardFieldNumber;
const int SSignList::kErrFieldNumber;
#endif // !_MSC_VER
SSignList::SSignList()
: ::google::protobuf::Message() {
SharedCtor();
}
void SSignList::InitAsDefaultInstance() {
}
SSignList::SSignList(const SSignList& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SSignList::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20502u;
sign_ = 0u;
count_ = 0u;
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SSignList::~SSignList() {
SharedDtor();
}
void SSignList::SharedDtor() {
if (this != default_instance_) {
}
}
void SSignList::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SSignList::descriptor() {
protobuf_AssignDescriptorsOnce();
return SSignList_descriptor_;
}
const SSignList& SSignList::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SSignList* SSignList::default_instance_ = NULL;
SSignList* SSignList::New() const {
return new SSignList;
}
void SSignList::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20502u;
sign_ = 0u;
count_ = 0u;
err_ = 0u;
}
reward_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SSignList::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20502];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_sign;
break;
}
// optional uint32 sign = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_sign:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &sign_)));
set_has_sign();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(24)) goto parse_count;
break;
}
// optional uint32 count = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_count:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &count_)));
set_has_count();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(34)) goto parse_reward;
break;
}
// repeated .protocol.SignAward reward = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_reward:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_reward()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(34)) goto parse_reward;
if (input->ExpectTag(40)) goto parse_err;
break;
}
// optional uint32 err = 5;
case 5: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SSignList::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20502];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional uint32 sign = 2;
if (has_sign()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->sign(), output);
}
// optional uint32 count = 3;
if (has_count()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->count(), output);
}
// repeated .protocol.SignAward reward = 4;
for (int i = 0; i < this->reward_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
4, this->reward(i), output);
}
// optional uint32 err = 5;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SSignList::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20502];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional uint32 sign = 2;
if (has_sign()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->sign(), target);
}
// optional uint32 count = 3;
if (has_count()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->count(), target);
}
// repeated .protocol.SignAward reward = 4;
for (int i = 0; i < this->reward_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
4, this->reward(i), target);
}
// optional uint32 err = 5;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SSignList::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20502];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 sign = 2;
if (has_sign()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->sign());
}
// optional uint32 count = 3;
if (has_count()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->count());
}
// optional uint32 err = 5;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
// repeated .protocol.SignAward reward = 4;
total_size += 1 * this->reward_size();
for (int i = 0; i < this->reward_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->reward(i));
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SSignList::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SSignList* source =
::google::protobuf::internal::dynamic_cast_if_available<const SSignList*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SSignList::MergeFrom(const SSignList& from) {
GOOGLE_CHECK_NE(&from, this);
reward_.MergeFrom(from.reward_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_sign()) {
set_sign(from.sign());
}
if (from.has_count()) {
set_count(from.count());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SSignList::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SSignList::CopyFrom(const SSignList& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SSignList::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SSignList::Swap(SSignList* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(sign_, other->sign_);
std::swap(count_, other->count_);
reward_.Swap(&other->reward_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SSignList::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SSignList_descriptor_;
metadata.reflection = SSignList_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int CMailAward::kCmdFieldNumber;
const int CMailAward::kIdFieldNumber;
#endif // !_MSC_VER
CMailAward::CMailAward()
: ::google::protobuf::Message() {
SharedCtor();
}
void CMailAward::InitAsDefaultInstance() {
}
CMailAward::CMailAward(const CMailAward& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void CMailAward::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20503u;
id_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
CMailAward::~CMailAward() {
SharedDtor();
}
void CMailAward::SharedDtor() {
if (this != default_instance_) {
}
}
void CMailAward::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CMailAward::descriptor() {
protobuf_AssignDescriptorsOnce();
return CMailAward_descriptor_;
}
const CMailAward& CMailAward::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
CMailAward* CMailAward::default_instance_ = NULL;
CMailAward* CMailAward::New() const {
return new CMailAward;
}
void CMailAward::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20503u;
id_ = 0u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool CMailAward::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20503];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_id;
break;
}
// required uint32 id = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_id:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &id_)));
set_has_id();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void CMailAward::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20503];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// required uint32 id = 2;
if (has_id()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->id(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* CMailAward::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20503];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// required uint32 id = 2;
if (has_id()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->id(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int CMailAward::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20503];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// required uint32 id = 2;
if (has_id()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->id());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void CMailAward::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const CMailAward* source =
::google::protobuf::internal::dynamic_cast_if_available<const CMailAward*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void CMailAward::MergeFrom(const CMailAward& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_id()) {
set_id(from.id());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void CMailAward::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CMailAward::CopyFrom(const CMailAward& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CMailAward::IsInitialized() const {
if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
return true;
}
void CMailAward::Swap(CMailAward* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(id_, other->id_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata CMailAward::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = CMailAward_descriptor_;
metadata.reflection = CMailAward_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int SMailAward::kCmdFieldNumber;
const int SMailAward::kIdFieldNumber;
const int SMailAward::kErrFieldNumber;
#endif // !_MSC_VER
SMailAward::SMailAward()
: ::google::protobuf::Message() {
SharedCtor();
}
void SMailAward::InitAsDefaultInstance() {
}
SMailAward::SMailAward(const SMailAward& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void SMailAward::SharedCtor() {
_cached_size_ = 0;
cmd_ = 20503u;
id_ = 0u;
err_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
SMailAward::~SMailAward() {
SharedDtor();
}
void SMailAward::SharedDtor() {
if (this != default_instance_) {
}
}
void SMailAward::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SMailAward::descriptor() {
protobuf_AssignDescriptorsOnce();
return SMailAward_descriptor_;
}
const SMailAward& SMailAward::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Hall_2eproto();
return *default_instance_;
}
SMailAward* SMailAward::default_instance_ = NULL;
SMailAward* SMailAward::New() const {
return new SMailAward;
}
void SMailAward::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
cmd_ = 20503u;
id_ = 0u;
err_ = 0u;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool SMailAward::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 cmd = 1 [default = 20503];
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &cmd_)));
set_has_cmd();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_id;
break;
}
// optional uint32 id = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_id:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &id_)));
set_has_id();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(24)) goto parse_err;
break;
}
// optional uint32 err = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_err:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &err_)));
set_has_err();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void SMailAward::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 cmd = 1 [default = 20503];
if (has_cmd()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->cmd(), output);
}
// optional uint32 id = 2;
if (has_id()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->id(), output);
}
// optional uint32 err = 3;
if (has_err()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->err(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* SMailAward::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 cmd = 1 [default = 20503];
if (has_cmd()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->cmd(), target);
}
// optional uint32 id = 2;
if (has_id()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->id(), target);
}
// optional uint32 err = 3;
if (has_err()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->err(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int SMailAward::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 cmd = 1 [default = 20503];
if (has_cmd()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->cmd());
}
// optional uint32 id = 2;
if (has_id()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->id());
}
// optional uint32 err = 3;
if (has_err()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->err());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void SMailAward::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const SMailAward* source =
::google::protobuf::internal::dynamic_cast_if_available<const SMailAward*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void SMailAward::MergeFrom(const SMailAward& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cmd()) {
set_cmd(from.cmd());
}
if (from.has_id()) {
set_id(from.id());
}
if (from.has_err()) {
set_err(from.err());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void SMailAward::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void SMailAward::CopyFrom(const SMailAward& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SMailAward::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void SMailAward::Swap(SMailAward* other) {
if (other != this) {
std::swap(cmd_, other->cmd_);
std::swap(id_, other->id_);
std::swap(err_, other->err_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata SMailAward::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = SMailAward_descriptor_;
metadata.reflection = SMailAward_reflection_;
return metadata;
}
// @@protoc_insertion_point(namespace_scope)
} // namespace protocol
// @@protoc_insertion_point(global_scope)
| [
"37165209+qianpeng0523@users.noreply.github.com"
] | 37165209+qianpeng0523@users.noreply.github.com |
e1ee3477052adbe80d9d5376af2ce6b10081a63f | 92d6188aa68681d5e518538f03cda09aa4ecfaab | /Source/Renderer/Renderpass/RenderpassAlt.cpp | 832e36a6d70622e6a4644284af9206df2b0fbac4 | [] | no_license | scsewell/Mantis | c768ab1cfb9324a9653b64bba415649ab225bca6 | 146d149cf3323f684abe3073c1a8d4be4fda3c95 | refs/heads/master | 2020-05-05T06:29:35.928276 | 2019-11-12T15:37:23 | 2019-11-12T15:37:23 | 179,790,395 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,315 | cpp | #include "stdafx.h"
#include "RenderpassAlt.h"
#include "Subpass.h"
#include "Renderer/Renderer.h"
#include "Renderer/RenderStage.h"
#define LOG_TAG MANTIS_TEXT("Renderpass")
namespace Mantis
{
Renderpass::Renderpass(
const RenderStage& renderStage,
const VkFormat& depthFormat,
const VkFormat& surfaceFormat,
const VkSampleCountFlagBits& samples
) :
m_renderpass(VK_NULL_HANDLE)
{
auto logicalDevice = Renderer::Get()->GetLogicalDevice();
// create the renderpasses attachment descriptions
eastl::vector<VkAttachmentDescription> attachmentDescriptions;
for (const auto& attachment : renderStage.GetAttachments())
{
auto attachmentSamples = attachment.IsMultisampled() ? samples : VK_SAMPLE_COUNT_1_BIT;
VkAttachmentDescription attachmentDescription = {};
attachmentDescription.samples = attachmentSamples;
attachmentDescription.loadOp = static_cast<VkAttachmentLoadOp>(attachment.GetLoadOp());
attachmentDescription.storeOp = static_cast<VkAttachmentStoreOp>(attachment.GetStoreOp());
attachmentDescription.stencilLoadOp = static_cast<VkAttachmentLoadOp>(Attachment::LoadOp::DontCare);
attachmentDescription.stencilStoreOp = static_cast<VkAttachmentStoreOp>(Attachment::StoreOp::DontCare);
attachmentDescription.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
switch (attachment.GetType())
{
case Attachment::Type::Image:
attachmentDescription.finalLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
attachmentDescription.format = attachment.GetFormat();
break;
case Attachment::Type::Depth:
attachmentDescription.finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
attachmentDescription.format = depthFormat;
break;
case Attachment::Type::Swapchain:
attachmentDescription.finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
attachmentDescription.format = surfaceFormat;
break;
}
attachmentDescriptions.emplace_back(attachmentDescription);
}
// describe each subpass
eastl::vector<eastl::unique_ptr<SubpassDescription>> subpasses;
for (const auto& subpass : renderStage.GetSubpasses())
{
eastl::vector<VkAttachmentReference> inputAttachments;
eastl::vector<VkAttachmentReference> colorAttachments;
eastl::vector<VkAttachmentReference> resolveAttachments;
eastl::optional<VkAttachmentReference> depthAttachment;
eastl::vector<uint32_t> preserveAttachments;
for (const auto& attachmentRef : subpass.GetAttachmentRefs())
{
auto attachment = renderStage.GetAttachment(attachmentRef.binding);
if (!attachment)
{
Logger::ErrorTF(LOG_TAG, "Failed to find a renderpass attachment bound to: %i!", attachmentRef.binding);
continue;
}
VkAttachmentReference attachmentReference = {};
attachmentReference.attachment = attachmentRef.binding;
switch (attachmentRef.mode)
{
case AttachmentMode::Input:
attachmentReference.layout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
inputAttachments.push_back(attachmentReference);
break;
case AttachmentMode::Color:
attachmentReference.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
colorAttachments.push_back(attachmentReference);
break;
case AttachmentMode::Resolve:
attachmentReference.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
resolveAttachments.push_back(attachmentReference);
break;
case AttachmentMode::Depth:
attachmentReference.layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
depthAttachment = attachmentReference;
break;
case AttachmentMode::Preserve:
preserveAttachments.push_back(attachmentRef.binding);
break;
default:
Logger::ErrorTF(LOG_TAG, "Unsupported attachment mode: %i!", attachmentRef.mode);
break;
}
}
subpasses.push_back(eastl::make_unique<SubpassDescription>(
VK_PIPELINE_BIND_POINT_GRAPHICS,
inputAttachments,
colorAttachments,
resolveAttachments,
depthAttachment,
preserveAttachments
));
}
eastl::vector<VkSubpassDescription> subpassDescriptions(subpasses.size());
for (const auto& subpass : subpasses)
{
subpassDescriptions.push_back(subpass->GetSubpassDescription());
}
// create the dependancies for the subpasses
eastl::vector<VkSubpassDependency> subpassDependencies;
for (const auto& subpass : renderStage.GetSubpasses())
{
auto dependencies = subpass.GetDependencies();
if (dependencies.size() == 0)
{
// If the subpass has no dependencies on other subpasses, createa an external subpass dependency
VkSubpassDependency dependency = {};
dependency.srcSubpass = VK_SUBPASS_EXTERNAL;
dependency.dstSubpass = subpass.GetBinding();
dependency.srcStageMask = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT;
dependency.dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
dependency.srcAccessMask = VK_ACCESS_MEMORY_READ_BIT;
dependency.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
dependency.dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT;
subpassDependencies.emplace_back(dependency);
}
else
{
// add dependencies on other subpasses
for (const auto& dependencySubpass : dependencies)
{
VkSubpassDependency dependency = {};
dependency.srcSubpass = dependencySubpass->GetBinding();
dependency.dstSubpass = subpass.GetBinding();
dependency.srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
dependency.dstStageMask = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT;
dependency.srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
dependency.dstAccessMask = VK_ACCESS_SHADER_READ_BIT;
dependency.dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT;
subpassDependencies.emplace_back(dependency);
}
}
}
// There should be only one subpass that is not a dependency, which is dependant on all
// other subpasses. This must also have the highest binding index. We can therefore assume
// that the last subpass gets the final dependency to the external source.
VkSubpassDependency dependency = {};
dependency.srcSubpass = renderStage.GetSubpasses().back().GetBinding();
dependency.dstSubpass = VK_SUBPASS_EXTERNAL;
dependency.srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
dependency.dstStageMask = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT;
dependency.srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
dependency.dstAccessMask = VK_ACCESS_MEMORY_READ_BIT;
dependency.dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT;
subpassDependencies.emplace_back(dependency);
// create the render pass
VkRenderPassCreateInfo renderPassCreateInfo = {};
renderPassCreateInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
renderPassCreateInfo.attachmentCount = static_cast<uint32_t>(attachmentDescriptions.size());
renderPassCreateInfo.pAttachments = attachmentDescriptions.data();
renderPassCreateInfo.subpassCount = static_cast<uint32_t>(subpassDescriptions.size());
renderPassCreateInfo.pSubpasses = subpassDescriptions.data();
renderPassCreateInfo.dependencyCount = static_cast<uint32_t>(subpassDependencies.size());
renderPassCreateInfo.pDependencies = subpassDependencies.data();
if (Renderer::Check(vkCreateRenderPass(*logicalDevice, &renderPassCreateInfo, nullptr, &m_renderpass)))
{
Logger::ErrorT(LOG_TAG, "Failed to create renderpass!");
}
}
Renderpass::~Renderpass()
{
auto logicalDevice = Renderer::Get()->GetLogicalDevice();
vkDestroyRenderPass(*logicalDevice, m_renderpass, nullptr);
}
}
| [
"scott.sewell@mail.mcgill.ca"
] | scott.sewell@mail.mcgill.ca |
3a356b99c1ed88bf89e7a0c86ca6436658c1fb86 | b4aff90b636412db70a2e2e2ab819a24d65cba2b | /voipengine/voipsdk/webrtc/src/chromium/src/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h | 86a0a7e5246ea274d3f82da229cb7377a2a23863 | [] | no_license | brainpoint/voip_ios | 9a9aebba88b3c5bb17108d7ed87c702f23dc6f12 | 5205f896b9e60881f52c0b12b1c5188c9608d83e | refs/heads/master | 2020-12-26T04:37:38.258937 | 2015-04-14T16:16:31 | 2015-04-14T16:16:31 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 13,064 | h | // Copyright 2014 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.
#ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_H_
#define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_H_
#include <vector>
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/prefs/pref_member.h"
#include "base/threading/thread_checker.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_configurator.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_statistics_prefs.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
#include "net/base/net_log.h"
#include "net/base/net_util.h"
#include "net/base/network_change_notifier.h"
#include "net/url_request/url_fetcher_delegate.h"
class PrefService;
namespace net {
class HostPortPair;
class HttpNetworkSession;
class HttpResponseHeaders;
class URLFetcher;
class URLRequestContextGetter;
}
namespace data_reduction_proxy {
class DataReductionProxyEventStore;
// The number of days of bandwidth usage statistics that are tracked.
const unsigned int kNumDaysInHistory = 60;
// The number of days of bandwidth usage statistics that are presented.
const unsigned int kNumDaysInHistorySummary = 30;
COMPILE_ASSERT(kNumDaysInHistorySummary <= kNumDaysInHistory,
DataReductionProxySettings_summary_too_long);
// Values of the UMA DataReductionProxy.StartupState histogram.
// This enum must remain synchronized with DataReductionProxyStartupState
// in metrics/histograms/histograms.xml.
enum ProxyStartupState {
PROXY_NOT_AVAILABLE = 0,
PROXY_DISABLED,
PROXY_ENABLED,
PROXY_STARTUP_STATE_COUNT,
};
// Values of the UMA DataReductionProxy.ProbeURL histogram.
// This enum must remain synchronized with
// DataReductionProxyProbeURLFetchResult in metrics/histograms/histograms.xml.
// TODO(marq): Rename these histogram buckets with s/DISABLED/RESTRICTED/, so
// their names match the behavior they track.
enum ProbeURLFetchResult {
// The probe failed because the Internet was disconnected.
INTERNET_DISCONNECTED = 0,
// The probe failed for any other reason, and as a result, the proxy was
// disabled.
FAILED_PROXY_DISABLED,
// The probe failed, but the proxy was already restricted.
FAILED_PROXY_ALREADY_DISABLED,
// The probe succeeded, and as a result the proxy was restricted.
SUCCEEDED_PROXY_ENABLED,
// The probe succeeded, but the proxy was already restricted.
SUCCEEDED_PROXY_ALREADY_ENABLED,
// This must always be last.
PROBE_URL_FETCH_RESULT_COUNT
};
// Central point for configuring the data reduction proxy.
// This object lives on the UI thread and all of its methods are expected to
// be called from there.
// TODO(marq): Convert this to be a KeyedService with an
// associated factory class, and refactor the Java call sites accordingly.
class DataReductionProxySettings
: public net::URLFetcherDelegate,
public net::NetworkChangeNotifier::IPAddressObserver {
public:
typedef std::vector<long long> ContentLengthList;
static bool IsProxyKeySetOnCommandLine();
DataReductionProxySettings(DataReductionProxyParams* params);
~DataReductionProxySettings() override;
DataReductionProxyParams* params() const {
return params_.get();
}
// Initializes the data reduction proxy with profile and local state prefs,
// and a |UrlRequestContextGetter| for canary probes. The caller must ensure
// that all parameters remain alive for the lifetime of the
// |DataReductionProxySettings| instance.
void InitDataReductionProxySettings(
PrefService* prefs,
net::URLRequestContextGetter* url_request_context_getter,
net::NetLog* net_log,
DataReductionProxyEventStore* event_store);
// Sets the |statistics_prefs_| to be used for data reduction proxy pref reads
// and writes.
void SetDataReductionProxyStatisticsPrefs(
DataReductionProxyStatisticsPrefs* statistics_prefs);
// Sets the |on_data_reduction_proxy_enabled_| callback and runs to register
// the DataReductionProxyEnabled synthetic field trial.
void SetOnDataReductionEnabledCallback(
const base::Callback<void(bool)>& on_data_reduction_proxy_enabled);
// Sets the logic the embedder uses to set the networking configuration that
// causes traffic to be proxied.
void SetProxyConfigurator(
DataReductionProxyConfigurator* configurator);
// Returns true if the proxy is enabled.
bool IsDataReductionProxyEnabled();
// Returns true if the alternative proxy is enabled.
bool IsDataReductionProxyAlternativeEnabled() const;
// Returns true if the proxy is managed by an adminstrator's policy.
bool IsDataReductionProxyManaged();
// Enables or disables the data reduction proxy. If a probe URL is available,
// and a probe request fails at some point, the proxy won't be used until a
// probe succeeds.
void SetDataReductionProxyEnabled(bool enabled);
// Enables or disables the alternative data reduction proxy configuration.
void SetDataReductionProxyAlternativeEnabled(bool enabled);
// Returns the time in microseconds that the last update was made to the
// daily original and received content lengths.
int64 GetDataReductionLastUpdateTime();
// Returns a vector containing the total size of all HTTP content that was
// received over the last |kNumDaysInHistory| before any compression by the
// data reduction proxy. Each element in the vector contains one day of data.
ContentLengthList GetDailyOriginalContentLengths();
// Returns aggregate received and original content lengths over the specified
// number of days, as well as the time these stats were last updated.
void GetContentLengths(unsigned int days,
int64* original_content_length,
int64* received_content_length,
int64* last_update_time);
// Records that the data reduction proxy is unreachable or not.
void SetUnreachable(bool unreachable);
// Returns whether the data reduction proxy is unreachable. Returns true
// if no request has successfully completed through proxy, even though atleast
// some of them should have.
bool IsDataReductionProxyUnreachable();
// Returns an vector containing the aggregate received HTTP content in the
// last |kNumDaysInHistory| days.
ContentLengthList GetDailyReceivedContentLengths();
ContentLengthList GetDailyContentLengths(const char* pref_name);
// net::URLFetcherDelegate:
void OnURLFetchComplete(const net::URLFetcher* source) override;
// Configures data reduction proxy and makes a request to the probe URL to
// determine server availability. |at_startup| is true when this method is
// called in response to creating or loading a new profile.
void MaybeActivateDataReductionProxy(bool at_startup);
protected:
void InitPrefMembers();
// Returns a fetcher for the probe to check if OK for the proxy to use SPDY.
// Virtual for testing.
virtual net::URLFetcher* GetURLFetcherForAvailabilityCheck();
// Virtualized for unit test support.
virtual PrefService* GetOriginalProfilePrefs();
// Sets the proxy configs, enabling or disabling the proxy according to
// the value of |enabled| and |alternative_enabled|. Use the alternative
// configuration only if |enabled| and |alternative_enabled| are true. If
// |restricted| is true, only enable the fallback proxy. |at_startup| is true
// when this method is called from InitDataReductionProxySettings.
virtual void SetProxyConfigs(bool enabled,
bool alternative_enabled,
bool restricted,
bool at_startup);
// Metrics method. Subclasses should override if they wish to provide
// alternatives.
virtual void RecordDataReductionInit();
virtual void AddDefaultProxyBypassRules();
// Writes a warning to the log that is used in backend processing of
// customer feedback. Virtual so tests can mock it for verification.
virtual void LogProxyState(bool enabled, bool restricted, bool at_startup);
// Virtualized for mocking. Records UMA containing the result of requesting
// the probe URL.
virtual void RecordProbeURLFetchResult(
data_reduction_proxy::ProbeURLFetchResult result);
// Virtualized for mocking. Records UMA specifying whether the proxy was
// enabled or disabled at startup.
virtual void RecordStartupState(
data_reduction_proxy::ProxyStartupState state);
// Virtualized for mocking. Returns the list of network interfaces in use.
virtual void GetNetworkList(net::NetworkInterfaceList* interfaces,
int policy);
DataReductionProxyConfigurator* configurator() {
return configurator_;
}
// Reset params for tests.
void ResetParamsForTest(DataReductionProxyParams* params);
private:
friend class DataReductionProxySettingsTestBase;
friend class DataReductionProxySettingsTest;
FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
TestAuthenticationInit);
FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
TestAuthHashGeneration);
FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
TestAuthHashGenerationWithOriginSetViaSwitch);
FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
TestResetDataReductionStatistics);
FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
TestIsProxyEnabledOrManaged);
FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
TestContentLengths);
FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
TestGetDailyContentLengths);
FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
TestMaybeActivateDataReductionProxy);
FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
TestOnIPAddressChanged);
FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
TestOnProxyEnabledPrefChange);
FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
TestInitDataReductionProxyOn);
FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
TestInitDataReductionProxyOff);
FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
TestBypassList);
FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
CheckInitMetricsWhenNotAllowed);
FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
TestSetProxyConfigs);
FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
TestSetProxyConfigsHoldback);
// NetworkChangeNotifier::IPAddressObserver:
void OnIPAddressChanged() override;
void OnProxyEnabledPrefChange();
void OnProxyAlternativeEnabledPrefChange();
void ResetDataReductionStatistics();
// Requests the proxy probe URL, if one is set. If unable to do so, disables
// the proxy, if enabled. Otherwise enables the proxy if disabled by a probe
// failure.
void ProbeWhetherDataReductionProxyIsAvailable();
// Disables use of the data reduction proxy on VPNs. Returns true if the
// data reduction proxy has been disabled.
bool DisableIfVPN();
// Generic method to get a URL fetcher.
net::URLFetcher* GetBaseURLFetcher(const GURL& gurl, int load_flags);
std::string key_;
bool restricted_by_carrier_;
bool enabled_by_user_;
bool disabled_on_vpn_;
bool unreachable_;
scoped_ptr<net::URLFetcher> fetcher_;
// A new BoundNetLog is created for each canary check so that we can correlate
// the request begin/end phases.
net::BoundNetLog bound_net_log_;
BooleanPrefMember spdy_proxy_auth_enabled_;
BooleanPrefMember data_reduction_proxy_alternative_enabled_;
PrefService* prefs_;
DataReductionProxyStatisticsPrefs* statistics_prefs_;
net::URLRequestContextGetter* url_request_context_getter_;
// The caller must ensure that the |net_log_|, if set, outlives this instance.
// It is used to create new instances of |bound_net_log_| on canary
// requests.
net::NetLog* net_log_;
// The caller must ensure that the |event_store_| outlives this instance.
DataReductionProxyEventStore* event_store_;
base::Callback<void(bool)> on_data_reduction_proxy_enabled_;
DataReductionProxyConfigurator* configurator_;
base::ThreadChecker thread_checker_;
scoped_ptr<DataReductionProxyParams> params_;
DISALLOW_COPY_AND_ASSIGN(DataReductionProxySettings);
};
} // namespace data_reduction_proxy
#endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_H_
| [
"houxuehua49@gmail.com"
] | houxuehua49@gmail.com |
cd0f9d7ac81ef4bead3c7a879624540689801fdf | 64e4fabf9b43b6b02b14b9df7e1751732b30ad38 | /src/chromium/gen/gen_combined/services/service_manager/public/mojom/service_manager.mojom-test-utils.h | d1a47329fab0c0c65574a514523c3f8f1dd7688b | [
"BSD-3-Clause"
] | permissive | ivan-kits/skia-opengl-emscripten | 8a5ee0eab0214c84df3cd7eef37c8ba54acb045e | 79573e1ee794061bdcfd88cacdb75243eff5f6f0 | refs/heads/master | 2023-02-03T16:39:20.556706 | 2020-12-25T14:00:49 | 2020-12-25T14:00:49 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,168 | h | // Copyright 2019 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.
#ifndef SERVICES_SERVICE_MANAGER_PUBLIC_MOJOM_SERVICE_MANAGER_MOJOM_TEST_UTILS_H_
#define SERVICES_SERVICE_MANAGER_PUBLIC_MOJOM_SERVICE_MANAGER_MOJOM_TEST_UTILS_H_
#include "services/service_manager/public/mojom/service_manager.mojom.h"
#include "base/component_export.h"
namespace service_manager {
namespace mojom {
class COMPONENT_EXPORT(SERVICE_MANAGER_MOJOM) ServiceManagerListenerInterceptorForTesting : public ServiceManagerListener {
virtual ServiceManagerListener* GetForwardingInterface() = 0;
void OnInit(std::vector<RunningServiceInfoPtr> running_services) override;
void OnServiceCreated(RunningServiceInfoPtr service) override;
void OnServiceStarted(const ::service_manager::Identity& identity, uint32_t pid_deprecated) override;
void OnServicePIDReceived(const ::service_manager::Identity& identity, uint32_t pid) override;
void OnServiceFailedToStart(const ::service_manager::Identity& identity) override;
void OnServiceStopped(const ::service_manager::Identity& identity) override;
};
class COMPONENT_EXPORT(SERVICE_MANAGER_MOJOM) ServiceManagerListenerAsyncWaiter {
public:
explicit ServiceManagerListenerAsyncWaiter(ServiceManagerListener* proxy);
~ServiceManagerListenerAsyncWaiter();
private:
ServiceManagerListener* const proxy_;
DISALLOW_COPY_AND_ASSIGN(ServiceManagerListenerAsyncWaiter);
};
class COMPONENT_EXPORT(SERVICE_MANAGER_MOJOM) ServiceManagerInterceptorForTesting : public ServiceManager {
virtual ServiceManager* GetForwardingInterface() = 0;
void AddListener(ServiceManagerListenerPtr listener) override;
};
class COMPONENT_EXPORT(SERVICE_MANAGER_MOJOM) ServiceManagerAsyncWaiter {
public:
explicit ServiceManagerAsyncWaiter(ServiceManager* proxy);
~ServiceManagerAsyncWaiter();
private:
ServiceManager* const proxy_;
DISALLOW_COPY_AND_ASSIGN(ServiceManagerAsyncWaiter);
};
} // namespace mojom
} // namespace service_manager
#endif // SERVICES_SERVICE_MANAGER_PUBLIC_MOJOM_SERVICE_MANAGER_MOJOM_TEST_UTILS_H_ | [
"trofimov_d_a@magnit.ru"
] | trofimov_d_a@magnit.ru |
1e57f2604229ba49bf90e102624f396f22097d31 | ab6bc87dda49fb95e15985b2d45136161e1c11e6 | /genWall.cpp | 9af0dd85e8ba7fd626b63a811772f829c17c0946 | [] | no_license | RaulPPelaez/OscillatingWall | 981067e0a7e60a44983822ea6ce81987cbac13b1 | 1445e66e5d20f03aa898a353fe803815c765424f | refs/heads/master | 2020-03-13T21:59:41.229805 | 2018-06-25T15:54:42 | 2018-06-25T15:54:42 | 131,307,959 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,587 | cpp |
#include"uammd/src/third_party/bravais/bravais.h"
#include<cstdio>
#include<iostream>
#include<vector>
#include<limits.h>
using namespace std;
template<class T>
T norm( T* v){
return v[0]*v[0]+v[1]*v[1]+v[2]*v[2];
}
int main(int argc, char* argv[]){
double Lx = std::stod(argv[1]);
double Ly = std::stod(argv[2]);
int nlayers = std::atoi(argv[3]);
double a = std::stod(argv[4]);
int Ngrid = Lx*Ly/a/a;
std::vector<float> layer(4*Ngrid, 0);
Bravais(layer.data(), tri, Ngrid,
Lx/a, Ly/a, 0,
1.0, NULL, NULL, true);
//auto pos = layer;
vector<float> pos;
pos.clear();
int nx = int(Lx/a+0.5);
int ny = int((Ly/a)/(sqrt(3)*0.5)+0.5);
if(ny%2 != 0) ny-=1;
double dr = Lx/nx*0.5;
double dry = Ly/ny/sqrt(3);
int p = 0;
pos.resize(4*nx*ny,0);
for(int i = 0; i<nx; i++){
for(int j = 0; j<ny; j++){
pos[4*p+0] = -Lx*0.5+ i*dr*2+((1-pow(-1.0, j))*0.5)*dr;
pos[4*p+1] = -Ly*0.5+ sqrt(3)*j*dry;
pos[4*p+2] = 0;
p++;
}
}
std::cout<<nlayers*(pos.size()/4)<<"\n";
//std::cout<<"#Lx="<<Lx*0.5<<";Ly="<<Ly*0.5<<";Lz="<<nlayers*0.5<<";"<<std::endl;
//for(int i = 0; i<pos.size()/4; i++){ pos[4*i+2] += -nlayers*a*0.5; }
for(int k = 0; k<nlayers; k++){
float sign = pow(-1, k);
if(k==0) sign=0;
for(int i = 0; i<pos.size()/4; i++){
pos[4*i+2] += dr*sqrt(6)/3.*2;
pos[4*i+1] += dry*sign*sqrt(3)/3.;
pos[4*i+0] += dr*sign;
for(int j = 0; j<3;j++){
std::cout<<pos[4*i+j]<<" ";
}
std::cout<<" 1\n";
}
}
return 0;
}
| [
"raul.perez@uam.es"
] | raul.perez@uam.es |
8ca90ee5625cdd987c347e4469f592ae6b710546 | 47575c44eda00228ba5198ba44e6907dfd5043b3 | /player/shared/AdvancedTargeting.cpp | 6307c98d7574af5c86d0801d60867a0c56b89bb9 | [] | no_license | BhupinderSD/Battleships | 6a58d6de2e03f21e13b149c572cab9bde3bbeb15 | 9b749a0fc23ca1e8ec1ce675e549eeb2bf5fe6a1 | refs/heads/main | 2023-03-22T01:26:38.449075 | 2021-03-24T13:59:53 | 2021-03-24T13:59:53 | 343,942,217 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,068 | cpp | //
// Created by Bhupinder Dhoofer on 23/03/2021.
//
#include "AdvancedTargeting.h"
/**
* Fires at random locations until a boat is hit. Once we have hit a boat and
* while it has not sunk, we traverse every valid surrounding coordinate till it
* has sunk.
*/
Coordinate AdvancedTargeting::getFireLocation(GameBoard &gameBoard, HitBoard &hitBoard, std::string &playerName) {
if (locationsToSearch.empty()) { // If we have no coordinates to search, fire at a random one.
return ::getAutoFireLocation(gameBoard, hitBoard, playerName);
}
Coordinate coordinateToSearch = locationsToSearch[0]; // Get the next location to search in the vector.
locationsToSearch.erase(locationsToSearch.begin()); // Remove the location that we are about to search.
::printFiringCoordinates(playerName, coordinateToSearch); // Prints the location this player is firing at.
return coordinateToSearch;
}
void AdvancedTargeting::saveHit(const Coordinate &hitLocation, HitStatus hitStatus) {
if (hitStatus == SUNK) { // Reset the current state since the boat we were looking for has sunk.
locationsToSearch.clear();
}
if (hitStatus == HIT) { // Save the surrounding locations so we can start hunting for the rest of the boat.
savePotentialLocations(hitLocation);
}
}
void AdvancedTargeting::savePotentialLocations(const Coordinate &hitLocation) {
int hitLocationXCoordinate = getNumberFromAsciiLabel(hitLocation.x);
Coordinate left;
left.x = ::getAsciiLabel(hitLocationXCoordinate - 1);
left.y = hitLocation.y;
Coordinate top;
top.x = ::getAsciiLabel(hitLocationXCoordinate);
top.y = hitLocation.y + 1;
Coordinate right;
right.x = ::getAsciiLabel(hitLocationXCoordinate + 1);
right.y = hitLocation.y;
Coordinate bottom;
bottom.x = ::getAsciiLabel(hitLocationXCoordinate);
bottom.y = hitLocation.y - 1;
Coordinate potentialLocations[] = {left, top, right, bottom};
for (const Coordinate& coordinate : potentialLocations) {
if (::isValidIndex(coordinate)) {
locationsToSearch.push_back(coordinate);
}
}
}
| [
"bhupinderbob@yahoo.com"
] | bhupinderbob@yahoo.com |
196107c908364f78d9c0b184313ab013da0bb23a | d52d5fdbcd848334c6b7799cad7b3dfd2f1f33e4 | /third_party/folly/folly/test/EndianTest.cpp | f3665093aa8062fd70a74ef282737e05b4d41c84 | [
"Apache-2.0"
] | permissive | zhiliaoniu/toolhub | 4109c2a488b3679e291ae83cdac92b52c72bc592 | 39a3810ac67604e8fa621c69f7ca6df1b35576de | refs/heads/master | 2022-12-10T23:17:26.541731 | 2020-07-18T03:33:48 | 2020-07-18T03:33:48 | 125,298,974 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,799 | cpp | /*
* Copyright 2011-present Facebook, 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
*
* 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 <folly/lang/Bits.h>
#include <folly/portability/GTest.h>
using namespace folly;
TEST(Endian, Basic) {
uint8_t v8 = 0x12;
uint8_t v8s = 0x12;
uint16_t v16 = 0x1234;
uint16_t v16s = 0x3412;
uint32_t v32 = 0x12345678;
uint32_t v32s = 0x78563412;
uint64_t v64 = 0x123456789abcdef0ULL;
uint64_t v64s = 0xf0debc9a78563412ULL;
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define GEN1(sz) \
EXPECT_EQ(v##sz, Endian::little(v##sz)); \
EXPECT_EQ(v##sz, Endian::little##sz(v##sz)); \
EXPECT_EQ(v##sz##s, Endian::big(v##sz)); \
EXPECT_EQ(v##sz##s, Endian::big##sz(v##sz));
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#define GEN1(sz) \
EXPECT_EQ(v##sz##s, Endian::little(v##sz)); \
EXPECT_EQ(v##sz##s, Endian::little##sz(v##sz)); \
EXPECT_EQ(v##sz, Endian::big(v##sz)); \
EXPECT_EQ(v##sz, Endian::big##sz(v##sz));
#else
# error Your machine uses a weird endianness!
#endif /* __BYTE_ORDER__ */
#define GEN(sz) \
EXPECT_EQ(v##sz##s, Endian::swap(v##sz)); \
EXPECT_EQ(v##sz##s, Endian::swap##sz(v##sz)); \
GEN1(sz);
GEN(8);
GEN(16)
GEN(32)
GEN(64)
#undef GEN
#undef GEN1
}
| [
"yangshengzhi1@bigo.sg"
] | yangshengzhi1@bigo.sg |
3a1ae63a1a19214eaac55be578e38e2daa128054 | fa2069464c2ab9866fe6d5dd656dc48670037ba0 | /include/pixiu/server/session/interface.hpp | 32bc7bbd5253c55762f58c5a12cd4f60c5a3ccaf | [
"MIT"
] | permissive | blockspacer/pixiu | 2b4f881094f3876dd9a30d8acf431d5020f5a041 | a75f06a363df0bdec37ff270b67ee877bfaed03a | refs/heads/master | 2022-03-11T08:54:56.031718 | 2019-08-22T19:20:34 | 2019-08-22T19:20:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 391 | hpp | #pragma once
#include <memory>
#include <boost/lockfree/spsc_queue.hpp>
#include <pixiu/macro.hpp>
#include <functional>
namespace pixiu::server_bits::session {
struct interface {
public:
virtual void async_handle_requests() = 0;
virtual ~interface() {}
};
using interface_ptr = std::shared_ptr<interface>;
}
namespace pixiu::server_bits {
using session_ptr = session::interface_ptr;
} | [
"CHChang810716@gmail.com"
] | CHChang810716@gmail.com |
97f9e3bb947d561e605a9729c92eee389f055e87 | c6ecad18dd41ea69c22baf78dfeb95cf9ba547d0 | /src/boost_1_42_0/boost/mpl/multiplies.hpp | 72621064bdc5c5286492aa0c2a758e8f91655919 | [
"BSL-1.0"
] | permissive | neuschaefer/qnap-gpl | b1418d504ebe17d7a31a504d315edac309430fcf | 7bb76f6cfe7abef08777451a75924f667cca335b | refs/heads/master | 2022-08-16T17:47:37.015870 | 2020-05-24T18:56:05 | 2020-05-24T18:56:05 | 266,605,194 | 3 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 1,435 | hpp |
#ifndef BOOST_MPL_MULTIPLIES_HPP_INCLUDED
#define BOOST_MPL_MULTIPLIES_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// 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/mpl for documentation.
// $Id: multiplies.hpp,v 1.1.1.1 2010/10/21 06:23:59 williamkao Exp $
// $Date: 2010/10/21 06:23:59 $
// $Revision: 1.1.1.1 $
#include <boost/mpl/times.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
#include <boost/mpl/aux_/preprocessor/default_params.hpp>
#include <boost/mpl/aux_/preprocessor/params.hpp>
#include <boost/mpl/aux_/config/ctps.hpp>
// backward compatibility header, deprecated
namespace boost { namespace mpl {
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
# define AUX778076_OP_ARITY BOOST_MPL_LIMIT_METAFUNCTION_ARITY
#else
# define AUX778076_OP_ARITY 2
#endif
template<
BOOST_MPL_PP_DEFAULT_PARAMS(AUX778076_OP_ARITY, typename N, na)
>
struct multiplies
: times< BOOST_MPL_PP_PARAMS(AUX778076_OP_ARITY, N) >
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(
AUX778076_OP_ARITY
, multiplies
, ( BOOST_MPL_PP_PARAMS(AUX778076_OP_ARITY, N) )
)
};
BOOST_MPL_AUX_NA_SPEC(AUX778076_OP_ARITY, multiplies)
#undef AUX778076_OP_ARITY
}}
#endif // BOOST_MPL_MULTIPLIES_HPP_INCLUDED
| [
"j.neuschaefer@gmx.net"
] | j.neuschaefer@gmx.net |
724c820bfab92402723c5c1a2820d6060a3ce481 | 16e7752576a3218334e6ed0a4947e02863c2c52a | /CPP_Apna college/if_else_practice.cpp | 5b766044ab9220d39bda0b1cd0288ba69e8c2bfb | [] | no_license | zanzaney/CPP-Data-Structures | 5aaac9501b3ca3d592555d3a108732fccb481301 | d2fcd2efa7e42b565fdb7965be36af8ddfae5c6d | refs/heads/master | 2023-01-27T16:06:00.695152 | 2020-12-08T15:22:39 | 2020-12-08T15:22:39 | 298,610,428 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 311 | cpp | #include<iostream>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
if(a>b){
if(a>c){
cout<<a<<" is greatest"<<endl;
}
}else if(b>c){
cout<<b<<" is the greatest"<<endl;
}else{
cout<<c<<" is the greatest"<<endl;
}
return 0;
}
| [
"archishmanzan@gmail.com"
] | archishmanzan@gmail.com |
e0993692758520f8067367163ad970584232600b | ebaaaffb2a7ff5991441e9ce2110f40c36185798 | /C++/command/party/NoCommand.h | a7f107e6ddfa9ccb0594daa03e07c3b0242e5d3f | [] | no_license | iMageChans/DesignModel | 6fa0e9322992f0003951e564c1e84449b4b76d33 | c4c59770b356db606e38f2c1bba278d8627cbac5 | refs/heads/master | 2020-12-28T01:39:44.541684 | 2020-02-18T00:02:57 | 2020-02-18T00:02:57 | 238,139,157 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 244 | h | //
// Created by Chans on 2020/2/7.
//
#ifndef PARTY_NOCOMMAND_H
#define PARTY_NOCOMMAND_H
#include "Command.h"
class NoCommand : public Command{
public:
void execute() override;
void undo() override;
};
#endif //PARTY_NOCOMMAND_H
| [
"imagechans@gmail.com"
] | imagechans@gmail.com |
9b5543979955e7554c59845272b06ff553da59b3 | e7c75acac5a06bc269cf8fbfa5c2abe9c9924693 | /src/script/bitcoinconsensus.cpp | 865688fe5e4622051d5a5eec5febd91a97fda0a6 | [
"MIT"
] | permissive | 7AC0B95/happy-coin | 857e797f9065cae240c4509b3d8d0ec17961116c | 1dbfaa50ac468f9cc5a9cab6310e2779b8f0f87c | refs/heads/master | 2023-08-13T21:15:59.339700 | 2021-05-15T15:49:18 | 2021-05-15T15:49:18 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,449 | cpp | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2018 The Bitcoin Core developers
// Copyright (c) 2021 The HAPPY Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <script/bitcoinconsensus.h>
#include <primitives/transaction.h>
#include <pubkey.h>
#include <script/interpreter.h>
#include <version.h>
namespace {
/** A class that deserializes a single CTransaction one time. */
class TxInputStream
{
public:
TxInputStream(int nTypeIn, int nVersionIn, const unsigned char *txTo, size_t txToLen) :
m_type(nTypeIn),
m_version(nVersionIn),
m_data(txTo),
m_remaining(txToLen)
{}
void read(char* pch, size_t nSize)
{
if (nSize > m_remaining)
throw std::ios_base::failure(std::string(__func__) + ": end of data");
if (pch == nullptr)
throw std::ios_base::failure(std::string(__func__) + ": bad destination buffer");
if (m_data == nullptr)
throw std::ios_base::failure(std::string(__func__) + ": bad source buffer");
memcpy(pch, m_data, nSize);
m_remaining -= nSize;
m_data += nSize;
}
template<typename T>
TxInputStream& operator>>(T&& obj)
{
::Unserialize(*this, obj);
return *this;
}
int GetVersion() const { return m_version; }
int GetType() const { return m_type; }
private:
const int m_type;
const int m_version;
const unsigned char* m_data;
size_t m_remaining;
};
inline int set_error(bitcoinconsensus_error* ret, bitcoinconsensus_error serror)
{
if (ret)
*ret = serror;
return 0;
}
struct ECCryptoClosure
{
ECCVerifyHandle handle;
};
ECCryptoClosure instance_of_eccryptoclosure;
} // namespace
/** Check that all specified flags are part of the libconsensus interface. */
static bool verify_flags(unsigned int flags)
{
return (flags & ~(bitcoinconsensus_SCRIPT_FLAGS_VERIFY_ALL)) == 0;
}
static int verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, CAmount amount,
const unsigned char *txTo , unsigned int txToLen,
unsigned int nIn, unsigned int flags, bitcoinconsensus_error* err)
{
if (!verify_flags(flags)) {
return set_error(err, bitcoinconsensus_ERR_INVALID_FLAGS);
}
try {
TxInputStream stream(SER_NETWORK, PROTOCOL_VERSION, txTo, txToLen);
CTransaction tx(deserialize, stream);
if (nIn >= tx.vin.size())
return set_error(err, bitcoinconsensus_ERR_TX_INDEX);
if (GetSerializeSize(tx, PROTOCOL_VERSION) != txToLen)
return set_error(err, bitcoinconsensus_ERR_TX_SIZE_MISMATCH);
// Regardless of the verification result, the tx did not error.
set_error(err, bitcoinconsensus_ERR_OK);
PrecomputedTransactionData txdata(tx);
return VerifyScript(tx.vin[nIn].scriptSig, CScript(scriptPubKey, scriptPubKey + scriptPubKeyLen), &tx.vin[nIn].scriptWitness, flags, TransactionSignatureChecker(&tx, nIn, amount, txdata), nullptr);
} catch (const std::exception&) {
return set_error(err, bitcoinconsensus_ERR_TX_DESERIALIZE); // Error deserializing
}
}
int bitcoinconsensus_verify_script_with_amount(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, int64_t amount,
const unsigned char *txTo , unsigned int txToLen,
unsigned int nIn, unsigned int flags, bitcoinconsensus_error* err)
{
CAmount am(amount);
return ::verify_script(scriptPubKey, scriptPubKeyLen, am, txTo, txToLen, nIn, flags, err);
}
int bitcoinconsensus_verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen,
const unsigned char *txTo , unsigned int txToLen,
unsigned int nIn, unsigned int flags, bitcoinconsensus_error* err)
{
if (flags & bitcoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS) {
return set_error(err, bitcoinconsensus_ERR_AMOUNT_REQUIRED);
}
CAmount am(0);
return ::verify_script(scriptPubKey, scriptPubKeyLen, am, txTo, txToLen, nIn, flags, err);
}
unsigned int bitcoinconsensus_version()
{
// Just use the API version for now
return BITCOINCONSENSUS_API_VER;
}
| [
"jfla15@student.aau.dk"
] | jfla15@student.aau.dk |
309bffcf550ecbcf3ef960cb8cb9a3581a29d4e5 | ba9adad5887e691cfd2775ea34576b7cddedd804 | /custom/structural_patterns/facade/Facade.h | 47d794c2831fa1af59c5aae788fc101d1883fd1e | [] | no_license | timothyshull/design_patterns | 25afa122ee0b091e3dbda25b1ed8e9a8a33727cf | 94b6c15baab98c44d70a8ea243e76b1084010002 | refs/heads/master | 2021-01-21T17:24:01.987743 | 2017-03-17T19:55:36 | 2017-03-17T19:55:36 | 85,349,123 | 4 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 391 | h | #ifndef FACADE_H
#define FACADE_H
class Subsystem_1 {
public:
Subsystem_1();
~Subsystem_1();
void operation();
};
class Subsystem_2 {
public:
Subsystem_2();
~Subsystem_2();
void operation();
};
class Facade {
public:
Facade();
~Facade();
void operation_wrapper();
private:
Subsystem_1* _subs1;
Subsystem_2* _subs2;
};
#endif //FACADE_H
| [
"timothyshull@gmail.com"
] | timothyshull@gmail.com |
c8ceedeed6c2c501481e9b2c331fe7787e3e8299 | 743288286a2642ff5eb4f7f40717bd11e505f323 | /src/fem/mesh/MESH_DIR.hpp | d1a6fabdfacf6b7a55c6ce692fbebb6e0fb4918e | [
"MIT"
] | permissive | dgmaths9/GALES-multi-fluid | 23a3b0d9d9a987bbf255139be7215be48573854f | 2e7b51cfc852a05258f073d646366913201f271c | refs/heads/master | 2023-04-19T02:28:56.150372 | 2022-11-28T18:44:22 | 2022-11-28T18:44:22 | 571,494,558 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 201 | hpp | #ifndef _GALES_MESH_DIR_HPP_
#define _GALES_MESH_DIR_HPP_
#include "point.hpp"
#include "node.hpp"
#include "element.hpp"
#include "mesh.hpp"
#include "quad.hpp"
#include "mesh_motion.hpp"
#endif
| [
"deepak.garg@ingv.it"
] | deepak.garg@ingv.it |
a23740df73d185c82d9ad6805109bae8ac2f7ae0 | c50a2978b7818d61a8d4260a0fdb366f56cb71c2 | /Source/mainwindow.h | 6a70ff111b291ec0f526225e9287b1024dc7a2ce | [] | no_license | Trinak/MorseCodeConverter | 02e24539188a553a529b53e4c7a6792bcd774664 | 28663a6bba38c6749313aa1a6ca4ad0f677c7d1a | refs/heads/master | 2020-05-17T00:09:56.002250 | 2015-01-06T03:32:06 | 2015-01-06T03:32:06 | 16,286,637 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 718 | h | #ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void on_textConvertButton_clicked();
void on_morseConvertButton_clicked();
void on_actionSave_triggered();
void on_actionOpen_triggered();
void on_actionOpen_Morse_Code_triggered();
void on_actionSave_Morse_Code_triggered();
void on_actionExit_triggered();
private:
QString convertToMorse(QString text);
QString convertToText(QString morse);
Ui::MainWindow *ui;
std::map<QString, QChar> morseToText;
};
#endif // MAINWINDOW_H
| [
"devon.arrington@gmail.com"
] | devon.arrington@gmail.com |
b82fb596b7cab00f1cddeaf4e2d2083333da9963 | 2e0413ede754657bb3bb9b56634abb4f3d2806b8 | /wrapper.cc | d7056c807fd39d3d7ff383123e48c8eb6cf5ef2a | [] | no_license | arranstewart/gprolog_wrapper | 87e1e211d027f1db9f88cc22c9429cb41fd5eab6 | a113086e3d2ba1c8dee25c5d1ce648c3721b2283 | refs/heads/master | 2021-01-20T10:13:11.358078 | 2017-05-10T08:37:35 | 2017-05-10T08:37:35 | 90,333,090 | 2 | 2 | null | 2020-07-01T11:10:04 | 2017-05-05T03:24:37 | C++ | UTF-8 | C++ | false | false | 7,581 | cc |
#include "wrapper.h"
#include <gprolog.h>
#include <vector>
#include <iostream>
#include <sstream>
#include <functional>
#include <exception>
using std::string;
using std::cout;
using std::endl;
using std::vector;
// set up #defines specifying the gprolog version you're using.
// if 1.3.0 (used on ubuntu) we set up some #defines so current (1.4)
// function names and types still work.
#define GPROLOG_VERSION_1_3_0
#ifdef GPROLOG_VERSION_1_3_0
#define PlBool Bool
#define Pl_Start_Prolog Start_Prolog
#define Pl_Find_Atom Find_Atom
#define Pl_Start_Prolog Start_Prolog
#define Pl_Stop_Prolog Stop_Prolog
#define PL_TRUE TRUE
#define PL_FALSE FALSE
#define Pl_Mk_Variable Mk_Variable
#define Pl_Mk_Atom Mk_Atom
#define Pl_Rd_Atom Rd_Atom
// Pl_Query_Next_Solution is actually fine as is.
#define Pl_Un_Proper_List_Check Un_Proper_List_Check
#define Pl_Write Write_Simple
#define Pl_Mk_Integer Mk_Integer
#define Pl_Create_Atom Create_Atom
#define Pl_Mk_Float Mk_Float
#define Pl_Atom_Nil Atom_Nil
#define Pl_Atom_Name Atom_Name
#define Pl_Rd_Atom_Check Rd_Atom_Check
#endif
// GPROLOG_VERSION_1_3_0
// wrappers around the C types. Gprolog just defines a lot of them as
// ints or longs, so we wrap them in structs.
// it's guaranteed (since the structs have no vtables) that a
// pointer to them points to the same spot as the first member.
// It's *not* guaranteed that the struct as a whole is of the same
// size (compilers are at liberty to add packing, for instane).
// So doing reinterpret_cast() between arrays of the two
// is not at all guaranteed to work. (Tho it does, currently, for gcc
// and clang.)
struct atom {
int atom_id;
};
struct term {
PlTerm the_term;
};
// empty structs. Just used as tags/phantoms to make creation
// of vectors of terms more readable.
struct variable {
};
struct nil {
};
// atom functions
/////////////////
string atom_to_str(atom at) {
string res { Pl_Atom_Name(at.atom_id) };
return res;
}
// this will probably result in some kind of (gprolog) error
// if the term is not, indeed, unified with an atom.
atom term_to_atom(term t) {
atom myAt { Pl_Rd_Atom_Check(t.the_term) } ;
return myAt;
}
template<typename T>
inline atom mk_atom(T) {
static_assert(sizeof(T) != sizeof(T), "func mk_atom must be specialized for this type");
}
// construct an atom from a char *.
template<>
inline atom mk_atom<const char *>(const char *str) {
// mersion 1.3 has a char *. If gprolog does indeed guarantee
// not to change the char *, the const_cast should be fine.
int at_id = Pl_Create_Atom(
const_cast<char *>(
str
)
);
return { at_id };
}
// get the nil atom
template<>
inline atom mk_atom<nil>(nil) {
return find_atom("[]");
};
inline atom find_atom(const char * atom_name) {
// The docco seems to promise that this will, in fact, be
// respected as const.
int my_atom_id = Find_Atom(
const_cast<char *>(
atom_name
)
);
(my_atom_id != -1) || ({
printf("couldn't find an atom '%s'!!!\n", atom_name);
exit(EXIT_FAILURE);
1;
});
return { my_atom_id };
}
// term functions
template<typename T>
inline term mk_term(T) {
static_assert(sizeof(T) != sizeof(T), "func mk_term must be specialized for this type");
}
template<>
inline term mk_term<long>(long l) {
return { Mk_Integer(l) };
}
template<>
inline term mk_term<int>(int l) {
return mk_term( (long) l);
}
template<>
inline term mk_term<double>(double d) {
return { Pl_Mk_Float( d ) };
}
template<>
inline term mk_term<atom>(atom a) {
return { Pl_Mk_Atom( a.atom_id ) };
}
/** usage:
* term my_var_term = mk_term( variable { } );
*
* variable is really just a tag, a phantom type, to show
* what we want to make.
*/
template<>
inline term mk_term<variable>(variable v) {
return { Pl_Mk_Variable() };
}
// API for queries & programs
class prolog_exception : public std::runtime_error {
public:
prolog_exception(string str)
: runtime_error( str )
{}
};
class oneSoln {
public:
oneSoln(const string & functor_name, std::initializer_list<term> args)
: m_functor_name(functor_name),
m_args(args)
{}
oneSoln(const string & functor_name, vector<term> args)
: m_functor_name(functor_name),
m_args(args)
{}
term arg(int i) {
return m_args.at(i);
}
/** call the functor with args, and just get one solution.
* returns result -
* PL_FAILURE on failure,
* PL_SUCCESS on success, and unifications will have been done, or
* it'll die on PL_EXCEPTION, but print the exception.
*/
int operator()(bool verbose=false) {
// we're actually going to fiddle with the contents.
// ah well.
term * args_ = const_cast<term *>(m_args.data());
PlTerm * pl_args = reinterpret_cast<PlTerm *>( args_);
atom functor = find_atom(m_functor_name.c_str() );
int result = Pl_Query_Call(functor.atom_id, m_args.size(), pl_args);
if (result == PL_EXCEPTION) {
PlTerm exception = Pl_Get_Exception();
Pl_Write(exception);
cout << "exception calling " << m_functor_name << endl;
std::ostringstream oss;
oss << "exception calling " << m_functor_name << endl;
throw prolog_exception( oss.str() );
}
if (verbose) {
cout << "\nresult of call to " << m_functor_name << "/"
<< m_args.size() << " was: " << result << endl;
}
return result;
}
private:
string m_functor_name;
const vector<term> m_args;
};
class call {
public:
call(std::function<void()> func)
: m_call(func)
{}
private:
void operator()() {
m_call();
}
std::function<void()> m_call;
friend class query;
};
class query {
public:
query()
: calls()
{}
query & add(call c) {
calls.push_back(c);
return *this;
}
private:
void operator()() {
Pl_Query_Begin(PL_TRUE);
for( auto it = calls.begin(); it != calls.end(); it++ ) {
call c = (*it);
c();
}
// TODO - provide version for queries where we expect multiple
// solns.
//Pl_Query_End(PL_RECOVER);
Pl_Query_End(PL_CUT);
}
vector<call> calls;
friend class program;
};
class program {
public:
program()
: queries(), hasBegun(false)
{}
program & add(query q) {
queries.push_back(q);
return *this;
}
void operator()() {
begin();
for( auto it = queries.begin(); it != queries.end(); it++ ) {
query q = (*it);
q();
}
Pl_Stop_Prolog();
}
~program() {
if (hasBegun) {
end(); }
}
private:
vector<query> queries;
void begin() {
Pl_Start_Prolog(0, NULL);
hasBegun = true;
}
void end() {
Pl_Stop_Prolog();
hasBegun = false;
}
bool hasBegun;
};
void example() {
query q1;
q1.add(
call { []() -> void {
const auto nil_at = mk_atom( nil {} );
cout << "try write nil" << endl;
int res = oneSoln {"write",{ mk_term(nil_at)}} (true);
}}
).add(
call { []() -> void {
int res;
const auto nil_at = mk_atom( nil {} );
oneSoln mycall("length", {
mk_term(nil_at), mk_term(variable{})
});
res = mycall(true);
oneSoln writeArg("write", { mycall.arg(1) } );
res = writeArg(true);
}}
);
program p {};
p.add(q1);
p();
}
| [
"19115656@student.uwa.edu.au"
] | 19115656@student.uwa.edu.au |
e3fb1f72f3faae43805683e7443fde5638862406 | 7d71fa3604d4b0538f19ed284bc5c7d8b52515d2 | /Clients/AG/Pm8/Unused Projects/ConnMgr.unused/prefonl.cpp | 33ef2dd856ff3d0ffe7a6c42ab0d0d556286e3bf | [] | no_license | lineCode/ArchiveGit | 18e5ddca06330018e4be8ab28c252af3220efdad | f9cf965cb7946faa91b64e95fbcf8ad47f438e8b | refs/heads/master | 2020-12-02T09:59:37.220257 | 2016-01-20T23:55:26 | 2016-01-20T23:55:26 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 22,250 | cpp | /***************************************************************************
* FILE: PREFONL.CPP *
* SUMMARY: Property Page for Online configuration. *
* AUTHOR: Dennis Plotzke *
* ------------------------------------------------------------------------*
* Initials Legend: *
* DGP Dennis Plotzke *
* ------------------------------------------------------------------------*
* Revision History *
* *
* Date Initials Description of Change *
* ------------------------------------------------------------------------*
//
// $Log: /PM8/ConnMgr/prefonl.cpp $
//
// 1 3/03/99 6:14p Gbeddow
//
// 1 10/19/98 11:18a Dennis
//
// 10 8/29/98 8:23a Dennis
// Messages and saving of online settings only when visiting that dialog
//
// 9 8/24/98 5:38p Mwilson
// enabled more helpful hints
//
// 8 8/12/98 1:58p Mwilson
// hide checkboxes for web publishing for AG projects
//
// 7 7/17/98 5:49p Johno
// Support "Web Publish Warning" checkbox in CPreferencesOnlinePage
//
// 6 7/14/98 6:34p Jayn
//
// 5 6/03/98 1:42p Johno
// Added web page design checker control, log
//
* 1/27/98 DGP Created *
***************************************************************************/
#include "stdafx.h"
#include "resource.h"
#include "prefonl.h"
#include "ConnSet.h"
#include "util.h"
#include "inifile.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
void AFXAPI DDV_MinChars(CDataExchange* pDX, CString const &value, int nMinChars)
{
if (pDX->m_bSaveAndValidate && value.GetLength() < nMinChars)
{
CString csMessage, csResource;
csResource.LoadString(IDS_DDV_MINCHARS);
ASSERT(!csResource.IsEmpty());
csMessage.Format(csResource, nMinChars);
AfxMessageBox(csMessage);
csResource.Empty(); // exception prep
csMessage.Empty(); // exception prep
pDX->Fail();
}
}
/////////////////////////////////////////////////////////////////////////////
// CPreferencesOnlinePage dialog
CPreferencesOnlinePage::CPreferencesOnlinePage()
: CDialog(CPreferencesOnlinePage::IDD)
{
//{{AFX_DATA_INIT(CPreferencesOnlinePage)
m_nCurDialup = -1;
//}}AFX_DATA_INIT
m_pConnSettings = NULL;
m_bOwnSettings = FALSE;
}
CPreferencesOnlinePage::~CPreferencesOnlinePage()
{
DeInit();
}
void CPreferencesOnlinePage::DeInit()
{
if(m_bOwnSettings)
{
delete m_pConnSettings;
m_pConnSettings = NULL;
m_bOwnSettings = FALSE;
}
}
void CPreferencesOnlinePage::InitSettings(CConnectionSettings * pConnSettings)
{
m_pConnSettings = pConnSettings;
}
#ifndef IS_PROPERTY_PAGE
int CPreferencesOnlinePage::DoModal(CConnectionSettings * pConnSettings)
{
InitSettings(pConnSettings);
return INHERITED::DoModal();
}
#endif
/*
int CPreferencesOnlinePage::DoModal()
{
int nRetCode;
nRetCode = CDialog::DoModal();
DeInit();
return nRetCode;
}
*/
void CPreferencesOnlinePage::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPreferencesOnlinePage)
DDX_Control(pDX, IDC_CONNECTION_MODEM, m_btnModem);
DDX_Control(pDX, IDC_CONNECTION_DIRECT, m_btnDirect);
DDX_Control(pDX, IDC_DIALUP_CONNECTIONS, m_comboDialups);
DDX_Control(pDX, IDC_CONNECTION_MODEM_PROPERTIES, m_btnAdvanced);
DDX_CBIndex(pDX, IDC_DIALUP_CONNECTIONS, m_nCurDialup);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPreferencesOnlinePage, CDialog)
//{{AFX_MSG_MAP(CPreferencesOnlinePage)
ON_BN_CLICKED(IDC_CONNECTION_MODEM_PROPERTIES, OnConnectionModemProperties)
ON_BN_CLICKED(IDC_CONNECTION_MODEM, OnConnectionModem)
ON_BN_CLICKED(IDC_CONNECTION_DIRECT, OnConnectionDirect)
ON_CBN_SELCHANGE(IDC_DIALUP_CONNECTIONS, OnSelchangeDialupConnections)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPreferencesOnlinePage message handlers
void CPreferencesOnlinePage::OnConnectionModem()
{
if(m_btnModem.GetCheck())
{
m_comboDialups.EnableWindow(TRUE);
m_btnAdvanced.EnableWindow(TRUE);
}
}
void CPreferencesOnlinePage::OnConnectionDirect()
{
if(m_btnDirect.GetCheck())
{
m_comboDialups.EnableWindow(FALSE);
m_btnAdvanced.EnableWindow(FALSE);
}
}
void CPreferencesOnlinePage::OnSelchangeDialupConnections()
{
BOOL bEnableAdvanced = FALSE;
CComboBox *pDialupsCombo;
CConnectionSettings::Type connectType = CConnectionSettings::typeNone;
UpdateData(TRUE);
pDialupsCombo = (CComboBox*) GetDlgItem(IDC_DIALUP_CONNECTIONS);
connectType = (CConnectionSettings::Type) pDialupsCombo->GetItemData(m_nCurDialup);
if(connectType != CConnectionSettings::typeModemDialup)
bEnableAdvanced = TRUE;
m_btnAdvanced.EnableWindow(bEnableAdvanced);
m_pConnSettings->SetType(connectType);
m_pConnSettings->GetSettings();
}
BOOL CPreferencesOnlinePage::OnInitDialog()
{
CComboBox *pDialupsCombo;
CButton *pBtnModem, *pBtnDirect;
CString csResource;
m_bSetActiveOnce = FALSE;
CDialog::OnInitDialog();
m_bVisitedThisPage = FALSE;
#if 0
BOOL bAG = GetConfiguration()->Product() == CPrintMasterConfiguration::plAmericanGreetings;
if(bAG)
{
CWnd* pWndDesign = GetDlgItem(IDC_DESIGN_CHECK);
if(pWndDesign )
pWndDesign->ShowWindow(SW_HIDE);
CWnd* pWndCheck = GetDlgItem(IDC_USE_PROMPT);
if(pWndCheck )
pWndCheck->ShowWindow(SW_HIDE);
}
#endif
m_bOwnSettings = FALSE;
DeInit();
if(m_pConnSettings == NULL)
{
m_bOwnSettings = TRUE;
m_pConnSettings = new CConnectionSettings;
m_pConnSettings->Update(FALSE, FALSE);
}
pBtnModem = (CButton *) GetDlgItem(IDC_CONNECTION_MODEM);
ASSERT(pBtnModem);
pBtnDirect = (CButton *) GetDlgItem(IDC_CONNECTION_DIRECT);
ASSERT(pBtnDirect);
if(m_pConnSettings->GetType() != CConnectionSettings::typeDirect)
{
if(pBtnModem)
pBtnModem->SetCheck(1);
m_comboDialups.EnableWindow(TRUE);
m_btnAdvanced.EnableWindow(TRUE);
}
else
{
if(pBtnDirect)
pBtnDirect->SetCheck(1);
m_comboDialups.EnableWindow(FALSE);
m_btnAdvanced.EnableWindow(FALSE);
}
pDialupsCombo = (CComboBox*) GetDlgItem(IDC_DIALUP_CONNECTIONS);
if(pDialupsCombo)
{
CDialupConnections *pDialups;
int nItemIndex=-1;
int nModemAOLIndex, nCompuServeIndex;
int nModemDialupIndex, nDirectIndex, nModemCustomIndex;
BOOL bEnableAdvanced;
nModemAOLIndex = nModemDialupIndex = nDirectIndex = nModemCustomIndex = -1;
if(m_pConnSettings->IsAOL95Installed())
{
csResource.LoadString(IDS_AOL);
ASSERT(!csResource.IsEmpty());
if(!csResource.IsEmpty())
nModemAOLIndex = pDialupsCombo->AddString(csResource);
ASSERT(nModemAOLIndex >= 0);
if(nModemAOLIndex >= 0)
pDialupsCombo->SetItemData(
nModemAOLIndex,
(DWORD) CConnectionSettings::typeModemAOL);
}
if(m_pConnSettings->IsCompuServeInstalled())
{
csResource.LoadString(IDS_COMPUSERVE);
ASSERT(!csResource.IsEmpty());
if(!csResource.IsEmpty())
nCompuServeIndex = pDialupsCombo->AddString(csResource);
ASSERT(nCompuServeIndex >= 0);
if(nCompuServeIndex >= 0)
pDialupsCombo->SetItemData(
nCompuServeIndex,
(DWORD) CConnectionSettings::typeModemCompuServe);
}
pDialups = m_pConnSettings->GetDialups();
ASSERT(pDialups);
if(pDialups->GetEntryCount())
{
csResource.LoadString(IDS_DIALUP);
ASSERT(!csResource.IsEmpty());
if(!csResource.IsEmpty())
nModemDialupIndex = pDialupsCombo->AddString(csResource);
ASSERT(nModemDialupIndex >= 0);
if(nModemDialupIndex >= 0)
pDialupsCombo->SetItemData(
nModemDialupIndex,
(DWORD) CConnectionSettings::typeModemDialup);
}
csResource.LoadString(IDS_CUSTOM_CONNECTION);
ASSERT(!csResource.IsEmpty());
if(!csResource.IsEmpty())
nModemCustomIndex = pDialupsCombo->AddString(csResource);
ASSERT(nModemCustomIndex >= 0);
if(nModemCustomIndex >= 0)
pDialupsCombo->SetItemData(
nModemCustomIndex,
(DWORD) CConnectionSettings::typeModemCustom);
bEnableAdvanced = FALSE;
switch(m_pConnSettings->GetType())
{
case CConnectionSettings::typeModemAOL:
nItemIndex = nModemAOLIndex;
break;
case CConnectionSettings::typeModemCompuServe:
nItemIndex = nCompuServeIndex;
break;
case CConnectionSettings::typeModemDialup:
nItemIndex = nModemDialupIndex;
break;
case CConnectionSettings::typeModemCustom:
nItemIndex = nModemCustomIndex;
if(nItemIndex >= 0)
bEnableAdvanced = TRUE;
break;
case CConnectionSettings::typeDirect:
nItemIndex = nDirectIndex;
break;
case CConnectionSettings::typeNone:
default:
nItemIndex = -1;
break;
}
if(m_pConnSettings->GetType() != CConnectionSettings::typeDirect)
m_btnAdvanced.EnableWindow(bEnableAdvanced);
if(nItemIndex < 0)
nItemIndex = 0;
m_nCurDialup = nItemIndex;
UpdateData(FALSE);
// Simulate SelChange(), Why doesn't UpdateData() do this?
OnSelchangeDialupConnections();
m_pConnSettings->GetSettings();
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CPreferencesOnlinePage::OnOK()
{
CComboBox *pDialupsCombo;
CButton *pBtnModem;
int nCurSel;
CString csName;
CConnectionSettings::Type connectType = CConnectionSettings::typeNone;
#ifdef IS_PROPERTY_PAGE
if(!m_bVisitedThisPage)
return;
#endif
UpdateData(TRUE); // Update Member variables
pBtnModem = (CButton *) GetDlgItem(IDC_CONNECTION_MODEM);
if(pBtnModem->GetCheck())
{
pDialupsCombo = (CComboBox*) GetDlgItem(IDC_DIALUP_CONNECTIONS);
nCurSel = pDialupsCombo->GetCurSel();
ASSERT(nCurSel >= 0);
if(nCurSel >= 0)
{
pDialupsCombo->GetLBText(nCurSel, csName);
connectType = (CConnectionSettings::Type) pDialupsCombo->GetItemData(nCurSel);
}
}
else
{
csName.LoadString(IDS_DIRECT_CONNECTION);
ASSERT(!csName.IsEmpty());
connectType = CConnectionSettings::typeDirect;
}
if(connectType != CConnectionSettings::typeModemCustom)
m_pConnSettings->SetName(csName);
else if(m_comboDialups.IsWindowEnabled())
{
CConnectionSettings::Type connectType = CConnectionSettings::typeNone;
CComboBox *pDialupsCombo;
CString csFileName;
BOOL bValidData;
pDialupsCombo = (CComboBox*) GetDlgItem(IDC_DIALUP_CONNECTIONS);
connectType = (CConnectionSettings::Type) pDialupsCombo->GetItemData(m_nCurDialup);
csFileName = m_pConnSettings->GetAppFileName();
if(!Util::FileExists(csFileName))
{
CString csResource;
csResource.LoadString(IDS_ONLINE_MISSING_APPPATH);
ASSERT(!csResource.IsEmpty());
AfxMessageBox(csResource);
csResource.Empty();
csFileName.Empty();
bValidData = FALSE;
}
if(!bValidData)
return;
}
m_pConnSettings->SetType(connectType);
m_pConnSettings->SaveSettings();
CDialog::OnOK(); // End dialog
}
void CPreferencesOnlinePage::OnConnectionModemProperties()
{
int nRetVal;
CString csAppFileName;
CConnectionSettingsAdvanced dlgAdvancedSettings;
nRetVal = dlgAdvancedSettings.DoModal(m_pConnSettings);
return;
}
#ifdef IS_PROPERTY_PAGE
BOOL CPreferencesOnlinePage::OnSetActive()
{
BOOL bSetActive = INHERITED::OnSetActive();
if(!m_bSetActiveOnce)
m_bSetActiveOnce = TRUE;
else if(!m_bVisitedThisPage)
{
m_pConnSettings->Update(FALSE, TRUE);
m_bVisitedThisPage = TRUE;
}
return bSetActive;
}
BOOL CPreferencesOnlinePage::OnKillActive()
{
BOOL bValidData = TRUE;
INHERITED::OnKillActive();
if(m_bVisitedThisPage)
{
CConnectionSettings::Type connectType = CConnectionSettings::typeNone;
CComboBox *pDialupsCombo;
CString csFileName;
pDialupsCombo = (CComboBox*) GetDlgItem(IDC_DIALUP_CONNECTIONS);
connectType = (CConnectionSettings::Type) pDialupsCombo->GetItemData(m_nCurDialup);
if(m_comboDialups.IsWindowEnabled() &&
connectType == CConnectionSettings::typeModemCustom)
{
csFileName = m_pConnSettings->GetAppFileName();
if(!Util::FileExists(csFileName))
{
CString csResource;
LoadConfigurationString(IDS_ONLINE_MISSING_APPPATH, csResource);
ASSERT(!csResource.IsEmpty());
AfxMessageBox(csResource);
csResource.Empty();
csFileName.Empty();
bValidData = FALSE;
}
}
}
return bValidData;
}
#endif
/////////////////////////////////////////////////////////////////////////////
// CConnectionSettingsAdvanced dialog
CConnectionSettingsAdvanced::CConnectionSettingsAdvanced(CWnd* pParent /*=NULL*/)
: CDialog(CConnectionSettingsAdvanced::IDD, pParent)
{
//{{AFX_DATA_INIT(CConnectionSettingsAdvanced)
m_dwFirstCheck = 0;
m_dwTimeOut = 0;
m_csAppTitle = _T("");
m_csAppPathLabel = _T("");
m_bUsesDialup = FALSE;
m_bRestoreAutodial = FALSE;
//}}AFX_DATA_INIT
m_csFileName = "*.exe";
}
void CConnectionSettingsAdvanced::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CConnectionSettingsAdvanced)
DDX_Control(pDX, IDC_CONNECTION_RESTORE_AUTODIAL, m_btnRestoreAutodial);
DDX_Control(pDX, IDC_CONNECTION_PROGRAM, m_btnAppPath);
DDX_Text(pDX, IDC_CONNECTION_FIRSTCHECK, m_dwFirstCheck);
DDV_MinMaxDWord(pDX, m_dwFirstCheck, 1, 120);
DDX_Text(pDX, IDC_CONNECTION_TIMEOUT, m_dwTimeOut);
DDV_MinMaxDWord(pDX, m_dwTimeOut, 1, 9999);
DDX_Text(pDX, IDC_CONNECTION_APPTITLE, m_csAppTitle);
DDV_MaxChars(pDX, m_csAppTitle, 30);
DDX_Text(pDX, IDC_CONNECTION_APPPATH_LABEL, m_csAppPathLabel);
DDX_Check(pDX, IDC_CONNECTION_USES_DIALUP, m_bUsesDialup);
DDX_Check(pDX, IDC_CONNECTION_RESTORE_AUTODIAL, m_bRestoreAutodial);
//}}AFX_DATA_MAP
DDX_Text(pDX, IDC_CONNECTION_APPTITLE, m_csAppTitle);
DDV_MinChars(pDX, m_csAppTitle, 1);
}
BEGIN_MESSAGE_MAP(CConnectionSettingsAdvanced, CDialog)
//{{AFX_MSG_MAP(CConnectionSettingsAdvanced)
ON_BN_CLICKED(IDC_CONNECTION_PROGRAM, OnConnectionProgram)
ON_BN_CLICKED(IDC_CONNECTION_USES_DIALUP, OnConnectionUsesDialup)
ON_UPDATE_COMMAND_UI(IDC_CONNECTION_USES_DIALUP, OnUpdateAutodial)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CConnectionSettingsAdvanced message handlers
void CConnectionSettingsAdvanced::SetAppTitle(LPCSTR szAppTitle)
{
m_csAppTitle = szAppTitle;
}
LPCSTR CConnectionSettingsAdvanced::GetAppTitle() const
{
return m_csAppTitle;
}
void CConnectionSettingsAdvanced::SetAppFileName(LPCSTR szFileName)
{
m_csFileName = szFileName;
m_csAppPathLabel = m_csFileName;
}
LPCSTR CConnectionSettingsAdvanced::GetAppFileName() const
{
return m_csFileName;
}
int CConnectionSettingsAdvanced::DoModal(CConnectionSettings *pConnSettings)
{
int nRetVal;
ASSERT(pConnSettings);
if(pConnSettings == NULL)
return IDCANCEL;
m_pConnSettings = pConnSettings;
SetAppTitle(m_pConnSettings->GetName());
SetAppFileName(m_pConnSettings->GetAppFileName());
SetTimeOut(m_pConnSettings->GetTimeOut());
SetFirstCheck(m_pConnSettings->GetFirstCheck());
m_bUsesDialup = m_pConnSettings->WatchForDialup();
m_bRestoreAutodial = m_pConnSettings->RestoreAutodial();
nRetVal = CDialog::DoModal();
if(nRetVal == IDOK)
{
m_pConnSettings->SetTimeOut(GetTimeOut());
m_pConnSettings->SetFirstCheck(GetFirstCheck());
m_pConnSettings->SetName(GetAppTitle());
m_pConnSettings->SetAppFileName(GetAppFileName());
m_pConnSettings->SetWatchForDialup(m_bUsesDialup);
m_pConnSettings->SetRestoreAutodial(m_bRestoreAutodial);
m_pConnSettings->SaveSettings();
}
return nRetVal;
}
BOOL CConnectionSettingsAdvanced::OnInitDialog()
{
CDialog::OnInitDialog();
if(m_pConnSettings->GetType() == CConnectionSettings::typeModemAOL)
{
CEdit *pEditAppTitle;
m_btnAppPath.EnableWindow(FALSE);
pEditAppTitle = (CEdit *) GetDlgItem(IDC_CONNECTION_APPTITLE);
ASSERT(pEditAppTitle);
if(pEditAppTitle)
pEditAppTitle->EnableWindow(FALSE);
}
m_btnRestoreAutodial.EnableWindow(!m_bUsesDialup);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CConnectionSettingsAdvanced::OnConnectionProgram()
{
CString csPath, csResource;
Util::SplitPath(m_csFileName, &csPath,NULL);
csPath += "*.exe";
CFileDialog cfDialog(TRUE, "exe", csPath, OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_EXTENSIONDIFFERENT, "Program Files (*.exe)", this);
csResource.LoadString(IDS_CONNECTION_ADV_SELECTAPP);
ASSERT(!csResource.IsEmpty());
cfDialog.m_ofn.lpstrTitle = csResource;
if(cfDialog.DoModal() == IDOK)
{
if( (cfDialog.m_ofn.Flags & OFN_EXTENSIONDIFFERENT ) == 0)
{
SetAppFileName(cfDialog.GetPathName());
UpdateData(FALSE);
}
else
{
csResource.LoadString(IDS_CONNECTION_ADV_NOTAPP);
ASSERT(!csResource.IsEmpty());
AfxMessageBox(csResource);
}
}
}
void CConnectionSettingsAdvanced::OnConnectionUsesDialup()
{
UpdateData(TRUE);
m_btnRestoreAutodial.EnableWindow(!m_bUsesDialup);
}
void CConnectionSettingsAdvanced::OnUpdateAutodial(CCmdUI* pCmdUI)
{
UpdateData(TRUE);
pCmdUI->Enable(!m_bUsesDialup);
}
/////////////////////////////////////////////////////////////////////////////
// COnlineProgramConfirmStart dialog
COnlineProgramConfirmStart::COnlineProgramConfirmStart(CWnd* pParent /*=NULL*/)
: CDialog(COnlineProgramConfirmStart::IDD, pParent)
{
//{{AFX_DATA_INIT(COnlineProgramConfirmStart)
m_bDontShowMe = FALSE;
//}}AFX_DATA_INIT
}
void COnlineProgramConfirmStart::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(COnlineProgramConfirmStart)
DDX_Check(pDX, IDC_ONLINE_CONFIRM_START_SHOW, m_bDontShowMe);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(COnlineProgramConfirmStart, CDialog)
//{{AFX_MSG_MAP(COnlineProgramConfirmStart)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// COnlineProgramConfirmStart message handlers
BOOL COnlineProgramConfirmStart::OnInitDialog()
{
CString csFileName;
CIniFile IniFile;
CDialog::OnInitDialog();
CenterWindow();
// TODO-replace with registry functions
Util::GetWindowsDirectory(csFileName);
csFileName += "\\ConnMgr.ini";
IniFile.Name(csFileName);
BOOL bShowMe = (BOOL)IniFile.GetInteger("Configuration", "ShowOnlineConfirm", 1);
if(!bShowMe)
EndDialog(IDOK);
m_bDontShowMe = FALSE;
UpdateData(FALSE); // Send Member variables to dialog
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void COnlineProgramConfirmStart::OnOK()
{
CIniFile IniFile;
CString csFileName;
Util::GetWindowsDirectory(csFileName);
csFileName += "\\ConnMgr.ini";
IniFile.Name(csFileName);
UpdateData(TRUE); // Update Member variables
IniFile.WriteInteger("Configuration", "ShowOnlineConfirm", !m_bDontShowMe);
CDialog::OnOK();
}
| [
"jim@facetofacesoftware.com"
] | jim@facetofacesoftware.com |
f454d47e9057b723fc82615dc024ec505c1d4709 | 0113df5ee0f251553bbaea9f1fc7516d68375767 | /src/object.cpp | b55186c045d9f3636d0cf6a9e4ef0f8b9cd6d2db | [] | no_license | Ezbob/OFF-2016-Lakridspibejagten | 14c9c671e5d3935f8ad5d459e773843583936368 | 927e607294ec0476e45b6dde8084d205ba3efca7 | refs/heads/master | 2020-09-22T08:11:45.886483 | 2017-02-09T17:14:56 | 2017-02-09T17:14:56 | 67,340,094 | 0 | 1 | null | 2017-02-09T17:14:56 | 2016-09-04T11:05:46 | C++ | UTF-8 | C++ | false | false | 101 | cpp | #include "object.hpp"
void Object::draw(sf::RenderWindow &window) {
return;
window.draw(*this);
}
| [
"casper@snemanden.com"
] | casper@snemanden.com |
5dd5fbe11809fc14851d74a285edbb2a231669c0 | 24bc4990e9d0bef6a42a6f86dc783785b10dbd42 | /components/segmentation_platform/embedder/default_model/query_tiles_model.cc | 77299e367bd94c7baebea9cfd7caab07a54a9635 | [
"BSD-3-Clause"
] | permissive | nwjs/chromium.src | 7736ce86a9a0b810449a3b80a4af15de9ef9115d | 454f26d09b2f6204c096b47f778705eab1e3ba46 | refs/heads/nw75 | 2023-08-31T08:01:39.796085 | 2023-04-19T17:25:53 | 2023-04-19T17:25:53 | 50,512,158 | 161 | 201 | BSD-3-Clause | 2023-05-08T03:19:09 | 2016-01-27T14:17:03 | null | UTF-8 | C++ | false | false | 5,086 | cc | // Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/segmentation_platform/embedder/default_model/query_tiles_model.h"
#include <array>
#include "base/metrics/field_trial_params.h"
#include "base/task/sequenced_task_runner.h"
#include "components/query_tiles/switches.h"
#include "components/segmentation_platform/internal/metadata/metadata_writer.h"
#include "components/segmentation_platform/public/config.h"
#include "components/segmentation_platform/public/constants.h"
#include "components/segmentation_platform/public/model_provider.h"
#include "components/segmentation_platform/public/proto/model_metadata.pb.h"
namespace segmentation_platform {
namespace {
using proto::SegmentId;
// Default parameters for query tiles model.
constexpr SegmentId kQueryTilesSegmentId =
SegmentId::OPTIMIZATION_TARGET_SEGMENTATION_QUERY_TILES;
constexpr int64_t kQueryTilesSignalStorageLength = 28;
constexpr int64_t kQueryTilesMinSignalCollectionLength = 7;
constexpr int64_t kMvThreshold = 1;
// See
// https://source.chromium.org/chromium/chromium/src/+/main:chrome/android/java/src/org/chromium/chrome/browser/query_tiles/QueryTileUtils.java
const char kNumDaysKeepShowingQueryTiles[] =
"num_days_keep_showing_query_tiles";
const char kNumDaysMVCkicksBelowThreshold[] =
"num_days_mv_clicks_below_threshold";
// DEFAULT_NUM_DAYS_KEEP_SHOWING_QUERY_TILES
constexpr int kQueryTilesDefaultSelectionTTLDays = 28;
// DEFAULT_NUM_DAYS_MV_CLICKS_BELOW_THRESHOLD
constexpr int kQueryTilesDefaultUnknownTTLDays = 7;
// InputFeatures.
constexpr std::array<MetadataWriter::UMAFeature, 2> kQueryTilesUMAFeatures = {
MetadataWriter::UMAFeature::FromUserAction("MobileNTPMostVisited", 7),
MetadataWriter::UMAFeature::FromUserAction(
"Search.QueryTiles.NTP.Tile.Clicked",
7)};
std::unique_ptr<ModelProvider> GetQueryTilesDefaultModel() {
if (!base::GetFieldTrialParamByFeatureAsBool(
query_tiles::features::kQueryTilesSegmentation,
kDefaultModelEnabledParam, false)) {
return nullptr;
}
return std::make_unique<QueryTilesModel>();
}
} // namespace
// static
std::unique_ptr<Config> QueryTilesModel::GetConfig() {
if (!base::FeatureList::IsEnabled(
query_tiles::features::kQueryTilesSegmentation)) {
return nullptr;
}
auto config = std::make_unique<Config>();
config->segmentation_key = kQueryTilesSegmentationKey;
config->segmentation_uma_name = kQueryTilesUmaName;
config->AddSegmentId(SegmentId::OPTIMIZATION_TARGET_SEGMENTATION_QUERY_TILES,
GetQueryTilesDefaultModel());
int segment_selection_ttl_days = base::GetFieldTrialParamByFeatureAsInt(
query_tiles::features::kQueryTilesSegmentation,
kNumDaysKeepShowingQueryTiles, kQueryTilesDefaultSelectionTTLDays);
int unknown_selection_ttl_days = base::GetFieldTrialParamByFeatureAsInt(
query_tiles::features::kQueryTilesSegmentation,
kNumDaysMVCkicksBelowThreshold, kQueryTilesDefaultUnknownTTLDays);
config->segment_selection_ttl = base::Days(segment_selection_ttl_days);
config->unknown_selection_ttl = base::Days(unknown_selection_ttl_days);
config->is_boolean_segment = true;
return config;
}
QueryTilesModel::QueryTilesModel() : ModelProvider(kQueryTilesSegmentId) {}
void QueryTilesModel::InitAndFetchModel(
const ModelUpdatedCallback& model_updated_callback) {
proto::SegmentationModelMetadata query_tiles_metadata;
MetadataWriter writer(&query_tiles_metadata);
writer.SetDefaultSegmentationMetadataConfig(
kQueryTilesMinSignalCollectionLength, kQueryTilesSignalStorageLength);
// Set discrete mapping.
writer.AddBooleanSegmentDiscreteMapping(kQueryTilesSegmentationKey);
// Set features.
writer.AddUmaFeatures(kQueryTilesUMAFeatures.data(),
kQueryTilesUMAFeatures.size());
base::SequencedTaskRunner::GetCurrentDefault()->PostTask(
FROM_HERE,
base::BindRepeating(model_updated_callback, kQueryTilesSegmentId,
std::move(query_tiles_metadata), 2));
}
void QueryTilesModel::ExecuteModelWithInput(
const ModelProvider::Request& inputs,
ExecutionCallback callback) {
// Invalid inputs.
if (inputs.size() != kQueryTilesUMAFeatures.size()) {
base::SequencedTaskRunner::GetCurrentDefault()->PostTask(
FROM_HERE, base::BindOnce(std::move(callback), absl::nullopt));
return;
}
const int mv_clicks = inputs[0];
const int query_tiles_clicks = inputs[1];
float result = 0;
// If mv clicks are below the threshold or below the query tiles clicks, query
// tiles should be enabled.
if (mv_clicks <= kMvThreshold || mv_clicks <= query_tiles_clicks) {
result = 1; // Enable query tiles;
}
base::SequencedTaskRunner::GetCurrentDefault()->PostTask(
FROM_HERE,
base::BindOnce(std::move(callback), ModelProvider::Response(1, result)));
}
bool QueryTilesModel::ModelAvailable() {
return true;
}
} // namespace segmentation_platform
| [
"roger@nwjs.io"
] | roger@nwjs.io |
b5e691364f6dab0d10f3af0656fee7c11b224704 | 83d5d05ad90ddea2bc66127a51506b1f864156df | /RecursiveBF/RecursiveBF/rbf.hpp | 6dc47eca97983f048e709e7eac532cf5b7a7f444 | [] | no_license | elfpattern/mycode | ed704b4fc464693ca16764caad08679b6dae115e | f8fe598aa33c4f357dd3ce0a06ab7dd872c1484b | refs/heads/master | 2021-07-24T13:32:00.971817 | 2017-11-04T05:09:40 | 2017-11-04T05:09:40 | 104,558,404 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,467 | hpp | #ifndef INCLUDE_RBF
#define INCLUDE_RBF
#include <math.h>
#include <string>
#define QX_DEF_CHAR_MAX 255
/* ======================================================================
RecursiveBF: A lightweight library for recursive bilateral filtering.
-------------------------------------------------------------------------
Intro: Recursive bilateral filtering (developed by Qingxiong Yang)
is pretty fast compared with most edge-preserving filtering
methods.
- computational complexity is linear in both input size and
dimensionality
- takes about 43 ms to process a one mega-pixel color image
(i7 1.8GHz & 4GB memory)
- about 18x faster than Fast high-dimensional filtering
using the permutohedral lattice
- about 86x faster than Gaussian kd-trees for fast high-
dimensional filtering
Usage: // ----------------------------------------------------------
// Basic Usage
// ----------------------------------------------------------
unsigned char * img = ...; // input image
unsigned char * img_out = 0; // output image
int width = ..., height = ..., channel = ...; // image size
recursive_bf(img, img_out,
sigma_spatial, sigma_range,
width, height, channel);
// ----------------------------------------------------------
// Advanced: using external buffer for better performance
// ----------------------------------------------------------
unsigned char * img = ...; // input image
unsigned char * img_out = 0; // output image
int width = ..., height = ..., channel = ...; // image size
float * buffer = new float[ // external buf
( width * height* channel
+ width * height
+ width * channel
+ width) * 2];
recursive_bf(img, img_out,
sigma_spatial, sigma_range,
width, height, channel,
buffer);
delete[] buffer;
Notice: Large sigma_spatial/sigma_range parameter may results in
visible artifact which can be removed by an additional
filter with small sigma_spatial/sigma_range parameter.
-------------------------------------------------------------------------
Reference: Qingxiong Yang, Recursive Bilateral Filtering,
European Conference on Computer Vision (ECCV) 2012, 399-413.
====================================================================== */
inline void recursive_bf(
unsigned char * img_in,
unsigned char *& img_out,
float sigma_spatial, float sigma_range,
int width, int height, int channel,
float * buffer /*= 0*/);
// ----------------------------------------------------------------------
inline void _recursive_bf(
unsigned char * img,
float sigma_spatial, float sigma_range,
int width, int height, int channel,
float * buffer = 0)
{
const int width_height = width * height;
const int width_channel = width * channel;
const int width_height_channel = width * height * channel;
bool is_buffer_internal = (buffer == 0);
if (is_buffer_internal)
buffer = new float[(width_height_channel + width_height
+ width_channel + width) * 2];
float * img_out_f = buffer;
float * img_temp = &img_out_f[width_height_channel];
float * map_factor_a = &img_temp[width_height_channel];
float * map_factor_b = &map_factor_a[width_height];
float * slice_factor_a = &map_factor_b[width_height];
float * slice_factor_b = &slice_factor_a[width_channel];
float * line_factor_a = &slice_factor_b[width_channel];
float * line_factor_b = &line_factor_a[width];
//compute a lookup table
float range_table[QX_DEF_CHAR_MAX + 1];
float inv_sigma_range = 1.0f / (sigma_range * QX_DEF_CHAR_MAX);
for (int i = 0; i <= QX_DEF_CHAR_MAX; i++)
range_table[i] = static_cast<float>(exp(-i * inv_sigma_range));
float alpha = static_cast<float>(exp(-sqrt(2.0) / (sigma_spatial * width)));
float ypr, ypg, ypb, ycr, ycg, ycb;
float fp, fc;
float inv_alpha_ = 1 - alpha;
for (int y = 0; y < height; y++)
{
float * temp_x = &img_temp[y * width_channel];
unsigned char * in_x = &img[y * width_channel];
unsigned char * texture_x = &img[y * width_channel];
*temp_x++ = ypr = *in_x++;
*temp_x++ = ypg = *in_x++;
*temp_x++ = ypb = *in_x++;
unsigned char tpr = *texture_x++;
unsigned char tpg = *texture_x++;
unsigned char tpb = *texture_x++;
float * temp_factor_x = &map_factor_a[y * width];
*temp_factor_x++ = fp = 1;
// from left to right
for (int x = 1; x < width; x++)
{
unsigned char tcr = *texture_x++;
unsigned char tcg = *texture_x++;
unsigned char tcb = *texture_x++;
unsigned char dr = abs(tcr - tpr);
unsigned char dg = abs(tcg - tpg);
unsigned char db = abs(tcb - tpb);
int range_dist = (((dr << 1) + dg + db) >> 2);
float weight = range_table[range_dist];
float alpha_ = weight*alpha;
*temp_x++ = ycr = inv_alpha_*(*in_x++) + alpha_*ypr;
*temp_x++ = ycg = inv_alpha_*(*in_x++) + alpha_*ypg;
*temp_x++ = ycb = inv_alpha_*(*in_x++) + alpha_*ypb;
tpr = tcr; tpg = tcg; tpb = tcb;
ypr = ycr; ypg = ycg; ypb = ycb;
*temp_factor_x++ = fc = inv_alpha_ + alpha_*fp;
fp = fc;
}
*--temp_x; *temp_x = 0.5f*((*temp_x) + (*--in_x));
*--temp_x; *temp_x = 0.5f*((*temp_x) + (*--in_x));
*--temp_x; *temp_x = 0.5f*((*temp_x) + (*--in_x));
tpr = *--texture_x;
tpg = *--texture_x;
tpb = *--texture_x;
ypr = *in_x; ypg = *in_x; ypb = *in_x;
*--temp_factor_x; *temp_factor_x = 0.5f*((*temp_factor_x) + 1);
fp = 1;
// from right to left
for (int x = width - 2; x >= 0; x--)
{
unsigned char tcr = *--texture_x;
unsigned char tcg = *--texture_x;
unsigned char tcb = *--texture_x;
unsigned char dr = abs(tcr - tpr);
unsigned char dg = abs(tcg - tpg);
unsigned char db = abs(tcb - tpb);
int range_dist = (((dr << 1) + dg + db) >> 2);
float weight = range_table[range_dist];
float alpha_ = weight * alpha;
ycr = inv_alpha_ * (*--in_x) + alpha_ * ypr;
ycg = inv_alpha_ * (*--in_x) + alpha_ * ypg;
ycb = inv_alpha_ * (*--in_x) + alpha_ * ypb;
*--temp_x; *temp_x = 0.5f*((*temp_x) + ycr);
*--temp_x; *temp_x = 0.5f*((*temp_x) + ycg);
*--temp_x; *temp_x = 0.5f*((*temp_x) + ycb);
tpr = tcr; tpg = tcg; tpb = tcb;
ypr = ycr; ypg = ycg; ypb = ycb;
fc = inv_alpha_ + alpha_*fp;
*--temp_factor_x;
*temp_factor_x = 0.5f*((*temp_factor_x) + fc);
fp = fc;
}
}
alpha = static_cast<float>(exp(-sqrt(2.0) / (sigma_spatial * height)));
inv_alpha_ = 1 - alpha;
float * ycy, * ypy, * xcy;
unsigned char * tcy, * tpy;
memcpy(img_out_f, img_temp, sizeof(float)* width_channel);
float * in_factor = map_factor_a;
float*ycf, *ypf, *xcf;
memcpy(map_factor_b, in_factor, sizeof(float) * width);
for (int y = 1; y < height; y++)
{
tpy = &img[(y - 1) * width_channel];
tcy = &img[y * width_channel];
xcy = &img_temp[y * width_channel];
ypy = &img_out_f[(y - 1) * width_channel];
ycy = &img_out_f[y * width_channel];
xcf = &in_factor[y * width];
ypf = &map_factor_b[(y - 1) * width];
ycf = &map_factor_b[y * width];
for (int x = 0; x < width; x++)
{
unsigned char dr = abs((*tcy++) - (*tpy++));
unsigned char dg = abs((*tcy++) - (*tpy++));
unsigned char db = abs((*tcy++) - (*tpy++));
int range_dist = (((dr << 1) + dg + db) >> 2);
float weight = range_table[range_dist];
float alpha_ = weight*alpha;
for (int c = 0; c < channel; c++)
*ycy++ = inv_alpha_*(*xcy++) + alpha_*(*ypy++);
*ycf++ = inv_alpha_*(*xcf++) + alpha_*(*ypf++);
}
}
int h1 = height - 1;
ycf = line_factor_a;
ypf = line_factor_b;
memcpy(ypf, &in_factor[h1 * width], sizeof(float) * width);
for (int x = 0; x < width; x++)
map_factor_b[h1 * width + x] = 0.5f*(map_factor_b[h1 * width + x] + ypf[x]);
ycy = slice_factor_a;
ypy = slice_factor_b;
memcpy(ypy, &img_temp[h1 * width_channel], sizeof(float)* width_channel);
int k = 0;
for (int x = 0; x < width; x++) {
for (int c = 0; c < channel; c++) {
int idx = (h1 * width + x) * channel + c;
img_out_f[idx] = 0.5f*(img_out_f[idx] + ypy[k++]) / map_factor_b[h1 * width + x];
}
}
for (int y = h1 - 1; y >= 0; y--)
{
tpy = &img[(y + 1) * width_channel];
tcy = &img[y * width_channel];
xcy = &img_temp[y * width_channel];
float*ycy_ = ycy;
float*ypy_ = ypy;
float*out_ = &img_out_f[y * width_channel];
xcf = &in_factor[y * width];
float*ycf_ = ycf;
float*ypf_ = ypf;
float*factor_ = &map_factor_b[y * width];
for (int x = 0; x < width; x++)
{
unsigned char dr = abs((*tcy++) - (*tpy++));
unsigned char dg = abs((*tcy++) - (*tpy++));
unsigned char db = abs((*tcy++) - (*tpy++));
int range_dist = (((dr << 1) + dg + db) >> 2);
float weight = range_table[range_dist];
float alpha_ = weight*alpha;
float fcc = inv_alpha_*(*xcf++) + alpha_*(*ypf_++);
*ycf_++ = fcc;
*factor_ = 0.5f * (*factor_ + fcc);
for (int c = 0; c < channel; c++)
{
float ycc = inv_alpha_*(*xcy++) + alpha_*(*ypy_++);
*ycy_++ = ycc;
*out_ = 0.5f * (*out_ + ycc) / (*factor_);
*out_++;
}
*factor_++;
}
memcpy(ypy, ycy, sizeof(float) * width_channel);
memcpy(ypf, ycf, sizeof(float) * width);
}
for (int i = 0; i < width_height_channel; ++i)
img[i] = static_cast<unsigned char>(img_out_f[i]);
if (is_buffer_internal)
delete[] buffer;
}
inline void recursive_bf(
unsigned char * img_in,
unsigned char *& img_out,
float sigma_spatial, float sigma_range,
int width, int height, int channel,
float * buffer = 0)
{
if (img_out == 0)
img_out = new unsigned char[width * height * channel];
for (int i = 0; i < width * height * channel; ++i)
img_out[i] = img_in[i];
_recursive_bf(img_out, sigma_spatial, sigma_range, width, height, channel, buffer);
}
#endif // INCLUDE_RBF
| [
"877377181@qq.com"
] | 877377181@qq.com |
16ca40fc3600cc0e0050a7c1632874c528f12cf1 | b5e5fda5f43ac53bcafffc2ed36236ee6e7b65fa | /effective/operator.cc | 77295990dd79a2240418c1a3f9e5c1f6866a4de6 | [
"Apache-2.0"
] | permissive | zyfjeff/utils_code | da3d3c9e63d97d9ac819becf960f62af9a548efe | 034b1a0ff9ae4f7cebafdd7cfa464cc52119ab24 | refs/heads/master | 2021-01-17T08:12:32.304318 | 2016-04-12T11:44:11 | 2016-04-12T11:44:11 | 24,494,840 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 164 | cc | #include <iotream>
class Widget
{
public:
//.....
Widget& operator=(const Widget& rhs)
{
//....
return *this;
}
}
int main()
{
}
| [
"445188383@qq.com"
] | 445188383@qq.com |
659b0ecaa21b109736d38b71f878f6cddf17f39a | 77a08ec51aa16191986a739267fd9d4379bbb208 | /cf/301D.cpp | 2da619e526bc44068934c21a6dc5201accdfbb47 | [] | no_license | cenariusxz/ACM-Coding | 8f698203db802f79578921b311b38346950ef0ca | dc09ac9adfb4b80d463bdc93f52b479a957154e6 | refs/heads/master | 2023-06-24T13:12:13.279255 | 2021-07-26T01:24:36 | 2021-07-26T01:24:36 | 185,567,471 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 823 | cpp | #include<stdio.h>
#include<string.h>
double dp[105][105][105];
int main(){
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
memset(dp,0,sizeof(dp));
dp[a][b][c]=1;
int i,j,k;
for(i=a;i>=0;i--){
for(j=b;j>=0;j--){
for(k=c;k>=0;k--){
if((i==0&&j==0&&k==0)||(i==a&&j==b&&k==c))continue;
/* else if(i==0&&j==0)dp[i][j][k]=dp[i][j][k+1];
else if(j==0&&k==0)dp[i][j][k]=dp[i+1][j][k];
else if(i==0&&k==0)dp[i][j][k]=dp[i][j+1][k];
*/ else{
dp[i][j][k]=0;
dp[i][j][k]+=dp[i+1][j][k]*(i+1)*k/((i+j+k+1)*(i+j+k)*1.0);
dp[i][j][k]+=dp[i][j+1][k]*(j+1)*i/((i+j+k+1)*(i+j+k)*1.0);
dp[i][j][k]+=dp[i][j][k+1]*(k+1)*j/((i+j+k+1)*(i+j+k)*1.0);
printf("%d %d %d %.10lf\n",i,j,k,dp[i][j][k]);
}
}
}
}
printf("%.10lf %.10lf %.10lf\n",dp[1][0][0],dp[0][1][0],dp[0][0][1]);
return 0;
}
| [
"810988849@qq.com"
] | 810988849@qq.com |
bd7ace112a45c925abd5d87432796d8553bad277 | 92723558eb8c2bded71ed590015865613b5316d2 | /cocos2d/cocos/scripting/lua-bindings/manual/platform/android/CCLuaJavaBridge.h | 22b20857fc9c7349d310dafe5f3e7a712073e646 | [
"CC-BY-4.0",
"MIT",
"CC-BY-3.0"
] | permissive | triompha/EarthWarrior3D | f062a9d4440f330bdadfcdc884dc5773976427a8 | d68a347902fa1ca1282df198860f5fb95f326797 | refs/heads/master | 2021-01-23T00:06:29.585993 | 2015-07-28T13:00:42 | 2015-07-28T13:00:42 | 39,833,618 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,835 | h | #ifndef COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_PLATFORM_ANDROID_LUA_JAVA_BRIDGE_H
#define COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_PLATFORM_ANDROID_LUA_JAVA_BRIDGE_H
#include <jni.h>
#include <string>
#include <vector>
#include "cocos2d.h"
using namespace std;
extern "C" {
#include "lua.h"
}
using namespace cocos2d;
#define LUAJ_ERR_OK 0
#define LUAJ_ERR_TYPE_NOT_SUPPORT (-1)
#define LUAJ_ERR_INVALID_SIGNATURES (-2)
#define LUAJ_ERR_METHOD_NOT_FOUND (-3)
#define LUAJ_ERR_EXCEPTION_OCCURRED (-4)
#define LUAJ_ERR_VM_THREAD_DETACHED (-5)
#define LUAJ_ERR_VM_FAILURE (-6)
#define LUAJ_REGISTRY_FUNCTION "luaj_function_id" // table[function] = id
#define LUAJ_REGISTRY_RETAIN "luaj_function_id_retain" // table[id] = retain count
class LuaJavaBridge
{
public:
static void luaopen_luaj(lua_State *L);
static int retainLuaFunctionById(int functionId);
static int releaseLuaFunctionById(int functionId);
static int callLuaFunctionById(int functionId, const char *arg);
static int callLuaGlobalFunction(const char *functionName, const char *arg);
private:
typedef enum
{
TypeInvalid = -1,
TypeVoid = 0,
TypeInteger = 1,
TypeFloat = 2,
TypeBoolean = 3,
TypeString = 4,
TypeVector = 5,
TypeFunction= 6,
} ValueType;
typedef vector<ValueType> ValueTypes;
typedef union
{
int intValue;
float floatValue;
int boolValue;
string *stringValue;
} ReturnValue;
class CallInfo
{
public:
CallInfo(const char *className, const char *methodName, const char *methodSig)
: m_valid(false)
, m_error(LUAJ_ERR_OK)
, m_className(className)
, m_methodName(methodName)
, m_methodSig(methodSig)
, m_returnType(TypeVoid)
, m_argumentsCount(0)
, m_retjs(NULL)
, m_env(NULL)
, m_classID(NULL)
, m_methodID(NULL)
{
memset(&m_ret, 0, sizeof(m_ret));
m_valid = validateMethodSig() && getMethodInfo();
}
~CallInfo(void);
bool isValid(void) {
return m_valid;
}
int getErrorCode(void) {
return m_error;
}
JNIEnv *getEnv(void) {
return m_env;
}
int argumentTypeAtIndex(size_t index) {
return m_argumentsType.at(index);
}
bool execute(void);
bool executeWithArgs(jvalue *args);
int pushReturnValue(lua_State *L);
private:
bool m_valid;
int m_error;
string m_className;
string m_methodName;
string m_methodSig;
int m_argumentsCount;
ValueTypes m_argumentsType;
ValueType m_returnType;
ReturnValue m_ret;
jstring m_retjs;
JNIEnv *m_env;
jclass m_classID;
jmethodID m_methodID;
bool validateMethodSig(void);
bool getMethodInfo(void);
ValueType checkType(const string& sig, size_t *pos);
};
static int callJavaStaticMethod(lua_State *L);
static int retainLuaFunction(lua_State *L, int functionIndex, int *retainCountReturn);
static int getMethodInfo(CallInfo *call, const char *className, const char *methodName, const char *paramCode);
static int fetchArrayElements(lua_State *L, int index);
static int callAndPushReturnValue(lua_State *L, CallInfo *call, jvalue *args);
static lua_State *s_luaState;
static int s_newFunctionId;
};
#endif //COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_PLATFORM_ANDROID_LUA_JAVA_BRIDGE_H
| [
"zhiyong.zzy@alibaba-inc.com"
] | zhiyong.zzy@alibaba-inc.com |
2e4742ffd863f1d3291515c8db089c7335415e4a | 8ddef74060accfe362e7940f1b2d823eca116161 | /Gui/Widgets/WidgetAndFeaturePrototypes/Common/Widgets/dynamicsamesizehorizontalboxlayoutbasedsmartscrollarea.cpp | 2ef5681b42460c3d623500f77a3673e3a7952f21 | [
"BSD-2-Clause-Views",
"BSD-2-Clause"
] | permissive | Bitfall/AppWhirr-SamplesAndPrototypes | a56e72c687c963e39e08964ee5e608083aea05e1 | d990391a345f15c7cd516f3dba26867b6d75f3be | refs/heads/master | 2021-01-22T23:20:46.777259 | 2013-01-31T09:58:03 | 2013-01-31T09:58:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 18,629 | cpp | #include "dynamicsamesizehorizontalboxlayoutbasedsmartscrollarea.h"
#include <QPropertyAnimation>
#include <QKeyEvent>
#include <QEvent>
#include <QScrollArea>
#include <QScrollBar>
// layout and delegates
#include "Common/Layouts/dynamicsamesizehorizontalboxlayout.h"
#include "Common/Layouts/SnapshotChangeDelegates/samesizelayoutsnapshotchangedelegatebase.h"
#include "Common/Sorting/widgetlistsnapshothandlerdelegate.h"
#include "Common/MouseAndGrabscrollDelegate/mousegrabscrolldelegate.h"
#include "Common/Sorting/cleverapplicationiconpresentersortingdelegate.h"
//
#include "Common/IdBasedWidgetCollection/idbasedwidgetcollection.h"
#include "Common/Widgets/idbasedselectableandhighlightablewidgetbase.h"
// configuration
#include "Settings/guiconfigurations.h"
#include "Settings/settings.h"
// utility
#include <QDebug>
DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea(QSize itemSize, SameSizeLayoutSnapshotChangeDelegateBase *layoutSnapshotChangeDelegate, bool isCenterizeItemsHorizontally, QWidget *parent) :
QScrollArea(parent)
{
#if 1
//
// delegates
// create, initialize and connect the delegates
this->_idBasedWidgetCollection = new IdBasedWidgetCollection(this);
this->mouseGrabScrollDelegate = new MouseGrabScrollDelegate(this);
// layout delegates
WidgetListSnapshotHandlerDelegate *snapshotHandlerDelegate = new WidgetListSnapshotHandlerDelegate;
// iconPickerLayoutSnapshotChangedDelegate->setIconPresenterListDelegate(this->iconPresenterListDelegate);
//
// make connections to the layout-delegates
// make the connections between the sort-result delegate and this window handler/delegate
connect(snapshotHandlerDelegate, SIGNAL(itemSelected(QWidget *)), this, SLOT(itemSelected(QWidget *)));
connect(snapshotHandlerDelegate, SIGNAL(itemDeselected(QWidget *)), this, SLOT(itemDeselected(QWidget *)));
connect(layoutSnapshotChangeDelegate, SIGNAL(layoutChangeStarted()), this, SLOT(_updateContentSizeByLastGivenWidth()));
connect(layoutSnapshotChangeDelegate, SIGNAL(layoutChangeFinished()), this, SLOT(_updateContentSizeByLastGivenWidth()));
#endif
//
// create the content layout and widget
// layout
contentLayout = new DynamicSameSizeHorizontalBoxLayout(snapshotHandlerDelegate, layoutSnapshotChangeDelegate, itemSize);
contentLayout->setCenterizeHorizontally(isCenterizeItemsHorizontally);
// contentLayout->setSizeConstraint(QLayout::SetMinAndMaxSize); // ! don't do this!! this is evil!!
// widget
contentWidget = new QWidget(this);
contentWidget->setLayout(contentLayout);
contentWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
#if 1
// content margins
contentWidget->setContentsMargins(0, 0, 0, 0);
contentLayout->setContentsMargins(0, 0, 0, 0);
contentLayout->setSpacing(0);
this->setContentsMargins(0, 0, 0, 0);
// contentLayout->setDynamicContentMargins(50, 0, 50, 0);
#endif
#if 1
// size policy
this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
#endif
// init scroll-area
this->setWidgetResizable(false); // it will resize itself, don't let the scroll area to resize the content - the content will resize the scroll area
this->setFrameShape(QFrame::NoFrame);
// connect the mouse-grab-scroll delegate
mouseGrabScrollDelegate->setTargetScrollArea(this);
// parenting, layouting
this->setWidget(contentWidget);
#if 1
//
// event filters
this->installEventFilter(this);
#endif
//
// Setup stylesheet
this->setStyleSheet(GuiConfigurations::browserScrollerStyleSheet());
}
//QSize DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::sizeHint() const
//{
//#ifdef ENABLE_SMART_LAYOUTING_SIZE_EVENT_LOGGING
// DLog(" -- Size Hint: ") << this->contentLayout->minimumSize();
//#endif
//// return this->minimumSize();
// return this->contentLayout->getCachedCalculatedOptimalSize();
//}
void DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::resizeEvent(QResizeEvent *event) {
#ifdef ENABLE_SMART_LAYOUTING_SIZE_EVENT_LOGGING
DLogS << " -!- Resize event in smart-scroll-area: " << event->size();
#endif
_lastGivenContentWidth = event->size().width();
#if 0
// recalculate the optimal size for the content of the scroll area
this->contentLayout->recalculateMinimalSizeByTotalLayoutWidth(event->size().width());
// then resize the content layout as well
// QSize sizeWithNewWidthAndMinimalHeight(event->size().width(), this->contentLayout->getCalculatedOptimalSize().height());
// this->contentWidget->resize(sizeWithNewWidthAndMinimalHeight);
// this->contentWidget->resize(event->size());
QSize calculatedOptimalSize = this->contentLayout->getCalculatedOptimalSize();
#ifdef ENABLE_SMART_LAYOUTING_SIZE_EVENT_LOGGING
DLogS << " - Calculated optimal size: " << calculatedOptimalSize;
#endif
this->contentWidget->resize(calculatedOptimalSize); // resize the content
this->contentWidget->adjustSize();
#else
this->_updateContentSize(_lastGivenContentWidth);
#endif
// this->contentLayout->update();
// this->contentWidget->updateGeometry();
this->updateGeometry();
QScrollArea::resizeEvent(event);
}
void DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::_updateContentSizeByLastGivenWidth()
{
this->_updateContentSize(_lastGivenContentWidth);
}
void DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::_updateContentSize(int targetContentWidth)
{
#ifdef ENABLE_SMART_LAYOUTING_SIZE_EVENT_LOGGING
DLogS << "_updateContentSize() - with width: " << targetContentWidth;
#endif
// recalculate the optimal size for the content of the scroll area
this->contentLayout->recalculateMinimalAndOptimalSizesByTotalLayoutWidth(targetContentWidth);
// then resize the content layout as well
// QSize sizeWithNewWidthAndMinimalHeight(event->size().width(), this->contentLayout->getCalculatedOptimalSize().height());
// this->contentWidget->resize(sizeWithNewWidthAndMinimalHeight);
// this->contentWidget->resize(event->size());
QSize calculatedOptimalSize = this->contentLayout->getCalculatedOptimalSize();
#ifdef ENABLE_SMART_LAYOUTING_SIZE_EVENT_LOGGING
DLogS << " - Calculated optimal size: " << calculatedOptimalSize;
#endif
this->contentWidget->resize(calculatedOptimalSize); // resize the content
this->contentWidget->adjustSize();
this->contentWidget->updateGeometry();
// this->updateGeometry();
// this->update();
}
// Q_SLOT
void DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::_commitCurrentWorkingSnapshotWithThisOrder(WidgetListSnapshot sortingResultSnapshot) {
if(contentLayout->getSnapshotHandlerDelegate() != NULL)
{
// this->_idBasedWidgetCollection->_refreshListOrderByIdList(sortingResultSnapshot.getOrderedItems());
FLAG_FOR_REVIEW_WITH_HINT("This should check whether the items are already added, or do it somehow else to don't require this condition!");
contentLayout->getSnapshotHandlerDelegate()->commitSnapshot(sortingResultSnapshot);
}
else {
WLog("Snapshot handler delegate not found!");
}
}
//void DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::addWidgetToList(IdBasedSelectableAndHighlightableWidgetBase *widgetToAdd, bool isPresentItAsWell)
void DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::addIdBasedWidgetToCurrentWorkingSnapshot(IdBasedSelectableAndHighlightableWidgetBase *widgetToAdd)
{
if(widgetToAdd == NULL) {
DLog("Invalid input (widget) parameter (NULL). Cannot add it to the list.");
return;
}
// IconPresenterWidget *theNewIconPresenter = _createAndAddIconToGui(iconModel);
widgetToAdd->installEventFilter(this);
connect(widgetToAdd, SIGNAL(mouseEntered(IdBasedSelectableAndHighlightableWidgetBase*)), this, SLOT(mouseEnteredToItem(IdBasedSelectableAndHighlightableWidgetBase*)));
connect(widgetToAdd, SIGNAL(mouseLeaved(IdBasedSelectableAndHighlightableWidgetBase*)), this, SLOT(mouseLeavedFromItem(IdBasedSelectableAndHighlightableWidgetBase*)));
connect(widgetToAdd, SIGNAL(activated(IdBasedSelectableAndHighlightableWidgetBase*)), this, SLOT(itemActivated(IdBasedSelectableAndHighlightableWidgetBase*)));
// add it to the all-item list
this->_idBasedWidgetCollection->add(widgetToAdd);
// add it to the layout -> needed because of reparenting. Without this the widget will appear in a separate window.
contentLayout->addWidget(widgetToAdd);
// contentLayout->getSnapshotHandlerDelegate()->addItem(theNewIconPresenter->getIconModel().getIconTitle());
#if 0
if(isPresentItAsWell)
{
// contentLayout->getSnapshotHandlerDelegate()->addItem(widgetToAdd);
// convert the id-based list to simple, widget list
QList<QWidget *> widgets;
QList<IdBasedWidgetBase *> idBasedWidgets = this->_idBasedWidgetCollection->getAll();
int widgetCnt = idBasedWidgets.size();
for(int i = 0; i < widgetCnt; i++) {
widgets << idBasedWidgets[i];
}
// then commit the list
contentLayout->getSnapshotHandlerDelegate()->commitSnapshot(WidgetListSnapshot(widgets));
}
#endif
}
// Q_SLOT
void DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::itemActivated(IdBasedSelectableAndHighlightableWidgetBase *source)
{
// delegate the signal
Q_EMIT itemActivatedSignal(source);
}
// Q_SLOT
void DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::itemSelected(QWidget *item)
{
IdBasedSelectableAndHighlightableWidgetBase *castedItem = dynamic_cast<IdBasedSelectableAndHighlightableWidgetBase *>(item);
if(castedItem != NULL) {
castedItem->startHighlighted();
// delegate the signal
Q_EMIT itemSelectedSignal(castedItem);
} else {
WLog(" ! cannot cast the snapshot-widget");
}
}
// Q_SLOT
void DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::itemDeselected(QWidget *item)
{
IdBasedSelectableAndHighlightableWidgetBase *castedItem = dynamic_cast<IdBasedSelectableAndHighlightableWidgetBase *>(item);
if(castedItem != NULL) {
castedItem->startNotHighlighted();
// delegate the signal
Q_EMIT itemDeselectedSignal(castedItem);
} else {
WLog(" ! cannot cast the snapshot-widget");
}
}
// Q_SLOT
void DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::mouseEnteredToItem(IdBasedSelectableAndHighlightableWidgetBase *source)
{
contentLayout->getSnapshotHandlerDelegate()->selectThisItem(source);
}
// Q_SLOT
void DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::mouseLeavedFromItem(IdBasedSelectableAndHighlightableWidgetBase *source)
{
contentLayout->getSnapshotHandlerDelegate()->deselectThisItem(source);
}
// ===========================
// event handling and mouse/keyboard handling / processing
bool DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::processKeyPressEventFilter(QKeyEvent *keyEvent)
{
if( keyEvent->key() == Qt::Key_Up || keyEvent->key() == Qt::Key_Left) {
contentLayout->getSnapshotHandlerDelegate()->selectPreviousItem();
ensureCurrentSelectedItemCenterizedInScrollArea();
return true;
}
else if( keyEvent->key() == Qt::Key_Down || keyEvent->key() == Qt::Key_Right) {
contentLayout->getSnapshotHandlerDelegate()->selectNextItem();
ensureCurrentSelectedItemCenterizedInScrollArea();
return true;
}
return false;
}
bool DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::processMouseWheelEventFilter(QWheelEvent *wheelEvent)
{
#if 0 // use this if mouse-wheel should select the next item in the layout, instead of a smooth-scroll
if(wheelEvent->delta() > 0)
{
contentLayout->getSnapshotHandlerDelegate()->selectNextItem();
ensureCurrentSelectedItemCenterizedInScrollArea();
return true;
}
else if(wheelEvent->delta() < 0)
{
contentLayout->getSnapshotHandlerDelegate()->selectPreviousItem();
ensureCurrentSelectedItemCenterizedInScrollArea();
return true;
}
#else
this->mouseGrabScrollDelegate->doSmoothDropScroll(0, -1 * wheelEvent->delta() * Settings::sharedSettings()->getMouseScrollSpeedAdjustmentValue());
#endif
return true;
}
bool DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::processKeyPressEvent(QKeyEvent *keyEvent)
{
return false;
}
bool DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::processKeyReleaseEvent(QKeyEvent *keyEvent)
{
return false;
}
bool DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::processMouseButtonPressEvent(QObject *obj, QMouseEvent *e)
{
return this->mouseGrabScrollDelegate->handleMouseButtonPressEvent(e);
}
bool DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::processMouseMoveEvent(QObject *obj, QMouseEvent *e)
{
return mouseGrabScrollDelegate->handleMouseMoveEvent(e);
}
bool DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::processMouseButtonReleaseEvent(QObject *obj, QMouseEvent *e)
{
return this->mouseGrabScrollDelegate->handleMouseButtonReleaseEvent(e);
}
bool DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::event(QEvent *event)
{
if(event->type() == QEvent::KeyPress)
{
QKeyEvent *keyEvent = dynamic_cast<QKeyEvent*>(event);
if( this->processKeyPressEvent(keyEvent) )
{
event->accept();
return true;
}
}
else if(event->type() == QEvent::KeyRelease)
{
QKeyEvent *keyEvent = dynamic_cast<QKeyEvent*>(event);
if( this->processKeyReleaseEvent(keyEvent) )
{
event->accept();
return true;
}
}
return QScrollArea::event(event);
}
bool DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::eventFilter(QObject *obj, QEvent *event)
{
if(event->type() == QEvent::MouseButtonPress)
{
QMouseEvent *me = dynamic_cast<QMouseEvent *>(event);
if(me)
{
if( processMouseButtonPressEvent(obj, me) ) {
return true;
}
}
}
else if(event->type() == QEvent::MouseMove)
{
QMouseEvent *me = dynamic_cast<QMouseEvent *>(event);
if(me)
{
if( processMouseMoveEvent(obj, me) ) {
return true;
}
}
}
else if(event->type() == QEvent::MouseButtonRelease)
{
QMouseEvent *me = dynamic_cast<QMouseEvent *>(event);
if(me)
{
if( processMouseButtonReleaseEvent(obj, me) ) {
return true;
}
}
}
else if(event->type() == QEvent::Wheel) {
QWheelEvent *wheelEvent = dynamic_cast<QWheelEvent *>(event);
if(wheelEvent) {
return this->processMouseWheelEventFilter(wheelEvent);
}
}
else if(event->type() == QEvent::KeyPress)
{
QKeyEvent *keyEvent = dynamic_cast<QKeyEvent*>(event);
return this->processKeyPressEventFilter(keyEvent);
}
return QScrollArea::eventFilter(obj, event);
}
void DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::activateCurrentItem()
{
IdBasedSelectableAndHighlightableWidgetBase *currentCastedItem = this->getCurrentSelectedItemOrTheFirst();
if(currentCastedItem == NULL) {
WLog(" ! Some critical error happened, cannot get a valid icon-presenter-widget to activate it.");
return;
}
currentCastedItem->startActivate();
}
IdBasedSelectableAndHighlightableWidgetBase *DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::getCurrentSelectedItemOrTheFirst() const
{
IdBasedSelectableAndHighlightableWidgetBase *currentCastedItem = dynamic_cast<IdBasedSelectableAndHighlightableWidgetBase *>(contentLayout->getSnapshotHandlerDelegate()->getCurrentItem());
if(currentCastedItem == NULL) {
// there's no selected item -> try the first one
DLogS << "Cannot get the current item, so try the first available item.";
currentCastedItem = dynamic_cast<IdBasedSelectableAndHighlightableWidgetBase *>(contentLayout->getSnapshotHandlerDelegate()->getFirstItem());
}
// if(currentCastedItem == NULL) {
// WLog(" ! Some critical error happened, cannot get a valid icon-presenter-widget to activate it.");
// return;
// }
return currentCastedItem;
}
void DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::ensureCurrentSelectedItemCenterizedInScrollArea()
{
IdBasedSelectableAndHighlightableWidgetBase *currentCastedItem = this->getCurrentSelectedItemOrTheFirst();
if(currentCastedItem == NULL) {
WLog(" ! Some critical error happened, cannot get a valid icon-presenter-widget to activate it.");
return;
}
if(currentCastedItem != NULL) {
QPropertyAnimation *scrollAnim = new QPropertyAnimation(
this->verticalScrollBar(),
"value");
scrollAnim->setDuration(300);
scrollAnim->setStartValue(this->verticalScrollBar()->value());
scrollAnim->setEndValue(currentCastedItem->geometry().y() - this->height() / 2 + currentCastedItem->geometry().height() / 2);
scrollAnim->setEasingCurve(QEasingCurve::InOutQuad); // InOutQuad, OutExpo
scrollAnim->start(QAbstractAnimation::DeleteWhenStopped);
}
}
QList<QWidget *> DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::getCurrentWorkingSnapshotAsWidgetList() const
{
return this->_idBasedWidgetCollection->_getAllAsWidgetList();
}
QList<IdBasedWidgetBase *> DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::getCurrentWorkingSnapshot() const
{
return this->_idBasedWidgetCollection->getAll();
}
IdBasedWidgetBase *DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::getItemFromWorkingSnapshotByItemId(QString itemId) const
{
return this->_idBasedWidgetCollection->getById(itemId);
}
void DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::_commitCurrentWorkingSnapshot() {
contentLayout->getSnapshotHandlerDelegate()->commitSnapshot(WidgetListSnapshot(this->_idBasedWidgetCollection->_getAllAsWidgetList()));
}
IdBasedWidgetCollection *DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::__getIdBasedWidgetCollection() const {
FLAG_AS_DEPRECATED;
return this->_idBasedWidgetCollection;
}
WidgetListSnapshotHandlerDelegate *DynamicSameSizeHorizontalBoxLayoutBasedSmartScrollArea::getSnapshotHandlerDelegate() const {
return this->contentLayout->getSnapshotHandlerDelegate();
}
| [
"viktor.benei@gmail.com"
] | viktor.benei@gmail.com |
f298f9336cdfa5b0eabc6cf19c1508b9008a3af1 | 2eebad927eefb044e3a17873ff615f24684297b3 | /DirectX/DirectX/Content/Engine/Graphics/ParticleSystem/ParticleSystem.h | 3457453a8dd8a7e1a173a9aefcab07c7ec8c1891 | [] | no_license | ShadowSneaker/DirectX | 5e22b7e46ef8fbae1d407d0cf8251c804ac8bd0e | 24807f6ceed738e6c99c86a6a3b5c75d76ed54d4 | refs/heads/master | 2022-03-28T20:41:27.336126 | 2020-01-07T15:10:33 | 2020-01-07T15:10:33 | 211,302,531 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 375 | h | #pragma once
#include "../Meshes/StaticMesh.h"
struct SParticle
{
float Gravity{ 1.0f };
SVector Position;
SVector Velocity;
SVector4 Colour;
};
class CParticleSystem
{
private:
/// Properties
class CRenderer* Renderer;
ID3D11Buffer* VertexBuffer{ nullptr };
public:
CParticleSystem(class CRenderer* InRenderer);
/// Functions
int CreateParticle();
}; | [
"danielsfoyle@gmail.com"
] | danielsfoyle@gmail.com |
4a7e5133a72cc008a1a16113546ec9b8a3b2230c | df89a1540a17b08e9d5513c0514ba284fe38e1e6 | /PTADS/021/main.cpp | 6779a60a5e2570a3f65c366ee5b71c9890523de3 | [] | no_license | xuyanbo03/Algorithm | 3eccab6492af6c75745ff94b2e3d484e6a995af8 | c9dd1ac5009475d465793e5d671fa594556b65da | refs/heads/master | 2021-01-20T09:37:27.250534 | 2018-06-18T08:24:15 | 2018-06-18T08:24:15 | 90,269,241 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 2,565 | cpp | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
using namespace std;
const int inf=0x3f3f3f3f;
const double epx=1e-10;
typedef long long ll;
const ll INF=1e18;
typedef int ElementType;
typedef struct Node *PtrToNode;
struct Node {
ElementType Data;
PtrToNode Next;
};
typedef PtrToNode List;
List Read(); /* 细节在此不表 */
void Print( List L ); /* 细节在此不表;空链表将输出NULL */
List Merge( List L1, List L2 );
int main()
{
List L1, L2, L;
L1 = Read();
L2 = Read();
L = Merge(L1, L2);
Print(L);
Print(L1);
Print(L2);
return 0;
}
List Merge( List L1, List L2 ){
if(!L1&&!L2){
return NULL;
}
List L,p1,p2,p;
L=(List)malloc(sizeof(struct Node));
p1=L1->Next;
p2=L2->Next;
p=L;
while(pa&&pb){
if(pa->Data<=pb->Data){
p->Next=p1;
p1=p1->Next;
}else{
p->Next=p2;
p2=p2->Next;
}
p=p->Next;
}
if(p1){
p->Next=p1;
}
if(p2){
p->Next=p2;
}
L1->Next=NULL;
L2->Next=NULL;
return L;
}
//02-线性结构1 两个有序链表序列的合并(15 分)
//本题要求实现一个函数,将两个链表表示的递增整数序列合并为一个非递减的整数序列。
//
//函数接口定义:
//List Merge( List L1, List L2 );
//其中List结构定义如下:
//
//typedef struct Node *PtrToNode;
//struct Node {
// ElementType Data; /* 存储结点数据 */
// PtrToNode Next; /* 指向下一个结点的指针 */
//};
//typedef PtrToNode List; /* 定义单链表类型 */
//L1和L2是给定的带头结点的单链表,其结点存储的数据是递增有序的;函数Merge要将L1和L2合并为一个非递减的整数序列。应直接使用原序列中的结点,返回归并后的带头结点的链表头指针。
//
//裁判测试程序样例:
//#include <stdio.h>
//#include <stdlib.h>
//
//typedef int ElementType;
//typedef struct Node *PtrToNode;
//struct Node {
// ElementType Data;
// PtrToNode Next;
//};
//typedef PtrToNode List;
//
//List Read(); /* 细节在此不表 */
//void Print( List L ); /* 细节在此不表;空链表将输出NULL */
//
//List Merge( List L1, List L2 );
//
//int main()
//{
// List L1, L2, L;
// L1 = Read();
// L2 = Read();
// L = Merge(L1, L2);
// Print(L);
// Print(L1);
// Print(L2);
// return 0;
//}
//
///* 你的代码将被嵌在这里 */
//输入样例:
//3
//1 3 5
//5
//2 4 6 8 10
//输出样例:
//1 2 3 4 5 6 8 10
//NULL
//NULL
| [
"610958401@qq.com"
] | 610958401@qq.com |
fe948b98d4ce95c9be86efdf1253c98f315ee5e5 | 44414f260cc7c19e33f66bb97df1d59628565dfc | /autofax.h | 44c1370708b446d9456e0315f5a785ce92051131 | [] | no_license | IanMadlenya/autofax | 822ae6b521bce722ceafab63f758690d0051e7a0 | 372146c63a3b71c4a737ac3ca61b55977d6f5460 | refs/heads/master | 2021-01-21T20:06:45.485850 | 2017-05-22T21:09:06 | 2017-05-22T21:09:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 22,436 | h | enum FaxTyp:uchar {capi=1,hyla};
enum FxStat:uchar {init/*0*/,gestrichen,schwebend,wartend/*3*/,blockiert/*4*/,bereit/*5*/,verarb/*6*/,gesandt/*7*/,gescheitert/*8*/,fehlend,woasined};
enum hyinst {keineh,hysrc,hypak,hyppk}; // hyla source, hyla Paket, hylaplus Paket
class zielmustercl; // fuer die Verteilung der erfolgreich gefaxten Dateien auf verschiedene Dateien
class fxfcl; // Faxfile
class fsfcl; // Faxsendfile
class paramcl; // Programmparameter
void useruucp(const string& huser, int obverb,int oblog);
string zielname(const string& qdatei, const string& zielvz,uchar wieweiterzaehl=0, string* zieldatei=0, int obverb=0, int oblog=0);
string zielname(const string& qdatei, zielmustercl *zmp,uchar wieweiterzaehl=0, string* zieldatei=0, int obverb=0, int oblog=0);
void dorename(const string& quelle, const string& ziel, const string& cuser=nix, uint *vfehler=0, int obverb=0, int oblog=0);
string verschiebe(const string& qdatei, const string& zielvz, const string& cuser=nix,uint *vfehler=0, uchar wieweiterzaehl=0, int obverb=0,int oblog=0);
void verschiebe(const string& qdatei, zielmustercl *zmp, const string& cuser=nix, uint *vfehler=0, uchar wieweiterzaehl=0, int obverb=0, int oblog=0);
string kopiere(const string& qdatei, const string& zieldp, uint *kfehler, uchar wieweiterzaehl, int obverb=0,int oblog=0);
string kopiere(const string& qdatei, zielmustercl *zmp, uint *kfehler, uchar wieweiterzaehl, int obverb=0, int oblog=0);
void prueffuncgettel3(DB *Myp, const string& usr, const string& host, int obverb, int oblog);
void pruefstdfaxnr(DB *Myp, const string& usr, const string& host, int obverb, int oblog);
void faxemitC(DB *My, const string& spooltab, const string& altspool, fsfcl *fsfp, paramcl *pmp, int obverb, int oblog);
void faxemitH(DB *My, const string& spooltab, const string& altspool, fsfcl *fsfp, paramcl *pmp, int obverb, int oblog);
int pruefcapi(paramcl *pmp, int obverb, int oblog);
void kuerzevtz(string *vzp);
pid_t PIDausName(const char* PName, uchar klgr, uchar exakt, int obverb, int oblog);
void getSender(paramcl *pmp,const string& faxnr, string *getnamep, string *bsnamep,int obverb=0,int oblog=0);
void hfaxsetup(paramcl *pmp,int obverb=0, int oblog=0);
void hconfig(paramcl *pmp,int obverb=0, int oblog=0);
const string& pruefspool(DB *My,const string& spooltab, const string& altspool, int obverb, int oblog, uchar direkt=0);
void pruefouttab(DB *My, const string& touta, int obverb, int oblog, uchar direkt=0);
void pruefudoc(DB *My, const string& tudoc, int obverb, int oblog, uchar direkt=0);
void pruefinctab(DB *My, const string& tinca, int obverb, int oblog, uchar direkt=0);
void kuerzevtz(string *vzp);
void pruefrules(int obverb, int oblog);
void pruefblack(int obverb, int oblog);
void pruefmodcron(int obverb, int oblog);
void viadd(string *cmd,const string& datei,const uchar ro=0,const uchar hinten=0, const uchar unten=0);
// Steuerung der Abspeicherung gesendeter Faxe je nach Muster
class zielmustercl
{
// beim letzten Element muss ziel leer sein!
private:
string muster;
public:
string ziel;
regex_t regex;
// wird nur in Vorgaben gebraucht:
zielmustercl(const char * const muster,const char * const ziel);
zielmustercl(const char * const muster,const string& ziel);
zielmustercl();
int kompilier(uchar obext=1);
int setzemuster(const string& vmuster,uchar obext=1);
const string& holmuster();
int obmusterleer();
}; // class zielmustercl
class urfxcl // urspruengliche Dateidaten vor Aufteilung an verschiedene Faxadressaten
{
public:
string teil;
string ur;
unsigned prio; // Prioritaet der Fax-Programme: 0 = capi und 0 = hyla per Konfigurationsdatei, 1= capi und 2= hyla per Faxdateiname
urfxcl(const string& teil, string& ur,unsigned prio): teil(teil), ur(ur), prio(prio) {}
};
class fxfcl // Faxfile
{
public:
string npdf; // nicht-PDF
string spdf; // schon-PDF
string ur; // urspruenglicher Dateinamen
unsigned prio; // Prioritaet der Fax-Programme: 0 = capi und 0 = hyla per Konfigurationsdatei, 1= capi und 2= hyla per Faxdateiname
ulong pseiten; // PDF-Seitenzahl
fxfcl(const string& npdf,const string& spdf,const string& ur,unsigned prio): npdf(npdf),spdf(spdf),ur(ur),prio(prio),pseiten(0) {}
// nur fuer Initialisierung in fsfcl, Konstruktur /*1*/, nur fuer faxealle
fxfcl(unsigned prio, const string& npdf,const string& spdf,ulong pseiten): npdf(npdf),spdf(spdf),prio(prio),pseiten(pseiten) {}
fxfcl(const string& spdf,const string& ur,unsigned prio): npdf(""),spdf(spdf),prio(prio),pseiten(0) {}
fxfcl() {}
};
class fsfcl : public fxfcl // Faxsendfile
{
public:
string id; // id in spooltab
string telnr; // Telnr. des Adressaten
string capisd; // capispooldatei
int capids; //capidials
string hylanr; // hylanr
string protdakt; // z.B. /var/spool/hylafax/doneq/q9902
int hdialsn; // hyladials
string hpages; // Seitenzahl
uchar fobcapi; // ob es jetzt mit Capi weggefaxt werden muss
uchar fobhyla; // ob es jetzt mit Hyla weggefaxt werden muss
string adressat; // Name des Adressaten aus Faxdatei
string idalt; // id in altspool
string original; // base_name(spdf)
string origvu; // base_name(npdf)
string idudoc; // id des urspruenglichen Dateinamens in tabelle udoc
string cspf; // capispoolpfad
string cdd; // cdateidatum
string cdials; // capidials
string ctries; // parameter aus capiprot
string starttime; // parameter aus capiprot
string dialstring; // parameter aus capiprot
string hstate="0"; // Statuszahl ("state" in man sendq)
string hstatus; // Textbeschreibung des letztes Fehlschlags
string hstatuscode; // in xferfaxlog nicht gefunden
time_t tts=0;
time_t killtime=0;
string number; // Telefonnummer
string hdials; // hyladials
string maxdials; // maxdials (hylafax)
string hdd; // hdateidatum
string sendqgespfad; // kann fuer capi oder hyla verwendet werden
string hgerg; // hyla_gescheitert_erg
int hversuzahl;
FxStat capistat=init;// 1=wartend, 2=gesandt, 3=gescheitert, 4=fehlend (in spool keine Capi-Datei eingetragen oder die eingetragene gibts nicht)
FxStat hylastat=init;// 1=wartend, 2=gesandt, 3=gescheitert, 4=fehlend (in spool keine hyla-Datei eingetragen oder die eingetragene gibts nicht)
private:
public:
void archiviere(DB *My, paramcl *pmp, struct stat *entryp,uchar obgescheitert, FaxTyp ftyp, uchar *gel, int obverb, int oblog);
int loeschecapi(int obverb, int oblog);
int loeschehyla(paramcl *pmp,int obverb, int oblog);
/*1*/fsfcl(const string id, const string npdf, const string spdf, const string telnr, unsigned prio, const string capisd, int capids,
const string hylanr, int hdialsn, uchar fobcapi, uchar fobhyla, const string adressat, ulong pseiten, string idalt):
fxfcl(prio,npdf,spdf,pseiten), id(id), telnr(telnr), capisd(capisd), capids(capids),
hylanr(hylanr), hdialsn(hdialsn), fobcapi(fobcapi), fobhyla(fobhyla), adressat(adressat),idalt(idalt) {}
/*2*/fsfcl(const string id,const string original): id(id), original(original) {}
/*3*/fsfcl(const string id, const string capisd, const string hylanr, string const cspf): id(id), capisd(capisd), hylanr(hylanr), cspf(cspf) {}
/*4*/fsfcl(const string& hylanr): hylanr(hylanr) {}
/*5*/fsfcl(const string sendqgespfad, FxStat capistat): sendqgespfad(sendqgespfad), capistat(capistat) {}
void setzcapistat(paramcl *pmp, struct stat *entrysendp);
void capiausgeb(stringstream *ausgp, const string& maxctrials, uchar fuerlog=0, int obverb=0, int oblog=0,unsigned long faxord=0);
void hylaausgeb(stringstream *ausgp, paramcl *pmp, int obsfehlt, uchar fuerlog=0, int obverb=0, uchar obzaehl=0, int oblog=0);
int holcapiprot(int obverb);
}; // class fsfcl
extern const string s_true; // ="true";
extern const string s_dampand; // =" && ";
extern const string s_gz; // ="gz";
extern const string defvors; // ="https://github.com/libelle17/"
extern const string defnachs; // ="/archive/master.tar.gz"
class paramcl // Programmparameter
{
private:
double tstart, tende;
svec modems; // gefundene Modems
size_t optslsz=0; // last opts.size()
uchar modemgeaendert=0; // hmodem neu gesetzt
// long gmtoff; // Sekunden Abstand zur UTC-Zeit einschließlich Sommerzeit
public:
string cl; // comanndline
string mpfad; // meinpfad()
string meinname; // base_name(meinpfad()) // argv[0] // 'autofax'
string vaufr; // (vollaufruf) z.B. '/usr/bin/autofax -norf'
string saufr; // (stummaufruf) 'autofax -norf'
string zsaufr; // zitiert saufr (in sed)
// string instvz; // $HOME/autofax
// cppSchluess *hconfp=0;
schlArr hylconf;
uchar hgelesen=0; // Protokolldatei war auslesbar
static constexpr const char *moeglhvz[2]={"/var/spool/fax","var/spool/hylafax"};
string huser="uucp"; // "uucp" oder "fax"
uchar obfcard=1; // ob Fritzcard eingesteckt
uchar obfcgeprueft=0; // ob schon geprueft, ob Fritzcard eingesteckt
uchar obmodem=1; // ob Modem angeschlossen
uchar obmdgeprueft=0; // ob schon geprueft, ob Modem verfuegbar
uchar obocrgeprueft=0; // ob ocrmypdf installiert ist
const string spooltab="spool";
const string altspool="altspool"; // Historie der Spooltabelle
const string udoctab="udoc";
int obverb=0; // verbose
int oblog=0; // mehr Protokollieren
uchar obvi=0; // ob Konfigurationsdatei editiert werden soll
uchar obvc=0; // ob Capisuite-Konfigurationsdateien betrachtet werden sollen
uchar obvh=0; // ob Hylafax-Konfigurations- und Logdateindatei betrachtet werden sollen
uchar obvs=0; // ob Quelldateien bearbeitet werden sollen
uchar loef=0; // loesche eine Fax-Datei
uchar loew=0; // loeschewaise in der Datenbank, aber nicht mehr real nachweisbare Dateien in der Datenbank loeschen
uchar loea=0; // loesche alle wartenden Faxe und zugehoerige Dateieintraege
uchar loee=0; // empfangene Dateien loeschen, die nicht verarbeitet werden koennen
uchar erneut=0; // empfangenes Fax erneut bereitstellen
uchar uml=0; // umleiten: vorzeitig den zweiten Weg aktivieren
uchar kez=0; // korrigiere Erfolgskennzeichen
uchar bwv=0; // bereinige Warteverzeichnis
uchar anhl=0; // autofax anhalten
uchar lista=0; // liste Archiv auf
uchar listf=0; // liste gescheiterte auf
uchar listi=0; // liste Eingegangene auf
uchar listw=0; // liste wartende auf
string suchstr; // Wortteil, nach dem in alten Faxen gesucht werden soll
string dszahl="30"; // Datensatzzahl fuer Tabellenausgaben
uchar logdateineu=0; // logdt vorher loeschen
uchar obhilfe=0; // Hilfe anzeigen
uchar zeigvers=0; // Version anzeigen
size_t faxord; // Ordinalzahl des Faxes unter allen anstehenden Faxen
unsigned long geszahl=0;
unsigned long ankzahl=0; // Zahl der angekommenen Faxe
unsigned long dbzahl=0; // Zahl der ueberprueften Datenbankeintraege
unsigned long wzahl=0;
unsigned long ezahl=0;
unsigned long gzahl=0;
unsigned long fzahl=0;
unsigned long weizahl=0; // Zahl der weiteren wartenden Faxe, die nicht in der Spooltabelle dieses Programms eingetragen sind
uchar gleichziel; // faxe auch ohne Fax-Erfolg auf Zielverzeichnis abspeichern
uchar obocri; // empfangene Faxe OCR unterziehen
uchar obocra; // gesandte Bilder OCR unterziehen
uchar obcapi=1; // ob ueberhaupt die Capisuite verwendet werden soll, gesetzt in: pruefisdn(), lieskonfein(), rueckfragen(), getcommandline(), main()
uchar obhyla=1; // ob ueberhaupt hylafax verwendet werden soll
uchar konfobcapi; // ob obcapi in der Konfigurationsdatei eingestellt ist
uchar konfobhyla; // ob obhyla in der Konfigurationsdatei eingestellt ist
// string hmodemstr; // Erkennung des Faxgeraetes nach /dev/tty, Standard ACM
string hmodem; // erkanntes und laufendes Modem ttyACM0
// string hmodname; // ttyACM0
uchar hylazuerst; // ob ein Fax zuerst ueber Hylafax versucht werden soll zu faxen
uchar rzf=0; // rueckzufragen
string dbq; // Datenbank
static const char* const smbdt;// "/etc/samba/smb.conf"
string cuser; // Linux-Benutzer fuer Capisuite, Samba
string muser; // Benutzer fuer Mysql/MariaDB
string mpwd; // Passwort fuer Mysql/MariaDB
DB* My=0;
const string touta="outa"; // MariaDB-Tabelle fuer gesandte oder gescheiterte Faxe
const string tudoc="udoc"; // MariaDB-Tabelle fuer gesandte oder gescheiterte Faxe
const string tinca="inca"; // MariaDB-Tabelle fuer empfangene Faxe
static const string edit;
static const string passwddt,groupdt,sudoersdt;
static const string hylacdt; // /etc/init.d/hylafax
uchar hylacdt_gibts=0; // Datei hylacdt existiert
string cfaxconfdt; // /etc/capisuite/fax.conf oder /usr/local/etc/capisuite/fax.conf laut Handbuch
string ccapiconfdt; // /etc/capisuite/capisuite.conf oder /usr/local/etc/capisuite/capisuite.conf laut Handbuch
// Parameter aus /etc/capisuite/fax.conf:
string spoolcapivz; // Verzeichnis der Capi-Spool-Dateien /var/spool/capisuite/
string cempfavz; // /var/spool/capisuite/autofaxarch/
string cfaxuservz; // /var/spool/capisuite/users/
string cfaxusersqvz; // /var/spool/capisuite/users/<user>/sendq
string nextdatei; // /var/spool/capisuite/users/<user>/sendq/fax-nextnr
string cfaxuserrcvz; // /var/spool/capisuite/users/<user>/received
string cdonevz; // Capisuite-Archiv: /var/spool/capisuite/done
string cfailedvz; // Capisuite-Archiv der gescheiterten /var/spool/capisuite/failed
string countrycode; // Landesvorwahl
string citycode; // Ortsvorwahl
string msn; // MSN fuer Fax
string LongDistancePrefix; // Vorsatz fuer ausserorts
string InternationalPrefix; // Vorsatz fuer ausserlandes
string LocalIdentifier; // eigener Namen fuer Hylafax bis 10 Buchstaben
string cFaxUeberschrift; // eigener Namen fuer Capisuite bis 20 Buchstaben
string cklingelzahl; // Zahl der Klingeltoene, bis Capisuite einen Anruf annnimmt
string hklingelzahl; // Zahl der Klingeltoene, bis Hylafax einen Anruf annnimmt
string maxhdials; // Zahl der Wahlversuche in Hylafax
string maxcdials; // Zahl der Wahlversuche in Capisuite
uchar capizukonf=0; // capi zu konfigurieren
uchar hylazukonf=0; // hyla zu konfigurieren
uchar oblgschreib=0; // Konfigurationsdatei seitens der Sprache voraussichtlich schreiben
uchar obkschreib=0; // Konfigurationsdatei schreiben
uchar logdneu=0; // Logdatei geaendert
uchar logvneu=0; // Logverzeichnis geaendert
string varsphylavz; // Verzeichnis der Hyla-Spool-Dateien /var/spool/hylafax oder /var/spool/fax
string hempfavz; // var/spool/(hyla)fax/autofaxarch
string xferfaxlog; // varsphylavz + "/etc/xferfaxlog";
string faxqpfad,hfaxdpfad; // /usr/local/sbin/faxq, /usr/local/sbin/hfaxq
string faxgtpfad; // /usr/lib/fax/faxgetty oder /usr/local/sbin/faxgetty
string hsendqvz; // /var/spool/hylafax/sendq
string hdoneqvz; // /var/spool/hylafax/doneq
string harchivevz; // /var/spool/hylafax/archive
unsigned long aufrufe=0; // Zahl der bisherigen Programmaufrufe
struct tm laufrtag={0}; // Tag des letztes Aufrufs
unsigned long tagesaufr=0; // Zahl der bisherigen Programmaufrufe heute
unsigned long monatsaufr=0; // Zahl der bisherigen Programmaufrufe heute
#ifdef _WIN32
char cpt[255];
DWORD dcpt;
#elif linux
char cpt[MAXHOSTNAMELEN];
size_t cptlen;
#endif
string host="localhost"; // fuer MySQL/MariaDB
string logdname; // Logdatei-Name ohne Pfad autofax.log
string logvz; // nur das Verzeichnis /var/log
string loggespfad; // Gesamtpfad, auf den dann die in kons.h verwiesene und oben definierte Variable logdt zeigt
// bei jeder Aenderung muss auch logdt neu gesetzt werden!
string zufaxenvz;
string wvz; // Warteverzeichnis
string nvz; // Gescheitertenverzeichnis
string empfvz; // Empfangsverzeichnis
string cronminut; // Minuten fuer crontab; 0 = kein Crontab-Eintrag
string maxcapiv; // maximale Versuchnr in Capi, bis Hyla versucht wird
string maxhylav; // maixmale Versuchsnr in Hylafax, bis Capi versucht wird
string langu; // Sprache (Anfangsbuchstabe)
// cppSchluess *cgconfp; // Gesamtkonfiguration
schlArr cgconf; // Gesamtkonfiguration
// size_t gcs; // dessen Groesse
string sqlvz; // Zahl der SQL-Befehle aus Vorgaben
size_t sqlvzn=0; // Zahl der SQL-Befehle aus Vorgaben numerisch
// cppSchluess *sqlconfvp=0; // SQL-Pointer aus Vorgaben
schlArr sqlconfv;
string sqlz; // Zahl der SQL-Befehle
size_t sqlzn=0; // Zahl der SQL-Befehle numerisch
// cppSchluess *sqlconfp; // SQL-Pointer
schlArr sqlconf; // SQL-Array
zielmustercl *zmp; // Zielmusterzeiger
// cppSchluess *zmconfp; // dessen Serialisierung
schlArr zmconf; // dessen Serialisierung
string zmz; // Zielmusterzahl
size_t zmzn; // Zielmusterzahl numerisch
zielmustercl *zmvp; // Zielmusterzeiger aus Vorgaben
string zmvz; // Zielmusterzahl aus Vorgaben
size_t zmvzn=0; // Zielmusterzahl numerisch aus Vorgaben
// cppSchluess *capiconfp; // Capi-Konfiguration (fax.conf)
schlArr cconf; // capisuite.conf
schlArr capiconf; // Capi-Konfiguration (fax.conf)
// size_t ccs; // capiconf-confsize
string konfdt; // name der Konfigurationsdatei
string zaehlerdt; // konfdt+".zaehl"
string anfaxstr, ancfaxstr, anhfaxstr; // 'an Fax', "an cFax", "an hFax"
string anstr; // ' an '
string undstr; // 'und'
string cmd; // string fuer command fuer Betriebssystembefehle
vector<optioncl> opts;
uchar keineverarbeitung=0; // wenn cronminuten geaendert werden sollen, vorher abkuerzen
uchar cmeingegeben=0;
vector<argcl> argcmv; // class member vector
servc *sfaxq=0, *shfaxd=0, *shylafaxd=0, *sfaxgetty=0, *scapis=0;
string modconfdt; // hylafax-Konfigurationsdatei, z.B. /var/spool/hylafax/etc/config.ttyACM0
confdat *cfaxcp=0; // Zeiger auf ausgelesene /etc/capisuite/fax.conf
string virtvz; // instvz+"/ocrv";
string ocrmp; // virtvz+"/bin/ocrmypdf";
string vorcm; // Vor-Cron-Minuten
linst_cl* linstp=0;
private:
void lgnzuw(); // in vorgaben, lieskonfein, getcommandl0, getcommandline, rueckfragen
string neuerdateiname(const string& qpfad); // in DateienHerricht
void WVZinDatenbank(vector<fxfcl> *fxvp); // in DateienHerricht
string getzielvz(const string& datei); // in bereinigewv
int setzegcp(const string& name, string *wert);
void pruefcvz();
void pruefsfftobmp();
void setzhylastat(fsfcl *fsf, uchar *hyla_uverz_nrp, uchar startvznr,int *obsfehltp=0,
struct stat *est=0);
void konfcapi();
int xferlog(fsfcl *fsfp/*, string *totpages=0, string *ntries=0, string *totdials=0, string *tottries=0, string *maxtries=0*/);
void richtcapiher();
void setzmodconfd();
void setzzielmuster(confdat& afconf);
void setzsql(confdat& afconf);
int pruefinstv();
int kompilbase(const string& was,const string& endg);
int kompiliere(const string& was,const string& endg,const string& vorcfg=nix,const string& cfgbismake=s_dampand);
int kompilfort(const string& was,const string& vorcfg=nix,const string& cfgbismake=s_dampand,uchar ohneconf=0);
void bereinigecapi();
int zupdf(const string* quell, const string& ziel, ulong *pseitenp=0, int obocr=1, int loeschen=1); // 0=Erfolg
int holtif(const string& datei,ulong *seitenp=0,struct tm *tmp=0,struct stat *elogp=0,
string *absdrp=0,string *tsidp=0,string *calleridp=0,string *devnamep=0);
void setztmpcron();
void pruefmodcron();
void pruefunpaper();
int pruefocr();
void unpaperfuercron(const string& ocrprog);
void empfhyla(const string& ganz,uchar indb=1,uchar mitversch=1);
void empfcapi(const string& stamm,uchar indb=1,uchar mitversch=1);
void uebertif();
public:
int Log(const string& text,const bool oberr=0,const short klobverb=0);
paramcl(int argc,char** argv);
~paramcl();
void pruefggfmehrfach();
void nextnum();
string stdfaxnr(const string& faxnr);
void logvorgaben();
void getcommandl0();
void pruefmodem();
void setzfaxgtpfad();
void pruefisdn();
void liescapiconf();
void VorgbAllg(); // allgemeine Vorgaben
void MusterVorgb();
#ifdef autofaxcpp
void VorgbSpeziell() __attribute__((weak)); // implementationsspezifische Vorgaben (aber nur Quellcodeaenderung aenderbar, Modul vorgaben.cpp)
#else
void VorgbSpeziell(); // implementationsspezifische Vorgaben (aber nur Quellcodeaenderung aenderbar, Modul vorgaben.cpp)
#endif
void lieskonfein();
int getcommandline();
void rueckfragen();
int setzhylavz(); // sucht das Hylaverzeichnis und setzt varsphylavz darauf, return 0, wenn nicht gefunden dann varsphylavz="", return 1
void verzeichnisse();
void pruefcron();
void pruefsamba();
int initDB();
int pruefDB(const string& db);
void bereinigewv();
void anhalten();
void tu_lista(const string& oberfolg,const string& submids=nix);
void tu_listi();
void suchestr();
int pruefsoffice(uchar mitloe=0);
int pruefconvert();
void DateienHerricht();
void clieskonf();
void capisv();
int pruefcapi();
int holvomnetz(const string& datei,const string& vors=defvors,const string& nachs=defnachs);
void hliesconf();
void hconfigtty();
int cservice();
int hservice_faxq_hfaxd();
void hylasv1();
void hylasv2(hyinst hyinstart);
// int hservice_faxgetty();
int pruefhyla();
int aenderefax(const int aktion=0); // 0=loeschen, 1=umleiten
int empferneut();
size_t loeschewaise();
size_t loescheallewartende();
void faxealle();
void untersuchespool(uchar mitupd=1);
void zeigweitere();
void zeigkonf();
void zeigdienste();
void sammlecapi(vector<fsfcl> *fsfvp);
void sammlehyla(vector<fsfcl> *fsfvp);
void korrigierecapi(unsigned tage=90);
void korrigierehyla(unsigned tage=90);
void empfarch();
void zeigueberschrift();
void schlussanzeige();
void autofkonfschreib();
void dovi();
void dovc();
void dovh();
}; // class paramcl
| [
"gerald.schade@gmx.de"
] | gerald.schade@gmx.de |
cb748f8b613399e0a2577b56fcbb2363e7b2164d | 9a310f9857356af442b38ce15d11ac1c58bef3cb | /include/CkJwe.h | a6001786b831071652f290525f13986d74a2e82f | [] | no_license | namtuanbk/cat_ke_team | efe4017eae529f63f241cb87646097c75e7405b0 | 059a4541bc6b14d093d582a58366b7742d92e059 | refs/heads/master | 2020-03-22T13:07:51.578531 | 2018-07-22T09:06:55 | 2018-07-22T09:06:55 | 140,085,441 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 14,614 | h | // CkJwe.h: interface for the CkJwe class.
//
//////////////////////////////////////////////////////////////////////
// This header is generated for Chilkat 9.5.0.73
#ifndef _CkJwe_H
#define _CkJwe_H
#include "chilkatDefs.h"
#include "CkString.h"
#include "CkMultiByteBase.h"
class CkBinData;
class CkStringBuilder;
class CkPrivateKey;
class CkJsonObject;
class CkPublicKey;
#if !defined(__sun__) && !defined(__sun)
#pragma pack (push, 8)
#endif
// CLASS: CkJwe
class CK_VISIBLE_PUBLIC CkJwe : public CkMultiByteBase
{
private:
// Don't allow assignment or copying these objects.
CkJwe(const CkJwe &);
CkJwe &operator=(const CkJwe &);
public:
CkJwe(void);
virtual ~CkJwe(void);
static CkJwe *createNew(void);
void CK_VISIBLE_PRIVATE inject(void *impl);
// May be called when finished with the object to free/dispose of any
// internal resources held by the object.
void dispose(void);
// BEGIN PUBLIC INTERFACE
// ----------------------
// Properties
// ----------------------
// The number of recipients for this JWE.
int get_NumRecipients(void);
// Controls whether the JWE Compact Serialization or JWE JSON Serialization is
// preferred when creating JWEs. The default value is true, which is to use
// compact serialization when possible. If multiple recipients exist, or if any
// unprotected headers exist, then JWE JSON Serialization is used regardless of
// this property setting.
bool get_PreferCompact(void);
// Controls whether the JWE Compact Serialization or JWE JSON Serialization is
// preferred when creating JWEs. The default value is true, which is to use
// compact serialization when possible. If multiple recipients exist, or if any
// unprotected headers exist, then JWE JSON Serialization is used regardless of
// this property setting.
void put_PreferCompact(bool newVal);
// Controls whether the flattened serialization is preferred when JWE JSON
// Serialization is used. The default value is true, which is to use the
// flattened serialization when possible. If multiple recipients exist, then the
// general (non-flattened) JWE JSON Serialization is used regardless of this
// property setting.
bool get_PreferFlattened(void);
// Controls whether the flattened serialization is preferred when JWE JSON
// Serialization is used. The default value is true, which is to use the
// flattened serialization when possible. If multiple recipients exist, then the
// general (non-flattened) JWE JSON Serialization is used regardless of this
// property setting.
void put_PreferFlattened(bool newVal);
// ----------------------
// Methods
// ----------------------
// Decrypts a JWE and returns the original (decrypted) string content. The byte
// representation of the decrypted bytes is indicated by charset (such as "utf-8").
// (The charset tells Chilkat how to intepret the decrypted bytes as characters.)
//
// The index specifies which recipient key is used for decryption. (Most JWEs have
// only a single recipent, and thus the index is typically 0.)
//
// Supported Algorithms:
// RSAES OAEP 256 (using SHA-256 and MGF1 with SHA-256) encryption with
// A128CBC-HS256, A192CBC-HS384, A256CBC-HS512, A128GCM, A192GCM, A256GCM
// RSAES OAEP (using SHA-1 and MGF1 with SHA-1) encryption with A128CBC-HS256,
// A192CBC-HS384, A256CBC-HS512, A128GCM, A192GCM, A256GCM
// RSAES-PKCS1-V1_5 encryption with A128CBC-HS256, A192CBC-HS384,
// A256CBC-HS512, A128GCM, A192GCM, A256GCM
// Direct symmetric key encryption with pre-shared key A128CBC-HS256,
// A192CBC-HS384, A256CBC-HS512, A128GCM, A192GCM and A256GCM
// A128KW, A192KW, A256KW encryption with A128CBC-HS256, A192CBC-HS384,
// A256CBC-HS512, A128GCM, A192GCM, A256GCM
// A128GCMKW, A192GCMKW, A256GCMKW encryption with A128CBC-HS256,
// A192CBC-HS384, A256CBC-HS512, A128GCM, A192GCM, A256GCM
// PBES2-HS256+A128KW, PBES2-HS384+A192KW, PBES2-HS512+A256KW with
// A128CBC-HS256, A192CBC-HS384, A256CBC-HS512, A128GCM, A192GCM, A256GCM
//
bool Decrypt(int index, const char *charset, CkString &outStr);
// Decrypts a JWE and returns the original (decrypted) string content. The byte
// representation of the decrypted bytes is indicated by charset (such as "utf-8").
// (The charset tells Chilkat how to intepret the decrypted bytes as characters.)
//
// The index specifies which recipient key is used for decryption. (Most JWEs have
// only a single recipent, and thus the index is typically 0.)
//
// Supported Algorithms:
// RSAES OAEP 256 (using SHA-256 and MGF1 with SHA-256) encryption with
// A128CBC-HS256, A192CBC-HS384, A256CBC-HS512, A128GCM, A192GCM, A256GCM
// RSAES OAEP (using SHA-1 and MGF1 with SHA-1) encryption with A128CBC-HS256,
// A192CBC-HS384, A256CBC-HS512, A128GCM, A192GCM, A256GCM
// RSAES-PKCS1-V1_5 encryption with A128CBC-HS256, A192CBC-HS384,
// A256CBC-HS512, A128GCM, A192GCM, A256GCM
// Direct symmetric key encryption with pre-shared key A128CBC-HS256,
// A192CBC-HS384, A256CBC-HS512, A128GCM, A192GCM and A256GCM
// A128KW, A192KW, A256KW encryption with A128CBC-HS256, A192CBC-HS384,
// A256CBC-HS512, A128GCM, A192GCM, A256GCM
// A128GCMKW, A192GCMKW, A256GCMKW encryption with A128CBC-HS256,
// A192CBC-HS384, A256CBC-HS512, A128GCM, A192GCM, A256GCM
// PBES2-HS256+A128KW, PBES2-HS384+A192KW, PBES2-HS512+A256KW with
// A128CBC-HS256, A192CBC-HS384, A256CBC-HS512, A128GCM, A192GCM, A256GCM
//
const char *decrypt(int index, const char *charset);
// Decrypts the loaded JWE and appends the decrypted bytes to the contents of bd.
// The index specifies which recipient key is used for decryption. (Most JWEs have
// only a single recipent, and thus the index is typically 0.)
bool DecryptBd(int index, CkBinData &bd);
// Decrypts the loaded JWE and appends the decrypted content to contentSb. The byte
// representation of the decrypted bytes is indicated by charset (such as "utf-8").
// (This tells Chilkat how to interpret the bytes as characters.)
//
// The index specifies which recipient key is used for decryption. (Most JWEs have
// only a single recipent, and thus the index is typically 0.)
//
bool DecryptSb(int index, const char *charset, CkStringBuilder &contentSb);
// Encrypts string content to produce a JWE. The byte representation of the content is
// indicated by charset (such as "utf-8").
//
// Supported Algorithms:
// RSAES OAEP 256 (using SHA-256 and MGF1 with SHA-256) encryption with
// A128CBC-HS256, A192CBC-HS384, A256CBC-HS512, A128GCM, A192GCM, A256GCM
// RSAES OAEP (using SHA-1 and MGF1 with SHA-1) encryption with A128CBC-HS256,
// A192CBC-HS384, A256CBC-HS512, A128GCM, A192GCM, A256GCM
// RSAES-PKCS1-V1_5 encryption with A128CBC-HS256, A192CBC-HS384,
// A256CBC-HS512, A128GCM, A192GCM, A256GCM
// Direct symmetric key encryption with pre-shared key A128CBC-HS256,
// A192CBC-HS384, A256CBC-HS512, A128GCM, A192GCM and A256GCM
// A128KW, A192KW, A256KW encryption with A128CBC-HS256, A192CBC-HS384,
// A256CBC-HS512, A128GCM, A192GCM, A256GCM
// A128GCMKW, A192GCMKW, A256GCMKW encryption with A128CBC-HS256,
// A192CBC-HS384, A256CBC-HS512, A128GCM, A192GCM, A256GCM
// PBES2-HS256+A128KW, PBES2-HS384+A192KW, PBES2-HS512+A256KW with
// A128CBC-HS256, A192CBC-HS384, A256CBC-HS512, A128GCM, A192GCM, A256GCM
//
bool Encrypt(const char *content, const char *charset, CkString &outStr);
// Encrypts string content to produce a JWE. The byte representation of the content is
// indicated by charset (such as "utf-8").
//
// Supported Algorithms:
// RSAES OAEP 256 (using SHA-256 and MGF1 with SHA-256) encryption with
// A128CBC-HS256, A192CBC-HS384, A256CBC-HS512, A128GCM, A192GCM, A256GCM
// RSAES OAEP (using SHA-1 and MGF1 with SHA-1) encryption with A128CBC-HS256,
// A192CBC-HS384, A256CBC-HS512, A128GCM, A192GCM, A256GCM
// RSAES-PKCS1-V1_5 encryption with A128CBC-HS256, A192CBC-HS384,
// A256CBC-HS512, A128GCM, A192GCM, A256GCM
// Direct symmetric key encryption with pre-shared key A128CBC-HS256,
// A192CBC-HS384, A256CBC-HS512, A128GCM, A192GCM and A256GCM
// A128KW, A192KW, A256KW encryption with A128CBC-HS256, A192CBC-HS384,
// A256CBC-HS512, A128GCM, A192GCM, A256GCM
// A128GCMKW, A192GCMKW, A256GCMKW encryption with A128CBC-HS256,
// A192CBC-HS384, A256CBC-HS512, A128GCM, A192GCM, A256GCM
// PBES2-HS256+A128KW, PBES2-HS384+A192KW, PBES2-HS512+A256KW with
// A128CBC-HS256, A192CBC-HS384, A256CBC-HS512, A128GCM, A192GCM, A256GCM
//
const char *encrypt(const char *content, const char *charset);
// Encrypts the contents of contentBd to produce a JWE that is appended to the contents
// of jweSb. (This method provides the means to produce a JWE from binary content.)
bool EncryptBd(CkBinData &contentBd, CkStringBuilder &jweSb);
// Encrypts the contents of contentSb to produce a JWE that is appended to the contents
// of jweSb. The byte representation of the string to be encrypted is indicated by
// charset (such as "utf-8").
bool EncryptSb(CkStringBuilder &contentSb, const char *charset, CkStringBuilder &jweSb);
// Finds the index of the recipient with a header parameter (paramName) equal to a
// specified value (paramValue). Returns -1 if no recipient contains a header with the
// given name/value. If caseSensitive is true, then the header param name/value
// comparisons are case sensitive. Otherwise it is case insensitive.
//
// The procedure for decrypting a JWE with multiple recipients is the following:
// Load the JWE via one of the Load* methods.
// Find the recipient index by some identifying header paramter. The typical
// case is via the "kid" header parameter. ("kid" is an arbitrary key ID
// applications can assign to identify keys.)
// Set the key for decryption at the found index by calling SetPrivateKey,
// SetWrappingKey, or SetPassword, depending on the type of key wrapping that is
// employed.
// Call Decrypt, DecryptSb, or DecryptBd to decrypt for the recipient (and key)
// at the given index.
//
int FindRecipient(const char *paramName, const char *paramValue, bool caseSensitive);
// Loads the contents of a JWE.
bool LoadJwe(const char *jwe);
// Loads the contents of a JWE from a StringBuilder object.
bool LoadJweSb(CkStringBuilder &sb);
// Sets the optional Additional Authenticated Data. This is only used for
// non-compact serializations. The charset specifies the character encoding (such as
// "utf-8") to be used for the byte representation for the additional authenticated
// data.
bool SetAad(const char *aad, const char *charset);
// Sets the optional Additional Authenticated Data. This is only used for
// non-compact serializations. This method provides a way for binary (non-text)
// additional authenticated data to be used.
bool SetAadBd(CkBinData &aad);
// Sets the PBES2 password for key encryption or decryption. This is for the case
// where the content encryption key (CEK) is encrypted using PBES2. An PBES2
// password should be used in the cases where the "alg" header parameter value is
// equal to one of the following:
// PBES2-HS256+A128KW
// PBES2-HS384+A192KW
// PBES2-HS512+A256KW
// The index is the index of the recipient, where the 1st recipient is at index 0.
// (The typical use case for JWEs is for a single recipient.)
bool SetPassword(int index, const char *password);
// Sets a private key for RSA key unwrapping/decryption. This is for the case where
// the content encryption key (CEK) is encrypted using RSA. An RSA private key
// should be used for decrypting in the cases where the "alg" header parameter
// value is equal to one of the following:
// RSA1_5
// RSA-OAEP
// RSA-OAEP-256
// RSA-OAEP-384 (added in Chilkat v9.5.0.71)
// RSA-OAEP-512 (added in Chilkat v9.5.0.71)
// The index is the index of the recipient, where the 1st recipient is at index 0.
// (The typical use case for JWEs is for a single recipient.)
bool SetPrivateKey(int index, CkPrivateKey &privKey);
// Sets the JWE Protected Header.
bool SetProtectedHeader(CkJsonObject &json);
// Sets a public key for RSA key wrapping encryption. This is for the case where
// the content encryption key (CEK) is encrypted using RSA. An RSA public key
// should be used when encrypting for the cases where the "alg" header parameter
// value is equal to one of the following:
// RSA1_5
// RSA-OAEP
// RSA-OAEP-256
// The index is the index of the recipient, where the 1st recipient is at index 0.
// (The typical use case for JWEs is for a single recipient.)
bool SetPublicKey(int index, CkPublicKey &pubKey);
// Sets a per-recipient unprotected header. This method would only be called if the
// JWE is for multiple recipients. The 1st recipient is at index 0.
bool SetRecipientHeader(int index, CkJsonObject &json);
// Sets the JWE Shared Unprotected Header.
bool SetUnprotectedHeader(CkJsonObject &json);
// Sets the AES wrapping key for encryption or decryption. This is for the case
// where the content encryption key (CEK) is encrypted using AES Key Wrap or AES
// GCM. An AES key should be used in the cases where the "alg" header parameter
// value is equal to one of the following:
// A128KW
// A192KW
// A256KW
// A128GCMKW
// A192GCMKW
// A256GCMKW
// dir
// The index is the index of the recipient, where the 1st recipient is at index 0.
// (The typical use case for JWEs is for a single recipient.)
//
// Note: This method also sets the shared direct symmetric key for the case when
// the "alg" is equal to "dir". In this case, the key specified is not actualy a
// key encryption key, but is the direct content encryption key.
//
// The encoding indicates the representation, such as "base64", "hex", "base64url",
// etc. of the encodedKey.
//
bool SetWrappingKey(int index, const char *encodedKey, const char *encoding);
// END PUBLIC INTERFACE
};
#if !defined(__sun__) && !defined(__sun)
#pragma pack (pop)
#endif
#endif
| [
"namtuanbk@gmail.com"
] | namtuanbk@gmail.com |
bfb991504406d6404c2d10b7176c3a9c8143b4a7 | 578aa20177519a89f99e12b71ec1df94241fc7e8 | /US3DTouch/vtkFlRenderWindowInteractor.cxx | df02bdea27b22c57d074c409637a20b7358dd5ad | [
"MIT"
] | permissive | berardino/haptic | 157244337b4819cb73eaa602b624eef0e7c2b282 | 8cb2bec3566e25baed903cb6159503c20663fb30 | refs/heads/master | 2021-01-22T21:58:45.036080 | 2017-03-20T18:58:02 | 2017-03-20T18:58:02 | 85,495,491 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 14,704 | cxx | /*
* vtkFlRenderWindowInteractor - class to enable VTK to render to and interact
* with a FLTK window.
*
* Copyright (c) 2002 Charl P. Botha <cpbotha@ieee.org> http://cpbotha.net/
* Based on original code and concept copyright (c) 2000,2001 David Pont
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: vtkFlRenderWindowInteractor.cxx,v 1.19 2002/04/22 13:02:05 cpbotha Exp $
*/
/*
* You must not delete one of these classes. Make use of the Delete()
* method... this thing makes use of VTK reference counting. Let me
* repeat that: never "delete" an instance of this class, always use
* ->Delete().
*/
#include "vtkFlRenderWindowInteractor.h"
// FLTK
#include <FL/x.H>
// vtk
#include <vtkRenderWindow.h>
#include <vtkRenderer.h>
#include <vtkInteractorStyle.h>
#include <vtkVersion.h>
//---------------------------------------------------------------------------
vtkFlRenderWindowInteractor::vtkFlRenderWindowInteractor() :
Fl_Gl_Window( 0, 0, 300, 300, "" ), vtkRenderWindowInteractor()
{
// this is a subclass of Fl_Group, call end so children cant be added
this->end();
}
//---------------------------------------------------------------------------
vtkFlRenderWindowInteractor::vtkFlRenderWindowInteractor( int x, int y, int w, int h) :
Fl_Gl_Window( x, y, w, h, NULL ), vtkRenderWindowInteractor()
{
// this is a subclass of Fl_Group, call end so children cant be added
this->end();
}
//---------------------------------------------------------------------------
vtkFlRenderWindowInteractor::~vtkFlRenderWindowInteractor()
{
// according to the fltk docs, destroying a widget does NOT remove it from
// its parent, so we have to do that explicitly at destruction
// (and remember, NEVER delete() an instance of this class)
if (parent())
((Fl_Group*)parent())->remove(*(Fl_Gl_Window*)this);
}
//---------------------------------------------------------------------------
vtkFlRenderWindowInteractor * vtkFlRenderWindowInteractor::New()
{
// we don't make use of the objectfactory, because we're not registered
return new vtkFlRenderWindowInteractor;
}
//---------------------------------------------------------------------------
void vtkFlRenderWindowInteractor::Initialize()
{
// if don't have render window then we can't do anything yet
if (!RenderWindow)
{
vtkErrorMacro(<< "vtkFlRenderWindowInteractor::Initialize has no render window");
return;
}
int *size = RenderWindow->GetSize();
// enable everything and start rendering
Enable(); //Ho disabilitato l'interazione con la scena
// here we USED to have RenderWindow->Start(); vtkRWI has it as ->Render(),
// so we'll try that to remain more consistent.
//RenderWindow->Render();
RenderWindow->Render();
// set the size in the render window interactor
Size[0] = size[0];
Size[1] = size[1];
// this is initialized
Initialized = 1;
}
//---------------------------------------------------------------------------
void vtkFlRenderWindowInteractor::Enable()
{
// if already enabled then done
if (Enabled)
return;
// that's it
Enabled = 1;
Modified();
}
//---------------------------------------------------------------------------
void vtkFlRenderWindowInteractor::Disable()
{
// if already disabled then done
if (!Enabled)
return;
// that's it (we can't remove the event handler like it should be...)
Enabled = 0;
Modified();
}
//---------------------------------------------------------------------------
void vtkFlRenderWindowInteractor::Start()
{
// the interactor cannot control the event loop
vtkErrorMacro(<<"vtkFlRenderWindowInteractor::Start() interactor cannot control event loop.");
}
//---------------------------------------------------------------------------
void vtkFlRenderWindowInteractor::SetRenderWindow(vtkRenderWindow *aren)
{
vtkRenderWindowInteractor::SetRenderWindow(aren);
// if a vtkFlRenderWindowInteractor has been shown already, and one
// re-sets the RenderWindow, neither UpdateSize nor draw is called,
// so we have to force the dimensions of the NEW RenderWindow to match
// the our (vtkFlRWI) dimensions
if (RenderWindow)
RenderWindow->SetSize(this->w(), this->h());
}
//---------------------------------------------------------------------------
// this gets called during FLTK window draw()s and resize()s
void vtkFlRenderWindowInteractor::UpdateSize(int W, int H)
{
if (RenderWindow != NULL)
{
// if the size changed tell render window
if ( (W != Size[0]) || (H != Size[1]) )
{
// adjust our (vtkRenderWindowInteractor size)
Size[0] = W;
Size[1] = H;
// and our RenderWindow's size
RenderWindow->SetSize(W, H);
// FLTK can move widgets on resize; if that happened, make
// sure the RenderWindow position agrees with that of the
// Fl_Gl_Window
int *pos = RenderWindow->GetPosition();
if( pos[0] != x() || pos[1] != y() ) {
RenderWindow->SetPosition( x(), y() );
}
}
}
}
//---------------------------------------------------------------------------
// FLTK needs global timer callbacks, but we set it up so that this global
// callback knows which instance OnTimer() to call
void OnTimerGlobal(void *p)
{
if (p)
((vtkFlRenderWindowInteractor *)p)->OnTimer();
}
//---------------------------------------------------------------------------
int vtkFlRenderWindowInteractor::CreateTimer(int timertype)
{
// to be called every 10 milliseconds, one shot timer
// we pass "this" so that the correct OnTimer instance will be called
if (timertype == VTKI_TIMER_FIRST)
Fl::add_timeout(0.01, OnTimerGlobal, (void *)this);
else
Fl::repeat_timeout(0.01, OnTimerGlobal, (void *)this);
return 1;
// Fl::repeat_timer() is more correct, it doesn't measure the timeout
// from now, but from when the system call that caused this timeout
// elapsed.
}
//---------------------------------------------------------------------------
int vtkFlRenderWindowInteractor::DestroyTimer()
{
// do nothing
return 1;
}
void vtkFlRenderWindowInteractor::OnTimer(void)
{
if (!Enabled)
return;
// this is all we need to do, InteractorStyle is stateful and will
// continue with whatever it's busy
#if (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
// new style
this->InvokeEvent(vtkCommand::TimerEvent, NULL);
#else
// old style
InteractorStyle->OnTimer();
#endif
}
//---------------------------------------------------------------------------
void vtkFlRenderWindowInteractor::TerminateApp()
{
}
//---------------------------------------------------------------------------
// FLTK event handlers
//---------------------------------------------------------------------------
void vtkFlRenderWindowInteractor::flush(void)
{
// err, we don't want to do any fansy pansy Fl_Gl_Window stuff, so we
// bypass all of it (else we'll get our front and back buffers in all
// kinds of tangles, and need extra glXSwapBuffers() calls and all that)
draw();
}
void vtkFlRenderWindowInteractor::draw_overlay(void){
}
//---------------------------------------------------------------------------
void vtkFlRenderWindowInteractor::draw(void){
if (RenderWindow!=NULL)
{
// make sure the vtk part knows where and how large we are
UpdateSize( this->w(), this->h() );
RenderWindow->SetWindowId( (void *)fl_xid( this ) );
#ifndef WIN32
RenderWindow->SetDisplayId( fl_display );
#endif
// get vtk to render to the Fl_Gl_Window
Render();
}
}
//---------------------------------------------------------------------------
void vtkFlRenderWindowInteractor::resize( int x, int y, int w, int h ) {
// make sure VTK knows about the new situation
UpdateSize( w, h );
// resize the FLTK window by calling ancestor method
Fl_Gl_Window::resize( x, y, w, h );
}
//---------------------------------------------------------------------------
// main FLTK event handler
int vtkFlRenderWindowInteractor::handle( int event ) {
if( !Enabled ) return 0;
#if (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
// setup for new style
// SEI(x, y, ctrl, shift, keycode, repeatcount, keysym)
this->SetEventInformation(Fl::event_x(), this->h()-Fl::event_y()-1,
Fl::event_state( FL_CTRL ), Fl::event_state( FL_SHIFT ),
Fl::event_key(), 1, NULL);
#endif
switch( event )
{
case FL_FOCUS:
case FL_UNFOCUS:
; // Return 1 if you want keyboard events, 0 otherwise. Yes we do
break;
case FL_KEYBOARD: // keypress
#if (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
// new style
this->InvokeEvent(vtkCommand::MouseMoveEvent, NULL);
this->InvokeEvent(vtkCommand::KeyPressEvent, NULL);
this->InvokeEvent(vtkCommand::CharEvent, NULL);
#else
// old style
InteractorStyle->OnChar(Fl::event_state( FL_CTRL ), Fl::event_state( FL_SHIFT ), Fl::event_key(), 1);
#endif
// now for possible controversy: there is no way to find out if the InteractorStyle actually did
// something with this event. To play it safe (and have working hotkeys), we return "0", which indicates
// to FLTK that we did NOTHING with this event. FLTK will send this keyboard event to other children
// in our group, meaning it should reach any FLTK keyboard callbacks (including hotkeys)
return 0;
break;
case FL_PUSH: // mouse down
this->take_focus(); // this allows key events to work
switch( Fl::event_button() )
{
case FL_LEFT_MOUSE:this->LeftButtonPress(Fl::event_x(),Fl::event_y());
#if (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
// new style
this->InvokeEvent(vtkCommand::LeftButtonPressEvent,NULL);
#else
// old style
InteractorStyle->OnLeftButtonDown(Fl::event_state( FL_CTRL ), Fl::event_state( FL_SHIFT ), Fl::event_x(), this->h()-Fl::event_y()-1);
#endif
break;
case FL_MIDDLE_MOUSE:
#if (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
// new style
this->InvokeEvent(vtkCommand::MiddleButtonPressEvent,NULL);
#else
// old style
InteractorStyle->OnMiddleButtonDown(Fl::event_state( FL_CTRL ), Fl::event_state( FL_SHIFT ), Fl::event_x(), this->h()-Fl::event_y()-1);
#endif
break;
case FL_RIGHT_MOUSE:this->RightButtonPress(Fl::event_x(),Fl::event_y());
#if (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
// new style
this->InvokeEvent(vtkCommand::RightButtonPressEvent,NULL);
#else
// old style
InteractorStyle->OnRightButtonDown(Fl::event_state( FL_CTRL ), Fl::event_state( FL_SHIFT ), Fl::event_x(), this->h()-Fl::event_y()-1);
#endif
break;
}
break; // this break should be here, at least according to vtkXRenderWindowInteractor
// we test for both of these, as fltk classifies mouse moves as with or
// without button press whereas vtk wants all mouse movement (this bug took
// a while to find :)
case FL_DRAG:this->OnMouseDrag();
case FL_MOVE:this->MouseMove(Fl::event_x(),Fl::event_y());
#if (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
// new style
this->InvokeEvent(vtkCommand::MouseMoveEvent, NULL);
#else
// old style
InteractorStyle->OnMouseMove(Fl::event_state( FL_CTRL ), Fl::event_state( FL_SHIFT ), Fl::event_x(), this->h()-Fl::event_y()-1);
#endif
break;
case FL_RELEASE: // mouse up
switch( Fl::event_button() ) {
case FL_LEFT_MOUSE:this->LeftButtonRelease(Fl::event_x(),Fl::event_y());
#if (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
// new style
this->InvokeEvent(vtkCommand::LeftButtonReleaseEvent,NULL);
#else
// old style
InteractorStyle->OnLeftButtonUp(Fl::event_state( FL_CTRL ), Fl::event_state( FL_SHIFT ), Fl::event_x(), this->h()-Fl::event_y()-1);
#endif
break;
case FL_MIDDLE_MOUSE:
#if (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
// new style
this->InvokeEvent(vtkCommand::MiddleButtonReleaseEvent,NULL);
#else
// old style
InteractorStyle->OnMiddleButtonUp(Fl::event_state( FL_CTRL ), Fl::event_state( FL_SHIFT ), Fl::event_x(), this->h()-Fl::event_y()-1);
#endif
break;
case FL_RIGHT_MOUSE:this->RightButtonRelease(Fl::event_x(),Fl::event_y());
#if (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
// new style
this->InvokeEvent(vtkCommand::RightButtonReleaseEvent,NULL);
#else
// old style
InteractorStyle->OnRightButtonUp(Fl::event_state( FL_CTRL ), Fl::event_state( FL_SHIFT ), Fl::event_x(), this->h()-Fl::event_y()-1);
#endif
break;
}
break;
default: // let the base class handle everything else
return Fl_Gl_Window::handle( event );
} // switch(event)...
return 1; // we handled the event if we didn't return earlier
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
static char const rcsid[] =
"$Id: vtkFlRenderWindowInteractor.cxx,v 1.19 2002/04/22 13:02:05 cpbotha Exp $";
const char *vtkFlRenderWindowInteractor_rcsid(void)
{
return rcsid;
}
void vtkFlRenderWindowInteractor::LeftButtonPress(int x, int y)
{
}
void vtkFlRenderWindowInteractor::RightButtonPress(int x, int y)
{
}
void vtkFlRenderWindowInteractor::LeftButtonRelease(int x, int y)
{
}
void vtkFlRenderWindowInteractor::RightButtonRelease(int x, int y)
{
}
void vtkFlRenderWindowInteractor::MouseMove(int x, int y)
{
}
void vtkFlRenderWindowInteractor::OnMouseDrag()
{
}
| [
"bto@tradeshift.com"
] | bto@tradeshift.com |
6705d78aadf3e61627fdb5a947d016273edfdaeb | b93f4b5356860e00d48c1fd9232dc5953adff1fa | /error.hpp | 55339c75cb5c83fe15de44493cc8a39dd23ee2f6 | [
"Apache-2.0"
] | permissive | CaptFrank/IrRemote | 0a783b329097fb6ca7a8c78c2f67cbfff87a5757 | b2b69ee2b2312ff709d9716bf4c8ccb7d477e793 | refs/heads/master | 2021-05-01T05:30:10.508716 | 2017-01-23T01:01:06 | 2017-01-23T01:01:06 | 79,757,714 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 933 | hpp | /*
* error.h
*
* Created on: Jan 22, 2017
* Author: francispapineau
*/
#ifndef IRCONTROLLER_ERROR_HPP_
#define IRCONTROLLER_ERROR_HPP_
/**
* This enum defines the global OS error codes.
* All modules should include this file to get the
* various errors.
*/
typedef enum {
/*
* Global Errors
*/
ERROR_OK, //!< ERROR_OK
ERROR_FAIL, //!< ERROR_FAIL
ERROR_NULL_PTR, //!< ERROR_NULL_PTR
/*
* IR Controller Errors
*/
ERROR_NOT_ACTIVATED, //!< ERROR_NOT_ACTIVATED
ERROR_COMMAND_NOT_VALID, //!< ERROR_COMMAND_NOT_VALID
ERROR_NOT_SUPPORTED_IOCTL,//!< ERROR_NOT_SUPPORTED_IOCTL
ERROR_NO_MATCH, //!< ERROR_NO_MATCH
ERROR_IR_SETUP_FAIL,
/*
* WIFI/MQTT Controller Errors
*/
ERROR_TIMEOUT,
ERROR_CONNECTION,
ERROR_SUBSCRIBING,
ERROR_PUBLISHING,
ERROR_WIFI_SETUP_FAIL,
ERROR_MQTT_SETUP_FAIL
} error_t;
#endif /* IRCONTROLLER_ERROR_HPP_ */
| [
"francispapineau@gmail.com"
] | francispapineau@gmail.com |
1dbb26f19f9fb88689eb5be0623f9b68bf59b78d | 1b48b76992426b3b6411bbad2487cd66755f4dab | /src/texteditor/codeassist/completionassistprovider.h | 9faf84dcb9f6dd027007d9bfc41cd79d9ee3b6e6 | [] | no_license | OSLL/sca | db36814bdf0c3d575ced38562f9223cef4f2fce5 | 389a0a6973052abb1ae0e7d995f5d3c54fd72481 | refs/heads/master | 2020-05-07T11:12:12.329830 | 2014-03-10T10:03:06 | 2014-03-10T10:03:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,090 | h | /****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef COMPLETIONASSISTPROVIDER_H
#define COMPLETIONASSISTPROVIDER_H
#include "iassistprovider.h"
namespace TextEditor {
class TEXTEDITOR_EXPORT CompletionAssistProvider : public IAssistProvider
{
Q_OBJECT
public:
CompletionAssistProvider();
virtual ~CompletionAssistProvider();
virtual bool isAsynchronous() const;
virtual int activationCharSequenceLength() const;
virtual bool isActivationCharSequence(const QString &sequence) const;
virtual bool isContinuationChar(const QChar &c) const;
};
} // TextEditor
#endif // COMPLETIONASSISTPROVIDER_H
| [
"exzo0mex@gmail.com"
] | exzo0mex@gmail.com |
9c909bfb34de3f32da76a9c2671b793b41a928e9 | 2982a765bb21c5396587c86ecef8ca5eb100811f | /util/wm5/LibCore/Assert/Wm5Assert.h | 4ed90d6848b8e952aba09ac5a664fc2b522f5839 | [] | no_license | evanw/cs224final | 1a68c6be4cf66a82c991c145bcf140d96af847aa | af2af32732535f2f58bf49ecb4615c80f141ea5b | refs/heads/master | 2023-05-30T19:48:26.968407 | 2011-05-10T16:21:37 | 2011-05-10T16:21:37 | 1,653,696 | 27 | 9 | null | null | null | null | UTF-8 | C++ | false | false | 1,604 | h | // 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
//
// File Version: 5.0.1 (2010/10/01)
#ifndef WM5ASSERT_H
#define WM5ASSERT_H
#include "Wm5CoreLIB.h"
#ifdef WM5_USE_ASSERT
//----------------------------------------------------------------------------
// Use WM5 asserts with file/line tracking.
//----------------------------------------------------------------------------
namespace Wm5
{
class WM5_CORE_ITEM Assert
{
public:
// Construction and destruction.
Assert (bool condition, const char* file, int line, const char* format,
...);
~Assert ();
private:
enum { MAX_MESSAGE_BYTES = 1024 };
static const char* msDebugPrompt;
static const size_t msDebugPromptLength;
static const char* msMessagePrefix;
#ifdef WM5_USE_ASSERT_WRITE_TO_MESSAGE_BOX
static const char* msMessageBoxTitle;
#endif
};
}
#define assertion(condition, format, ...) \
Wm5::Assert(condition, __FILE__, __LINE__, format, __VA_ARGS__)
//----------------------------------------------------------------------------
#else
//----------------------------------------------------------------------------
// Use standard asserts.
//----------------------------------------------------------------------------
#define assertion(condition, format, ...) assert(condition)
//----------------------------------------------------------------------------
#endif
#endif
| [
"evan_wallace@brown.edu"
] | evan_wallace@brown.edu |
5f4997b0496b02e049936b610957f3563f16044e | 948653a21d87000cf1efdee72f538b93a4b3f713 | /exam/example0/myclass.h | 354fd7c2ac30ee2655b3e27277e7dbd03367a43c | [] | no_license | feewet/robotics | 013ac056391c073ca498bb63cf3bc9bc969d204d | 877cf49fe42fad1f06670e381fcda1bcf542c168 | refs/heads/master | 2020-04-06T16:20:32.154857 | 2018-11-14T21:53:32 | 2018-11-14T21:53:32 | 157,615,989 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 64 | h | // myclass.h
class MyClass
{
public:
void foo();
int bar;
};
| [
"feewet@feewets-MacBook-Pro.local"
] | feewet@feewets-MacBook-Pro.local |
0bfceb9da798ecd306b7baa5504e9cd2b4f0603f | 9532435e3bcb4fd1ba3d05c947c0512c77573ae8 | /Source/ClientSide/UploadTool/UploadToolDlg.h | 955898d84f7ddd303fe5db776bfa74a67674ddd5 | [] | no_license | SeyedofOld/ModelPublishSuite | 16715ac23c1b8ddae5f26c653bd36093a523f536 | fe81f82b81eb0fadb2af2521eaf9be75f864ae84 | refs/heads/master | 2021-09-20T14:26:00.371238 | 2018-08-10T19:22:52 | 2018-08-10T19:22:52 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,008 | h |
// UploadToolDlg.h : header file
//
#pragma once
// CUploadToolDlg dialog
class CUploadToolDlg : public CDialogEx
{
// Construction
public:
CUploadToolDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_UPLOADTOOL_DIALOG };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnBnClickedOk ();
afx_msg void OnBnClickedBtnModelUpload ();
afx_msg void OnBnClickedBtnAdUpload ();
virtual LRESULT WindowProc ( UINT message, WPARAM wParam, LPARAM lParam );
void GetDlgItemAsChar ( UINT id, char* pszValue ) ;
afx_msg void OnBnClickedBtnModelFile ();
afx_msg void OnBnClickedBtnCreateSubs ();
afx_msg void OnBnClickedBtnAdFile ();
};
| [
"seyedof@yahoo.com"
] | seyedof@yahoo.com |
3e7874c7e40949b2af29a07ec101e8b9eae0741c | 12f2153cce750f245e309370f02ead5609b49d50 | /day04 (SUB-TYPING POLYMORPHISM)/ex01/PlasmaRifle.hpp | 3da47cb06725d4abce42dd5c8a870b6539b527ba | [] | no_license | hlombard/Piscine_CPP | e638d082171b0e84ead6444373e2ec57b03da1ff | 90ce065d9a1714cdca0551c438c6e491742d0410 | refs/heads/master | 2023-02-23T16:56:24.722420 | 2021-01-26T18:52:08 | 2021-01-26T18:52:08 | 333,182,153 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 334 | hpp | #ifndef PLASMARIFLE_HPP
# define PLASMARIFLE_HPP
#include "AWeapon.hpp"
class PlasmaRifle : public AWeapon {
public:
PlasmaRifle(void);
PlasmaRifle(PlasmaRifle const & src);
virtual void attack(void) const;
PlasmaRifle & operator=(PlasmaRifle const & src);
virtual ~PlasmaRifle(void);
};
#endif
| [
"hlombard@student.42.fr"
] | hlombard@student.42.fr |
3a5cfc842d9a849248fa01507835f85cee1a6043 | e306da3350c227fd9a5aa8e7b3c2ab8d3ba59a43 | /probA.cpp | f2d443fba98c0435f7e2c5933eced9f7b2b74660 | [] | no_license | aleanajla/chap-2-tht | 7edbb60b8e89bf5160b192894940ceae699954bb | 80513015439c5c7f075d88257e35729c98d907c8 | refs/heads/main | 2023-02-15T10:00:09.417439 | 2021-01-12T18:36:11 | 2021-01-12T18:36:11 | 329,000,546 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,952 | cpp | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
struct Num{
int number;
Num *next;
}*head,*tail,*head1,*tail1;
Num*createNum(int number){
Num *newNum = (Num*)malloc(sizeof(Num));
newNum->number = number;
newNum->next = NULL;
return newNum;
}
void pushHead(int number){
Num *temp = createNum(number);
if(!head){
head = tail = temp;
}
else{
temp->next = head;
head = temp;
}
}
//2
void pushHead1(int number){
Num *temp = createNum(number);
if(!head1){
head1 = tail1 = temp;
}
else{
temp->next = head1;
head1 = temp;
}
}
void pushTail(int number){
Num *temp = createNum(number);
if(!head){
head = tail = temp;
}
else{
tail->next = temp;
tail = temp;
}
}
// 2
void pushTail1(int number){
Num *temp = createNum(number);
if(!head1){
head1 = tail1 = temp;
}
else{
tail1->next = temp;
tail1 = temp;
}
}
void popHead(){
if(!head){
return;
}
else if(head == tail){
free(head);
head = tail = NULL;
}
else{
Num *temp = head->next;
head->next = NULL;
free(head);
head = NULL;
}
}
//2
void popHead1(){
if(!head1){
return;
}
else if(head1 == tail1){
free(head1);
head1 = tail1 = NULL;
}
else{
Num *temp = head1->next;
head1->next = NULL;
free(head1);
head1 = NULL;
}
}
void popTail(){
if(!head){
return;
}
else if(head == tail){
free(head);
head = tail = NULL;
}
else{
Num *temp = head;
while(temp->next != tail){
temp = temp->next;
}
temp->next = NULL;
free(tail);
tail= temp;
}
}
//2
void popTail1(){
if(!head1){
return;
}
else if(head1 == tail1){
free(head1);
head1 = tail1 = NULL;
}
else{
Num *temp = head1;
while(temp->next != tail1){
temp = temp->next;
}
temp->next = NULL;
free(tail1);
tail1= temp;
}
}
void printList(){
Num *curr = head;
while(curr){
printf(" %d ->",curr->number);
curr = curr->next;
}
puts("NULL");
}
void printList1(){
Num *curr = head1;
while(curr){
printf(" %d ->",curr->number);
curr = curr->next;
}
puts("NULL");
}
int main(){
pushHead(50);
pushHead(30);
pushTail(80);
pushTail(90);
pushTail(110);
printf("Linked 1\n");
printList();
pushHead1(20);
pushHead1(10);
pushTail1(110);
pushTail1(120);
pushTail1(140);
printf("Linked 2\n");
printList1();
printf("Merge Linked\n");
pushHead(20);
pushHead(10);
pushTail(120);
pushTail(130);
pushTail(140);
printList();
return 0;
} | [
"alea.syukur@binus.ac.id"
] | alea.syukur@binus.ac.id |
74192d7d22b3a183cb81f6cb18e2bac3d1bd2508 | f3251cda54d23fce2f66514294a632b165dfe310 | /SI7015/SI7015.h | b95d2e81363dbd9ab5d39bff1d005cfe17c8ccd8 | [] | no_license | ryker1990/CE_ARDUINO_LIB | 7f20c330b6bbe3347328465c95b4710a928ea19d | 3ac9780d73255b4b2c5c85d308093339e44433ed | refs/heads/master | 2021-05-13T15:32:29.347345 | 2018-01-09T05:54:33 | 2018-01-09T05:54:33 | 116,772,431 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 5,275 | h | /**************************************************************************/
/*
Distributed with a free-will license.
Use it any way you want, profit or free, provided it fits in the licenses of its associated works.
SI7015
This code is designed to work with the SI7015_I2CADC I2C Mini Module available from ControlEverything.com.
https://www.controleverything.com/content/Temperature?sku=SI7015_I2CS#tabs-0-product_tabset-2
*/
/**************************************************************************/
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include <Wire.h>
/**************************************************************************
I2C ADDRESS/BITS
**************************************************************************/
#define SI7015_DEFAULT_ADDRESS (0x40)
/**************************************************************************
CONVERSION DELAY (in mS)
**************************************************************************/
#define SI7015_CONVERSIONDELAY (100)
/**************************************************************************
CONTROL REGISTER
**************************************************************************/
#define SI7015_REG_CONTROL_MASK (0xFF)
#define SI7015_REG_CONTROL_STATUS (0x00)
#define SI7015_REG_CONTROL_DATA_HI (0x01)
#define SI7015_REG_CONTROL_DATA_LO (0x02)
#define SI7015_REG_CONTROL_CONFIG (0x03)
#define SI7015_REG_CONTROL_ID (0x11)
/**************************************************************************
CONFIG REGISTER
**************************************************************************/
#define SI7015_REG_STATUS_MASK (0x01) // Status Settings
#define SI7015_REG_STATUS_READY (0x00) // Conversion Complete
#define SI7015_REG_STATUS_NOT_READY (0x01) // Conversion in Progress
/**************************************************************************
CONFIG REGISTER
**************************************************************************/
#define SI7015_REG_CONFIG_FAST_MASK (0x20) // Fast Mode Enable
#define SI7015_REG_CONFIG_FAST_ENABLE_35 (0x00) // 35 ms (typical)
#define SI7015_REG_CONFIG_FAST_ENABLE_18 (0x20) // 18 ms (typical)
#define SI7015_REG_CONFIG_ENABLE_MASK (0x10) // Temperature Enable
#define SI7015_REG_CONFIG_ENABLE_HUMIDITY (0x00) // Relative humidity
#define SI7015_REG_CONFIG_ENABLE_TEMPERATURE (0x10) // Temperature
#define SI7015_REG_CONFIG_HEATER_MASK (0x02) // Heater Enable
#define SI7015_REG_CONFIG_HEATER_DISABLE (0x00) // Heater Off
#define SI7015_REG_CONFIG_HEATER_ENABLE (0x02) // Heater On
#define SI7015_REG_CONFIG_CONVERSION_MASK (0x01) // Conversion Start
#define SI7015_REG_CONFIG_CONVERSION_DONT (0x00) // Do not start a conversion
#define SI7015_REG_CONFIG_CONVERSION_START (0x01) // Start a conversion
/**************************************************************************
COEFFICIENTS
**************************************************************************/
#define SI7015_TEMPERATURE_OFFSET (50)
#define SI7015_TEMPERATURE_SLOPE (32)
#define SI7015_HUMIDITY_OFFSET (24)
#define SI7015_HUMIDITY_SLOPE (16)
#define A0 (-4.7844)
#define A1 (0.4008)
#define A2 (-0.00393)
#define Q0 (0.060162)
#define Q1 (0.000508)
typedef enum
{
FAST_ENABLE_35 = SI7015_REG_CONFIG_FAST_ENABLE_35,
FAST_ENABLE_18 = SI7015_REG_CONFIG_FAST_ENABLE_18
} siFastEnable_t;
typedef enum
{
HEATER_OFF = SI7015_REG_CONFIG_HEATER_DISABLE,
HEATER_ON = SI7015_REG_CONFIG_HEATER_ENABLE
} siHeaterEnable_t;
typedef enum
{
CONVERSION_DONT = SI7015_REG_CONFIG_CONVERSION_DONT,
CONVERSION_START = SI7015_REG_CONFIG_CONVERSION_START
} siConversion_t;
class SI7015
{
protected:
// Instance-specific properties
uint8_t si_conversionDelay;
siFastEnable_t si_fastenable;
siHeaterEnable_t si_heaterenable;
siConversion_t si_conversion;
float last_temperature;
public:
uint8_t si_i2cAddress;
void getAddr_SI7015(uint8_t i2cAddress);
boolean begin(void);
uint16_t getMeasurement(uint8_t configValue);
float Measure_Temperature();
float Measure_Humidity();
void setFastEnable(siFastEnable_t fastenable);
siFastEnable_t getFastEnable(void);
void setHeaterEnable(siHeaterEnable_t heaterenable);
siHeaterEnable_t getHeaterEnable(void);
void setConversion(siConversion_t conversion);
siConversion_t getConversion(void);
private:
};
| [
"ryker1990@gmail.com"
] | ryker1990@gmail.com |
25846898a890b54ffc09a0dbfe6bee87eb44d6f1 | f291a7671d98bb529f74bf2aafbcc0f75c15018b | /source/annotator/source/plugins/pluginswidget.cpp | bc8b460823c989efdbee917cc0f6cf554bd8b68a | [
"Apache-2.0"
] | permissive | reger-men/annotator | c01c6e0341918c03f269fb3174874b98529cdbf8 | 7b040613a9197e0c13d904b19485d3bf28f94733 | refs/heads/master | 2021-01-15T14:53:27.086364 | 2016-07-08T23:00:42 | 2016-07-08T23:00:42 | 62,969,625 | 0 | 0 | null | 2016-07-09T21:20:01 | 2016-07-09T21:20:00 | null | UTF-8 | C++ | false | false | 1,158 | cpp | #include "pluginswidget.h"
#include "ui_pluginswidget.h"
#include "plugins/plugin.h"
#include "plugins/pluginloader.h"
PluginsWidget::PluginsWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::PluginsWidget)
{
ui->setupUi(this);
reload();
}
PluginsWidget::~PluginsWidget()
{
delete ui;
}
void PluginsWidget::reload()
{
ui->comboBox->clear();
for(Annotator::Plugin *plugin: Annotator::PluginLoader::getInstance().getPlugins().toStdList())
{
ui->comboBox->addItem(plugin->getName());
}
on_comboBox_currentIndexChanged(ui->comboBox->currentText());
this->updateGeometry();
ui->gridLayout->update();
ui->scrollArea->updateGeometry();
}
void PluginsWidget::on_comboBox_currentIndexChanged(const QString &arg1)
{
Annotator::PluginLoader::getInstance().setCurrent(arg1);
Annotator::Plugin * plugin = Annotator::PluginLoader::getInstance().getPlugin(arg1);
if(plugin){
if(lastWidget != nullptr){
ui->layout->takeAt(0);
lastWidget->setParent(nullptr);
}
lastWidget = plugin->getWidget();
ui->layout->addWidget(lastWidget);
}
}
| [
"adil-lashab@hotmail.com"
] | adil-lashab@hotmail.com |
f887ae051ed929ec76bc5cc2fae9963a958267e6 | fe3d7da03dad0238c90274283b39d0a72fa6d7f6 | /DirectShowFilters/BDReader/source/SubtitlePin.cpp | cc56974a5f46ef11eafe82715f62095002a54b40 | [] | no_license | morpheusxx/MediaPortal-1 | d39f55ea833f2e236d409698f46c1e2c7f8c8b54 | 91418996e35b76f08b5885246a84f131fff0c731 | refs/heads/EXP-TVE3.5-MP1-MP2 | 2023-08-03T12:07:08.853789 | 2014-07-20T08:48:57 | 2014-07-20T08:48:57 | 11,057,754 | 1 | 4 | null | 2023-06-04T11:10:11 | 2013-06-29T19:00:10 | C# | UTF-8 | C++ | false | false | 8,612 | cpp | /*
* Copyright (C) 2005-2011 Team MediaPortal
* http://www.team-mediaportal.com
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
* http://www.gnu.org/copyleft/gpl.html
*
*/
#pragma warning(disable:4996)
#pragma warning(disable:4995)
#include "StdAfx.h"
#include <streams.h>
#include "SubtitlePin.h"
#include "bdreader.h"
// For more details for memory leak detection see the alloctracing.h header
#include "..\..\alloctracing.h"
extern void LogDebug(const char *fmt, ...);
extern void SetThreadName(DWORD dwThreadID, char* threadName);
CSubtitlePin::CSubtitlePin(LPUNKNOWN pUnk, CBDReaderFilter *pFilter, HRESULT *phr,CCritSec* section) :
CSourceStream(NAME("pinSubtitle"), phr, pFilter, L"Subtitle"),
m_pFilter(pFilter),
CSourceSeeking(NAME("pinSubtitle"),pUnk,phr,section),
m_section(section),
m_bConnected(false),
m_bRunning(false),
m_bFlushing(false),
m_bSeekDone(true)
{
m_rtStart = 0;
m_dwSeekingCaps =
AM_SEEKING_CanSeekAbsolute |
AM_SEEKING_CanSeekForwards |
AM_SEEKING_CanSeekBackwards |
AM_SEEKING_CanGetStopPos |
AM_SEEKING_CanGetDuration |
//AM_SEEKING_CanGetCurrentPos |
AM_SEEKING_Source;
}
CSubtitlePin::~CSubtitlePin()
{
}
bool CSubtitlePin::IsConnected()
{
return m_bConnected;
}
STDMETHODIMP CSubtitlePin::NonDelegatingQueryInterface( REFIID riid, void ** ppv )
{
if (riid == IID_IMediaSeeking)
return CSourceSeeking::NonDelegatingQueryInterface( riid, ppv );
if (riid == IID_IMediaPosition)
return CSourceSeeking::NonDelegatingQueryInterface( riid, ppv );
return CSourceStream::NonDelegatingQueryInterface(riid, ppv);
}
HRESULT CSubtitlePin::GetMediaType(CMediaType *pmt)
{
pmt->InitMediaType();
pmt->SetType (& MEDIATYPE_Stream);
pmt->SetSubtype (& MEDIASUBTYPE_MPEG2_TRANSPORT);
pmt->SetSampleSize(1);
pmt->SetTemporalCompression(FALSE);
pmt->SetVariableSize();
return S_OK;
}
HRESULT CSubtitlePin::DecideBufferSize(IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *pRequest)
{
HRESULT hr;
CheckPointer(pAlloc, E_POINTER);
CheckPointer(pRequest, E_POINTER);
if (pRequest->cBuffers == 0)
pRequest->cBuffers = 30;
pRequest->cbBuffer = 8192;
ALLOCATOR_PROPERTIES Actual;
hr = pAlloc->SetProperties(pRequest, &Actual);
if (FAILED(hr))
return hr;
if (Actual.cbBuffer < pRequest->cbBuffer)
return E_FAIL;
return S_OK;
}
HRESULT CSubtitlePin::CheckConnect(IPin *pReceivePin)
{
HRESULT hr;
PIN_INFO pinInfo;
FILTER_INFO filterInfo;
hr = pReceivePin->QueryPinInfo(&pinInfo);
if (!SUCCEEDED(hr)) return E_FAIL;
else if (pinInfo.pFilter == NULL) return E_FAIL;
else pinInfo.pFilter->Release(); // we dont need the filter just the info
// we only want to connect to the DVB subtitle input pin
// on the subtitle filter (and not the teletext one for example!)
if (wcscmp(pinInfo.achName, L"In") != 0)
{
//LogDebug("sub pin: Cant connect to pin name %s", pinInfo.achName);
return E_FAIL;
}
hr=pinInfo.pFilter->QueryFilterInfo(&filterInfo);
filterInfo.pGraph->Release();
if (!SUCCEEDED(hr)) return E_FAIL;
if (wcscmp(filterInfo.achName, L"MediaPortal DVBSub3") !=0)
{
//LogDebug("sub pin: Cant connect to filter name %s", filterInfo.achName);
return E_FAIL;
}
return CBaseOutputPin::CheckConnect(pReceivePin);
}
HRESULT CSubtitlePin::CompleteConnect(IPin *pReceivePin)
{
HRESULT hr = CBaseOutputPin::CompleteConnect(pReceivePin);
if (SUCCEEDED(hr))
m_bConnected = true;
else
LogDebug("pin:CompleteConnect() failed:%x", hr);
REFERENCE_TIME refTime;
m_pFilter->GetDuration(&refTime);
m_rtDuration = CRefTime(refTime);
return hr;
}
HRESULT CSubtitlePin::BreakConnect()
{
//LogDebug("sub:BreakConnect() ok");
m_bConnected = false;
return CSourceStream::BreakConnect();
}
DWORD CSubtitlePin::ThreadProc()
{
SetThreadName(-1, "BDReader_SUBTITLE");
return __super::ThreadProc();
}
void CSubtitlePin::CreateEmptySample(IMediaSample *pSample)
{
if (pSample)
{
pSample->SetTime(NULL, NULL);
pSample->SetActualDataLength(0);
pSample->SetSyncPoint(false);
}
else
LogDebug("aud:CreateEmptySample() invalid sample!");
}
HRESULT CSubtitlePin::FillBuffer(IMediaSample *pSample)
{
try
{
CDeMultiplexer& demux = m_pFilter->GetDemultiplexer();
Packet* buffer=NULL;
do
{
if (m_pFilter->IsStopping() || !m_bRunning || !m_bSeekDone)
{
//LogDebug("sub:isseeking:%d %d",m_pFilter->IsSeeking() ,m_bSeeking);
CreateEmptySample(pSample);
Sleep(20);
return S_OK;
}
buffer = demux.GetSubtitle();
if (demux.EndOfFile())
{
CreateEmptySample(pSample);
return S_FALSE;
}
if (!buffer)
Sleep(20);
else
{
if (m_bDiscontinuity || buffer->bDiscontinuity)
{
LogDebug("sub: Set discontinuity");
pSample->SetDiscontinuity(true);
m_bDiscontinuity = false;
}
pSample->SetTime(NULL, NULL);
pSample->SetSyncPoint(FALSE);
BYTE* pSampleBuffer;
pSample->SetActualDataLength(buffer->GetDataSize());
pSample->GetPointer(&pSampleBuffer);
memcpy(pSampleBuffer, buffer->GetData(), buffer->GetDataSize());
delete buffer;
}
} while (!buffer);
return S_OK;
}
catch(...)
{
LogDebug("sub: Fillbuffer exception");
}
return NOERROR;
}
HRESULT CSubtitlePin::ChangeStart()
{
return S_OK;
}
HRESULT CSubtitlePin::ChangeStop()
{
return S_OK;
}
HRESULT CSubtitlePin::ChangeRate()
{
return S_OK;
}
HRESULT CSubtitlePin::OnThreadStartPlay()
{
m_bDiscontinuity = true;
LogDebug("sub: OnThreadStartPlay: %6.3f", m_rtStart / 10000000.0);
return CSourceStream::OnThreadStartPlay();
}
HRESULT CSubtitlePin::DeliverBeginFlush()
{
m_bFlushing = true;
m_bSeekDone = false;
HRESULT hr = __super::DeliverBeginFlush();
LogDebug("sub: DeliverBeginFlush - hr: %08lX", hr);
if (hr != S_OK)
{
m_bFlushing = true;
m_bSeekDone = true;
}
return hr;
}
HRESULT CSubtitlePin::DeliverEndFlush()
{
HRESULT hr = __super::DeliverEndFlush();
LogDebug("sub: DeliverEndFlush - hr: %08lX", hr);
m_bFlushing = false;
return hr;
}
HRESULT CSubtitlePin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
{
if (m_bFlushing || !ThreadExists())
{
m_bSeekDone = true;
return S_FALSE;
}
LogDebug("sub: DeliverNewSegment start: %6.3f stop: %6.3f rate: %6.3f", tStart / 10000000.0, tStop / 10000000.0, dRate);
m_rtStart = tStart;
HRESULT hr = __super::DeliverNewSegment(tStart, tStop, dRate);
if (FAILED(hr))
LogDebug("sub: DeliverNewSegment - error: %08lX", hr);
m_bSeekDone = true;
return hr;
}
STDMETHODIMP CSubtitlePin::SetPositions(LONGLONG* pCurrent, DWORD CurrentFlags, LONGLONG* pStop, DWORD StopFlags)
{
return m_pFilter->SetPositionsInternal(this, pCurrent, CurrentFlags, pStop, StopFlags);
}
STDMETHODIMP CSubtitlePin::GetAvailable(LONGLONG* pEarliest, LONGLONG* pLatest)
{
//LogDebug("sub:GetAvailable");
return CSourceSeeking::GetAvailable(pEarliest, pLatest);
}
STDMETHODIMP CSubtitlePin::GetDuration(LONGLONG *pDuration)
{
REFERENCE_TIME refTime;
m_pFilter->GetDuration(&refTime);
m_rtDuration = CRefTime(refTime);
return CSourceSeeking::GetDuration(pDuration);
}
STDMETHODIMP CSubtitlePin::GetCurrentPosition(LONGLONG *pCurrent)
{
//LogDebug("sub:GetCurrentPosition");
return E_NOTIMPL;//CSourceSeeking::GetCurrentPosition(pCurrent);
}
void CSubtitlePin::SetRunningStatus(bool onOff)
{
m_bRunning = onOff;
}
| [
"tourettes@team-mediaportal.com"
] | tourettes@team-mediaportal.com |
5f2cd24b0714894f4df3b1c1fc7f51ec83b3bcd5 | 7d5691687676b900553628f9287b7cb9094dac9a | /partners_api/partners_api_tests/freenow_tests.cpp | 80559e33e05f45ce810fbc755618530cc8667113 | [
"Apache-2.0"
] | permissive | mapsme/omim | bf3ea4f419a547b7c124107e344d7f565d707c12 | 1892903b63f2c85b16ed4966d21fe76aba06b9ba | refs/heads/master | 2023-02-20T16:31:08.733960 | 2021-04-27T13:57:41 | 2021-04-28T14:44:52 | 42,798,033 | 5,032 | 1,527 | Apache-2.0 | 2022-10-03T08:28:24 | 2015-09-20T02:57:13 | C++ | UTF-8 | C++ | false | false | 3,874 | cpp | #include "testing/testing.hpp"
#include "partners_api/freenow_api.hpp"
#include "geometry/latlon.hpp"
#include "platform/platform.hpp"
#include <string>
namespace
{
using Runner = Platform::ThreadRunner;
std::string const kTokenResponse = R"(
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXV",
"token_type": "bearer",
"expires_in": 600,
"scope": "service-types"
})";
std::string const kServiceTypesResponse = R"(
{
"serviceTypes": [
{
"id": "TAXI",
"type": "TAXI",
"displayName": "Taxi",
"eta": {
"value": 0,
"displayValue": "0 Minutes"
},
"fare": {
"type": "FIXED",
"value": 5000,
"currencyCode": "GBP",
"displayValue": "5000GBP"
},
"availablePaymentMethodTypes": [
"BUSINESS_ACCOUNT",
"CREDIT_CARD",
"PAYPAL",
"CASH"
],
"seats": {
"max": 4,
"values": [],
"displayValue": "4"
},
"availableBookingOptions": [
{
"name": "COMMENT",
"displayName": "COMMENT",
"type": "TEXT"
},
{
"name": "MERCEDES",
"displayName": "MERCEDES",
"type": "BOOLEAN"
},
{
"name": "FAVORITE_DRIVER",
"displayName": "FAVORITE_DRIVER",
"type": "BOOLEAN"
},
{
"name": "FIVE_STARS",
"displayName": "FIVE_STARS",
"type": "BOOLEAN"
},
{
"name": "SMALL_ANIMAL",
"displayName": "SMALL_ANIMAL",
"type": "BOOLEAN"
}
]
}
]
})";
UNIT_TEST(Freenow_GetAccessToken)
{
ms::LatLon const from(55.796918, 37.537859);
ms::LatLon const to(55.758213, 37.616093);
std::string result;
taxi::freenow::RawApi::GetAccessToken(result);
TEST(!result.empty(), ());
auto const token = taxi::freenow::MakeTokenFromJson(result);
TEST(!token.m_token.empty(), ());
}
UNIT_TEST(Freenow_MakeTokenFromJson)
{
auto const token = taxi::freenow::MakeTokenFromJson(kTokenResponse);
TEST(!token.m_token.empty(), ());
TEST_NOT_EQUAL(token.m_expiredTime.time_since_epoch().count(), 0, ());
}
UNIT_TEST(Freenow_MakeProductsFromJson)
{
auto const products = taxi::freenow::MakeProductsFromJson(kServiceTypesResponse);
TEST_EQUAL(products.size(), 1, ());
TEST_EQUAL(products.back().m_name, "Taxi", ());
TEST_EQUAL(products.back().m_time, "0", ());
TEST_EQUAL(products.back().m_price, "5000GBP", ());
TEST_EQUAL(products.back().m_currency, "GBP", ());
}
UNIT_CLASS_TEST(Runner, Freenow_GetAvailableProducts)
{
taxi::freenow::Api api("http://localhost:34568/partners");
ms::LatLon const from(55.796918, 37.537859);
ms::LatLon const to(55.758213, 37.616093);
std::vector<taxi::Product> resultProducts;
api.GetAvailableProducts(from, to,
[&resultProducts](std::vector<taxi::Product> const & products) {
resultProducts = products;
testing::Notify();
},
[](taxi::ErrorCode const code) {
TEST(false, (code));
});
testing::Wait();
TEST(!resultProducts.empty(), ());
taxi::ErrorCode errorCode = taxi::ErrorCode::RemoteError;
ms::LatLon const farPos(56.838197, 35.908507);
api.GetAvailableProducts(from, farPos,
[](std::vector<taxi::Product> const & products) {
TEST(false, ());
},
[&errorCode](taxi::ErrorCode const code) {
errorCode = code;
testing::Notify();
});
testing::Wait();
TEST_EQUAL(errorCode, taxi::ErrorCode::NoProducts, ());
}
} // namespace
| [
"dvolvenkova@gmail.com"
] | dvolvenkova@gmail.com |
d44be4ec5b8260440042ffe0b6c2a83c8c1424cc | 988742a6fb3b45db6a0c0996c7b968a2268b9e52 | /ch14/manyfriend.cpp | 1a32a5dd9a15f494f528a7457794a8c03b0c4f8c | [] | no_license | briansorahan/cplusplus-primer-plus | e15e8510bdce5dc2cb4998a0a567d7fac5066fdb | 5693def87811b30bcc3480ffa3aa6c06bb874c1e | refs/heads/master | 2016-09-05T15:51:11.904042 | 2013-12-16T03:20:09 | 2013-12-16T03:20:09 | 13,820,738 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 608 | cpp | // unbound template friend to a template class
#include <iostream>
using std::cout;
using std::endl;
template <typename T>
class ManyFriend {
private:
T item;
public:
ManyFriend(const T & i) : item(i) {}
template <typename C, typename D> friend void show2(C &, D &);
};
template <typename C, typename D>
void show2(C & c, D & d) {
cout << c.item << ", " << d.item << endl;
}
int main() {
ManyFriend<int> mfi1(10);
ManyFriend<int> mfi2(20);
ManyFriend<double> mfd1(10.5);
cout << "mfi1, mfi2: ";
show2(mfi1, mfi2);
cout << "mfd1, mfi2: ";
show2(mfd1, mfi2);
}
| [
"bsorahan@gmail.com"
] | bsorahan@gmail.com |
e9e3b39b0aeb26342b89e911862fca9b240e7258 | 66c519b615c83047ea5011c189b28efcb363017c | /src/master/allocator/sorter/random/utils.hpp | 1329359040082ed128d8dbc45381aa3e529224e4 | [
"LicenseRef-scancode-warranty-disclaimer",
"BSD-3-Clause",
"LicenseRef-scancode-protobuf",
"PSF-2.0",
"BSL-1.0",
"MIT",
"Apache-2.0",
"BSD-2-Clause",
"GPL-2.0-or-later",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | yuquanshan/mesos | cea88989bfa82a485c5d6e42f0b7d67c2ef29421 | c1e7d6b9452dd7195aec33ddcc059d68c87a5ee8 | refs/heads/master | 2020-07-03T14:14:04.173467 | 2018-11-14T19:20:15 | 2018-11-14T19:20:15 | 74,165,701 | 2 | 0 | Apache-2.0 | 2018-07-22T18:10:38 | 2016-11-18T20:56:11 | C++ | UTF-8 | C++ | false | false | 3,185 | hpp | // Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you 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 __MASTER_ALLOCATOR_SORTER_RANDOM_UTILS_HPP__
#define __MASTER_ALLOCATOR_SORTER_RANDOM_UTILS_HPP__
#include <algorithm>
#include <cmath>
#include <numeric>
#include <random>
#include <vector>
#include <stout/check.hpp>
namespace mesos {
namespace internal {
namespace master {
namespace allocator {
// A weighted variant of std::shuffle. Items with higher weight
// have a higher chance of being towards the front of the list,
// equivalent to weighted random sampling without replacement.
// Code adapted from the following paper:
//
// http://utopia.duth.gr/~pefraimi/research/data/2007EncOfAlg.pdf
// Found from: https://softwareengineering.stackexchange.com/a/344274
//
// This has O(n log n) runtime complexity.
template <class RandomAccessIterator, class URBG>
void weightedShuffle(
RandomAccessIterator begin,
RandomAccessIterator end,
const std::vector<double>& weights,
URBG&& urbg)
{
CHECK_EQ(end - begin, (int) weights.size());
std::vector<double> keys(weights.size());
for (size_t i = 0; i < weights.size(); ++i) {
CHECK_GT(weights[i], 0.0);
// Make the key negative so that we don't have to reverse sort.
double random = std::uniform_real_distribution<>(0.0, 1.0)(urbg);
keys[i] = 0.0 - std::pow(random, (1.0 / weights[i]));
}
// Sort from smallest to largest keys. We store the sort permutation
// so that we can apply it to `items`.
std::vector<size_t> permutation(keys.size());
std::iota(permutation.begin(), permutation.end(), 0);
std::sort(permutation.begin(), permutation.end(),
[&](size_t i, size_t j){ return keys[i] < keys[j]; });
// Now apply the permutation to `items`.
//
// TODO(bmahler): Consider avoiding the copy of entries in `items`
// via an in-place application of the permutation:
// https://blog.merovius.de/2014/08/12/applying-permutation-in-constant.html
std::vector<typename std::iterator_traits<RandomAccessIterator>::value_type>
shuffled(end - begin);
std::transform(
permutation.begin(),
permutation.end(),
shuffled.begin(),
[&](size_t i){ return begin[i]; });
// Move the shuffled copy back into the `items`.
std::move(shuffled.begin(), shuffled.end(), begin);
}
} // namespace allocator {
} // namespace master {
} // namespace internal {
} // namespace mesos {
#endif // __MASTER_ALLOCATOR_SORTER_RANDOM_UTILS_HPP__
| [
"bmahler@apache.org"
] | bmahler@apache.org |
86d3b1777dd9a6ad436d360522265ca46ae55c61 | 3c2c03ec18880e2b43f6326a4daec1f1b87abdd9 | /mod_05/ex00/Bureaucrat.hpp | 99d0a50cd2a61724e2d97176e936d42b2b507aee | [] | no_license | aristotelis-bobas/cpp_modules | 97da17c685d9e7344b9f73ad02b25d9c9afd2fb7 | e815912dc55b5a26969750c341d3441486aa117e | refs/heads/master | 2023-01-02T08:57:48.225945 | 2020-11-01T19:31:21 | 2020-11-01T19:31:21 | 297,717,685 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,635 | hpp | /* ************************************************************************** */
/* */
/* :::::::: */
/* Bureaucrat.hpp :+: :+: */
/* +:+ */
/* By: abobas <abobas@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2020/06/22 15:05:45 by abobas #+# #+# */
/* Updated: 2020/06/22 18:29:23 by abobas ######## odam.nl */
/* */
/* ************************************************************************** */
#ifndef BUREAUCRAT_HPP
#define BUREAUCRAT_HPP
#include <string>
#include <ostream>
#include <exception>
class Bureaucrat
{
private:
const std::string name;
int grade;
public:
Bureaucrat(std::string const name, int grade);
Bureaucrat(Bureaucrat const &other);
Bureaucrat& operator = (Bureaucrat const &other);
int getGrade() const;
std::string getName() const;
void promoteGrade();
void demoteGrade();
class GradeTooHighException: public std::exception
{
virtual const char* what() const throw();
};
class GradeTooLowException: public std::exception
{
virtual const char* what() const throw();
};
virtual ~Bureaucrat();
};
std::ostream& operator << (std::ostream &out, Bureaucrat const &src);
#endif
| [
"abobas@student.codam.nl"
] | abobas@student.codam.nl |
bc99f837df73ac56e8355d3f6bd70af40f31c52e | cdbce8b09cf43bf2e66e5e3437ae591262a55270 | /(3930) Data Mining/Perceptron/Perceptron/perceptron.cpp | 59a5d5d24550d3de0d14e74a29edd855210de62a | [] | no_license | tokenok/Visual-Studio-Projects | b82a53f141eff01eef69f119f55dabd8b52e803e | c3947dda48fdccdba01a21b0e5052b12a18fe2a6 | refs/heads/master | 2022-05-02T11:06:46.201991 | 2018-10-28T22:07:24 | 2018-10-28T22:07:24 | 89,531,738 | 5 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 12,845 | cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
#include <random>
#include <chrono>
#include <fstream>
#include <conio.h>
#include "C://CPPLibs/common//common.h"
using namespace std;
enum classes {
CLS_VIRGINICA,
CLS_VERSICOLOR,
CLS_SETOSA
};
struct iris {
double sepal_w, sepal_l, petal_l, petal_w;
int cls;
double b;
};
vector<iris> data = {
{3, 5.9, 5.1, 1.8, CLS_VIRGINICA, 1},
{2.6, 5.5, 4.4, 1.2, CLS_VERSICOLOR, 1},
{2.8, 6.2, 4.8, 1.8, CLS_VIRGINICA, 1},
{3.2, 4.7, 1.3, 0.2, CLS_SETOSA, 1},
{2.2, 6, 4, 1, CLS_VERSICOLOR, 1},
{3.3, 6.7, 5.7, 2.1, CLS_VIRGINICA, 1},
{3.3, 6.7, 5.7, 2.5, CLS_VIRGINICA, 1},
{3.4, 5.1, 1.5, 0.2, CLS_SETOSA, 1},
{3.5, 5, 1.6, 0.6, CLS_SETOSA, 1},
{3.4, 4.8, 1.9, 0.2, CLS_SETOSA, 1},
{3.8, 5.1, 1.5, 0.3, CLS_SETOSA, 1},
{3.3, 5, 1.4, 0.2, CLS_SETOSA, 1},
{3.7, 5.3, 1.5, 0.2, CLS_SETOSA, 1},
{3.1, 6.9, 4.9, 1.5, CLS_VERSICOLOR, 1},
{2.4, 4.9, 3.3, 1, CLS_VERSICOLOR, 1},
{3.1, 6.4, 5.5, 1.8, CLS_VIRGINICA, 1},
{3.8, 5.7, 1.7, 0.3, CLS_SETOSA, 1},
{3, 7.6, 6.6, 2.1, CLS_VIRGINICA, 1},
{3.1, 6.9, 5.4, 2.1, CLS_VIRGINICA, 1},
{4.1, 5.2, 1.5, 0.1, CLS_SETOSA, 1},
{2.8, 6.8, 4.8, 1.4, CLS_VERSICOLOR, 1},
{3.2, 4.6, 1.4, 0.2, CLS_SETOSA, 1},
{2.3, 5, 3.3, 1, CLS_VERSICOLOR, 1},
{3, 7.1, 5.9, 2.1, CLS_VIRGINICA, 1},
{3.2, 7.2, 6, 1.8, CLS_VIRGINICA, 1},
{2.8, 5.6, 4.9, 2, CLS_VIRGINICA, 1},
{3.5, 5, 1.3, 0.3, CLS_SETOSA, 1},
{3, 4.4, 1.3, 0.2, CLS_SETOSA, 1},
{4.4, 5.7, 1.5, 0.4, CLS_SETOSA, 1},
{3, 4.9, 1.4, 0.2, CLS_SETOSA, 1},
{3, 6.6, 4.4, 1.4, CLS_VERSICOLOR, 1},
{3, 5.6, 4.1, 1.3, CLS_VERSICOLOR, 1},
{2.6, 7.7, 6.9, 2.3, CLS_VIRGINICA, 1},
{3, 5.9, 4.2, 1.5, CLS_VERSICOLOR, 1},
{2.8, 6.4, 5.6, 2.1, CLS_VIRGINICA, 1},
{2.8, 7.7, 6.7, 2, CLS_VIRGINICA, 1},
{2.8, 6.1, 4, 1.3, CLS_VERSICOLOR, 1},
{3.8, 7.9, 6.4, 2, CLS_VIRGINICA, 1},
{3.6, 4.9, 1.4, 0.1, CLS_SETOSA, 1},
{3.2, 4.7, 1.6, 0.2, CLS_SETOSA, 1},
{3.2, 6.4, 5.3, 2.3, CLS_VIRGINICA, 1},
{3.4, 6.2, 5.4, 2.3, CLS_VIRGINICA, 1},
{2.9, 6, 4.5, 1.5, CLS_VERSICOLOR, 1},
{3.4, 5.4, 1.5, 0.4, CLS_SETOSA, 1},
{3.5, 5.5, 1.3, 0.2, CLS_SETOSA, 1},
{3.9, 5.4, 1.3, 0.4, CLS_SETOSA, 1},
{3, 5.7, 4.2, 1.2, CLS_VERSICOLOR, 1},
{2.8, 6.4, 5.6, 2.2, CLS_VIRGINICA, 1},
{3.4, 5, 1.5, 0.2, CLS_SETOSA, 1},
{2.5, 5.5, 4, 1.3, CLS_VERSICOLOR, 1},
{3, 6.8, 5.5, 2.1, CLS_VIRGINICA, 1},
{2.7, 6, 5.1, 1.6, CLS_VERSICOLOR, 1},
{2.4, 5.5, 3.8, 1.1, CLS_VERSICOLOR, 1},
{2.8, 6.5, 4.6, 1.5, CLS_VERSICOLOR, 1},
{3.1, 4.8, 1.6, 0.2, CLS_SETOSA, 1},
{4, 5.8, 1.2, 0.2, CLS_SETOSA, 1},
{3, 6.7, 5.2, 2.3, CLS_VIRGINICA, 1},
{2.5, 5.7, 5, 2, CLS_VIRGINICA, 1},
{2.9, 6.3, 5.6, 1.8, CLS_VIRGINICA, 1},
{3.2, 6.5, 5.1, 2, CLS_VIRGINICA, 1},
{2.7, 5.8, 5.1, 1.9, CLS_VIRGINICA, 1},
{2.9, 6.1, 4.7, 1.4, CLS_VERSICOLOR, 1},
{3.1, 6.7, 4.7, 1.5, CLS_VERSICOLOR, 1},
{2.7, 5.8, 4.1, 1, CLS_VERSICOLOR, 1},
{3, 6.5, 5.2, 2, CLS_VIRGINICA, 1},
{3, 6.7, 5, 1.7, CLS_VERSICOLOR, 1},
{3, 4.8, 1.4, 0.1, CLS_SETOSA, 1},
{3.2, 6.9, 5.7, 2.3, CLS_VIRGINICA, 1},
{3.6, 4.6, 1, 0.2, CLS_SETOSA, 1},
{2.5, 6.7, 5.8, 1.8, CLS_VIRGINICA, 1},
{3, 5.6, 4.5, 1.5, CLS_VERSICOLOR, 1},
{3.8, 5.1, 1.9, 0.4, CLS_SETOSA, 1},
{2.2, 6.2, 4.5, 1.5, CLS_VERSICOLOR, 1},
{2.3, 6.3, 4.4, 1.3, CLS_VERSICOLOR, 1},
{3, 6.1, 4.9, 1.8, CLS_VIRGINICA, 1},
{2.9, 6.4, 4.3, 1.3, CLS_VERSICOLOR, 1},
{2.7, 5.8, 5.1, 1.9, CLS_VIRGINICA, 1},
{2.8, 5.8, 5.1, 2.4, CLS_VIRGINICA, 1},
{2.8, 6.1, 4.7, 1.2, CLS_VERSICOLOR, 1},
{3.2, 5, 1.2, 0.2, CLS_SETOSA, 1},
{2.6, 6.1, 5.6, 1.4, CLS_VIRGINICA, 1},
{3.1, 6.9, 5.1, 2.3, CLS_VIRGINICA, 1},
{2.9, 7.3, 6.3, 1.8, CLS_VIRGINICA, 1},
{3.7, 5.1, 1.5, 0.4, CLS_SETOSA, 1},
{3, 6.5, 5.8, 2.2, CLS_VIRGINICA, 1},
{2.8, 7.4, 6.1, 1.9, CLS_VIRGINICA, 1},
{3.2, 6.8, 5.9, 2.3, CLS_VIRGINICA, 1},
{3, 6, 4.8, 1.8, CLS_VIRGINICA, 1},
{3.1, 4.9, 1.5, 0.1, CLS_SETOSA, 1},
{3.8, 7.7, 6.7, 2.2, CLS_VIRGINICA, 1},
{2.8, 6.3, 5.1, 1.5, CLS_VIRGINICA, 1},
{3, 4.8, 1.4, 0.3, CLS_SETOSA, 1},
{2.7, 5.6, 4.2, 1.3, CLS_VERSICOLOR, 1},
{3.2, 7, 4.7, 1.4, CLS_VERSICOLOR, 1},
{2.7, 5.8, 3.9, 1.2, CLS_VERSICOLOR, 1},
{3.6, 7.2, 6.1, 2.5, CLS_VIRGINICA, 1},
{3.2, 5.9, 4.8, 1.8, CLS_VERSICOLOR, 1},
{2.5, 6.3, 5, 1.9, CLS_VIRGINICA, 1},
{2.7, 6.4, 5.3, 1.9, CLS_VIRGINICA, 1},
{3.2, 4.4, 1.3, 0.2, CLS_SETOSA, 1},
{3.8, 5.1, 1.6, 0.2, CLS_SETOSA, 1},
{3, 7.7, 6.1, 2.3, CLS_VIRGINICA, 1},
{3.4, 5.2, 1.4, 0.2, CLS_SETOSA, 1},
{2.6, 5.7, 3.5, 1, CLS_VERSICOLOR, 1},
{2.8, 5.7, 4.1, 1.3, CLS_VERSICOLOR, 1},
{3.6, 5, 1.4, 0.2, CLS_SETOSA, 1},
{3.4, 5.4, 1.7, 0.2, CLS_SETOSA, 1},
{3.5, 5.1, 1.4, 0.2, CLS_SETOSA, 1},
{3, 6.5, 5.5, 1.8, CLS_VIRGINICA, 1},
{2.4, 5.5, 3.7, 1, CLS_VERSICOLOR, 1},
{3.5, 5.1, 1.4, 0.3, CLS_SETOSA, 1},
{3.4, 6, 4.5, 1.6, CLS_VERSICOLOR, 1},
{2.7, 6.3, 4.9, 1.8, CLS_VIRGINICA, 1},
{2.3, 4.5, 1.3, 0.3, CLS_SETOSA, 1},
{2.3, 5.5, 4, 1.3, CLS_VERSICOLOR, 1},
{3, 7.2, 5.8, 1.6, CLS_VIRGINICA, 1},
{2.2, 6, 5, 1.5, CLS_VIRGINICA, 1},
{3.3, 6.3, 6, 2.5, CLS_VIRGINICA, 1},
{3, 6.1, 4.6, 1.4, CLS_VERSICOLOR, 1},
{3, 5, 1.6, 0.2, CLS_SETOSA, 1},
{3.2, 6.4, 4.5, 1.5, CLS_VERSICOLOR, 1},
{3.9, 5.4, 1.7, 0.4, CLS_SETOSA, 1},
{3, 5.4, 4.5, 1.5, CLS_VERSICOLOR, 1},
{2.9, 4.4, 1.4, 0.2, CLS_SETOSA, 1},
{2.5, 6.3, 4.9, 1.5, CLS_VERSICOLOR, 1},
{2.9, 5.7, 4.2, 1.3, CLS_VERSICOLOR, 1},
{2.9, 6.2, 4.3, 1.3, CLS_VERSICOLOR, 1},
{4.2, 5.5, 1.4, 0.2, CLS_SETOSA, 1},
{3.1, 6.7, 4.4, 1.4, CLS_VERSICOLOR, 1},
{3.3, 6.3, 4.7, 1.6, CLS_VERSICOLOR, 1},
{3.4, 4.6, 1.4, 0.3, CLS_SETOSA, 1},
{3.7, 5.4, 1.5, 0.2, CLS_SETOSA, 1},
{2.5, 5.6, 3.9, 1.1, CLS_VERSICOLOR, 1},
{3.3, 5.1, 1.7, 0.5, CLS_SETOSA, 1},
{3, 4.3, 1.1, 0.1, CLS_SETOSA, 1},
{3.1, 6.7, 5.6, 2.4, CLS_VIRGINICA, 1},
{3.5, 5.2, 1.5, 0.2, CLS_SETOSA, 1},
{3.4, 6.3, 5.6, 2.4, CLS_VIRGINICA, 1},
{3.1, 4.9, 1.5, 0.2, CLS_SETOSA, 1},
{3.4, 5, 1.6, 0.4, CLS_SETOSA, 1},
{3.1, 4.6, 1.5, 0.2, CLS_SETOSA, 1},
{2, 5, 3.5, 1, CLS_VERSICOLOR, 1},
{2.7, 5.2, 3.9, 1.4, CLS_VERSICOLOR, 1},
{2.5, 5.1, 3, 1.1, CLS_VERSICOLOR, 1},
{2.9, 5.6, 3.6, 1.3, CLS_VERSICOLOR, 1},
{3.4, 4.8, 1.6, 0.2, CLS_SETOSA, 1},
{2.8, 5.7, 4.5, 1.3, CLS_VERSICOLOR, 1},
{2.6, 5.8, 4, 1.2, CLS_VERSICOLOR, 1},
{2.5, 4.9, 4.5, 1.7, CLS_VIRGINICA, 1},
{2.9, 6.6, 4.6, 1.3, CLS_VERSICOLOR, 1}
};
void normalize() {
//ofstream of;
//of.open("normalized.txt");
//get mins and maxs
double swn = 100000, swx = 0, sln = 100000, slx = 0, pwn = 100000, pwx = 0, pln = 100000, plx = 0;
for (int i = 0; i < data.size(); i++) {
swn = data[i].sepal_w < swn ? data[i].sepal_w : swn;
swx = data[i].sepal_w > swx ? data[i].sepal_w : swx;
sln = data[i].sepal_l < sln ? data[i].sepal_l : sln;
slx = data[i].sepal_l > slx ? data[i].sepal_l : slx;
pwn = data[i].petal_w < pwn ? data[i].petal_w : pwn;
pwx = data[i].petal_w > pwx ? data[i].petal_w : pwx;
pln = data[i].petal_l < pln ? data[i].petal_l : pln;
plx = data[i].petal_l > plx ? data[i].petal_l : plx;
}
for (int i = 0; i < data.size(); i++) {
data[i].sepal_w = ((data[i].sepal_w - swn) / (swx - swn));
data[i].sepal_l = ((data[i].sepal_l - sln) / (slx - sln));
data[i].petal_w = ((data[i].petal_w - pwn) / (pwx - pwn));
data[i].petal_l = ((data[i].petal_l - pln) / (plx - pln));
// if (data[i].cls != CLS_SETOSA)
// of << data[i].sepal_w << '\t' << data[i].sepal_l << '\t' << data[i].petal_w << '\t' << data[i].petal_l << '\t' << (data[i].cls == CLS_VIRGINICA ? "virginica" : "versicolor") << '\n';
}
//of.close();
}
double calc_model(const iris& dat, const iris& weights) {
return (dat.b * weights.b)
+ (dat.petal_w * weights.petal_w)
+ (dat.petal_l * weights.petal_l)
// + (dat.sepal_w * weights.sepal_w)
// + (dat.sepal_l * weights.sepal_l)
;
}
int count_errors(int cls, const iris& weights) {
int count = 0;
for (int i = 0; i < data.size(); i++) {
int c = data[i].cls == cls ? -1 : 1;
double model = calc_model(data[i], weights);
if ((c < 0 || model < 0) && (c >= 0 || model >= 0)) {
count++;
}
}
return count;
}
//returns number of misses
//out(result) -> perceptron coefficients
int get_perceptron(int cls, iris* result) {
double learning_rate = .1;
iris weights;
weights.b = (double)rand() / RAND_MAX - 1;
weights.sepal_w = (double)rand() / RAND_MAX - 1;
weights.sepal_l = (double)rand() / RAND_MAX - 1;
weights.petal_w = (double)rand() / RAND_MAX - 1;
weights.petal_l = (double)rand() / RAND_MAX - 1;
int minerrors = data.size() + 1;
for (int epoch = 0; epoch < 2000; epoch++) {
int errors = 0;
for (int i = 0; i < data.size(); i++) {
if (cls == CLS_SETOSA)
continue;
int c = data[i].cls == cls ? -1 : 1;
double model = calc_model(data[i], weights);
if ((c < 0 || model < 0) && (c >= 0 || model >= 0)) {
weights.b += learning_rate * c * data[i].b;
weights.sepal_w += learning_rate * c * data[i].sepal_w;
weights.sepal_l += learning_rate * c * data[i].sepal_l;
weights.petal_w += learning_rate * c * data[i].petal_w;
weights.petal_l += learning_rate * c * data[i].petal_l;
}
errors = count_errors(cls, weights);
if (errors <= minerrors) {
minerrors = errors;
result->b = weights.b;
result->petal_l = weights.petal_l;
result->petal_w = weights.petal_w;
result->sepal_l = weights.sepal_l;
result->sepal_w = weights.sepal_w;
if (errors == 0)
break;
}
}
shuffle(data.begin(), data.end(), std::default_random_engine(chrono::system_clock::now().time_since_epoch().count()));
}
return minerrors;
}
int main() {
srand(clock());
normalize();
ofstream out;
out.open("outfile.txt");
iris res1 = {0}, res2 = {0}, res3 = {0}, res4 = {0}, res5 = {0};
iris avg;
int miss = 0;
/*miss = get_perceptron(CLS_SETOSA, &res1); out << miss << '\t' << res1.sepal_w << '\t' << res1.sepal_l << '\t' << res1.petal_w << '\t' << res1.petal_l << '\t' << res1.b << '\n';
miss = get_perceptron(CLS_SETOSA, &res2); out << miss << '\t' << res2.sepal_w << '\t' << res2.sepal_l << '\t' << res2.petal_w << '\t' << res2.petal_l << '\t' << res2.b << '\n';
miss = get_perceptron(CLS_SETOSA, &res3); out << miss << '\t' << res3.sepal_w << '\t' << res3.sepal_l << '\t' << res3.petal_w << '\t' << res3.petal_l << '\t' << res3.b << '\n';
miss = get_perceptron(CLS_SETOSA, &res4); out << miss << '\t' << res4.sepal_w << '\t' << res4.sepal_l << '\t' << res4.petal_w << '\t' << res4.petal_l << '\t' << res4.b << '\n';
miss = get_perceptron(CLS_SETOSA, &res5); out << miss << '\t' << res5.sepal_w << '\t' << res5.sepal_l << '\t' << res5.petal_w << '\t' << res5.petal_l << '\t' << res5.b << '\n';
avg.petal_l = (res1.petal_l + res2.petal_l + res3.petal_l + res4.petal_l + res5.petal_l) / 5;
avg.petal_w = (res1.petal_w + res2.petal_w + res3.petal_w + res4.petal_w + res5.petal_w) / 5;
avg.sepal_l = (res1.sepal_l + res2.sepal_l + res3.sepal_l + res4.sepal_l + res5.sepal_l) / 5;
avg.sepal_w = (res1.sepal_w + res2.sepal_w + res3.sepal_w + res4.sepal_w + res5.sepal_w) / 5;
avg.b = (res1.b + res2.b + res3.b + res4.b + res5.b) / 5;
miss = count_errors(CLS_SETOSA, avg);
out << miss << '\t' << res1.sepal_w << '\t' << avg.sepal_l << '\t' << avg.petal_w << '\t' << avg.petal_l << '\t' << avg.b << '\n';*/
//cout << "\n";
/*miss = get_perceptron(CLS_VIRGINICA, &res1); out << miss << '\t' << res1.sepal_w << '\t' << res1.sepal_l << '\t' << res1.petal_w << '\t' << res1.petal_l << '\t' << res1.b << '\n';
miss = get_perceptron(CLS_VIRGINICA, &res2); out << miss << '\t' << res2.sepal_w << '\t' << res2.sepal_l << '\t' << res2.petal_w << '\t' << res2.petal_l << '\t' << res2.b << '\n';
miss = get_perceptron(CLS_VIRGINICA, &res3); out << miss << '\t' << res3.sepal_w << '\t' << res3.sepal_l << '\t' << res3.petal_w << '\t' << res3.petal_l << '\t' << res3.b << '\n';
miss = get_perceptron(CLS_VIRGINICA, &res4); out << miss << '\t' << res4.sepal_w << '\t' << res4.sepal_l << '\t' << res4.petal_w << '\t' << res4.petal_l << '\t' << res4.b << '\n';
miss = get_perceptron(CLS_VIRGINICA, &res5); out << miss << '\t' << res5.sepal_w << '\t' << res5.sepal_l << '\t' << res5.petal_w << '\t' << res5.petal_l << '\t' << res5.b << '\n';
avg.petal_l = (res1.petal_l + res2.petal_l + res3.petal_l + res4.petal_l + res5.petal_l) / 5;
avg.petal_w = (res1.petal_w + res2.petal_w + res3.petal_w + res4.petal_w + res5.petal_w) / 5;
avg.sepal_l = (res1.sepal_l + res2.sepal_l + res3.sepal_l + res4.sepal_l + res5.sepal_l) / 5;
avg.sepal_w = (res1.sepal_w + res2.sepal_w + res3.sepal_w + res4.sepal_w + res5.sepal_w) / 5;
avg.b = (res1.b + res2.b + res3.b + res4.b + res5.b) / 5;
miss = count_errors(CLS_VIRGINICA, avg);
out << miss << '\t' << res1.sepal_w << '\t' << avg.sepal_l << '\t' << avg.petal_w << '\t' << avg.petal_l << '\t' << avg.b << '\n';*/
out.close();
return 0;
}
| [
"mrjack.is.minty@gmail.com"
] | mrjack.is.minty@gmail.com |
736960ef4438a6a3b9ec3bb37c76e80ccc3845ee | f07f790d30956617ff0900fce2e3f791773ae7b4 | /Clase14-Puteros_1/Clase14-Puteros_1/main.cpp | 82b6dba945172cd4a40e313772df87c0046be657 | [] | no_license | Sergio1993/POO | 0e606db31af8804c3e6fac31d267ee8bf5943a14 | 976a21ae063b7d96feac1c39f4979291875d517d | refs/heads/master | 2021-01-20T12:03:49.716329 | 2015-07-13T22:55:20 | 2015-07-13T22:55:20 | 33,879,783 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 901 | cpp | //
// main.cpp
// Clase14-Puteros_1
//
// Created by Sergio Pita on 24/2/15.
// Copyright (c) 2015 Sergio Pita. All rights reserved.
//
#include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
//int *pUno = 0;
char variableChar = 'a';
char *pChar;
pChar = &variableChar;
cout << *pChar << endl;
int count = 10, *temp, sum = 0;
temp = &count;
*temp = 20;
temp = ∑
*temp = count;
printf("count = %d, *temp = %d, sum = %d\n", count, *temp, sum );
int x = 8, y = 5, z = 3;
int *pX = 0, *pY = 0, *pZ = 0;
pY = &z;
*pY = y;
*pY = z;
cout << z << endl;
x = 8, y = 5, z = 3;
pZ = &x;
*pZ = z;
*pZ = x;
cout << x << endl;
x = 8, y = 5, z = 3;
pX = &y;
*pX = x;
*pX = y;
cout << y << endl;
return 0;
}
| [
"pita310593@gmail.com"
] | pita310593@gmail.com |
f37bf56172581dc7181b3d639a086ce5b9dbded0 | a85d05bde5207730df061ea43c08ece2e54c2bee | /source/include/calcpara.h | 790138e4630ac2b3d908df975503434f4f9cf26f | [] | no_license | ocean-wave/qtverify | 2a747abb167fdc446b79f829835f2deca3899d8d | 5bafb90f075075e7abad1f3514c23d2e69c1caf4 | refs/heads/master | 2020-07-03T22:49:05.524632 | 2016-08-04T05:59:35 | 2016-08-04T05:59:35 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 1,332 | h | #ifndef CALCPARA_H
#define CALCPARA_H
#include <QtGui/QWidget>
#include <QtGui/QDataWidgetMapper>
#include "ui_calcpara.h"
class QSettings;
class QSqlTableModel;
class CalcParaDlg : public QDialog
{
Q_OBJECT
public:
CalcParaDlg(QWidget *parent = 0, Qt::WFlags flags = 0);
~CalcParaDlg();
QSettings *settings;
void mapVfDeptModel(); //送检单位模型
void mapManuDeptModel(); //制造单位模型
void mapUserModel(); //检测员模型
void mapMeterModelModel();//表型号模型
void mapMeterStandardModel();//表规格模型
void initSettings();
void readSettings();
void writeSettings();
QString getMeterNO();
int getStandard();
int getModel();
int getGrade();
int getManuFact();
int getVerifyDept();
int getVerifyPerson();
float getMaxT();
float getMinT();
float getMaxDeltaT();
float getMinDeltaT();
signals:
void saveSuccessSignal();
public slots:
void closeEvent(QCloseEvent * event);
void on_btnOK_clicked();
void on_btnExit_clicked();
private slots:
signals:
private:
Ui::CalcParaClass ui;
QString m_meterNO;
int m_standard;
int m_model;
int m_grade;
int m_manufact;
int m_verifydept;
int m_verifyperson;
float m_maxT;
float m_minT;
float m_maxDeltaT;
float m_minDeltaT;
};
#endif //CALCPARA_H | [
"yangshen@62fcab80-fd93-7748-8c49-e77283212eb3"
] | yangshen@62fcab80-fd93-7748-8c49-e77283212eb3 |
0e9e94c6f760331cd0dab60046a5644b73b45294 | ba9adad5887e691cfd2775ea34576b7cddedd804 | /custom/behavioral_patterns/iterator/main.cpp | 4aa03e209a906ce7113f7a31f57f8ff1de6ea7ae | [] | no_license | timothyshull/design_patterns | 25afa122ee0b091e3dbda25b1ed8e9a8a33727cf | 94b6c15baab98c44d70a8ea243e76b1084010002 | refs/heads/master | 2021-01-21T17:24:01.987743 | 2017-03-17T19:55:36 | 2017-03-17T19:55:36 | 85,349,123 | 4 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 307 | cpp | #include <iostream>
#include "Iterator.h"
#include "Aggregate.h"
int main(int argc, char* argv[])
{
Aggregate* ag = new Concrete_aggregate();
Iterator* it = new Concrete_iterator(ag);
for (; !(it->is_done()); it->next()) {
std::cout << it->current_item() << "\n";
}
return 0;
}
| [
"timothyshull@gmail.com"
] | timothyshull@gmail.com |
a1293a2ce2e5bc449dfae7036f4c369445f4e039 | 40d9006c2f2a9403da9701a154e744011df26c2d | /输出已有图案的部分图案.cpp | 916f6621930c8bb498cda27845a4930439a87454 | [
"MIT"
] | permissive | Jerromylynn/The-first-stage | 4b2c4550a560e1535cb2cc65ad58c2eacb49bcf4 | 9cd59247a067f8502effd8e6569c9494349f4247 | refs/heads/master | 2021-09-05T13:55:58.254052 | 2018-01-28T13:00:38 | 2018-01-28T13:00:38 | 107,367,186 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 560 | cpp | #include<stdio.h>
#include<string.h>
int main(){
char ss[8][10]=
{" ",
"--**-**--",
"-*-*****-",
"-*----**-",
"--*--**--",
"---***---",
"----*----",
" "};
int n;
int c[9]={0};
scanf("%d",&n);
if(n<1||n>7){
printf("Input Error\n");
return 0;
}
for(int i=1;i<7;i++)
{
for(int j=1;j<8;j++)
{
if(ss[i][j]=='*')
{
int b=0;
for(int k=i-1;k<=i+1;k++)
{
for(int l=j-1;l<=j+1;l++)
{
if(ss[k][l]=='-')
b++;
}
}
c[b]++;
}
}
}
printf("%d\n",c[n]);
return 0;
}
| [
"1044685413@qq.com"
] | 1044685413@qq.com |
0858c53e5bdf07a8d9cdbf8539b709697b25ba5d | 3a2f666ed938a888c67ec039de235b89ccaeed47 | /platforms/cpu/src/CpuCustomNonbondedForce.cpp | e0f1fe63b40746e1e147fb70378ed05e2cfb2f22 | [] | no_license | mohebifar/openmm | f90c09ecd1cf7d28c7b63b2764447666863bd2c2 | 93742ae3aeef39948dc086fc1b6df2a69c49846d | refs/heads/master | 2021-01-21T21:15:10.581962 | 2017-06-14T19:00:58 | 2017-06-14T19:00:58 | 94,796,470 | 1 | 0 | null | 2018-05-19T15:03:12 | 2017-06-19T16:14:35 | C++ | UTF-8 | C++ | false | false | 13,528 | cpp |
/* Portions copyright (c) 2009-2017 Stanford University and Simbios.
* Contributors: Peter Eastman
*
* 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, CONTRIBUTORS 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.
*/
#include <string.h>
#include <sstream>
#include "SimTKOpenMMUtilities.h"
#include "ReferenceForce.h"
#include "CpuCustomNonbondedForce.h"
#include "openmm/internal/gmx_atomic.h"
using namespace OpenMM;
using namespace std;
CpuCustomNonbondedForce::ThreadData::ThreadData(const Lepton::CompiledExpression& energyExpression, const Lepton::CompiledExpression& forceExpression,
const vector<string>& parameterNames, const std::vector<Lepton::CompiledExpression> energyParamDerivExpressions) :
energyExpression(energyExpression), forceExpression(forceExpression), energyParamDerivExpressions(energyParamDerivExpressions) {
map<string, double*> variableLocations;
variableLocations["r"] = &r;
particleParam.resize(2*parameterNames.size());
for (int i = 0; i < (int) parameterNames.size(); i++) {
for (int j = 0; j < 2; j++) {
stringstream name;
name << parameterNames[i] << (j+1);
variableLocations[name.str()] = &particleParam[i*2+j];
}
}
energyParamDerivs.resize(energyParamDerivExpressions.size());
this->energyExpression.setVariableLocations(variableLocations);
this->forceExpression.setVariableLocations(variableLocations);
expressionSet.registerExpression(this->energyExpression);
expressionSet.registerExpression(this->forceExpression);
for (auto& expression : this->energyParamDerivExpressions) {
expression.setVariableLocations(variableLocations);
expressionSet.registerExpression(expression);
}
}
CpuCustomNonbondedForce::CpuCustomNonbondedForce(const Lepton::CompiledExpression& energyExpression,
const Lepton::CompiledExpression& forceExpression, const vector<string>& parameterNames, const vector<set<int> >& exclusions,
const std::vector<Lepton::CompiledExpression> energyParamDerivExpressions, ThreadPool& threads) :
cutoff(false), useSwitch(false), periodic(false), useInteractionGroups(false), paramNames(parameterNames), exclusions(exclusions), threads(threads) {
for (int i = 0; i < threads.getNumThreads(); i++)
threadData.push_back(new ThreadData(energyExpression, forceExpression, parameterNames, energyParamDerivExpressions));
}
CpuCustomNonbondedForce::~CpuCustomNonbondedForce() {
for (auto data : threadData)
delete data;
}
void CpuCustomNonbondedForce::setUseCutoff(double distance, const CpuNeighborList& neighbors) {
cutoff = true;
cutoffDistance = distance;
neighborList = &neighbors;
}
void CpuCustomNonbondedForce::setInteractionGroups(const vector<pair<set<int>, set<int> > >& groups) {
useInteractionGroups = true;
for (auto& group : groups) {
const set<int>& set1 = group.first;
const set<int>& set2 = group.second;
for (set<int>::const_iterator atom1 = set1.begin(); atom1 != set1.end(); ++atom1) {
for (set<int>::const_iterator atom2 = set2.begin(); atom2 != set2.end(); ++atom2) {
if (*atom1 == *atom2 || exclusions[*atom1].find(*atom2) != exclusions[*atom1].end())
continue; // This is an excluded interaction.
if (*atom1 > *atom2 && set1.find(*atom2) != set1.end() && set2.find(*atom1) != set2.end())
continue; // Both atoms are in both sets, so skip duplicate interactions.
groupInteractions.push_back(make_pair(*atom1, *atom2));
}
}
}
}
void CpuCustomNonbondedForce::setUseSwitchingFunction(double distance) {
useSwitch = true;
switchingDistance = distance;
}
void CpuCustomNonbondedForce::setPeriodic(Vec3* periodicBoxVectors) {
assert(cutoff);
assert(periodicBoxVectors[0][0] >= 2.0*cutoffDistance);
assert(periodicBoxVectors[1][1] >= 2.0*cutoffDistance);
assert(periodicBoxVectors[2][2] >= 2.0*cutoffDistance);
periodic = true;
this->periodicBoxVectors[0] = periodicBoxVectors[0];
this->periodicBoxVectors[1] = periodicBoxVectors[1];
this->periodicBoxVectors[2] = periodicBoxVectors[2];
recipBoxSize[0] = (float) (1.0/periodicBoxVectors[0][0]);
recipBoxSize[1] = (float) (1.0/periodicBoxVectors[1][1]);
recipBoxSize[2] = (float) (1.0/periodicBoxVectors[2][2]);
periodicBoxVec4.resize(3);
periodicBoxVec4[0] = fvec4(periodicBoxVectors[0][0], periodicBoxVectors[0][1], periodicBoxVectors[0][2], 0);
periodicBoxVec4[1] = fvec4(periodicBoxVectors[1][0], periodicBoxVectors[1][1], periodicBoxVectors[1][2], 0);
periodicBoxVec4[2] = fvec4(periodicBoxVectors[2][0], periodicBoxVectors[2][1], periodicBoxVectors[2][2], 0);
triclinic = (periodicBoxVectors[0][1] != 0.0 || periodicBoxVectors[0][2] != 0.0 ||
periodicBoxVectors[1][0] != 0.0 || periodicBoxVectors[1][2] != 0.0 ||
periodicBoxVectors[2][0] != 0.0 || periodicBoxVectors[2][1] != 0.0);
}
void CpuCustomNonbondedForce::calculatePairIxn(int numberOfAtoms, float* posq, vector<Vec3>& atomCoordinates, double** atomParameters,
double* fixedParameters, const map<string, double>& globalParameters,
vector<AlignedArray<float> >& threadForce, bool includeForce, bool includeEnergy, double& totalEnergy, double* energyParamDerivs) {
// Record the parameters for the threads.
this->numberOfAtoms = numberOfAtoms;
this->posq = posq;
this->atomCoordinates = &atomCoordinates[0];
this->atomParameters = atomParameters;
this->globalParameters = &globalParameters;
this->threadForce = &threadForce;
this->includeForce = includeForce;
this->includeEnergy = includeEnergy;
threadEnergy.resize(threads.getNumThreads());
gmx_atomic_t counter;
gmx_atomic_set(&counter, 0);
this->atomicCounter = &counter;
// Signal the threads to start running and wait for them to finish.
threads.execute([&] (ThreadPool& threads, int threadIndex) { threadComputeForce(threads, threadIndex); });
threads.waitForThreads();
// Combine the energies from all the threads.
int numThreads = threads.getNumThreads();
if (includeEnergy) {
for (int i = 0; i < numThreads; i++)
totalEnergy += threadEnergy[i];
}
// Combine the energy derivatives from all threads.
int numDerivs = threadData[0]->energyParamDerivs.size();
for (int i = 0; i < numThreads; i++)
for (int j = 0; j < numDerivs; j++)
energyParamDerivs[j] += threadData[i]->energyParamDerivs[j];
}
void CpuCustomNonbondedForce::threadComputeForce(ThreadPool& threads, int threadIndex) {
// Compute this thread's subset of interactions.
int numThreads = threads.getNumThreads();
threadEnergy[threadIndex] = 0;
double& energy = threadEnergy[threadIndex];
float* forces = &(*threadForce)[threadIndex][0];
ThreadData& data = *threadData[threadIndex];
for (auto& param : *globalParameters)
data.expressionSet.setVariable(data.expressionSet.getVariableIndex(param.first), param.second);
for (auto& deriv : data.energyParamDerivs)
deriv = 0.0;
fvec4 boxSize(periodicBoxVectors[0][0], periodicBoxVectors[1][1], periodicBoxVectors[2][2], 0);
fvec4 invBoxSize(recipBoxSize[0], recipBoxSize[1], recipBoxSize[2], 0);
if (useInteractionGroups) {
// The user has specified interaction groups, so compute only the requested interactions.
while (true) {
int i = gmx_atomic_fetch_add(reinterpret_cast<gmx_atomic_t*>(atomicCounter), 1);
if (i >= groupInteractions.size())
break;
int atom1 = groupInteractions[i].first;
int atom2 = groupInteractions[i].second;
for (int j = 0; j < (int) paramNames.size(); j++) {
data.particleParam[j*2] = atomParameters[atom1][j];
data.particleParam[j*2+1] = atomParameters[atom2][j];
}
calculateOneIxn(atom1, atom2, data, forces, energy, boxSize, invBoxSize);
}
}
else if (cutoff) {
// We are using a cutoff, so get the interactions from the neighbor list.
while (true) {
int blockIndex = gmx_atomic_fetch_add(reinterpret_cast<gmx_atomic_t*>(atomicCounter), 1);
if (blockIndex >= neighborList->getNumBlocks())
break;
const int blockSize = neighborList->getBlockSize();
const int* blockAtom = &neighborList->getSortedAtoms()[blockSize*blockIndex];
const vector<int>& neighbors = neighborList->getBlockNeighbors(blockIndex);
const vector<char>& exclusions = neighborList->getBlockExclusions(blockIndex);
for (int i = 0; i < (int) neighbors.size(); i++) {
int first = neighbors[i];
for (int j = 0; j < (int) paramNames.size(); j++)
data.particleParam[j*2] = atomParameters[first][j];
for (int k = 0; k < blockSize; k++) {
if ((exclusions[i] & (1<<k)) == 0) {
int second = blockAtom[k];
for (int j = 0; j < (int) paramNames.size(); j++)
data.particleParam[j*2+1] = atomParameters[second][j];
calculateOneIxn(first, second, data, forces, energy, boxSize, invBoxSize);
}
}
}
}
}
else {
// Every particle interacts with every other one.
while (true) {
int ii = gmx_atomic_fetch_add(reinterpret_cast<gmx_atomic_t*>(atomicCounter), 1);
if (ii >= numberOfAtoms)
break;
for (int jj = ii+1; jj < numberOfAtoms; jj++) {
if (exclusions[jj].find(ii) == exclusions[jj].end()) {
for (int j = 0; j < (int) paramNames.size(); j++) {
data.particleParam[j*2] = atomParameters[ii][j];
data.particleParam[j*2+1] = atomParameters[jj][j];
}
calculateOneIxn(ii, jj, data, forces, energy, boxSize, invBoxSize);
}
}
}
}
}
void CpuCustomNonbondedForce::calculateOneIxn(int ii, int jj, ThreadData& data,
float* forces, double& totalEnergy, const fvec4& boxSize, const fvec4& invBoxSize) {
// Get deltaR, R2, and R between 2 atoms
fvec4 deltaR;
fvec4 posI(posq+4*ii);
fvec4 posJ(posq+4*jj);
float r2;
getDeltaR(posI, posJ, deltaR, r2, boxSize, invBoxSize);
if (cutoff && r2 >= cutoffDistance*cutoffDistance)
return;
float r = sqrtf(r2);
data.r = r;
// accumulate forces
double dEdR = (includeForce ? data.forceExpression.evaluate()/r : 0.0);
double energy = (includeEnergy ? data.energyExpression.evaluate() : 0.0);
double switchValue = 1.0;
if (useSwitch) {
if (r > switchingDistance) {
double t = (r-switchingDistance)/(cutoffDistance-switchingDistance);
switchValue = 1+t*t*t*(-10+t*(15-t*6));
double switchDeriv = t*t*(-30+t*(60-t*30))/(cutoffDistance-switchingDistance);
dEdR = switchValue*dEdR + energy*switchDeriv/r;
energy *= switchValue;
}
}
fvec4 result = deltaR*dEdR;
(fvec4(forces+4*ii)+result).store(forces+4*ii);
(fvec4(forces+4*jj)-result).store(forces+4*jj);
// accumulate energies
totalEnergy += energy;
// Accumulate energy derivatives.
for (int i = 0; i < data.energyParamDerivExpressions.size(); i++)
data.energyParamDerivs[i] += switchValue*data.energyParamDerivExpressions[i].evaluate();
}
void CpuCustomNonbondedForce::getDeltaR(const fvec4& posI, const fvec4& posJ, fvec4& deltaR, float& r2, const fvec4& boxSize, const fvec4& invBoxSize) const {
deltaR = posJ-posI;
if (periodic) {
if (triclinic) {
deltaR -= periodicBoxVec4[2]*floorf(deltaR[2]*recipBoxSize[2]+0.5f);
deltaR -= periodicBoxVec4[1]*floorf(deltaR[1]*recipBoxSize[1]+0.5f);
deltaR -= periodicBoxVec4[0]*floorf(deltaR[0]*recipBoxSize[0]+0.5f);
}
else {
fvec4 base = round(deltaR*invBoxSize)*boxSize;
deltaR = deltaR-base;
}
}
r2 = dot3(deltaR, deltaR);
}
| [
"peastman@stanford.edu"
] | peastman@stanford.edu |
8b7894ecc67b207692eeb5caef7054c7f9afd1c7 | a5edb9bc455f8e1e4cb7e20842ab0eeb8f602049 | /source/net/tcp/tcpclient.cpp | f35201714357f1b20758fe88c7c278980918c3fd | [
"Apache-2.0"
] | permissive | lwIoT/lwiot-core | 32d148b4527c9ca9f4b9716bd89ae10d4a99030e | 07d2a3ba962aef508911e453268427b006c57701 | refs/heads/master | 2020-03-13T06:47:44.493308 | 2019-08-30T15:15:21 | 2019-08-30T15:15:21 | 131,012,032 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,303 | cpp | /*
* TCP client wrapper.
*
* @author Michel Megens
* @email dev@bietje.net
*/
#include <stdlib.h>
#include <stdio.h>
#include <lwiot.h>
#include <lwiot/types.h>
#include <lwiot/log.h>
#include <lwiot/stl/string.h>
#include <lwiot/network/tcpclient.h>
#include <lwiot/error.h>
#include <lwiot/network/stdnet.h>
namespace lwiot
{
TcpClient::TcpClient() : _remote_addr((uint32_t)0), _remote_port(0)
{
}
TcpClient::TcpClient(const lwiot::IPAddress &addr, uint16_t port) : _remote_addr(addr), _remote_port(to_netorders(port))
{
}
TcpClient::TcpClient(const lwiot::String &host, uint16_t port) : _remote_addr((uint32_t)0), _remote_port(to_netorders(port))
{
}
TcpClient& TcpClient::operator=(lwiot::TcpClient &&client)
{
*this = client;
return *this;
}
TcpClient& TcpClient::operator=(const lwiot::TcpClient &client)
{
this->_remote_port = client._remote_port;
this->_remote_addr = client._remote_addr;
return *this;
}
TcpClient::operator bool() const
{
return this->connected();
}
bool TcpClient::operator==(const lwiot::TcpClient &other)
{
return false;
}
bool TcpClient::operator!=(const lwiot::TcpClient &other)
{
return false;
}
const IPAddress& TcpClient::remote() const
{
return this->_remote_addr;
}
uint16_t TcpClient::port() const
{
return to_netorders(this->_remote_port);
}
uint8_t TcpClient::read()
{
uint8_t tmp;
auto rc = this->read(&tmp, sizeof(tmp));
if(rc < 0)
return 0;
return tmp;
}
bool TcpClient::write(uint8_t byte)
{
return this->write(&byte, sizeof(byte)) == sizeof(byte);
}
Stream& TcpClient::operator<<(char x)
{
this->write((uint8_t)x);
return *this;
}
Stream& TcpClient::operator<<(short x)
{
this->write((uint8_t*)&x, sizeof(x));
return *this;
}
Stream& TcpClient::operator<<(int x)
{
this->write((uint8_t*)&x, sizeof(x));
return *this;
}
Stream& TcpClient::operator<<(const long & x)
{
this->write((uint8_t*)&x, sizeof(x));
return *this;
}
Stream& TcpClient::operator<<(const long long& x)
{
this->write((uint8_t*)&x, sizeof(x));
return *this;
}
Stream& TcpClient::operator<<(unsigned char x)
{
this->write((uint8_t)x);
return *this;
}
Stream& TcpClient::operator<<(unsigned short x)
{
this->write((uint8_t*)&x, sizeof(x));
return *this;
}
Stream& TcpClient::operator<<(unsigned int x)
{
this->write((uint8_t*)&x, sizeof(x));
return *this;
}
Stream& TcpClient::operator<<(unsigned const long & x)
{
this->write((uint8_t*)&x, sizeof(x));
return *this;
}
Stream& TcpClient::operator<<(const unsigned long long& x)
{
this->write((uint8_t*)&x, sizeof(x));
return *this;
}
Stream& TcpClient::operator<<(const float &x)
{
this->write((uint8_t*)&x, sizeof(x));
return *this;
}
Stream& TcpClient::operator<<(const double &x)
{
this->write((uint8_t*)&x, sizeof(x));
return *this;
}
Stream& TcpClient::operator<<(const lwiot::String &str)
{
*this << str.c_str();
return *this;
}
Stream& TcpClient::operator<<(const char *cstr)
{
this->write(reinterpret_cast<const uint8_t *>(cstr), strlen(cstr));
return *this;
}
}
| [
"dev@bietje.net"
] | dev@bietje.net |
e97fb58c6a40fbe21c07471f96090ee0cd203ff2 | 1555a682e74657c28dcde082bfb704a3f4f32264 | /core/utilities/peripherycpp/diag/diag_spi.cpp | ee7d18d5197feb2d1c76882165f10b86b8fa7dee | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | lyp365859350/rip | bc78cd3fbc0f99141f5070922ca893255fd8347b | 51cfc0683e985ccdbf698556135eda7368758c10 | refs/heads/master | 2021-09-23T00:53:11.780796 | 2018-02-22T04:51:23 | 2018-02-22T04:51:23 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 649 | cpp | #include <peripherycpp/spi.hpp>
using Spi = rip::peripherycpp::Spi;
int main(int argc, char** argv)
{
Spi s;
s.open("/dev/spidev0.0", 0, 25000000);
uint8_t *txbuf = new uint8_t[2];
txbuf[0] = 'H';
txbuf[1] = 'i';
uint8_t *rxbuf;
s.transfer(txbuf, rxbuf, 2);
unsigned int mode = s.getMode();
uint32_t speed = s.getMaxSpeed();
int bo = s.getBitOrder();
uint8_t bpw = s.getBitsPerWord();
uint8_t flags = s.getExtraFlags();
s.close();
printf("rxbuf = %s\nmode = %i\nspeed = %lu\nbit order = %i\nbits per word = %hi\nflags = %hi\n", (char *)(rxbuf), mode, speed, bo, bpw, flags);
return 0;
}
| [
"lumsden.ian@gmail.com"
] | lumsden.ian@gmail.com |
c1261d92e49914ee742fc99c334d1de706b5c66e | 50cef9458a4f92992a036b4ee05f61541ae39126 | /450/hw1/myserver.cpp | 8710851ef705bae7509cb7fa8264bde574b51f93 | [] | no_license | wcmonty/sw | 9de53658cf29e1daa5282f4eeb4210c7edca8a73 | 3e66b39803014bca01c1ad18781977e0eb26af5e | refs/heads/master | 2021-01-19T13:47:14.310121 | 2015-01-25T22:58:45 | 2015-01-25T22:58:45 | 29,833,723 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,473 | cpp | /**
* @file myserver.cpp
* @author William Montgomery
* @date January 2014
* @brief This program receives a file from a remote client and sends back an acknowledgement after the entire file has been received.
* Two possible options for closing the connection:
* (1) Send a close command along with the acknowledgement and then close.
* (2) Hold the connection open waiting for additional files / commands.
* The "persistent" field in the header indicates the client's preference.
*/
#include <stdlib.h>
#include "message.h"
#include "processor.h"
#include "socket.h"
// Constants
const int PACKET_TYPE = 2;
static const int PORT = 54321;
/**
* @brief main main
* @param argc The argument count
* @param argv The argument value
* @return this
*/
int main(int argc, char **argv)
{
cout << "myServer by William Montgomery (wmontg2@uic.edu)" << endl;
// Create a socket object
Socket *socket;
if (argc >= 2 && atoi(argv[1])) {
socket = new Socket(atoi(argv[1]));
}
else {
socket = new Socket(PORT);
}
// Create a processor object
Processor *processor = Processor::getProcessor();
// Listen to incoming requests and process them
socket->start_listening(5); // maximum number of clients waiting to connect
processor->setSocket(socket)->process();
// Clean up
delete processor;
delete socket;
return EXIT_SUCCESS;
}
| [
"wmontg2@uic.edu"
] | wmontg2@uic.edu |
fed873c28b143c9b862484988a968645e98ef628 | f9d4e39c17ec3994fea6151c8780105856267ed8 | /算法/算法4_乘法口诀表.cpp | 828663445e962e0968937dca64bd758c1e3e70cc | [] | no_license | wangheng0107/HelloWord | 02a638053f113905f32cb0c882d31f4ee332003e | 275d6484c3077bd756ca209ec4efc2e97498915d | refs/heads/master | 2023-08-07T21:10:51.944460 | 2021-09-24T07:32:43 | 2021-09-24T07:32:43 | 403,616,778 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 306 | cpp | #include <iostream>
using namespace std;
/**
* 九九乘法表
* @return
*/
int mainppp() {
//嵌套循环
for (int i = 1; i < 10; ++i) {
for (int j = 1; j <= i; ++j) {
cout << j << " * " << i << " = " << j * i << " ";
}
cout << endl;
}
return 0;
} | [
"wangheng@sogou-inc.com"
] | wangheng@sogou-inc.com |
1a0550ba089d834c021047d12697fd6c1683eee7 | 14945c5598b8d24ca4292b377562deac82b37939 | /yt/comments/main.cpp | 900a6db47bd20cf25667abd3417a47d875dbd84f | [] | no_license | pkkrsingh877/CPP_Playground | ed7832c5a46301a588d728fcc229b55432a5d547 | 44cd89f2a95d6c03cf9fab9ee60e97734938fa7d | refs/heads/master | 2023-09-01T00:33:13.352931 | 2021-10-11T23:10:38 | 2021-10-11T23:10:38 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 185 | cpp | #include <iostream>
using namespace std;
int main(){
cout << "Hi! I want this line to be printed.";
/*cout <<"Hi! I don't want this line to be printed.";
*/
return 0;
} | [
"pkkrsingh877@gmail.com"
] | pkkrsingh877@gmail.com |
ea36865251baaa37fc81c661560adb3d300dc510 | 4724eabaa028ea2315f843233cb3761552a6ff25 | /include/qpdf/QPDFPageDocumentHelper.hh | 82ab71fa053c0f592f4456c899aa200eb5ff882c | [] | no_license | douglasralmeida/contextopdf | ffd5603e8787f1d96acc5829f831ce165177fffb | 07bb4f8dbd1ed7bf9c039c0f029e0942879e20c1 | refs/heads/master | 2020-04-13T16:34:36.742287 | 2019-03-10T01:14:15 | 2019-03-10T01:14:15 | 163,324,921 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,386 | hh | // Copyright (c) 2005-2018 Jay Berkenbilt
//
// This file is part of qpdf.
//
// 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.
//
// Versions of qpdf prior to version 7 were released under the terms
// of version 2.0 of the Artistic License. At your option, you may
// continue to consider qpdf to be licensed under those terms. Please
// see the manual for additional information.
#ifndef QPDFPAGEDOCUMENTHELPER_HH
#define QPDFPAGEDOCUMENTHELPER_HH
#include <qpdf/QPDFDocumentHelper.hh>
#include <qpdf/QPDFPageObjectHelper.hh>
#include <qpdf/DLL.h>
#include <vector>
#include <qpdf/QPDF.hh>
class QPDFPageDocumentHelper: public QPDFDocumentHelper
{
public:
QPDF_DLL
QPDFPageDocumentHelper(QPDF&);
// Traverse page tree, and return all /Page objects wrapped in
// QPDFPageObjectHelper objects. Unlike with
// QPDFObjectHandle::getAllPages, the vector of pages returned by
// this call is not affected by additions or removals of pages. If
// you manipulate pages, you will have to call this again to get a
// new copy. Please comments in QPDFObjectHandle.hh for
// getAllPages() for additional details.
QPDF_DLL
std::vector<QPDFPageObjectHelper> getAllPages();
// The PDF /Pages tree allows inherited values. Working with the
// pages of a pdf is much easier when the inheritance is resolved
// by explicitly setting the values in each /Page.
QPDF_DLL
void pushInheritedAttributesToPage();
// This calls QPDFPageObjectHelper::removeUnreferencedResources
// for every page in the document. See comments in
// QPDFPageObjectHelper.hh for details.
QPDF_DLL
void removeUnreferencedResources();
// Add new page at the beginning or the end of the current pdf.
// The newpage parameter may be either a direct object, an
// indirect object from this QPDF, or an indirect object from
// another QPDF. If it is a direct object, it will be made
// indirect. If it is an indirect object from another QPDF, this
// method will call pushInheritedAttributesToPage on the other
// file and then copy the page to this QPDF using the same
// underlying code as copyForeignObject.
QPDF_DLL
void addPage(QPDFPageObjectHelper newpage, bool first);
// Add new page before or after refpage. See comments for addPage
// for details about what newpage should be.
QPDF_DLL
void addPageAt(QPDFPageObjectHelper newpage, bool before,
QPDFPageObjectHelper refpage);
// Remove page from the pdf.
QPDF_DLL
void removePage(QPDFPageObjectHelper page);
private:
class Members
{
friend class QPDFPageDocumentHelper;
public:
QPDF_DLL
~Members();
private:
Members();
Members(Members const&);
};
PointerHolder<Members> m;
};
#endif // QPDFPAGEDOCUMENTHELPER_HH
| [
"douglasralmeida@live.com"
] | douglasralmeida@live.com |
38ad0a524f3f1825636efb6db5d01c7e0dc02884 | fae26d601fe2b795fcd9ce40061bfb5db727ebf4 | /113 - Power of Cryptography/main.cpp | 36b9e6f041ddcc3e80d957fc6d55046c04aca2c1 | [] | no_license | phg1024/UVa | 5771caf2f9070abfab857b0b32db3a076fce7c3b | e27e4a67c80e716c87f266a68396ac5b5968345d | refs/heads/master | 2020-04-11T05:40:30.107452 | 2014-07-17T07:49:33 | 2014-07-17T07:49:33 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 334 | cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;
int main() {
double n, p;
while (scanf("%lf%lf", &n, &p) != EOF) {
printf("%.lf\n", pow(p, 1/n));
}
return 0;
}
| [
"peihongguo@gmail.com"
] | peihongguo@gmail.com |
356b733256dcfef125d94b867aa3fba0a2c1390c | a2681499f4334accc7d52bc3902a9790b63031dd | /src/main/medfilt.cc | 50025553187fad4d47cc9987d272e41cfcaa1b3a | [
"Apache-2.0"
] | permissive | sp-nitech/SPTK | db9f3c4399b67abb8df3d6379fbd21a33423320f | ab234a5926c10e37d7c62b427a4df804382dd388 | refs/heads/master | 2023-08-19T08:42:45.858537 | 2023-08-17T05:54:42 | 2023-08-17T05:54:42 | 103,337,202 | 187 | 26 | Apache-2.0 | 2023-08-17T05:54:43 | 2017-09-13T01:15:34 | C++ | UTF-8 | C++ | false | false | 9,574 | cc | // ------------------------------------------------------------------------ //
// Copyright 2021 SPTK Working Group //
// //
// 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 <fstream> // std::ifstream
#include <iomanip> // std::setw
#include <iostream> // std::cerr, std::cin, std::cout, std::endl, etc.
#include <sstream> // std::ostringstream
#include <vector> // std::vector
#include "GETOPT/ya_getopt.h"
#include "SPTK/filter/median_filter.h"
#include "SPTK/input/input_source_from_stream.h"
#include "SPTK/utils/sptk_utils.h"
namespace {
enum LongOptions {
kMagic = 1000,
};
enum WaysToApplyFilter {
kEachDimension = 0,
kAcrossDimension,
kNumWaysToApplyFilter
};
const int kDefaultNumInputOrder(0);
const int kDefaultNumFilterOrder(2);
const WaysToApplyFilter kDefaultWayToApplyFilter(kEachDimension);
void PrintUsage(std::ostream* stream) {
// clang-format off
*stream << std::endl;
*stream << " medfilt - median filter" << std::endl;
*stream << std::endl;
*stream << " usage:" << std::endl;
*stream << " medfilt [ options ] [ infile ] > stdout" << std::endl;
*stream << " options:" << std::endl;
*stream << " -l l : length of vector ( int)[" << std::setw(5) << std::right << kDefaultNumInputOrder + 1 << "][ 1 <= l <= ]" << std::endl; // NOLINT
*stream << " -m m : order of vector ( int)[" << std::setw(5) << std::right << "l-1" << "][ 0 <= m <= ]" << std::endl; // NOLINT
*stream << " -k k : order of filter ( int)[" << std::setw(5) << std::right << kDefaultNumFilterOrder << "][ 0 <= k <= ]" << std::endl; // NOLINT
*stream << " -w w : way to apply filter ( int)[" << std::setw(5) << std::right << kDefaultWayToApplyFilter << "][ 0 <= w <= 1 ]" << std::endl; // NOLINT
*stream << " 0 (each dimension)" << std::endl;
*stream << " 1 (across dimension)" << std::endl;
*stream << " -magic magic : magic number (double)[" << std::setw(5) << std::right << "N/A" << "]" << std::endl; // NOLINT
*stream << " -h : print this message" << std::endl;
*stream << " infile:" << std::endl;
*stream << " data sequence (double)[stdin]" << std::endl; // NOLINT
*stream << " stdout:" << std::endl;
*stream << " filtered data sequence (double)" << std::endl; // NOLINT
*stream << " notice:" << std::endl;
*stream << " if w = 0, output size is m+1, otherwise 1" << std::endl;
*stream << std::endl;
*stream << " SPTK: version " << sptk::kVersion << std::endl;
*stream << std::endl;
// clang-format on
}
} // namespace
/**
* @a medfilt [ @e option ] [ @e infile ]
*
* - @b -l @e int
* - length of vector @f$(1 \le M + 1)@f$
* - @b -m @e int
* - order of vector @f$(0 \le M)@f$
* - @b -k @e int
* - order of filter @f$(0 \le K)@f$
* - @b -w @e int
* - way to apply filter
* \arg @c 0 each dimension
* \arg @c 1 across dimension
* - @b -magic @e double
* - magic number
* - @b infile @e str
* - double-type data sequence
* - @b stdout
* - double-type filtered data sequence
*
* @code{.sh}
* echo 1 3 5 7 | x2x +ad | medfilt -w 0 -l 1 -k 2 | x2x +da
* # 2 3 5 6
* @endcode
*
* @code{.sh}
* echo 1 2 3 4 5 6 7 8 | x2x +ad | medfilt -w 0 -l 2 | x2x +da
* # 2 3 3 4 5 6 6 7
* @endcode
*
* @code{.sh}
* echo 1 2 3 4 5 6 7 8 | x2x +ad | medfilt -w 1 -l 2 | x2x +da
* # 2.5 3.5 5.5 6.5
* @endcode
*
* @param[in] argc Number of arguments.
* @param[in] argv Argument vector.
* @return 0 on success, 1 on failure.
*/
int main(int argc, char* argv[]) {
int num_input_order(kDefaultNumInputOrder);
int num_filter_order(kDefaultNumFilterOrder);
WaysToApplyFilter way_to_apply_filter(kDefaultWayToApplyFilter);
double magic_number(0.0);
bool is_magic_number_specified(false);
const struct option long_options[] = {
{"magic", required_argument, NULL, kMagic},
{0, 0, 0, 0},
};
for (;;) {
const int option_char(
getopt_long_only(argc, argv, "l:m:k:w:h", long_options, NULL));
if (-1 == option_char) break;
switch (option_char) {
case 'l': {
if (!sptk::ConvertStringToInteger(optarg, &num_input_order) ||
num_input_order <= 0) {
std::ostringstream error_message;
error_message
<< "The argument for the -l option must be a positive integer";
sptk::PrintErrorMessage("medfilt", error_message);
return 1;
}
--num_input_order;
break;
}
case 'm': {
if (!sptk::ConvertStringToInteger(optarg, &num_input_order) ||
num_input_order < 0) {
std::ostringstream error_message;
error_message << "The argument for the -m option must be a "
<< "non-negative integer";
sptk::PrintErrorMessage("medfilt", error_message);
return 1;
}
break;
}
case 'k': {
if (!sptk::ConvertStringToInteger(optarg, &num_filter_order) ||
num_filter_order < 0) {
std::ostringstream error_message;
error_message << "The argument for the -k option must be a "
<< "non-negative integer";
sptk::PrintErrorMessage("medfilt", error_message);
return 1;
}
break;
}
case 'w': {
const int min(0);
const int max(static_cast<int>(kNumWaysToApplyFilter) - 1);
int tmp;
if (!sptk::ConvertStringToInteger(optarg, &tmp) ||
!sptk::IsInRange(tmp, min, max)) {
std::ostringstream error_message;
error_message << "The argument for the -w option must be an integer "
<< "in the range of " << min << " to " << max;
sptk::PrintErrorMessage("medfilt", error_message);
return 1;
}
way_to_apply_filter = static_cast<WaysToApplyFilter>(tmp);
break;
}
case kMagic: {
if (!sptk::ConvertStringToDouble(optarg, &magic_number)) {
std::ostringstream error_message;
error_message
<< "The argument for the -magic option must be a number";
sptk::PrintErrorMessage("medfilt", error_message);
return 1;
}
is_magic_number_specified = true;
break;
}
case 'h': {
PrintUsage(&std::cout);
return 0;
}
default: {
PrintUsage(&std::cerr);
return 1;
}
}
}
const int num_input_files(argc - optind);
if (1 < num_input_files) {
std::ostringstream error_message;
error_message << "Too many input files";
sptk::PrintErrorMessage("medfilt", error_message);
return 1;
}
const char* input_file(0 == num_input_files ? NULL : argv[optind]);
if (!sptk::SetBinaryMode()) {
std::ostringstream error_message;
error_message << "Cannot set translation mode";
sptk::PrintErrorMessage("medfilt", error_message);
return 1;
}
std::ifstream ifs;
if (NULL != input_file) {
ifs.open(input_file, std::ios::in | std::ios::binary);
if (ifs.fail()) {
std::ostringstream error_message;
error_message << "Cannot open file " << input_file;
sptk::PrintErrorMessage("medfilt", error_message);
return 1;
}
}
std::istream& input_stream(ifs.is_open() ? ifs : std::cin);
const int input_length(num_input_order + 1);
sptk::InputSourceFromStream input_source(false, input_length, &input_stream);
sptk::MedianFilter median_filter(num_input_order, num_filter_order,
&input_source,
kEachDimension == way_to_apply_filter,
is_magic_number_specified, magic_number);
if (!median_filter.IsValid()) {
std::ostringstream error_message;
error_message << "Failed to initialize MedianFilter";
sptk::PrintErrorMessage("medfilt", error_message);
return 1;
}
const int output_length(median_filter.GetSize());
std::vector<double> output(output_length);
while (median_filter.Get(&output)) {
if (!sptk::WriteStream(0, output_length, output, &std::cout, NULL)) {
std::ostringstream error_message;
error_message << "Failed to write output";
sptk::PrintErrorMessage("medfilt", error_message);
return 1;
}
}
return 0;
}
| [
"takenori.yoshimura24@gmail.com"
] | takenori.yoshimura24@gmail.com |
27673be22bd2b5fd7f99c5cff6dec34f1e099a68 | 6525746e3478741d5658406b2a7b1df287b46288 | /openFoam/heatTransfer/chtMultiRegionFoam/adjacentSolidFluid/constant/regionProperties | 5117a9c318c0ae6fea7958d1fe6e84937e101f3e | [] | no_license | scramjetFoam/cfdCaseSetups | 05a91228988a01feeca95676590fd0c3b7a60479 | 37bf3f07aae6e274133d1c9d289c43ebdd87d741 | refs/heads/master | 2023-07-06T02:57:54.810381 | 2020-11-05T15:42:20 | 2020-11-05T15:42:20 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 930 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 5 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object regionProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
regions
(
fluid (fluid)
solid (solid)
);
// ************************************************************************* //
| [
"julian.toumey@uconn.edu"
] | julian.toumey@uconn.edu | |
179bdeffdcb807053a7afef67fa52e6d55e41f03 | 27894a9a992b507029228f8e5f096ae5a3ddd6d8 | /OpenCLTestReduction/OpenCLTestReduction.cpp | 6babab05da961911b50c5c533c6269569586ce9f | [] | no_license | asdlei99/OpenCLTest | 09372934e9018ca2010d70d579ce228ad44ac118 | 89cf005b4108ac3ac8cada470d62fdfba82af64e | refs/heads/master | 2020-09-26T12:46:21.984457 | 2016-12-24T12:09:06 | 2016-12-24T12:09:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 33,701 | cpp | /*****************************************************************************
* Copyright (c) 2013-2016 Intel Corporation
* All rights reserved.
*
* WARRANTY DISCLAIMER
*
* THESE MATERIALS ARE 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 INTEL OR ITS
* 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 THESE
* MATERIALS, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Intel Corporation is the author of the Materials, and requests that all
* problem reports or change requests be submitted to it directly
*****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <tchar.h>
#include <memory.h>
#include <vector>
#include <algorithm>
#include "CL\cl.h"
#include "utils.h"
#include "Template.cl"
//for perf. counters
#include <Windows.h>
// Macros for OpenCL versions
#define OPENCL_VERSION_1_2 1.2f
#define OPENCL_VERSION_2_0 2.0f
#define CLAMP(x, low, high) (((x) > (high))? (high) : ((x) < (low))? (low) : (x))
int ceil_int_div(int i, int div) {
return (i + div - 1) / div;
}
int ceil_int(int i, int div) {
return ceil_int_div(i, div) * div;
}
/* This function helps to create informative messages in
* case when OpenCL errors occur. It returns a string
* representation for an OpenCL error code.
* (E.g. "CL_DEVICE_NOT_FOUND" instead of just -1.)
*/
const char* TranslateOpenCLError(cl_int errorCode) {
switch (errorCode) {
case CL_SUCCESS: return "CL_SUCCESS";
case CL_DEVICE_NOT_FOUND: return "CL_DEVICE_NOT_FOUND";
case CL_DEVICE_NOT_AVAILABLE: return "CL_DEVICE_NOT_AVAILABLE";
case CL_COMPILER_NOT_AVAILABLE: return "CL_COMPILER_NOT_AVAILABLE";
case CL_MEM_OBJECT_ALLOCATION_FAILURE: return "CL_MEM_OBJECT_ALLOCATION_FAILURE";
case CL_OUT_OF_RESOURCES: return "CL_OUT_OF_RESOURCES";
case CL_OUT_OF_HOST_MEMORY: return "CL_OUT_OF_HOST_MEMORY";
case CL_PROFILING_INFO_NOT_AVAILABLE: return "CL_PROFILING_INFO_NOT_AVAILABLE";
case CL_MEM_COPY_OVERLAP: return "CL_MEM_COPY_OVERLAP";
case CL_IMAGE_FORMAT_MISMATCH: return "CL_IMAGE_FORMAT_MISMATCH";
case CL_IMAGE_FORMAT_NOT_SUPPORTED: return "CL_IMAGE_FORMAT_NOT_SUPPORTED";
case CL_BUILD_PROGRAM_FAILURE: return "CL_BUILD_PROGRAM_FAILURE";
case CL_MAP_FAILURE: return "CL_MAP_FAILURE";
case CL_MISALIGNED_SUB_BUFFER_OFFSET: return "CL_MISALIGNED_SUB_BUFFER_OFFSET"; //-13
case CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST: return "CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST"; //-14
case CL_COMPILE_PROGRAM_FAILURE: return "CL_COMPILE_PROGRAM_FAILURE"; //-15
case CL_LINKER_NOT_AVAILABLE: return "CL_LINKER_NOT_AVAILABLE"; //-16
case CL_LINK_PROGRAM_FAILURE: return "CL_LINK_PROGRAM_FAILURE"; //-17
case CL_DEVICE_PARTITION_FAILED: return "CL_DEVICE_PARTITION_FAILED"; //-18
case CL_KERNEL_ARG_INFO_NOT_AVAILABLE: return "CL_KERNEL_ARG_INFO_NOT_AVAILABLE"; //-19
case CL_INVALID_VALUE: return "CL_INVALID_VALUE";
case CL_INVALID_DEVICE_TYPE: return "CL_INVALID_DEVICE_TYPE";
case CL_INVALID_PLATFORM: return "CL_INVALID_PLATFORM";
case CL_INVALID_DEVICE: return "CL_INVALID_DEVICE";
case CL_INVALID_CONTEXT: return "CL_INVALID_CONTEXT";
case CL_INVALID_QUEUE_PROPERTIES: return "CL_INVALID_QUEUE_PROPERTIES";
case CL_INVALID_COMMAND_QUEUE: return "CL_INVALID_COMMAND_QUEUE";
case CL_INVALID_HOST_PTR: return "CL_INVALID_HOST_PTR";
case CL_INVALID_MEM_OBJECT: return "CL_INVALID_MEM_OBJECT";
case CL_INVALID_IMAGE_FORMAT_DESCRIPTOR: return "CL_INVALID_IMAGE_FORMAT_DESCRIPTOR";
case CL_INVALID_IMAGE_SIZE: return "CL_INVALID_IMAGE_SIZE";
case CL_INVALID_SAMPLER: return "CL_INVALID_SAMPLER";
case CL_INVALID_BINARY: return "CL_INVALID_BINARY";
case CL_INVALID_BUILD_OPTIONS: return "CL_INVALID_BUILD_OPTIONS";
case CL_INVALID_PROGRAM: return "CL_INVALID_PROGRAM";
case CL_INVALID_PROGRAM_EXECUTABLE: return "CL_INVALID_PROGRAM_EXECUTABLE";
case CL_INVALID_KERNEL_NAME: return "CL_INVALID_KERNEL_NAME";
case CL_INVALID_KERNEL_DEFINITION: return "CL_INVALID_KERNEL_DEFINITION";
case CL_INVALID_KERNEL: return "CL_INVALID_KERNEL";
case CL_INVALID_ARG_INDEX: return "CL_INVALID_ARG_INDEX";
case CL_INVALID_ARG_VALUE: return "CL_INVALID_ARG_VALUE";
case CL_INVALID_ARG_SIZE: return "CL_INVALID_ARG_SIZE";
case CL_INVALID_KERNEL_ARGS: return "CL_INVALID_KERNEL_ARGS";
case CL_INVALID_WORK_DIMENSION: return "CL_INVALID_WORK_DIMENSION";
case CL_INVALID_WORK_GROUP_SIZE: return "CL_INVALID_WORK_GROUP_SIZE";
case CL_INVALID_WORK_ITEM_SIZE: return "CL_INVALID_WORK_ITEM_SIZE";
case CL_INVALID_GLOBAL_OFFSET: return "CL_INVALID_GLOBAL_OFFSET";
case CL_INVALID_EVENT_WAIT_LIST: return "CL_INVALID_EVENT_WAIT_LIST";
case CL_INVALID_EVENT: return "CL_INVALID_EVENT";
case CL_INVALID_OPERATION: return "CL_INVALID_OPERATION";
case CL_INVALID_GL_OBJECT: return "CL_INVALID_GL_OBJECT";
case CL_INVALID_BUFFER_SIZE: return "CL_INVALID_BUFFER_SIZE";
case CL_INVALID_MIP_LEVEL: return "CL_INVALID_MIP_LEVEL";
case CL_INVALID_GLOBAL_WORK_SIZE: return "CL_INVALID_GLOBAL_WORK_SIZE"; //-63
case CL_INVALID_PROPERTY: return "CL_INVALID_PROPERTY"; //-64
case CL_INVALID_IMAGE_DESCRIPTOR: return "CL_INVALID_IMAGE_DESCRIPTOR"; //-65
case CL_INVALID_COMPILER_OPTIONS: return "CL_INVALID_COMPILER_OPTIONS"; //-66
case CL_INVALID_LINKER_OPTIONS: return "CL_INVALID_LINKER_OPTIONS"; //-67
case CL_INVALID_DEVICE_PARTITION_COUNT: return "CL_INVALID_DEVICE_PARTITION_COUNT"; //-68
// case CL_INVALID_PIPE_SIZE: return "CL_INVALID_PIPE_SIZE"; //-69
// case CL_INVALID_DEVICE_QUEUE: return "CL_INVALID_DEVICE_QUEUE"; //-70
default:
return "UNKNOWN ERROR CODE";
}
}
/* Convenient container for all OpenCL specific objects used in the sample
*
* It consists of two parts:
* - regular OpenCL objects which are used in almost each normal OpenCL applications
* - several OpenCL objects that are specific for this particular sample
*
* You collect all these objects in one structure for utility purposes
* only, there is no OpenCL specific here: just to avoid global variables
* and make passing all these arguments in functions easier.
*/
struct ocl_args_d_t {
ocl_args_d_t();
~ocl_args_d_t();
// Regular OpenCL objects:
cl_context context; // hold the context handler
cl_device_id device; // hold the selected device handler
cl_command_queue commandQueue; // hold the commands-queue handler
cl_program program; // hold the program handler
cl_kernel kernel; // hold the kernel handler
float platformVersion; // hold the OpenCL platform version (default 1.2)
float deviceVersion; // hold the OpenCL device version (default. 1.2)
float compilerVersion; // hold the device OpenCL C version (default. 1.2)
// Objects that are specific for algorithm implemented in this sample
cl_mem srcMem; // hold first source buffer
cl_mem dstMem; // hold destination buffer
};
ocl_args_d_t::ocl_args_d_t() :
context(NULL),
device(NULL),
commandQueue(NULL),
program(NULL),
kernel(NULL),
platformVersion(OPENCL_VERSION_1_2),
deviceVersion(OPENCL_VERSION_1_2),
compilerVersion(OPENCL_VERSION_1_2),
srcMem(NULL),
dstMem(NULL) {
}
/*
* destructor - called only once
* Release all OpenCL objects
* This is a regular sequence of calls to deallocate all created OpenCL resources in bootstrapOpenCL.
*
* You may want to call these deallocation procedures in the middle of your application execution
* (not at the end) if you don't further need OpenCL runtime.
* You may want to do that in order to free some memory, for example,
* or recreate OpenCL objects with different parameters.
*
*/
ocl_args_d_t::~ocl_args_d_t() {
cl_int err = CL_SUCCESS;
if (kernel) {
err = clReleaseKernel(kernel);
if (CL_SUCCESS != err) {
LogError("Error: clReleaseKernel returned '%s'.\n", TranslateOpenCLError(err));
}
}
if (program) {
err = clReleaseProgram(program);
if (CL_SUCCESS != err) {
LogError("Error: clReleaseProgram returned '%s'.\n", TranslateOpenCLError(err));
}
}
if (srcMem) {
err = clReleaseMemObject(srcMem);
if (CL_SUCCESS != err) {
LogError("Error: clReleaseMemObject returned '%s'.\n", TranslateOpenCLError(err));
}
}
if (dstMem) {
err = clReleaseMemObject(dstMem);
if (CL_SUCCESS != err) {
LogError("Error: clReleaseMemObject returned '%s'.\n", TranslateOpenCLError(err));
}
}
if (commandQueue) {
err = clReleaseCommandQueue(commandQueue);
if (CL_SUCCESS != err) {
LogError("Error: clReleaseCommandQueue returned '%s'.\n", TranslateOpenCLError(err));
}
}
if (device) {
err = clReleaseDevice(device);
if (CL_SUCCESS != err) {
LogError("Error: clReleaseDevice returned '%s'.\n", TranslateOpenCLError(err));
}
}
if (context) {
err = clReleaseContext(context);
if (CL_SUCCESS != err) {
LogError("Error: clReleaseContext returned '%s'.\n", TranslateOpenCLError(err));
}
}
/*
* Note there is no procedure to deallocate platform
* because it was not created at the startup,
* but just queried from OpenCL runtime.
*/
}
/*
* Check whether an OpenCL platform is the required platform
* (based on the platform's name)
*/
bool CheckPreferredPlatformMatch(cl_platform_id platform, const char* preferredPlatform) {
size_t stringLength = 0;
cl_int err = CL_SUCCESS;
bool match = false;
// In order to read the platform's name, we first read the platform's name string length (param_value is NULL).
// The value returned in stringLength
err = clGetPlatformInfo(platform, CL_PLATFORM_NAME, 0, NULL, &stringLength);
if (CL_SUCCESS != err) {
LogError("Error: clGetPlatformInfo() to get CL_PLATFORM_NAME length returned '%s'.\n", TranslateOpenCLError(err));
return false;
}
// Now, that we know the platform's name string length, we can allocate enough space before read it
std::vector<char> platformName(stringLength);
// Read the platform's name string
// The read value returned in platformName
err = clGetPlatformInfo(platform, CL_PLATFORM_NAME, stringLength, &platformName[0], NULL);
if (CL_SUCCESS != err) {
LogError("Error: clGetplatform_ids() to get CL_PLATFORM_NAME returned %s.\n", TranslateOpenCLError(err));
return false;
}
// Now check if the platform's name is the required one
if (strstr(&platformName[0], preferredPlatform) != 0) {
// The checked platform is the one we're looking for
match = true;
}
return match;
}
/*
* Find and return the preferred OpenCL platform
* In case that preferredPlatform is NULL, the ID of the first discovered platform will be returned
*/
cl_platform_id FindOpenCLPlatform(const char* preferredPlatform, cl_device_type deviceType) {
cl_uint numPlatforms = 0;
cl_int err = CL_SUCCESS;
// Get (in numPlatforms) the number of OpenCL platforms available
// No platform ID will be return, since platforms is NULL
err = clGetPlatformIDs(0, NULL, &numPlatforms);
if (CL_SUCCESS != err) {
LogError("Error: clGetplatform_ids() to get num platforms returned %s.\n", TranslateOpenCLError(err));
return NULL;
}
LogInfo("Number of available platforms: %u\n", numPlatforms);
if (0 == numPlatforms) {
LogError("Error: No platforms found!\n");
return NULL;
}
std::vector<cl_platform_id> platforms(numPlatforms);
// Now, obtains a list of numPlatforms OpenCL platforms available
// The list of platforms available will be returned in platforms
err = clGetPlatformIDs(numPlatforms, &platforms[0], NULL);
if (CL_SUCCESS != err) {
LogError("Error: clGetplatform_ids() to get platforms returned %s.\n", TranslateOpenCLError(err));
return NULL;
}
// Check if one of the available platform matches the preferred requirements
for (cl_uint i = 0; i < numPlatforms; i++) {
bool match = true;
cl_uint numDevices = 0;
// If the preferredPlatform is not NULL then check if platforms[i] is the required one
// Otherwise, continue the check with platforms[i]
if ((NULL != preferredPlatform) && (strlen(preferredPlatform) > 0)) {
// In case we're looking for a specific platform
match = CheckPreferredPlatformMatch(platforms[i], preferredPlatform);
}
// match is true if the platform's name is the required one or don't care (NULL)
if (match) {
// Obtains the number of deviceType devices available on platform
// When the function failed we expect numDevices to be zero.
// We ignore the function return value since a non-zero error code
// could happen if this platform doesn't support the specified device type.
err = clGetDeviceIDs(platforms[i], deviceType, 0, NULL, &numDevices);
if (CL_SUCCESS != err) {
LogError("clGetDeviceIDs() returned %s.\n", TranslateOpenCLError(err));
}
if (0 != numDevices) {
// There is at list one device that answer the requirements
return platforms[i];
}
}
}
return NULL;
}
/*
* This function read the OpenCL platdorm and device versions
* (using clGetxxxInfo API) and stores it in the ocl structure.
* Later it will enable us to support both OpenCL 1.2 and 2.0 platforms and devices
* in the same program.
*/
int GetPlatformAndDeviceVersion(cl_platform_id platformId, ocl_args_d_t *ocl) {
cl_int err = CL_SUCCESS;
// Read the platform's version string length (param_value is NULL).
// The value returned in stringLength
size_t stringLength = 0;
err = clGetPlatformInfo(platformId, CL_PLATFORM_VERSION, 0, NULL, &stringLength);
if (CL_SUCCESS != err) {
LogError("Error: clGetPlatformInfo() to get CL_PLATFORM_VERSION length returned '%s'.\n", TranslateOpenCLError(err));
return err;
}
// Now, that we know the platform's version string length, we can allocate enough space before read it
std::vector<char> platformVersion(stringLength);
// Read the platform's version string
// The read value returned in platformVersion
err = clGetPlatformInfo(platformId, CL_PLATFORM_VERSION, stringLength, &platformVersion[0], NULL);
if (CL_SUCCESS != err) {
LogError("Error: clGetplatform_ids() to get CL_PLATFORM_VERSION returned %s.\n", TranslateOpenCLError(err));
return err;
}
if (strstr(&platformVersion[0], "OpenCL 2.0") != NULL) {
ocl->platformVersion = OPENCL_VERSION_2_0;
}
// Read the device's version string length (param_value is NULL).
err = clGetDeviceInfo(ocl->device, CL_DEVICE_VERSION, 0, NULL, &stringLength);
if (CL_SUCCESS != err) {
LogError("Error: clGetDeviceInfo() to get CL_DEVICE_VERSION length returned '%s'.\n", TranslateOpenCLError(err));
return err;
}
// Now, that we know the device's version string length, we can allocate enough space before read it
std::vector<char> deviceVersion(stringLength);
// Read the device's version string
// The read value returned in deviceVersion
err = clGetDeviceInfo(ocl->device, CL_DEVICE_VERSION, stringLength, &deviceVersion[0], NULL);
if (CL_SUCCESS != err) {
LogError("Error: clGetDeviceInfo() to get CL_DEVICE_VERSION returned %s.\n", TranslateOpenCLError(err));
return err;
}
if (strstr(&deviceVersion[0], "OpenCL 2.0") != NULL) {
ocl->deviceVersion = OPENCL_VERSION_2_0;
}
// Read the device's OpenCL C version string length (param_value is NULL).
err = clGetDeviceInfo(ocl->device, CL_DEVICE_OPENCL_C_VERSION, 0, NULL, &stringLength);
if (CL_SUCCESS != err) {
LogError("Error: clGetDeviceInfo() to get CL_DEVICE_OPENCL_C_VERSION length returned '%s'.\n", TranslateOpenCLError(err));
return err;
}
// Now, that we know the device's OpenCL C version string length, we can allocate enough space before read it
std::vector<char> compilerVersion(stringLength);
// Read the device's OpenCL C version string
// The read value returned in compilerVersion
err = clGetDeviceInfo(ocl->device, CL_DEVICE_OPENCL_C_VERSION, stringLength, &compilerVersion[0], NULL);
if (CL_SUCCESS != err) {
LogError("Error: clGetDeviceInfo() to get CL_DEVICE_OPENCL_C_VERSION returned %s.\n", TranslateOpenCLError(err));
return err;
}
else if (strstr(&compilerVersion[0], "OpenCL C 2.0") != NULL) {
ocl->compilerVersion = OPENCL_VERSION_2_0;
}
return err;
}
/*
* Generate random value for input buffers
*/
void generateInput(cl_float* inputArray, int nSize) {
srand(12345);
// random initialization of input
for (int i = 0; i < nSize; i++) {
inputArray[i] = (float)rand() / RAND_MAX;
}
}
/*
* This function picks/creates necessary OpenCL objects which are needed.
* The objects are:
* OpenCL platform, device, context, and command queue.
*
* All these steps are needed to be performed once in a regular OpenCL application.
* This happens before actual compute kernels calls are performed.
*
* For convenience, in this application you store all those basic OpenCL objects in structure ocl_args_d_t,
* so this function populates fields of this structure, which is passed as parameter ocl.
* Please, consider reviewing the fields before going further.
* The structure definition is right in the beginning of this file.
*/
int SetupOpenCL(ocl_args_d_t *ocl, cl_device_type deviceType) {
// The following variable stores return codes for all OpenCL calls.
cl_int err = CL_SUCCESS;
// Query for all available OpenCL platforms on the system
// Here you enumerate all platforms and pick one which name has preferredPlatform as a sub-string
cl_platform_id platformId = FindOpenCLPlatform("Intel", deviceType);
if (NULL == platformId) {
LogError("Error: Failed to find OpenCL platform.\n");
return CL_INVALID_VALUE;
}
// Create context with device of specified type.
// Required device type is passed as function argument deviceType.
// So you may use this function to create context for any CPU or GPU OpenCL device.
// The creation is synchronized (pfn_notify is NULL) and NULL user_data
cl_context_properties contextProperties[] = { CL_CONTEXT_PLATFORM, (cl_context_properties)platformId, 0 };
ocl->context = clCreateContextFromType(contextProperties, deviceType, NULL, NULL, &err);
if ((CL_SUCCESS != err) || (NULL == ocl->context)) {
LogError("Couldn't create a context, clCreateContextFromType() returned '%s'.\n", TranslateOpenCLError(err));
return err;
}
// Query for OpenCL device which was used for context creation
err = clGetContextInfo(ocl->context, CL_CONTEXT_DEVICES, sizeof(cl_device_id), &ocl->device, NULL);
if (CL_SUCCESS != err) {
LogError("Error: clGetContextInfo() to get list of devices returned %s.\n", TranslateOpenCLError(err));
return err;
}
// Read the OpenCL platform's version and the device OpenCL and OpenCL C versions
GetPlatformAndDeviceVersion(platformId, ocl);
// Create command queue.
// OpenCL kernels are enqueued for execution to a particular device through special objects called command queues.
// Command queue guarantees some ordering between calls and other OpenCL commands.
// Here you create a simple in-order OpenCL command queue that doesn't allow execution of two kernels in parallel on a target device.
#ifdef CL_VERSION_2_0
if (OPENCL_VERSION_2_0 == ocl->deviceVersion) {
const cl_command_queue_properties properties[] ={ CL_QUEUE_PROPERTIES, CL_QUEUE_PROFILING_ENABLE, 0 };
ocl->commandQueue = clCreateCommandQueueWithProperties(ocl->context, ocl->device, properties, &err);
} else {
// default behavior: OpenCL 1.2
cl_command_queue_properties properties = CL_QUEUE_PROFILING_ENABLE;
ocl->commandQueue = clCreateCommandQueue(ocl->context, ocl->device, properties, &err);
}
#else
// default behavior: OpenCL 1.2
cl_command_queue_properties properties = CL_QUEUE_PROFILING_ENABLE;
ocl->commandQueue = clCreateCommandQueue(ocl->context, ocl->device, properties, &err);
#endif
if (CL_SUCCESS != err) {
LogError("Error: clCreateCommandQueue() returned %s.\n", TranslateOpenCLError(err));
return err;
}
return CL_SUCCESS;
}
/*
* Create and build OpenCL program from its source code
*/
int CreateAndBuildProgram(ocl_args_d_t *ocl) {
cl_int err = CL_SUCCESS;
HMODULE hmodule = GetModuleHandle(NULL);
HRSRC hresource = nullptr;
HGLOBAL hresource_data = nullptr;
const char *source = nullptr;
size_t src_size = 0;
if ( nullptr == (hresource = FindResource(hmodule, L"CLDATA", L"KERNEL_DATA"))
|| nullptr == (hresource_data = LoadResource(hmodule, hresource))
|| nullptr == (source = (const char *)LockResource(hresource_data))
|| 0 == (src_size = SizeofResource(hmodule, hresource))) {
return CL_INVALID_VALUE;
}
ocl->program = clCreateProgramWithSource(ocl->context, 1, (const char**)&source, &src_size, &err);
if (CL_SUCCESS != err) {
LogError("Error: clCreateProgramWithSource returned %s.\n", TranslateOpenCLError(err));
return err;
}
// Build the program
// During creation a program is not built. You need to explicitly call build function.
// Here you just use create-build sequence,
// but there are also other possibilities when program consist of several parts,
// some of which are libraries, and you may want to consider using clCompileProgram and clLinkProgram as
// alternatives.
std::string options = "";
err = clBuildProgram(ocl->program, 1, &ocl->device, options.c_str(), NULL, NULL);
if (CL_SUCCESS != err) {
LogError("Error: clBuildProgram() for source program returned %s.\n", TranslateOpenCLError(err));
// In case of error print the build log to the standard output
// First check the size of the log
// Then allocate the memory and obtain the log from the program
if (err == CL_BUILD_PROGRAM_FAILURE) {
size_t log_size = 0;
clGetProgramBuildInfo(ocl->program, ocl->device, CL_PROGRAM_BUILD_LOG, 0, NULL, &log_size);
std::vector<char> build_log(log_size);
clGetProgramBuildInfo(ocl->program, ocl->device, CL_PROGRAM_BUILD_LOG, log_size, &build_log[0], NULL);
LogError("Error happened during the build of OpenCL program.\nBuild log:%s", &build_log[0]);
}
}
return err;
}
/*
* Create OpenCL buffers from host memory
* These buffers will be used later by the OpenCL kernel
*/
int CreateBufferArguments(ocl_args_d_t *ocl, cl_float* input, cl_float* output, int nSize, int nDstSize) {
cl_int err = CL_SUCCESS;
ocl->srcMem = clCreateBuffer(ocl->context, CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR, sizeof(cl_float) * nSize, input, &err);
if (CL_SUCCESS != err) {
LogError("Error: clCreateBuffer for srcMem returned %s\n", TranslateOpenCLError(err));
return err;
}
ocl->dstMem = clCreateBuffer(ocl->context, CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR, sizeof(cl_float) * nDstSize, output, &err);
if (CL_SUCCESS != err) {
LogError("Error: clCreateBuffer for dstMem returned %s\n", TranslateOpenCLError(err));
return err;
}
return CL_SUCCESS;
}
/*
* Set kernel arguments
*/
cl_uint SetKernelArguments(ocl_args_d_t *ocl, int nSize) {
cl_int err = CL_SUCCESS;
err = clSetKernelArg(ocl->kernel, 0, sizeof(cl_mem), (void *)&ocl->srcMem);
if (CL_SUCCESS != err) {
LogError("error: Failed to set argument srcMem, returned %s\n", TranslateOpenCLError(err));
return err;
}
err = clSetKernelArg(ocl->kernel, 1, sizeof(cl_mem), (void *)&ocl->dstMem);
if (CL_SUCCESS != err) {
LogError("Error: Failed to set argument dstMem, returned %s\n", TranslateOpenCLError(err));
return err;
}
err = clSetKernelArg(ocl->kernel, 2, sizeof(cl_int), (void *)&nSize);
if (CL_SUCCESS != err) {
LogError("Error: Failed to set argument arrayWidth, returned %s\n", TranslateOpenCLError(err));
return err;
}
return err;
}
/*
* Execute the kernel
*/
cl_uint ExecuteAddKernel(ocl_args_d_t *ocl, int nSize) {
cl_int err = CL_SUCCESS;
// Define global iteration space for clEnqueueNDRangeKernel.
size_t localWorkSize[2] = { GROUP_SIZE, 0 };
size_t globalWorkSize[2] = { ceil_int(nSize, localWorkSize[0]), 0 };
// execute kernel
err = clEnqueueNDRangeKernel(ocl->commandQueue, ocl->kernel, 1, NULL, globalWorkSize, localWorkSize, 0, NULL, NULL);
if (CL_SUCCESS != err) {
LogError("Error: Failed to run kernel, return %s\n", TranslateOpenCLError(err));
return err;
}
return CL_SUCCESS;
}
/*
* "Read" the result buffer (mapping the buffer to the host memory address)
*/
bool ReadAndVerify(ocl_args_d_t *ocl, float cpu_sum, int nSize) {
cl_int err = CL_SUCCESS;
bool result = true;
cl_float *ptrMapped = (cl_float *)clEnqueueMapBuffer(ocl->commandQueue, ocl->dstMem, CL_FALSE, CL_MAP_READ, 0, sizeof(cl_float) * nSize, 0, NULL, NULL, &err);
if (CL_SUCCESS != err) {
LogError("Error: clEnqueueMapBuffer for ocl->dstMem returned %s\n", TranslateOpenCLError(err));
}
// Call clFinish to guarantee that output region is updated
err = clFinish(ocl->commandQueue);
if (CL_SUCCESS != err) {
LogError("Error: clFinish returned %s\n", TranslateOpenCLError(err));
}
float gpu_sum = 0.0f;
for (int i = 0; i < nSize; i++) {
gpu_sum += ptrMapped[i];
}
if (std::abs((cpu_sum - gpu_sum) / cpu_sum) > 1e-5) {
LogError("Verification failed: %e:%e\n", cpu_sum, gpu_sum);
result = false;
}
err = clEnqueueUnmapMemObject(ocl->commandQueue, ocl->dstMem, ptrMapped, 0, NULL, NULL);
if (CL_SUCCESS != err) {
LogError("Error: clEnqueueUnmapMemObject for ocl->dstMem returned %s\n", TranslateOpenCLError(err));
}
err = clFinish(ocl->commandQueue);
if (CL_SUCCESS != err) {
LogError("Error: clFinish returned %s\n", TranslateOpenCLError(err));
}
return result;
}
/*
* main execution routine
* Basically it consists of three parts:
* - generating the inputs
* - running OpenCL kernel
* - reading results of processing
*/
int _tmain(int argc, TCHAR* argv[]) {
cl_int err;
ocl_args_d_t ocl;
cl_device_type deviceType = CL_DEVICE_TYPE_GPU;
LARGE_INTEGER perfFrequency;
LARGE_INTEGER performanceCountNDRangeStart;
LARGE_INTEGER performanceCountNDRangeStop;
int nSize = 4 * 1024 * 1024;
//initialize Open CL objects (context, queue, etc.)
if (CL_SUCCESS != SetupOpenCL(&ocl, deviceType)) {
return -1;
}
// allocate working buffers.
cl_float* input = (cl_float*)_aligned_malloc(sizeof(cl_float) * nSize, 4096);
cl_float* output = (cl_float*)_aligned_malloc(sizeof(cl_float) * nSize / GROUP_SIZE, 4096);
if (NULL == input || NULL == output) {
LogError("Error: _aligned_malloc failed to allocate buffers.\n");
return -1;
}
// Create and build the OpenCL program
if (CL_SUCCESS != CreateAndBuildProgram(&ocl)) {
return -1;
}
// Program consists of kernels.
// Each kernel can be called (enqueued) from the host part of OpenCL application.
// To call the kernel, you need to create it from existing program.
ocl.kernel = clCreateKernel(ocl.program, "reduce_add", &err);
if (CL_SUCCESS != err) {
LogError("Error: clCreateKernel returned %s\n", TranslateOpenCLError(err));
return -1;
}
// Create OpenCL buffers from host memory
// These buffers will be used later by the OpenCL kernel
if (CL_SUCCESS != CreateBufferArguments(&ocl, input, output, nSize, nSize / GROUP_SIZE)) {
return -1;
}
//random input
cl_float *ptrMapped = (cl_float *)clEnqueueMapBuffer(ocl.commandQueue, ocl.srcMem, CL_FALSE, CL_MAP_WRITE, 0, sizeof(cl_float) * nSize, 0, NULL, NULL, &err);
if (CL_SUCCESS != err) {
LogError("Error: clEnqueueMapBuffer for ocl->srcMem returned %s\n", TranslateOpenCLError(err));
return -1;
}
err = clFinish(ocl.commandQueue);
generateInput(ptrMapped, nSize);
float cpu_sum = 0.0f;
for (int i = 0; i < nSize; i++) {
cpu_sum += ptrMapped[i];
}
err = clEnqueueUnmapMemObject(ocl.commandQueue, ocl.srcMem, ptrMapped, 0, NULL, NULL);
if (CL_SUCCESS != err) {
LogError("Error: clEnqueueUnmapMemObject for ocl->srcMem returned %s\n", TranslateOpenCLError(err));
return err;
}
err = clFinish(ocl.commandQueue);
if (CL_SUCCESS != err) {
LogError("Error: clFinish returned %s\n", TranslateOpenCLError(err));
}
bool queueProfilingEnable = true;
for (;;) {
// Passing arguments into OpenCL kernel.
if (CL_SUCCESS != SetKernelArguments(&ocl, nSize)) {
return -1;
}
// Regularly you wish to use OpenCL in your application to achieve greater performance results
// that are hard to achieve in other ways.
// To understand those performance benefits you may want to measure time your application spent in OpenCL kernel execution.
// The recommended way to obtain this time is to measure interval between two moments:
// - just before clEnqueueNDRangeKernel is called, and
// - just after clFinish is called
// clFinish is necessary to measure entire time spending in the kernel, measuring just clEnqueueNDRangeKernel is not enough,
// because this call doesn't guarantees that kernel is finished.
// clEnqueueNDRangeKernel is just enqueue new command in OpenCL command queue and doesn't wait until it ends.
// clFinish waits until all commands in command queue are finished, that suits your need to measure time.
if (queueProfilingEnable)
QueryPerformanceCounter(&performanceCountNDRangeStart);
// Execute (enqueue) the kernel
if (CL_SUCCESS != ExecuteAddKernel(&ocl, nSize)) {
return -1;
}
if (queueProfilingEnable)
QueryPerformanceCounter(&performanceCountNDRangeStop);
nSize /= GROUP_SIZE;
if (nSize < GROUP_SIZE) {
break;
}
std::swap(ocl.srcMem, ocl.dstMem);
}
// The last part of this function: getting processed results back.
// use map-unmap sequence to update original memory area with output buffer.
ReadAndVerify(&ocl, cpu_sum, nSize);
// retrieve performance counter frequency
if (queueProfilingEnable) {
QueryPerformanceFrequency(&perfFrequency);
LogInfo("NDRange performance counter time %f ms.\n",
1000.0f*(float)(performanceCountNDRangeStop.QuadPart - performanceCountNDRangeStart.QuadPart) / (float)perfFrequency.QuadPart);
}
_aligned_free(input);
_aligned_free(output);
//情報を収集できるよう待機する
Sleep(5000);
return 0;
}
| [
"rigaya34589@live.jp"
] | rigaya34589@live.jp |
75bea4f266b66e582196c7c35533817e4c3298c7 | d9a82b73677efb4f85641a04f1a1f9b124bd1029 | /C3_22/LANqiaomoni.cpp | d614a2299b8af484c261f3a4c549e5691a4f64c4 | [] | no_license | Kalen-Ssl/shilu | 5f338c47b57be040ec711f5a45438a8d49e6a505 | dd5d5443b94746b7c07580c65251c107e30b00d4 | refs/heads/master | 2021-07-24T14:25:50.267058 | 2020-10-19T13:46:28 | 2020-10-19T13:46:28 | 219,538,481 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,253 | cpp | //#include <stdio.h>
//int main(){
// int n=1200000;
// int m=0;
// for(int i=1;i<=n;i++){
// if((n%i)==0){
// m++;
// }
// }
// printf("%d",m);
// return 0;
//}
//#include <stdio.h>
//int main(){
// int n=15.125;
// printf("%d",n*1024);
// return 0;
//}
//
//#include <stdio.h>
//int main(){
// int i,t=0;
// int a,b,c,d;
// for(i=1;i<=99;i++){
// a=i%10;
// b=i/10%10;
// if(a==9||b==9){
// t=t+1;
// }
// }
// for(i=100;i<=999;i++){
// a=i%10;
// b=i/10%10;
// c=i/100%10;
// if(a==9||b==9||c==9){
// t=t+1;
// }
// }
// for(i=1000;i<=2019;i++){
// a=i%10;
// b=i/10%10;
// c=i/100%10;
// d=i/1000%10;
// if(a==9||b==9||c==9||d==9){
// t=t+1;
// }
// }
// printf("%d",t);
// return 0;
//}
//#include <stdio.h>
//int getnums(int num2[],int n,int m){
// int v,j;
// for(v=0;v<n-1;v++){
// for(j=v+1;j<n;j++){
// if(num2[v]<num2[j]){
// int t=num2[v];
// num2[v]=num2[j];
// num2[j]=t;
// }
// }
// }
// int getnum=num2[m-1];
// return getnum;
//}
//
//int main()
//{
// int n,m,i,o,b;
// scanf("%d%d",&n,&m);
// int num[n+1];
// int num2[n+1];
// for(i=0;i<n;i++){
// scanf("%d",&num[i]);
// }
// for(b=0;b<n;b++){
// num2[b]=num[b];
// }
// int get=getnums(num2,n,m);
// for(o=0;o<n;o++){
// if(num[o]>=get){
// printf("%d ",num[o]);
// }
// }
// return 0;
//}
//
//
//
//
//
//
//
//#include <stdio.h>
//#include <string.h>
//int main(){
// char s[101];
// scanf("%s",s);
// int i;
// bool tmp=false;
// bool t=false;
// bool m=false;
// bool j=false;
// for(i=0;i<strlen(s);i++){
// if(s[i]!='a'||s[i]!='e'||s[i]!='i'||s[i]!='o'||s[i]!='u'){
// tmp=true;
// }
// if((tmp==true)&&((s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u'))){
// t=true;
// }
// if((t==true)&&(s[i]!='a'||s[i]!='e'||s[i]!='i'||s[i]!='o'||s[i]!='u')){
// m=true;
// }
// if((m==true)&&s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u'){
// j=true;
// }
// }
// if(j==true){
// printf("yes");
// }else{
// printf("no");
// }
// return 0;
//}
//
#include <stdio.h>
int main(){
int ans=0;
int a,b,c,d;
for(int i=1;i<=2019;i++){
a=i/1000;
b=i%1000/100;
c=i%100/10;
d=i%10;
if(a==9||b==9||c==9||d==9){
ans++;
}
}
printf("%d",ans);
return 0;
}
| [
"2071004049@qq.com"
] | 2071004049@qq.com |
1067ddb7df21bded743d2b43174c0de91b11d395 | 39209a3e9682981c10721480e367da0fc55896a9 | /MoltenVK/MoltenVK/Utility/MVKVectorAllocator.h | 442e0acac5d6bca33ab70630a21545fdb4c7e97d | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] | permissive | DiegoAce/MoltenVK | f18d825659777eb4dd9cb0d0256373dc04905a28 | ea0bbe57805b2459d8e15b1010186fa168788fa5 | refs/heads/master | 2020-04-12T17:40:11.739854 | 2018-12-21T02:08:54 | 2018-12-21T02:08:54 | 155,617,197 | 0 | 0 | Apache-2.0 | 2018-10-31T20:10:14 | 2018-10-31T20:10:14 | null | UTF-8 | C++ | false | false | 14,548 | h | /*
* MVKVectorAllocator.h
*
* Copyright (c) 2012-2018 Dr. Torsten Hans (hans@ipacs.de)
*
* 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 <new>
#include <type_traits>
namespace mvk_memory_allocator
{
inline char *alloc( const size_t num_bytes )
{
return new char[num_bytes];
}
inline void free( void *ptr )
{
delete[] (char*)ptr;
}
};
//////////////////////////////////////////////////////////////////////////////////////////
//
// mvk_vector_allocator_default -> malloc based allocator for MVKVector
//
//////////////////////////////////////////////////////////////////////////////////////////
template <typename T>
class mvk_vector_allocator_default final
{
public:
T *ptr;
size_t num_elements_used;
private:
size_t num_elements_reserved;
public:
template<class S, class... Args> typename std::enable_if< !std::is_trivially_constructible<S>::value >::type
construct( S *_ptr, Args&&... _args )
{
new ( _ptr ) S( std::forward<Args>( _args )... );
}
template<class S, class... Args> typename std::enable_if< std::is_trivially_constructible<S>::value >::type
construct( S *_ptr, Args&&... _args )
{
*_ptr = S( std::forward<Args>( _args )... );
}
template<class S> typename std::enable_if< !std::is_trivially_destructible<S>::value >::type
destruct( S *_ptr )
{
_ptr->~S();
}
template<class S> typename std::enable_if< std::is_trivially_destructible<S>::value >::type
destruct( S *_ptr )
{
}
template<class S> typename std::enable_if< !std::is_trivially_destructible<S>::value >::type
destruct_all()
{
for( size_t i = 0; i < num_elements_used; ++i )
{
ptr[i].~S();
}
num_elements_used = 0;
}
template<class S> typename std::enable_if< std::is_trivially_destructible<S>::value >::type
destruct_all()
{
num_elements_used = 0;
}
public:
constexpr mvk_vector_allocator_default() : ptr{ nullptr }, num_elements_used{ 0 }, num_elements_reserved{ 0 }
{
}
mvk_vector_allocator_default( mvk_vector_allocator_default &&a ) : ptr{ a.ptr }, num_elements_used{ a.num_elements_used }, num_elements_reserved{ a.num_elements_reserved }
{
a.ptr = nullptr;
a.num_elements_used = 0;
a.num_elements_reserved = 0;
}
~mvk_vector_allocator_default()
{
deallocate();
}
size_t get_capacity() const
{
return num_elements_reserved;
}
void swap( mvk_vector_allocator_default &a )
{
const auto copy_ptr = a.ptr;
const auto copy_num_elements_used = a.num_elements_used;
const auto copy_num_elements_reserved = a.num_elements_reserved;
a.ptr = ptr;
a.num_elements_used = num_elements_used;
a.num_elements_reserved = num_elements_reserved;
ptr = copy_ptr;
num_elements_used = copy_num_elements_used;
num_elements_reserved = copy_num_elements_reserved;
}
void allocate( const size_t num_elements_to_reserve )
{
deallocate();
ptr = reinterpret_cast< T* >( mvk_memory_allocator::alloc( num_elements_to_reserve * sizeof( T ) ) );
num_elements_used = 0;
num_elements_reserved = num_elements_to_reserve;
}
void re_allocate( const size_t num_elements_to_reserve )
{
//if constexpr( std::is_trivially_copyable<T>::value )
//{
// ptr = reinterpret_cast< T* >( mvk_memory_allocator::tm_memrealloc( ptr, num_elements_to_reserve * sizeof( T ) );
//}
//else
{
auto *new_ptr = reinterpret_cast< T* >( mvk_memory_allocator::alloc( num_elements_to_reserve * sizeof( T ) ) );
for( size_t i = 0; i < num_elements_used; ++i )
{
construct( &new_ptr[i], std::move( ptr[i] ) );
destruct( &ptr[i] );
}
//if ( ptr != nullptr )
{
mvk_memory_allocator::free( ptr );
}
ptr = new_ptr;
}
num_elements_reserved = num_elements_to_reserve;
}
void shrink_to_fit()
{
if( num_elements_used == 0 )
{
deallocate();
}
else
{
auto *new_ptr = reinterpret_cast< T* >( mvk_memory_allocator::alloc( num_elements_used * sizeof( T ) ) );
for( size_t i = 0; i < num_elements_used; ++i )
{
construct( &new_ptr[i], std::move( ptr[i] ) );
destruct( &ptr[i] );
}
mvk_memory_allocator::free( ptr );
ptr = new_ptr;
num_elements_reserved = num_elements_used;
}
}
void deallocate()
{
destruct_all<T>();
mvk_memory_allocator::free( ptr );
ptr = nullptr;
num_elements_reserved = 0;
}
};
//////////////////////////////////////////////////////////////////////////////////////////
//
// mvk_vector_allocator_with_stack -> malloc based MVKVector allocator with stack storage
//
//////////////////////////////////////////////////////////////////////////////////////////
template <typename T, int N>
class mvk_vector_allocator_with_stack
{
public:
T *ptr;
size_t num_elements_used;
private:
//size_t num_elements_reserved; // uhh, num_elements_reserved is mapped onto the stack elements, let the fun begin
alignas( alignof( T ) ) unsigned char elements_stack[N * sizeof( T )];
static_assert( N * sizeof( T ) >= sizeof( size_t ), "Bummer, nasty optimization doesn't work" );
void set_num_elements_reserved( const size_t num_elements_reserved )
{
*reinterpret_cast< size_t* >( &elements_stack[0] ) = num_elements_reserved;
}
public:
//
// faster element construction and destruction using type traits
//
template<class S, class... Args> typename std::enable_if< !std::is_trivially_constructible<S, Args...>::value >::type
construct( S *_ptr, Args&&... _args )
{
new ( _ptr ) S( std::forward<Args>( _args )... );
}
template<class S, class... Args> typename std::enable_if< std::is_trivially_constructible<S, Args...>::value >::type
construct( S *_ptr, Args&&... _args )
{
*_ptr = S( std::forward<Args>( _args )... );
}
template<class S> typename std::enable_if< !std::is_trivially_destructible<S>::value >::type
destruct( S *_ptr )
{
_ptr->~S();
}
template<class S> typename std::enable_if< std::is_trivially_destructible<S>::value >::type
destruct( S *_ptr )
{
}
template<class S> typename std::enable_if< !std::is_trivially_destructible<S>::value >::type
destruct_all()
{
for( size_t i = 0; i < num_elements_used; ++i )
{
ptr[i].~S();
}
num_elements_used = 0;
}
template<class S> typename std::enable_if< std::is_trivially_destructible<S>::value >::type
destruct_all()
{
num_elements_used = 0;
}
template<class S> typename std::enable_if< !std::is_trivially_destructible<S>::value >::type
swap_stack( mvk_vector_allocator_with_stack &a )
{
T stack_copy[N];
for( size_t i = 0; i < num_elements_used; ++i )
{
construct( &stack_copy[i], std::move( ptr[i] ) );
destruct( &ptr[i] );
}
for( size_t i = 0; i < a.num_elements_used; ++i )
{
construct( &ptr[i], std::move( a.ptr[i] ) );
destruct( &ptr[i] );
}
for( size_t i = 0; i < num_elements_used; ++i )
{
construct( &a.ptr[i], std::move( stack_copy[i] ) );
destruct( &stack_copy[i] );
}
}
template<class S> typename std::enable_if< std::is_trivially_destructible<S>::value >::type
swap_stack( mvk_vector_allocator_with_stack &a )
{
constexpr int STACK_SIZE = N * sizeof( T );
for( int i = 0; i < STACK_SIZE; ++i )
{
const auto v = elements_stack[i];
elements_stack[i] = a.elements_stack[i];
a.elements_stack[i] = v;
}
}
public:
mvk_vector_allocator_with_stack() : ptr{ reinterpret_cast< T* >( &elements_stack[0] ) }, num_elements_used{ 0 }
{
}
mvk_vector_allocator_with_stack( mvk_vector_allocator_with_stack &&a ) : num_elements_used{ a.num_elements_used }
{
// is a heap based -> steal ptr from a
if( !a.get_data_on_stack() )
{
ptr = a.ptr;
set_num_elements_reserved( a.get_capacity() );
a.ptr = a.get_default_ptr();
}
else
{
ptr = get_default_ptr();
for( size_t i = 0; i < a.num_elements_used; ++i )
{
construct( &ptr[i], std::move( a.ptr[i] ) );
destruct( &a.ptr[i] );
}
}
a.num_elements_used = 0;
}
~mvk_vector_allocator_with_stack()
{
deallocate();
}
size_t get_capacity() const
{
return get_data_on_stack() ? N : *reinterpret_cast< const size_t* >( &elements_stack[0] );
}
constexpr T *get_default_ptr() const
{
return reinterpret_cast< T* >( const_cast< unsigned char * >( &elements_stack[0] ) );
}
bool get_data_on_stack() const
{
return ptr == get_default_ptr();
}
void swap( mvk_vector_allocator_with_stack &a )
{
// both allocators on heap -> easy case
if( !get_data_on_stack() && !a.get_data_on_stack() )
{
auto copy_ptr = ptr;
auto copy_num_elements_reserved = get_capacity();
ptr = a.ptr;
set_num_elements_reserved( a.get_capacity() );
a.ptr = copy_ptr;
a.set_num_elements_reserved( copy_num_elements_reserved );
}
// both allocators on stack -> just switch the stack contents
else if( get_data_on_stack() && a.get_data_on_stack() )
{
swap_stack<T>( a );
}
else if( get_data_on_stack() && !a.get_data_on_stack() )
{
auto copy_ptr = a.ptr;
auto copy_num_elements_reserved = a.get_capacity();
a.ptr = a.get_default_ptr();
for( size_t i = 0; i < num_elements_used; ++i )
{
construct( &a.ptr[i], std::move( ptr[i] ) );
destruct( &ptr[i] );
}
ptr = copy_ptr;
set_num_elements_reserved( copy_num_elements_reserved );
}
else if( !get_data_on_stack() && a.get_data_on_stack() )
{
auto copy_ptr = ptr;
auto copy_num_elements_reserved = get_capacity();
ptr = get_default_ptr();
for( size_t i = 0; i < a.num_elements_used; ++i )
{
construct( &ptr[i], std::move( a.ptr[i] ) );
destruct( &a.ptr[i] );
}
a.ptr = copy_ptr;
a.set_num_elements_reserved( copy_num_elements_reserved );
}
auto copy_num_elements_used = num_elements_used;
num_elements_used = a.num_elements_used;
a.num_elements_used = copy_num_elements_used;
}
//
// allocates rounded up to the defined alignment the number of bytes / if the system cannot allocate the specified amount of memory then a null block is returned
//
void allocate( const size_t num_elements_to_reserve )
{
deallocate();
// check if enough memory on stack space is left
if( num_elements_to_reserve <= N )
{
return;
}
ptr = reinterpret_cast< T* >( mvk_memory_allocator::alloc( num_elements_to_reserve * sizeof( T ) ) );
num_elements_used = 0;
set_num_elements_reserved( num_elements_to_reserve );
}
//template<class S> typename std::enable_if< !std::is_trivially_copyable<S>::value >::type
void _re_allocate( const size_t num_elements_to_reserve )
{
auto *new_ptr = reinterpret_cast< T* >( mvk_memory_allocator::alloc( num_elements_to_reserve * sizeof( T ) ) );
for( size_t i = 0; i < num_elements_used; ++i )
{
construct( &new_ptr[i], std::move( ptr[i] ) );
destruct( &ptr[i] );
}
if( ptr != get_default_ptr() )
{
mvk_memory_allocator::free( ptr );
}
ptr = new_ptr;
set_num_elements_reserved( num_elements_to_reserve );
}
//template<class S> typename std::enable_if< std::is_trivially_copyable<S>::value >::type
// _re_allocate( const size_t num_elements_to_reserve )
//{
// const bool data_is_on_stack = get_data_on_stack();
//
// auto *new_ptr = reinterpret_cast< S* >( mvk_memory_allocator::tm_memrealloc( data_is_on_stack ? nullptr : ptr, num_elements_to_reserve * sizeof( S ) ) );
// if( data_is_on_stack )
// {
// for( int i = 0; i < N; ++i )
// {
// new_ptr[i] = ptr[i];
// }
// }
//
// ptr = new_ptr;
// set_num_elements_reserved( num_elements_to_reserve );
//}
void re_allocate( const size_t num_elements_to_reserve )
{
//TM_ASSERT( num_elements_to_reserve > get_capacity() );
if( num_elements_to_reserve > N )
{
_re_allocate( num_elements_to_reserve );
}
}
void shrink_to_fit()
{
// nothing to do if data is on stack already
if( get_data_on_stack() )
return;
// move elements to stack space
if( num_elements_used <= N )
{
const auto num_elements_reserved = get_capacity();
auto *stack_ptr = get_default_ptr();
for( size_t i = 0; i < num_elements_used; ++i )
{
construct( &stack_ptr[i], std::move( ptr[i] ) );
destruct( &ptr[i] );
}
mvk_memory_allocator::free( ptr );
ptr = stack_ptr;
}
else
{
auto *new_ptr = reinterpret_cast< T* >( mvk_memory_allocator::alloc( ptr, num_elements_used * sizeof( T ) ) );
for( size_t i = 0; i < num_elements_used; ++i )
{
construct( &new_ptr[i], std::move( ptr[i] ) );
destruct( &ptr[i] );
}
mvk_memory_allocator::free( ptr );
ptr = new_ptr;
set_num_elements_reserved( num_elements_used );
}
}
void deallocate()
{
destruct_all<T>();
if( !get_data_on_stack() )
{
mvk_memory_allocator::free( ptr );
}
ptr = get_default_ptr();
num_elements_used = 0;
}
};
| [
"mail@ipacs.de"
] | mail@ipacs.de |
6429afb6f0baa6ff10e8724fbfd853c7a0785c7d | 374a76b065a133084b6d87c498e0b0ac0fb0e0fc | /tensorflow/compiler/mlir/tools/kernel_gen/transforms/gpu_kernel_to_blob_pass.cc | f995c22f36f259b31281648942c32845a72dd044 | [
"Apache-2.0"
] | permissive | yashkarbhari/tensorflow | 26e1efa1bc89365cafcee20cc34aa6e2f1d71132 | fd20aef919be295ce540aef232a4450ffb5fb521 | refs/heads/master | 2022-12-25T11:17:06.508453 | 2020-10-03T05:52:11 | 2020-10-03T05:59:46 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,468 | cc | /* Copyright 2020 The TensorFlow Authors. 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.
==============================================================================*/
#include "llvm/Transforms/Utils/Cloning.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h" // from @llvm-project
#include "mlir/Target/NVVMIR.h" // from @llvm-project
#include "mlir/Target/ROCDLIR.h" // from @llvm-project
#include "mlir/Transforms/DialectConversion.h" // from @llvm-project
#include "tensorflow/compiler/mlir/hlo/include/mlir-hlo/Dialect/mhlo/IR/hlo_ops.h"
#include "tensorflow/compiler/mlir/tools/kernel_gen/transforms/passes.h"
#include "tensorflow/compiler/xla/debug_options_flags.h"
#include "tensorflow/compiler/xla/service/gpu/llvm_gpu_backend/gpu_backend_lib.h"
#include "tensorflow/compiler/xla/service/gpu/stream_executor_util.h"
#include "tensorflow/compiler/xla/service/gpu/target_constants.h"
#include "tensorflow/compiler/xla/service/hlo_module_config.h"
#include "tensorflow/compiler/xla/status.h"
#include "tensorflow/compiler/xla/statusor.h"
#include "tensorflow/core/platform/cuda_libdevice_path.h"
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/path.h"
#if GOOGLE_CUDA
#include "tensorflow/stream_executor/gpu/asm_compiler.h"
#elif TENSORFLOW_USE_ROCM
#include "tensorflow/core/platform/rocm_rocdl_path.h"
#endif
namespace mlir {
namespace kernel_gen {
namespace transforms {
namespace {
#define GEN_PASS_CLASSES
#include "tensorflow/compiler/mlir/tools/kernel_gen/transforms/kernel_gen_passes.h.inc"
using xla::InternalError;
class GpuKernelToBlobPass
: public GpuKernelToBlobPassBase<GpuKernelToBlobPass> {
public:
GpuKernelToBlobPass(mlir::StringRef blob_annotation,
llvm::ArrayRef<uint32_t> architectures,
bool generate_fatbin) {
blob_annotation_ = blob_annotation.str();
architectures_ = architectures;
generate_fatbin_ = generate_fatbin;
}
void runOnOperation() override {
mlir::gpu::GPUModuleOp gpu_module = getOperation();
auto blob_or = GetGpuBinaryBlob(gpu_module);
if (blob_or.ok()) {
const auto& blob = blob_or.ValueOrDie();
std::string blob_string(blob.begin(), blob.end());
gpu_module.setAttr(blob_annotation_,
mlir::StringAttr::get(blob_string, &getContext()));
return;
}
return signalPassFailure();
}
xla::StatusOr<std::vector<uint8_t>> GetGpuBinaryBlob(
mlir::gpu::GPUModuleOp gpu_module) {
if (architectures_.empty()) {
return InternalError("Expected at least one GPU architecture.");
}
if (!generate_fatbin_ && architectures_.size() > 1) {
return InternalError(
"Can only generate machine code for more than one architecture as a "
"fatbin.");
}
llvm::LLVMContext llvmContext;
#if TENSORFLOW_USE_ROCM
auto llvmModule = mlir::translateModuleToROCDLIR(gpu_module, llvmContext);
if (!llvmModule) {
return InternalError("Could not translate MLIR module to ROCDL IR");
}
llvmModule->setModuleIdentifier("acme");
xla::HloModuleConfig config;
config.set_debug_options(xla::GetDebugOptionsFromFlags());
// TODO(b/169066682): Support fatbin on ROCm.
if (generate_fatbin_) {
return InternalError("Fatbins are not yet supported for ROCm.");
}
uint32_t arch = architectures_.front();
std::string libdevice_dir = tensorflow::RocdlRoot();
return xla::gpu::amdgpu::CompileToHsaco(llvmModule.get(), arch, config,
libdevice_dir);
#elif GOOGLE_CUDA
auto llvmModule = mlir::translateModuleToNVVMIR(gpu_module, llvmContext);
if (!llvmModule) {
return InternalError("Could not translate MLIR module to NVVM");
}
llvmModule->setModuleIdentifier("acme");
llvmModule->setDataLayout(xla::gpu::nvptx::kDataLayout);
xla::HloModuleConfig config;
config.set_debug_options(xla::GetDebugOptionsFromFlags());
auto enable_fusion = [](llvm::TargetMachine* target) {
target->Options.AllowFPOpFusion = llvm::FPOpFusion::FPOpFusionMode::Fast;
};
// Compile and collect requested cubin and PTX images.
std::vector<tensorflow::se::CubinOrPTXImage> images;
TF_ASSIGN_OR_RETURN(std::string libdevice_dir, GetLibdeviceDir(config));
auto gpu_asm_opts = xla::gpu::PtxOptsFromConfig(config);
for (uint32_t arch : architectures_) {
int32_t cc_major = arch / 10;
int32_t cc_minor = arch % 10;
// Module may be changed by CompileToPtx.
auto llvmModuleCopy = llvm::CloneModule(*llvmModule);
TF_ASSIGN_OR_RETURN(
std::string ptx,
xla::gpu::nvptx::CompileToPtx(llvmModuleCopy.get(),
std::make_pair(cc_major, cc_minor),
config, libdevice_dir, enable_fusion));
// TODO(b/169066682): If compute_XX profile, collect PTX image here.
VLOG(1) << ptx;
TF_ASSIGN_OR_RETURN(std::vector<uint8_t> gpu_asm,
tensorflow::se::CompileGpuAsm(
cc_major, cc_minor, ptx.c_str(), gpu_asm_opts));
if (!generate_fatbin_) {
// Skip fatbin generation and return the first and only GPU machine
// code.
return gpu_asm;
}
// Collect cubin image.
images.push_back({absl::StrCat("sm_", arch), std::move(gpu_asm)});
}
// TODO(b/169870789): Revisit the use of fatbins.
// Bundle cubin and PTX images into a single fatbin.
return tensorflow::se::BundleGpuAsm(images,
gpu_asm_opts.preferred_cuda_dir);
#endif
return InternalError(
"Neither TENSORFLOW_USE_ROCM nor GOOGLE_CUDA are defined."
" Did you specify either --config=rocm or --config=cuda ?");
}
private:
xla::StatusOr<std::string> GetLibdeviceDir(
const xla::HloModuleConfig& hlo_module_config) {
for (const std::string& cuda_root : tensorflow::CandidateCudaRoots(
hlo_module_config.debug_options().xla_gpu_cuda_data_dir())) {
std::string libdevice_dir =
tensorflow::io::JoinPath(cuda_root, "nvvm", "libdevice");
VLOG(2) << "Looking for libdevice at " << libdevice_dir;
if (tensorflow::Env::Default()->IsDirectory(libdevice_dir).ok()) {
VLOG(2) << "Found libdevice dir " << libdevice_dir;
return libdevice_dir;
}
}
return InternalError(
"Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice");
}
};
} // namespace
std::unique_ptr<OperationPass<gpu::GPUModuleOp>> CreateGpuKernelToBlobPass(
mlir::StringRef blob_annotation, ArrayRef<uint32_t> architectures,
bool generate_fatbin) {
return std::make_unique<GpuKernelToBlobPass>(blob_annotation, architectures,
generate_fatbin);
}
} // namespace transforms
} // namespace kernel_gen
} // namespace mlir
| [
"gardener@tensorflow.org"
] | gardener@tensorflow.org |
d54fb8415661339c12f73171ff4b8353baf3fa70 | ce702eb37c0bde25c461deddaef7030188ce9a26 | /tests/DIALOGCommunicationTestProcess/testcommandhandler.cpp | e12c6158ac361cd57677b3753f4a9d88435d2b69 | [] | no_license | lemochus1/DIALOG | f43c4fd3ebf1cebdb13a65cef367b1c3371d2644 | f67782ef756e296148e97e81ab75866e6246369b | refs/heads/master | 2022-12-17T05:59:15.137798 | 2020-08-29T14:23:55 | 2020-08-29T14:23:55 | 284,671,166 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 966 | cpp | #include "testcommandhandler.h"
#include <iostream>
TESTCommandHandler::TESTCommandHandler(const QString& name)
: DIALOGCommandHandler(name)
{}
void TESTCommandHandler::commandReceivedSlot(const QByteArray &message)
{
QString asString = APIMessageLogger::GetInstance().getMessageLogString(message);
std::cout << "Received command: " << getName().toStdString()
<<" - "<< asString.toStdString() << std::endl;
APIMessageLogger::GetInstance().logCommandReceived(getName(), asString);
}
void TESTCommandHandler::controlServerConnectedSlot()
{
std::cout << "Command handler: " << getName().toStdString()
<< ": Control server connected." << std::endl;
}
void TESTCommandHandler::controlServerUnavailableErrorSlot()
{
std::cout << "Command handler: " << getName().toStdString()
<< ": Control server lost." << std::endl;
APIMessageLogger::GetInstance().logControlServerLost("command", getName());
}
| [
"lemochus@gmail.com"
] | lemochus@gmail.com |
6c318f766d42f1435712361aa212ebd1b1e8e964 | 28645f1537ee57a6426b9b9d5bbea08f67d3eaf2 | /src/YBehavior/network/network_msvc.cpp | 2d585acdc432b5b973673e8348bff30dfdb84453 | [] | no_license | wsrlyk/YBehavior | 32b1ef02bc6ab1022c444bd2d5cf51e1e724341a | cd7bd4573c190cc6a14db1288958677bb9d32f6c | refs/heads/master | 2023-09-01T10:54:01.041700 | 2023-08-24T08:13:28 | 2023-08-24T08:13:28 | 111,627,890 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,027 | cpp | #ifdef YDEBUGGER
#include "YBehavior/define.h"
#ifdef YB_MSVC
#include "YBehavior/network/network.h"
#include <windows.h>
#include <process.h> // beginthreadex
#include "YBehavior/logger.h"
#include <winsock.h>
#include <assert.h>
#pragma comment(lib, "Ws2_32.lib")
namespace YBehavior
{
const size_t kMaxPacketDataSize = 230;
const size_t kMaxPacketSize = 256;
const size_t kSocketBufferSize = 16384;
const size_t kGlobalQueueSize = (1024 * 32);
const size_t kLocalQueueSize = (1024 * 8);
SOCKET AsWinSocket(Handle h)
{
return (SOCKET)(h);
}
namespace Socket {
bool InitSockets()
{
WSADATA wsaData;
int ret = WSAStartup(MAKEWORD(2, 2), &wsaData);
return (ret == 0);
}
void ShutdownSockets()
{
WSACleanup();
}
bool TestConnection(Handle h)
{
SOCKET winSocket = AsWinSocket(h);
fd_set readSet;
FD_ZERO(&readSet);
FD_SET(winSocket, &readSet);
timeval timeout = { 0, 17000 };
int res = ::select(0, &readSet, 0, 0, &timeout);
if (res > 0) {
if (FD_ISSET(winSocket, &readSet))
{
return true;
}
}
return false;
}
void Close(Handle& h)
{
::closesocket(AsWinSocket(h));
h = Handle(0);
}
Handle CreateSocket(bool bBlock)
{
SOCKET winSocket = ::socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (winSocket == INVALID_SOCKET)
{
return Handle(0);
}
Handle r = Handle(winSocket);
unsigned long inonBlocking = (bBlock ? 0 : 1);
if (ioctlsocket(winSocket, FIONBIO, &inonBlocking) == 0)
{
return r;
}
Close(r);
return Handle(0);
}
Handle Accept(Handle listeningSocket, size_t bufferSize)
{
typedef int socklen_t;
sockaddr_in addr;
socklen_t len = sizeof(sockaddr_in);
memset(&addr, 0, sizeof(sockaddr_in));
SOCKET outSocket = ::accept(AsWinSocket(listeningSocket), (sockaddr*)&addr, &len);
if (outSocket != SOCKET_ERROR)
{
int sizeOfBufSize = sizeof(bufferSize);
::setsockopt(outSocket, SOL_SOCKET, SO_RCVBUF, (const char*)&bufferSize, sizeOfBufSize);
::setsockopt(outSocket, SOL_SOCKET, SO_SNDBUF, (const char*)&bufferSize, sizeOfBufSize);
return Handle(outSocket);
}
return Handle(0);
}
bool Listen(Handle h, Port port, int maxConnections)
{
SOCKET winSocket = AsWinSocket(h);
sockaddr_in addr = { 0 };
addr.sin_addr.s_addr = INADDR_ANY;
addr.sin_family = AF_INET;
addr.sin_port = htons(port);
memset(addr.sin_zero, 0, sizeof(addr.sin_zero));
int bReuseAddr = 1;
::setsockopt(winSocket, SOL_SOCKET, SO_REUSEADDR, (const char*)&bReuseAddr, sizeof(bReuseAddr));
//int rcvtimeo = 1000;
//::setsockopt(winSocket, SOL_SOCKET, SO_RCVTIMEO, (const char*)&rcvtimeo, sizeof(rcvtimeo));
if (::bind(winSocket, reinterpret_cast<const sockaddr*>(&addr), sizeof(addr)) == SOCKET_ERROR)
{
Close(h);
return false;
}
if (::listen(winSocket, maxConnections) == SOCKET_ERROR)
{
Close(h);
return false;
}
return true;
}
static size_t gs_packetsSent = 0;
static size_t gs_packetsReceived = 0;
bool Write(Handle& h, const void* buffer, size_t bytes, size_t& outBytesWritten)
{
outBytesWritten = 0;
if (bytes == 0 || !h)
{
return bytes == 0;
}
int res = ::send(AsWinSocket(h), (const char*)buffer, (int)bytes, 0);
if (res == SOCKET_ERROR)
{
int err = WSAGetLastError();
if (err == WSAECONNRESET || err == WSAECONNABORTED)
{
Close(h);
}
}
else
{
outBytesWritten = (size_t)res;
gs_packetsSent++;
}
return outBytesWritten != 0;
}
size_t Read(Handle& h, const void* buffer, size_t bytesMax)
{
size_t bytesRead = 0;
if (bytesMax == 0 || !h)
{
return bytesRead;
}
fd_set readfds;
FD_ZERO(&readfds);
FD_SET(AsWinSocket(h), &readfds);
struct timeval tv;
tv.tv_sec = 0;
tv.tv_usec = 100000;//0.1s
int rv = ::select(2, &readfds, 0, 0, &tv);
if (rv == -1)
{
}
else if (rv == 0)
{
//timeout
}
else
{
int res = ::recv(AsWinSocket(h), (char*)buffer, (int)bytesMax, 0);
if (res == SOCKET_ERROR)
{
int err = WSAGetLastError();
if (err == WSAECONNRESET || err == WSAECONNABORTED)
{
Close(h);
}
}
else if (res == 0)
{
///> Client has been closed.
Close(h);
}
else
{
bytesRead = (size_t)res;
gs_packetsReceived++;
}
return bytesRead;
}
return 0;
}
size_t GetPacketsSent()
{
return gs_packetsSent;
}
size_t GetPacketsReceived()
{
return gs_packetsReceived;
}
}
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
namespace Thread
{
ThreadHandle CreateThread(ThreadFunction* function, void* arg)
{
const uint32_t creationFlags = 0x0;
uintptr_t hThread = ::_beginthreadex(NULL, (unsigned)300, function, arg, creationFlags, NULL);
return (ThreadHandle)hThread;
}
void SleepMilli (int millisec)
{
Sleep(millisec);
}
}
struct Mutex::MutexImpl
{
CRITICAL_SECTION _criticalSection;
};
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
Mutex::Mutex()
{
// Be sure that the shadow is large enough
assert(sizeof(m_buffer) >= sizeof(MutexImpl));
// Use the shadow as memory space for the platform specific implementation
_impl = (MutexImpl*)m_buffer;
InitializeCriticalSection(&_impl->_criticalSection);
}
Mutex::~Mutex()
{
DeleteCriticalSection(&_impl->_criticalSection);
}
void Mutex::Lock()
{
EnterCriticalSection(&_impl->_criticalSection);
}
void Mutex::Unlock()
{
LeaveCriticalSection(&_impl->_criticalSection);
}
}
#endif
#endif // YDEBUGGER
| [
"wsrlyk@gmail.com"
] | wsrlyk@gmail.com |
613e4f7052084ff697aec41968d5f1df4d77faa1 | 4c84d6f2e63244a1d9f7d769a06a6d3d9b694101 | /bksafevul/src_bksafevul/bksafevul/Vulfix/HyperTextParser.h | b095abe1b29432759cb9b8528e543caf6ba4c801 | [
"Apache-2.0"
] | permissive | liangqidong/Guardian-demo | ad3582c9fc53924d2ce0ca3570bf2e0a909d1391 | 3bf26f02450a676b2b8f77892a895c328dfb6814 | refs/heads/master | 2020-03-06T22:37:53.416632 | 2018-03-28T08:26:10 | 2018-03-28T08:26:10 | 127,108,413 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 752 | h | #pragma once
#include <string>
#include <map>
#include <vector>
typedef std::basic_string<TCHAR> tstring;
typedef std::map<tstring, tstring> attributes;
#ifndef LPCTSTR
typedef const TCHAR *LPCTSTR;
#endif
struct TextPart
{
TextPart()
{ }
TextPart(LPCTSTR sztag, LPCTSTR szval)
{
if(sztag) tag = sztag;
if(szval) val = szval;
}
BOOL isText() const
{
return tag.empty();
}
BOOL isLink() const
{
return !tag.empty() && tag==_T("a");
}
BOOL isBold() const
{
return !tag.empty() && tag==_T("b");
}
tstring tag, val;
attributes attrs;
};
typedef std::vector<TextPart> TextParts;
class CHyperTextParser
{
public:
void Parse( LPCTSTR sz, TextParts &parts );
void _ParseAttribute( LPCTSTR pb, LPCTSTR pe, TextPart &tt );
}; | [
"18088708700@163.com"
] | 18088708700@163.com |
cddd82eb690907c70c27ec2169732b80c0822eca | 0f44aa77e5c0f115826c3a2704199dba340da256 | /ural/1588.cpp | 235eb1c25472ff99044944347dbbf10960f79b9a | [] | no_license | aswmtjdsj/oj-code | 79952149cab8cdc1ab88e7aba1a8670d49d9726c | bb0fed587246687d2e9461408a029f0727da9e11 | refs/heads/master | 2020-12-24T16:32:26.674883 | 2017-01-10T00:08:29 | 2017-01-10T00:08:29 | 18,274,815 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,686 | cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
const double eps = 1e-9;
#define maxn 302
int comp(double x)
{
return (fabs(x) < eps?0:x<-eps?-1:1);
}
struct point
{
double x,y;
point(){}
point(double _x,double _y):x(_x),y(_y){}
point operator - (const point &p)
{
return point(x - p.x,y - p.y);
}
double norm()
{
return sqrt(x * x + y * y);
}
}p[maxn];
double d[maxn][maxn] = {0.0};
int n;
int main()
{
scanf("%d",&n);
for(int i = 0;i < n;i++)
{
double x,y;
scanf("%lf %lf",&x,&y);
p[i] = point(x,y);
}
//puts("AA");
double sum = 0.0;
for(int i = 0;i < n;i++)
for(int j = i + 1;j < n;j++)
d[i][j] = d[j][i] = (p[i] - p[j]).norm();
/*for(int i = 0;i < n;i++)
for(int j = 0;j < n;j++)
printf("%.8lf%c",d[i][j],j==n-1?'\n':' ');*/
for(int i = 0;i < n;i++)
for(int j = i + 1;j < n;j++)
{
bool flag = false;
for(int k = 0;k < n;k++)
{
if(i == k || k == j)
continue;
/*cout << i << ' ' << j << endl;
printf("%.10lf\n",d[i][j]);
cout << i << ' ' << k << ' ' << j << endl;
printf("%.10lf\n",d[i][k] + d[k][j]);*/
if(comp(d[i][j] - d[i][k] - d[k][j]) == 0)
{
flag = true;
break;
}
}
if(!flag)
sum += d[i][j];
}
printf("%.0lf\n",floor(sum + 0.5 + eps));
//cout << floor(sum+0.5 + eps) << endl;
} | [
"bupt.aswmtjdsj@gmail.com"
] | bupt.aswmtjdsj@gmail.com |
51e04ecb2bba466792464373eaf509c2181fefe0 | bebdef83edff1cc8255785369e140ce84d43350a | /Codes/10172_Gae.cpp | b53e6f7d67d6676f7a781030df193b732b83d186 | [] | no_license | SayYoungMan/BaekJoon_OJ_Solutions | 027fe9603c533df74633386dc3f7e15d5b465a00 | b764ad1a33dc7c522e044eb0406903937fe8e4cc | refs/heads/master | 2023-07-05T13:47:43.260574 | 2021-08-26T11:42:21 | 2021-08-26T11:42:21 | 387,247,523 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 218 | cpp | #include <iostream>
int main() {
std::cout << "|\\_/|\n";
std::cout << "|q p| /}\n";
std::cout << "( 0 )\"\"\"\\\n";
std::cout << "|\"^\"` |\n";
std::cout << "||_/=\\\\__|\n";
return 0;
} | [
"nickte89@gmail.com"
] | nickte89@gmail.com |
26786fddedc25072a5ed72aaaf098f1a2f823807 | c557dc5688d94ef4c3c0d1cb7afbd7ee8337c02a | /src/UI.cpp | 7cf67d7a8023d9a89e6a20fe5b2df4cda00be815 | [] | no_license | keithloughnane/PhysicalAnalyticsServer | 0ceb110eeda8499cd4f651c3134ff1f67c66e25c | 0c0f4f94a1eb17d539e6456d9cd47c0f933e078c | refs/heads/master | 2016-09-05T17:48:42.926015 | 2013-07-31T19:49:39 | 2013-07-31T19:49:39 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 153 | cpp | #include "UI.h"
#include <iostream>
using namespace std;
UI::UI()
{
cout << "UI started...\n" ;
//ctor
}
UI::~UI()
{
//dtor
}
| [
"keith.loughnane@gmail.com"
] | keith.loughnane@gmail.com |
6d160200396d6cd8e4e5ba336c4465e0c9066332 | 06726bb031816046fe2175e483981e5f6e2ece82 | /GreenJudge/b017.cpp | f2ebbcab087d17bbb98f6f4d15d422a66370614a | [] | no_license | a37052800/c | 2390f07c77131fbe01fc26943cb544edebc1726a | e966460b617dbfdeca324a6b4e845a62c70631bb | refs/heads/master | 2023-01-11T11:49:06.463615 | 2022-12-26T08:14:27 | 2022-12-26T08:14:27 | 150,870,651 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 655 | cpp | #include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main()
{
string a,b;
int i=0,j,u=0,x=0;
cin>>a>>b;
int sa=a.size(),sb=b.size();
int na[sa],nb[sb],n[102]={0};
string c;
stringstream s;
while(a[i]!='\0')
{
c=a[i];
s.clear();
s.str(c);
s>>na[i];
i++;
}
i=0;
while(b[i]!='\0')
{
c=b[i];
s.clear();
s.str(c);
s>>nb[i];
i++;
}
for(i=0;i<=sa-1;i++)
{
for(j=0;j<=sb-1;j++)
{
n[101-i-j]=na[sa-1-i]*nb[sb-1-j]+n[101-i-j];
while(n[101-i-j]>=10)
{
n[101-1-i-j]++;
n[101-i-j]-=10;
}
}
}
for(i=0;i<=101;i++)
{
if(n[i]>0) x=1;
if(x==1) cout<<n[i];
}
return 0;
}
| [
"a37052800@gmail.com"
] | a37052800@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.