blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 201 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2 values | repo_name stringlengths 7 100 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 260 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 11.4k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 17 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 80 values | src_encoding stringclasses 28 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 8 9.86M | extension stringclasses 52 values | content stringlengths 8 9.86M | authors listlengths 1 1 | author stringlengths 0 119 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d6bc1448f54fd98cb6872e2249d11bd649b64541 | 5885fd1418db54cc4b699c809cd44e625f7e23fc | /nadc-2021/l.cpp | 9c512772e93715d905adec55786a52a3c955681d | [] | no_license | ehnryx/acm | c5f294a2e287a6d7003c61ee134696b2a11e9f3b | c706120236a3e55ba2aea10fb5c3daa5c1055118 | refs/heads/master | 2023-08-31T13:19:49.707328 | 2023-08-29T01:49:32 | 2023-08-29T01:49:32 | 131,941,068 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,708 | cpp | #include <bits/stdc++.h>
using namespace std;
#define _USE_MATH_DEFINES
//#define FILENAME sadcactus
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef long long ll;
typedef long double ld;
typedef complex<ld> pt;
constexpr char nl = '\n';
constexpr ll INF = 0x3f3f3f3f;
constexpr ll INFLL = 0x3f3f3f3f3f3f3f3f;
constexpr ll MOD = 998244353;
constexpr ld EPS = 1e-9L;
random_device _rd; mt19937 rng(_rd());
int get(ll bm, int j) {
return bm >> (4*j) & 0b1111;
}
int get_walk(ll bm, int j) {
return bm >> (4*j) & 0b111;
}
ll put(ll bm, int j, int v) {
return bm ^ (ll)(get(bm, j) ^ v) << (4*j);
}
ll put_walk(ll bm, int j, int v) {
return bm ^ (ll)((get(bm, j) & 0b111) ^ v) << (4*j);
}
bool walkable(ll bm, int j) {
return get(bm, j) > 1;
}
bool connected(ll bm, int j) {
return walkable(bm, j) && (get(bm, j) < 0b1000 || get(bm, j) > 0b1100);
}
ll renumerate(int m, ll bm) {
map<int,int> remap;
for(int i=0, rid=0; i<m; i++) {
if(walkable(bm, i) && !connected(bm, i)) {
if(!remap.count(get(bm, i))) {
remap[get(bm, i)] = rid++;
}
}
}
for(int i=0; i<m; i++) {
if(remap.count(get(bm, i))) {
bm = put(bm, i, remap[get(bm, i)] | 0b1000);
}
}
return bm;
}
pair<ll,int> escalator(int m, int r, ll bm, int t) {
int value = t;
if(r > 0 && connected(bm, 0)) {
value |= get_walk(bm, 0);
}
if(connected(bm, m-1)) {
value |= get_walk(bm, m-1);
}
int cons = 0;
if(r > 0 && walkable(bm, 0)) {
cons |= 1 << get_walk(bm, 0);
}
if(walkable(bm, m-1)) {
cons |= 1 << get_walk(bm, m-1);
}
for(int j=0; j<m; j++) {
if(walkable(bm, j) && (cons & 1 << get_walk(bm, j))) {
bm = put_walk(bm, j, value);
}
}
bm = (bm << 4 | value) & ((1LL << (4*m)) - 1);
bm = renumerate(m, bm);
return pair(bm, 0);
}
pair<ll,int> hallway(int m, int r, ll bm) {
int add = 0;
add += (r > 0 && get(bm, 0) == 1);
add += (get(bm, m-1) == 1);
int value = 0;
if(r > 0 && connected(bm, 0)) {
value |= get_walk(bm, 0);
}
if(connected(bm, m-1)) {
value |= get_walk(bm, m-1);
}
if(value == 0) {
value = -1;
if(r > 0 && walkable(bm, 0)) {
value = get_walk(bm, 0);
}
if(walkable(bm, m-1)) {
value = get_walk(bm, m-1);
}
if(value == -1) {
value = 4; // ???
}
}
int cons = 0;
if(r > 0 && walkable(bm, 0)) {
cons |= 1 << get_walk(bm, 0);
}
if(walkable(bm, m-1)) {
cons |= 1 << get_walk(bm, m-1);
}
for(int j=0; j<m; j++) {
if(walkable(bm, j) && (cons & 1 << get_walk(bm, j))) {
bm = put_walk(bm, j, value);
}
}
bm = (bm << 4 | value | 0b1000) & ((1LL << (4*m)) - 1);
bm = renumerate(m, bm);
return pair(bm, add);
}
pair<ll,int> pillar(int m, int r, ll bm, bool window) {
if(walkable(bm, m-1) && get_walk(bm, m-1) != 7) {
int cnt = 0;
for(int j=0; j<m; j++) {
if(walkable(bm, j)) {
cnt += (get_walk(bm, j) == get_walk(bm, m-1));
}
}
if(cnt == 1) {
return pair(-1, 0);
}
}
int add = 0;
if(window) {
add += (walkable(bm, m-1) && (get(bm, m-1) & 0b1000));
add += (r > 0 && walkable(bm, 0) && (get(bm, 0) & 0b1000));
}
bm = (bm << 4 | window) & ((1LL << (4*m)) - 1);
bm = renumerate(m, bm);
return pair(bm, add);
}
// double-check correctness
// read limits carefully
// characterize valid solutions
int main() {
cin.tie(0)->sync_with_stdio(0);
cout << fixed << setprecision(10);
#if defined(ONLINE_JUDGE) && defined(FILENAME)
freopen(FILENAME ".in", "r", stdin);
freopen(FILENAME ".out", "w", stdout);
#endif
int n, m;
cin >> n >> m;
vector g(n, vector<char>(m));
for(int i=0; i<n; i++) {
for(int j=0; j<m; j++) {
cin >> g[i][j];
}
}
if(n < m) {
vector ng(m, vector<char>(n));
for(int i=0; i<n; i++) {
for(int j=0; j<m; j++) {
ng[j][i] = g[i][j];
}
}
g = move(ng);
swap(n, m);
}
g.insert(begin(g), vector<char>(m, '#'));
g.insert(end(g), vector<char>(m, '#'));
// 1xxx = walkable
// 0, 1, 2, 3, 4 -> connectivity
// 5 -> escalator 1
// 6 -> escalator 2
// 7 -> both
// 0110 = escalator 1
// 0101 = escalator 2
// 0111 = escalator something
// 0000 = pillar
// 0001 = shop
vector<map<ll,int>> dp((n+2) * m);
dp[m-1][0] = 0;
for(int i=1; i<=n+1; i++) {
for(int j=0; j<m; j++) {
int u = i*m + j;
for(auto [state, val] : dp[u-1]) {
if(g[i][j] == 'U') {
auto [bm, add] = escalator(m, j, state, 0b101);
if(bm != -1) {
dp[u][bm] = max(dp[u][bm], val + add);
}
} else if(g[i][j] == 'D') {
auto [bm, add] = escalator(m, j, state, 0b110);
if(bm != -1) {
dp[u][bm] = max(dp[u][bm], val + add);
}
} else if(g[i][j] == '#') {
auto [bm, add] = pillar(m, j, state, false);
if(bm != -1) {
dp[u][bm] = max(dp[u][bm], val + add);
}
} else { // g[i][j] == '.'
// shop
{
auto [bm, add] = pillar(m, j, state, true);
if(bm != -1) {
dp[u][bm] = max(dp[u][bm], val + add);
}
}
// hallway
{
auto [bm, add] = hallway(m, j, state);
if(bm != -1) {
dp[u][bm] = max(dp[u][bm], val + add);
}
}
}
}
}
}
assert(dp[(n+2)*m - 1].count(0));
cout << dp[(n+2)*m - 1][0] << nl;
return 0;
}
| [
"henryxia9999@gmail.com"
] | henryxia9999@gmail.com |
cd1aab4a7af7441d9fdaaf66805650abb8f68ada | 7968913540f6b1f516cbf81a40ca3b7da4a6b6f2 | /DragonTimeSpace/DragonLib/Network/Messages/rankpk_msg.pb.cc | ece59d2ba89e26bba7dfac2f94556afbaf00917d | [] | no_license | sebafreitas/DragonTimeSpace | cd60d6daefa2b14bb4ad8022d2f0f319c3e6c2a9 | 16718fd3aacb284aa9fd5221744873ba944eca88 | refs/heads/master | 2023-02-27T18:40:36.094540 | 2021-02-04T13:51:57 | 2021-02-04T13:51:57 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | true | 424,008 | cc | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: rankpk_msg.proto
#include "rankpk_msg.pb.h"
#include <algorithm>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.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)
#include <google/protobuf/port_def.inc>
extern PROTOBUF_INTERNAL_EXPORT_rankpk_5fmsg_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_RetTeamCurScore_SC_rankpk_5fmsg_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_rankpk_5fmsg_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_PkRewards_rankpk_5fmsg_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_rankpk_5fmsg_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_RankPKHero_rankpk_5fmsg_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_rankpk_5fmsg_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_RankPKListItem_rankpk_5fmsg_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_rankpk_5fmsg_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_RankPKResult_rankpk_5fmsg_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_rankpk_5fmsg_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_RewardsNumber_rankpk_5fmsg_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_rankpk_5fmsg_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_UserRankPkInfo_rankpk_5fmsg_2eproto;
namespace rankpk_msg {
class UserRankPkInfoDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<UserRankPkInfo> _instance;
} _UserRankPkInfo_default_instance_;
class MSG_Req_MatchMemberInfo_CSDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_Req_MatchMemberInfo_CS> _instance;
} _MSG_Req_MatchMemberInfo_CS_default_instance_;
class MSG_Ret_MatchMemberInfo_SCDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_Ret_MatchMemberInfo_SC> _instance;
} _MSG_Ret_MatchMemberInfo_SC_default_instance_;
class MSG_Req_StartMatch_CSDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_Req_StartMatch_CS> _instance;
} _MSG_Req_StartMatch_CS_default_instance_;
class MSG_Ret_StartMatch_SCDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_Ret_StartMatch_SC> _instance;
} _MSG_Ret_StartMatch_SC_default_instance_;
class MSG_Req_CancelMatch_CSDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_Req_CancelMatch_CS> _instance;
} _MSG_Req_CancelMatch_CS_default_instance_;
class MSG_Ret_CancelMatch_SCDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_Ret_CancelMatch_SC> _instance;
} _MSG_Ret_CancelMatch_SC_default_instance_;
class MSG_RankPkReqPrepare_CSDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_RankPkReqPrepare_CS> _instance;
} _MSG_RankPkReqPrepare_CS_default_instance_;
class MSG_RankPkReqPrepare_SCDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_RankPkReqPrepare_SC> _instance;
} _MSG_RankPkReqPrepare_SC_default_instance_;
class MSG_GoToBattle_SCDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_GoToBattle_SC> _instance;
} _MSG_GoToBattle_SC_default_instance_;
class MSG_Ret_MatchResult_SCDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_Ret_MatchResult_SC> _instance;
} _MSG_Ret_MatchResult_SC_default_instance_;
class MSG_Req_GotoBattle_CSDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_Req_GotoBattle_CS> _instance;
} _MSG_Req_GotoBattle_CS_default_instance_;
class MSG_RetStartPrepare_SCDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_RetStartPrepare_SC> _instance;
} _MSG_RetStartPrepare_SC_default_instance_;
class MSG_ReqChoosePrepared_CSDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_ReqChoosePrepared_CS> _instance;
} _MSG_ReqChoosePrepared_CS_default_instance_;
class MSG_RetChoosePrepared_SCDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_RetChoosePrepared_SC> _instance;
} _MSG_RetChoosePrepared_SC_default_instance_;
class MSG_RetFightCountDown_SCDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_RetFightCountDown_SC> _instance;
} _MSG_RetFightCountDown_SC_default_instance_;
class MSG_RetStartFight_SCDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_RetStartFight_SC> _instance;
} _MSG_RetStartFight_SC_default_instance_;
class MSG_RetSpeedupFight_SCDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_RetSpeedupFight_SC> _instance;
} _MSG_RetSpeedupFight_SC_default_instance_;
class RankPKResultDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<RankPKResult> _instance;
} _RankPKResult_default_instance_;
class MSG_RetFightFinish_SCDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_RetFightFinish_SC> _instance;
} _MSG_RetFightFinish_SC_default_instance_;
class MSG_ReqGetSeasonRewards_CSDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_ReqGetSeasonRewards_CS> _instance;
} _MSG_ReqGetSeasonRewards_CS_default_instance_;
class MSG_RetGetSeasonRewards_SCDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_RetGetSeasonRewards_SC> _instance;
} _MSG_RetGetSeasonRewards_SC_default_instance_;
class MSG_RetRewardsEveryday_SCDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_RetRewardsEveryday_SC> _instance;
} _MSG_RetRewardsEveryday_SC_default_instance_;
class MSG_ReqRewardsEveryday_CSDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_ReqRewardsEveryday_CS> _instance;
} _MSG_ReqRewardsEveryday_CS_default_instance_;
class PkRewardsDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<PkRewards> _instance;
} _PkRewards_default_instance_;
class RewardsNumberDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<RewardsNumber> _instance;
} _RewardsNumber_default_instance_;
class RankPKHeroDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<RankPKHero> _instance;
} _RankPKHero_default_instance_;
class MSG_RetRankPKHeroHistory_SCDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_RetRankPKHeroHistory_SC> _instance;
} _MSG_RetRankPKHeroHistory_SC_default_instance_;
class MSG_RetUserRankStar_SCDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_RetUserRankStar_SC> _instance;
} _MSG_RetUserRankStar_SC_default_instance_;
class MSG_RetTeamLeftMemSize_SCDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_RetTeamLeftMemSize_SC> _instance;
} _MSG_RetTeamLeftMemSize_SC_default_instance_;
class MSG_ReqRankPKCurStage_CSDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_ReqRankPKCurStage_CS> _instance;
} _MSG_ReqRankPKCurStage_CS_default_instance_;
class MSG_RetRankPKCurStage_SCDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_RetRankPKCurStage_SC> _instance;
} _MSG_RetRankPKCurStage_SC_default_instance_;
class MSG_RetPreparedNum_SCDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_RetPreparedNum_SC> _instance;
} _MSG_RetPreparedNum_SC_default_instance_;
class MSG_RetMemPkPrepared_SCDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_RetMemPkPrepared_SC> _instance;
} _MSG_RetMemPkPrepared_SC_default_instance_;
class MSG_RetPKGeneralConfig_SCDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_RetPKGeneralConfig_SC> _instance;
} _MSG_RetPKGeneralConfig_SC_default_instance_;
class MSG_RetTeamCurScore_SCDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_RetTeamCurScore_SC> _instance;
} _MSG_RetTeamCurScore_SC_default_instance_;
class RankPKListItemDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<RankPKListItem> _instance;
} _RankPKListItem_default_instance_;
class MSG_ReqRankPKList_CSDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_ReqRankPKList_CS> _instance;
} _MSG_ReqRankPKList_CS_default_instance_;
class MSG_RetRankPKList_SCDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MSG_RetRankPKList_SC> _instance;
} _MSG_RetRankPKList_SC_default_instance_;
} // namespace rankpk_msg
static void InitDefaultsscc_info_MSG_GoToBattle_SC_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_GoToBattle_SC_default_instance_;
new (ptr) ::rankpk_msg::MSG_GoToBattle_SC();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_GoToBattle_SC::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_GoToBattle_SC_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_GoToBattle_SC_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_RankPkReqPrepare_CS_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_RankPkReqPrepare_CS_default_instance_;
new (ptr) ::rankpk_msg::MSG_RankPkReqPrepare_CS();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_RankPkReqPrepare_CS::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_RankPkReqPrepare_CS_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_RankPkReqPrepare_CS_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_RankPkReqPrepare_SC_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_RankPkReqPrepare_SC_default_instance_;
new (ptr) ::rankpk_msg::MSG_RankPkReqPrepare_SC();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_RankPkReqPrepare_SC::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_RankPkReqPrepare_SC_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_RankPkReqPrepare_SC_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_ReqChoosePrepared_CS_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_ReqChoosePrepared_CS_default_instance_;
new (ptr) ::rankpk_msg::MSG_ReqChoosePrepared_CS();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_ReqChoosePrepared_CS::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_ReqChoosePrepared_CS_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_ReqChoosePrepared_CS_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_ReqGetSeasonRewards_CS_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_ReqGetSeasonRewards_CS_default_instance_;
new (ptr) ::rankpk_msg::MSG_ReqGetSeasonRewards_CS();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_ReqGetSeasonRewards_CS::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_ReqGetSeasonRewards_CS_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_ReqGetSeasonRewards_CS_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_ReqRankPKCurStage_CS_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_ReqRankPKCurStage_CS_default_instance_;
new (ptr) ::rankpk_msg::MSG_ReqRankPKCurStage_CS();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_ReqRankPKCurStage_CS::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_ReqRankPKCurStage_CS_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_ReqRankPKCurStage_CS_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_ReqRankPKList_CS_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_ReqRankPKList_CS_default_instance_;
new (ptr) ::rankpk_msg::MSG_ReqRankPKList_CS();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_ReqRankPKList_CS::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_ReqRankPKList_CS_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_ReqRankPKList_CS_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_ReqRewardsEveryday_CS_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_ReqRewardsEveryday_CS_default_instance_;
new (ptr) ::rankpk_msg::MSG_ReqRewardsEveryday_CS();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_ReqRewardsEveryday_CS::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_ReqRewardsEveryday_CS_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_ReqRewardsEveryday_CS_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_Req_CancelMatch_CS_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_Req_CancelMatch_CS_default_instance_;
new (ptr) ::rankpk_msg::MSG_Req_CancelMatch_CS();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_Req_CancelMatch_CS::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_Req_CancelMatch_CS_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_Req_CancelMatch_CS_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_Req_GotoBattle_CS_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_Req_GotoBattle_CS_default_instance_;
new (ptr) ::rankpk_msg::MSG_Req_GotoBattle_CS();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_Req_GotoBattle_CS::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_Req_GotoBattle_CS_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_Req_GotoBattle_CS_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_Req_MatchMemberInfo_CS_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_Req_MatchMemberInfo_CS_default_instance_;
new (ptr) ::rankpk_msg::MSG_Req_MatchMemberInfo_CS();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_Req_MatchMemberInfo_CS::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_Req_MatchMemberInfo_CS_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_Req_MatchMemberInfo_CS_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_Req_StartMatch_CS_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_Req_StartMatch_CS_default_instance_;
new (ptr) ::rankpk_msg::MSG_Req_StartMatch_CS();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_Req_StartMatch_CS::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_Req_StartMatch_CS_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_Req_StartMatch_CS_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_RetChoosePrepared_SC_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_RetChoosePrepared_SC_default_instance_;
new (ptr) ::rankpk_msg::MSG_RetChoosePrepared_SC();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_RetChoosePrepared_SC::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_RetChoosePrepared_SC_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_RetChoosePrepared_SC_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_RetFightCountDown_SC_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_RetFightCountDown_SC_default_instance_;
new (ptr) ::rankpk_msg::MSG_RetFightCountDown_SC();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_RetFightCountDown_SC::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_RetFightCountDown_SC_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_RetFightCountDown_SC_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_RetFightFinish_SC_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_RetFightFinish_SC_default_instance_;
new (ptr) ::rankpk_msg::MSG_RetFightFinish_SC();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_RetFightFinish_SC::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_MSG_RetFightFinish_SC_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_MSG_RetFightFinish_SC_rankpk_5fmsg_2eproto}, {
&scc_info_RewardsNumber_rankpk_5fmsg_2eproto.base,
&scc_info_RankPKResult_rankpk_5fmsg_2eproto.base,}};
static void InitDefaultsscc_info_MSG_RetGetSeasonRewards_SC_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_RetGetSeasonRewards_SC_default_instance_;
new (ptr) ::rankpk_msg::MSG_RetGetSeasonRewards_SC();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_RetGetSeasonRewards_SC::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_RetGetSeasonRewards_SC_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_RetGetSeasonRewards_SC_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_RetMemPkPrepared_SC_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_RetMemPkPrepared_SC_default_instance_;
new (ptr) ::rankpk_msg::MSG_RetMemPkPrepared_SC();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_RetMemPkPrepared_SC::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_RetMemPkPrepared_SC_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_RetMemPkPrepared_SC_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_RetPKGeneralConfig_SC_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_RetPKGeneralConfig_SC_default_instance_;
new (ptr) ::rankpk_msg::MSG_RetPKGeneralConfig_SC();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_RetPKGeneralConfig_SC::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_RetPKGeneralConfig_SC_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_RetPKGeneralConfig_SC_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_RetPreparedNum_SC_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_RetPreparedNum_SC_default_instance_;
new (ptr) ::rankpk_msg::MSG_RetPreparedNum_SC();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_RetPreparedNum_SC::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_RetPreparedNum_SC_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_RetPreparedNum_SC_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_RetRankPKCurStage_SC_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_RetRankPKCurStage_SC_default_instance_;
new (ptr) ::rankpk_msg::MSG_RetRankPKCurStage_SC();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_RetRankPKCurStage_SC::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_MSG_RetRankPKCurStage_SC_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_MSG_RetRankPKCurStage_SC_rankpk_5fmsg_2eproto}, {
&scc_info_MSG_RetTeamCurScore_SC_rankpk_5fmsg_2eproto.base,}};
static void InitDefaultsscc_info_MSG_RetRankPKHeroHistory_SC_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_RetRankPKHeroHistory_SC_default_instance_;
new (ptr) ::rankpk_msg::MSG_RetRankPKHeroHistory_SC();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_RetRankPKHeroHistory_SC::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_MSG_RetRankPKHeroHistory_SC_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_MSG_RetRankPKHeroHistory_SC_rankpk_5fmsg_2eproto}, {
&scc_info_RankPKHero_rankpk_5fmsg_2eproto.base,}};
static void InitDefaultsscc_info_MSG_RetRankPKList_SC_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_RetRankPKList_SC_default_instance_;
new (ptr) ::rankpk_msg::MSG_RetRankPKList_SC();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_RetRankPKList_SC::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_MSG_RetRankPKList_SC_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_MSG_RetRankPKList_SC_rankpk_5fmsg_2eproto}, {
&scc_info_RankPKListItem_rankpk_5fmsg_2eproto.base,}};
static void InitDefaultsscc_info_MSG_RetRewardsEveryday_SC_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_RetRewardsEveryday_SC_default_instance_;
new (ptr) ::rankpk_msg::MSG_RetRewardsEveryday_SC();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_RetRewardsEveryday_SC::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_MSG_RetRewardsEveryday_SC_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_MSG_RetRewardsEveryday_SC_rankpk_5fmsg_2eproto}, {
&scc_info_PkRewards_rankpk_5fmsg_2eproto.base,}};
static void InitDefaultsscc_info_MSG_RetSpeedupFight_SC_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_RetSpeedupFight_SC_default_instance_;
new (ptr) ::rankpk_msg::MSG_RetSpeedupFight_SC();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_RetSpeedupFight_SC::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_RetSpeedupFight_SC_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_RetSpeedupFight_SC_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_RetStartFight_SC_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_RetStartFight_SC_default_instance_;
new (ptr) ::rankpk_msg::MSG_RetStartFight_SC();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_RetStartFight_SC::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_MSG_RetStartFight_SC_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_MSG_RetStartFight_SC_rankpk_5fmsg_2eproto}, {
&scc_info_MSG_RetTeamCurScore_SC_rankpk_5fmsg_2eproto.base,}};
static void InitDefaultsscc_info_MSG_RetStartPrepare_SC_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_RetStartPrepare_SC_default_instance_;
new (ptr) ::rankpk_msg::MSG_RetStartPrepare_SC();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_RetStartPrepare_SC::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_RetStartPrepare_SC_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_RetStartPrepare_SC_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_RetTeamCurScore_SC_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_RetTeamCurScore_SC_default_instance_;
new (ptr) ::rankpk_msg::MSG_RetTeamCurScore_SC();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_RetTeamCurScore_SC::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_RetTeamCurScore_SC_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_RetTeamCurScore_SC_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_RetTeamLeftMemSize_SC_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_RetTeamLeftMemSize_SC_default_instance_;
new (ptr) ::rankpk_msg::MSG_RetTeamLeftMemSize_SC();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_RetTeamLeftMemSize_SC::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_RetTeamLeftMemSize_SC_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_RetTeamLeftMemSize_SC_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_RetUserRankStar_SC_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_RetUserRankStar_SC_default_instance_;
new (ptr) ::rankpk_msg::MSG_RetUserRankStar_SC();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_RetUserRankStar_SC::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_RetUserRankStar_SC_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_RetUserRankStar_SC_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_Ret_CancelMatch_SC_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_Ret_CancelMatch_SC_default_instance_;
new (ptr) ::rankpk_msg::MSG_Ret_CancelMatch_SC();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_Ret_CancelMatch_SC::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_Ret_CancelMatch_SC_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_Ret_CancelMatch_SC_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_Ret_MatchMemberInfo_SC_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_Ret_MatchMemberInfo_SC_default_instance_;
new (ptr) ::rankpk_msg::MSG_Ret_MatchMemberInfo_SC();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_Ret_MatchMemberInfo_SC::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_MSG_Ret_MatchMemberInfo_SC_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_MSG_Ret_MatchMemberInfo_SC_rankpk_5fmsg_2eproto}, {
&scc_info_UserRankPkInfo_rankpk_5fmsg_2eproto.base,}};
static void InitDefaultsscc_info_MSG_Ret_MatchResult_SC_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_Ret_MatchResult_SC_default_instance_;
new (ptr) ::rankpk_msg::MSG_Ret_MatchResult_SC();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_Ret_MatchResult_SC::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_Ret_MatchResult_SC_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_Ret_MatchResult_SC_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_MSG_Ret_StartMatch_SC_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_MSG_Ret_StartMatch_SC_default_instance_;
new (ptr) ::rankpk_msg::MSG_Ret_StartMatch_SC();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::MSG_Ret_StartMatch_SC::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MSG_Ret_StartMatch_SC_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MSG_Ret_StartMatch_SC_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_PkRewards_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_PkRewards_default_instance_;
new (ptr) ::rankpk_msg::PkRewards();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::PkRewards::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_PkRewards_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_PkRewards_rankpk_5fmsg_2eproto}, {
&scc_info_RewardsNumber_rankpk_5fmsg_2eproto.base,}};
static void InitDefaultsscc_info_RankPKHero_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_RankPKHero_default_instance_;
new (ptr) ::rankpk_msg::RankPKHero();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::RankPKHero::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_RankPKHero_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_RankPKHero_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_RankPKListItem_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_RankPKListItem_default_instance_;
new (ptr) ::rankpk_msg::RankPKListItem();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::RankPKListItem::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_RankPKListItem_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_RankPKListItem_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_RankPKResult_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_RankPKResult_default_instance_;
new (ptr) ::rankpk_msg::RankPKResult();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::RankPKResult::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_RankPKResult_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_RankPKResult_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_RewardsNumber_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_RewardsNumber_default_instance_;
new (ptr) ::rankpk_msg::RewardsNumber();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::RewardsNumber::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_RewardsNumber_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_RewardsNumber_rankpk_5fmsg_2eproto}, {}};
static void InitDefaultsscc_info_UserRankPkInfo_rankpk_5fmsg_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::rankpk_msg::_UserRankPkInfo_default_instance_;
new (ptr) ::rankpk_msg::UserRankPkInfo();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::rankpk_msg::UserRankPkInfo::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_UserRankPkInfo_rankpk_5fmsg_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_UserRankPkInfo_rankpk_5fmsg_2eproto}, {}};
static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_rankpk_5fmsg_2eproto[39];
static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_rankpk_5fmsg_2eproto[1];
static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_rankpk_5fmsg_2eproto = nullptr;
const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_rankpk_5fmsg_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
PROTOBUF_FIELD_OFFSET(::rankpk_msg::UserRankPkInfo, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::UserRankPkInfo, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::UserRankPkInfo, charid_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::UserRankPkInfo, name_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::UserRankPkInfo, heroid_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::UserRankPkInfo, fight_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::UserRankPkInfo, rank_level_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::UserRankPkInfo, rank_star_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::UserRankPkInfo, rank_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::UserRankPkInfo, hide_score_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::UserRankPkInfo, all_battles_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::UserRankPkInfo, success_battles_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::UserRankPkInfo, battle_score_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::UserRankPkInfo, seanson_battles_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::UserRankPkInfo, best_rank_level_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::UserRankPkInfo, best_rank_),
1,
0,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Req_MatchMemberInfo_CS, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Req_MatchMemberInfo_CS, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Ret_MatchMemberInfo_SC, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Ret_MatchMemberInfo_SC, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Ret_MatchMemberInfo_SC, members_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Ret_MatchMemberInfo_SC, leaderid_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Ret_MatchMemberInfo_SC, season_id_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Ret_MatchMemberInfo_SC, start_time_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Ret_MatchMemberInfo_SC, end_time_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Ret_MatchMemberInfo_SC, leftdays_),
~0u,
0,
1,
2,
3,
4,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Req_StartMatch_CS, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Req_StartMatch_CS, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Ret_StartMatch_SC, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Ret_StartMatch_SC, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Ret_StartMatch_SC, retcode_),
0,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Req_CancelMatch_CS, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Req_CancelMatch_CS, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Ret_CancelMatch_SC, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Ret_CancelMatch_SC, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Ret_CancelMatch_SC, retcode_),
0,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RankPkReqPrepare_CS, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RankPkReqPrepare_CS, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RankPkReqPrepare_SC, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RankPkReqPrepare_SC, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RankPkReqPrepare_SC, readystate_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RankPkReqPrepare_SC, readynum_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RankPkReqPrepare_SC, totalnum_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RankPkReqPrepare_SC, lefttime_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RankPkReqPrepare_SC, enemyreadynum_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RankPkReqPrepare_SC, enemytotalnum_),
0,
1,
2,
3,
4,
5,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_GoToBattle_SC, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_GoToBattle_SC, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_GoToBattle_SC, retcode_),
0,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Ret_MatchResult_SC, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Ret_MatchResult_SC, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Ret_MatchResult_SC, retcode_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Ret_MatchResult_SC, lefttime_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Ret_MatchResult_SC, totalnum_),
0,
1,
2,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Req_GotoBattle_CS, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_Req_GotoBattle_CS, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetStartPrepare_SC, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetStartPrepare_SC, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetStartPrepare_SC, duration_),
0,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_ReqChoosePrepared_CS, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_ReqChoosePrepared_CS, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetChoosePrepared_SC, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetChoosePrepared_SC, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetChoosePrepared_SC, errcode_),
0,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetFightCountDown_SC, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetFightCountDown_SC, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetFightCountDown_SC, duration_),
0,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetStartFight_SC, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetStartFight_SC, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetStartFight_SC, duration_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetStartFight_SC, score_),
1,
0,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetSpeedupFight_SC, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetSpeedupFight_SC, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetSpeedupFight_SC, duration_),
0,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RankPKResult, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RankPKResult, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RankPKResult, charid_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RankPKResult, name_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RankPKResult, heroid_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RankPKResult, cure_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RankPKResult, hurt_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RankPKResult, dead_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RankPKResult, kill_),
1,
0,
2,
3,
4,
5,
6,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetFightFinish_SC, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetFightFinish_SC, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetFightFinish_SC, duration_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetFightFinish_SC, winteamid_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetFightFinish_SC, rewards_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetFightFinish_SC, merankpkresult_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetFightFinish_SC, enemyrankpkresult_),
0,
1,
~0u,
~0u,
~0u,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_ReqGetSeasonRewards_CS, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_ReqGetSeasonRewards_CS, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetGetSeasonRewards_SC, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetGetSeasonRewards_SC, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetGetSeasonRewards_SC, season_rewards_received_),
0,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetRewardsEveryday_SC, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetRewardsEveryday_SC, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetRewardsEveryday_SC, battle_number_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetRewardsEveryday_SC, success_number_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetRewardsEveryday_SC, pkrewards_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetRewardsEveryday_SC, remainder_day_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetRewardsEveryday_SC, rank_level_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetRewardsEveryday_SC, rewards_received_),
0,
1,
~0u,
2,
3,
4,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_ReqRewardsEveryday_CS, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_ReqRewardsEveryday_CS, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::PkRewards, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::PkRewards, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::PkRewards, heroid_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::PkRewards, time_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::PkRewards, rewards_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::PkRewards, pkresult_),
0,
1,
~0u,
2,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RewardsNumber, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RewardsNumber, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RewardsNumber, objectid_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RewardsNumber, number_),
0,
1,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RankPKHero, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RankPKHero, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RankPKHero, heroid_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RankPKHero, lastusetime_),
0,
1,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetRankPKHeroHistory_SC, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetRankPKHeroHistory_SC, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetRankPKHeroHistory_SC, heros_),
~0u,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetUserRankStar_SC, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetUserRankStar_SC, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetUserRankStar_SC, uid_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetUserRankStar_SC, rank_),
0,
1,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetTeamLeftMemSize_SC, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetTeamLeftMemSize_SC, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetTeamLeftMemSize_SC, team1id_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetTeamLeftMemSize_SC, team1left_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetTeamLeftMemSize_SC, team2id_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetTeamLeftMemSize_SC, team2left_),
0,
1,
2,
3,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_ReqRankPKCurStage_CS, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_ReqRankPKCurStage_CS, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetRankPKCurStage_SC, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetRankPKCurStage_SC, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetRankPKCurStage_SC, curstage_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetRankPKCurStage_SC, duration_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetRankPKCurStage_SC, score_),
1,
2,
0,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetPreparedNum_SC, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetPreparedNum_SC, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetPreparedNum_SC, curnum_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetPreparedNum_SC, allnum_),
0,
1,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetMemPkPrepared_SC, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetMemPkPrepared_SC, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetMemPkPrepared_SC, memid_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetMemPkPrepared_SC, heroid_),
0,
1,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetPKGeneralConfig_SC, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetPKGeneralConfig_SC, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetPKGeneralConfig_SC, teampknum_),
0,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetTeamCurScore_SC, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetTeamCurScore_SC, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetTeamCurScore_SC, team1id_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetTeamCurScore_SC, team1score_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetTeamCurScore_SC, team2id_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetTeamCurScore_SC, team2score_),
0,
1,
2,
3,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RankPKListItem, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RankPKListItem, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RankPKListItem, position_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RankPKListItem, charid_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RankPKListItem, name_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RankPKListItem, ranklevel_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RankPKListItem, guildname_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RankPKListItem, winbattle_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::RankPKListItem, winrate_),
3,
2,
0,
4,
1,
5,
6,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_ReqRankPKList_CS, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_ReqRankPKList_CS, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_ReqRankPKList_CS, type_),
0,
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetRankPKList_SC, _has_bits_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetRankPKList_SC, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetRankPKList_SC, type_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetRankPKList_SC, myposition_),
PROTOBUF_FIELD_OFFSET(::rankpk_msg::MSG_RetRankPKList_SC, data_),
0,
1,
~0u,
};
static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, 19, sizeof(::rankpk_msg::UserRankPkInfo)},
{ 33, 38, sizeof(::rankpk_msg::MSG_Req_MatchMemberInfo_CS)},
{ 38, 49, sizeof(::rankpk_msg::MSG_Ret_MatchMemberInfo_SC)},
{ 55, 60, sizeof(::rankpk_msg::MSG_Req_StartMatch_CS)},
{ 60, 66, sizeof(::rankpk_msg::MSG_Ret_StartMatch_SC)},
{ 67, 72, sizeof(::rankpk_msg::MSG_Req_CancelMatch_CS)},
{ 72, 78, sizeof(::rankpk_msg::MSG_Ret_CancelMatch_SC)},
{ 79, 84, sizeof(::rankpk_msg::MSG_RankPkReqPrepare_CS)},
{ 84, 95, sizeof(::rankpk_msg::MSG_RankPkReqPrepare_SC)},
{ 101, 107, sizeof(::rankpk_msg::MSG_GoToBattle_SC)},
{ 108, 116, sizeof(::rankpk_msg::MSG_Ret_MatchResult_SC)},
{ 119, 124, sizeof(::rankpk_msg::MSG_Req_GotoBattle_CS)},
{ 124, 130, sizeof(::rankpk_msg::MSG_RetStartPrepare_SC)},
{ 131, 136, sizeof(::rankpk_msg::MSG_ReqChoosePrepared_CS)},
{ 136, 142, sizeof(::rankpk_msg::MSG_RetChoosePrepared_SC)},
{ 143, 149, sizeof(::rankpk_msg::MSG_RetFightCountDown_SC)},
{ 150, 157, sizeof(::rankpk_msg::MSG_RetStartFight_SC)},
{ 159, 165, sizeof(::rankpk_msg::MSG_RetSpeedupFight_SC)},
{ 166, 178, sizeof(::rankpk_msg::RankPKResult)},
{ 185, 195, sizeof(::rankpk_msg::MSG_RetFightFinish_SC)},
{ 200, 205, sizeof(::rankpk_msg::MSG_ReqGetSeasonRewards_CS)},
{ 205, 211, sizeof(::rankpk_msg::MSG_RetGetSeasonRewards_SC)},
{ 212, 223, sizeof(::rankpk_msg::MSG_RetRewardsEveryday_SC)},
{ 229, 234, sizeof(::rankpk_msg::MSG_ReqRewardsEveryday_CS)},
{ 234, 243, sizeof(::rankpk_msg::PkRewards)},
{ 247, 254, sizeof(::rankpk_msg::RewardsNumber)},
{ 256, 263, sizeof(::rankpk_msg::RankPKHero)},
{ 265, 271, sizeof(::rankpk_msg::MSG_RetRankPKHeroHistory_SC)},
{ 272, 279, sizeof(::rankpk_msg::MSG_RetUserRankStar_SC)},
{ 281, 290, sizeof(::rankpk_msg::MSG_RetTeamLeftMemSize_SC)},
{ 294, 299, sizeof(::rankpk_msg::MSG_ReqRankPKCurStage_CS)},
{ 299, 307, sizeof(::rankpk_msg::MSG_RetRankPKCurStage_SC)},
{ 310, 317, sizeof(::rankpk_msg::MSG_RetPreparedNum_SC)},
{ 319, 326, sizeof(::rankpk_msg::MSG_RetMemPkPrepared_SC)},
{ 328, 334, sizeof(::rankpk_msg::MSG_RetPKGeneralConfig_SC)},
{ 335, 344, sizeof(::rankpk_msg::MSG_RetTeamCurScore_SC)},
{ 348, 360, sizeof(::rankpk_msg::RankPKListItem)},
{ 367, 373, sizeof(::rankpk_msg::MSG_ReqRankPKList_CS)},
{ 374, 382, sizeof(::rankpk_msg::MSG_RetRankPKList_SC)},
};
static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_UserRankPkInfo_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_Req_MatchMemberInfo_CS_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_Ret_MatchMemberInfo_SC_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_Req_StartMatch_CS_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_Ret_StartMatch_SC_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_Req_CancelMatch_CS_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_Ret_CancelMatch_SC_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_RankPkReqPrepare_CS_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_RankPkReqPrepare_SC_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_GoToBattle_SC_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_Ret_MatchResult_SC_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_Req_GotoBattle_CS_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_RetStartPrepare_SC_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_ReqChoosePrepared_CS_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_RetChoosePrepared_SC_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_RetFightCountDown_SC_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_RetStartFight_SC_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_RetSpeedupFight_SC_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_RankPKResult_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_RetFightFinish_SC_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_ReqGetSeasonRewards_CS_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_RetGetSeasonRewards_SC_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_RetRewardsEveryday_SC_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_ReqRewardsEveryday_CS_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_PkRewards_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_RewardsNumber_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_RankPKHero_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_RetRankPKHeroHistory_SC_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_RetUserRankStar_SC_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_RetTeamLeftMemSize_SC_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_ReqRankPKCurStage_CS_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_RetRankPKCurStage_SC_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_RetPreparedNum_SC_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_RetMemPkPrepared_SC_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_RetPKGeneralConfig_SC_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_RetTeamCurScore_SC_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_RankPKListItem_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_ReqRankPKList_CS_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::rankpk_msg::_MSG_RetRankPKList_SC_default_instance_),
};
const char descriptor_table_protodef_rankpk_5fmsg_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n\020rankpk_msg.proto\022\nrankpk_msg\032\016msg_enum"
".proto\"\237\002\n\016UserRankPkInfo\022\016\n\006charid\030\001 \001("
"\r\022\014\n\004name\030\002 \001(\t\022\016\n\006heroid\030\003 \001(\r\022\r\n\005fight"
"\030\004 \001(\r\022\022\n\nrank_level\030\005 \001(\r\022\021\n\trank_star\030"
"\006 \001(\r\022\014\n\004rank\030\007 \001(\r\022\022\n\nhide_score\030\010 \001(\r\022"
"\023\n\013all_battles\030\t \001(\r\022\027\n\017success_battles\030"
"\n \001(\r\022\024\n\014battle_score\030\013 \001(\r\022\027\n\017seanson_b"
"attles\030\014 \001(\r\022\027\n\017best_rank_level\030\r \001(\r\022\021\n"
"\tbest_rank\030\016 \001(\r\"\034\n\032MSG_Req_MatchMemberI"
"nfo_CS\"\246\001\n\032MSG_Ret_MatchMemberInfo_SC\022+\n"
"\007members\030\001 \003(\0132\032.rankpk_msg.UserRankPkIn"
"fo\022\020\n\010leaderid\030\002 \001(\004\022\021\n\tseason_id\030\003 \001(\r\022"
"\022\n\nstart_time\030\004 \001(\r\022\020\n\010end_time\030\005 \001(\r\022\020\n"
"\010leftdays\030\006 \001(\r\"\027\n\025MSG_Req_StartMatch_CS"
"\"(\n\025MSG_Ret_StartMatch_SC\022\017\n\007retcode\030\001 \001"
"(\r\"\030\n\026MSG_Req_CancelMatch_CS\")\n\026MSG_Ret_"
"CancelMatch_SC\022\017\n\007retcode\030\001 \001(\r\"\031\n\027MSG_R"
"ankPkReqPrepare_CS\"\221\001\n\027MSG_RankPkReqPrep"
"are_SC\022\022\n\nreadystate\030\001 \002(\r\022\020\n\010readynum\030\002"
" \002(\r\022\020\n\010totalnum\030\003 \002(\r\022\020\n\010lefttime\030\004 \001(\r"
"\022\025\n\renemyreadynum\030\005 \001(\r\022\025\n\renemytotalnum"
"\030\006 \001(\r\"$\n\021MSG_GoToBattle_SC\022\017\n\007retcode\030\001"
" \001(\r\"M\n\026MSG_Ret_MatchResult_SC\022\017\n\007retcod"
"e\030\001 \001(\r\022\020\n\010lefttime\030\002 \001(\r\022\020\n\010totalnum\030\003 "
"\001(\r\"\027\n\025MSG_Req_GotoBattle_CS\"*\n\026MSG_RetS"
"tartPrepare_SC\022\020\n\010duration\030\001 \001(\r\"\032\n\030MSG_"
"ReqChoosePrepared_CS\"+\n\030MSG_RetChoosePre"
"pared_SC\022\017\n\007errcode\030\001 \001(\r\",\n\030MSG_RetFigh"
"tCountDown_SC\022\020\n\010duration\030\001 \001(\r\"[\n\024MSG_R"
"etStartFight_SC\022\020\n\010duration\030\001 \001(\r\0221\n\005sco"
"re\030\002 \001(\0132\".rankpk_msg.MSG_RetTeamCurScor"
"e_SC\"*\n\026MSG_RetSpeedupFight_SC\022\020\n\010durati"
"on\030\001 \001(\r\"t\n\014RankPKResult\022\016\n\006charid\030\001 \001(\r"
"\022\014\n\004name\030\002 \001(\t\022\016\n\006heroid\030\003 \001(\r\022\014\n\004cure\030\004"
" \001(\r\022\014\n\004hurt\030\005 \001(\r\022\014\n\004dead\030\006 \001(\r\022\014\n\004kill"
"\030\007 \001(\r\"\317\001\n\025MSG_RetFightFinish_SC\022\020\n\010dura"
"tion\030\001 \001(\r\022\021\n\twinteamid\030\002 \001(\r\022*\n\007rewards"
"\030\003 \003(\0132\031.rankpk_msg.RewardsNumber\0220\n\016MeR"
"ankPKResult\030\004 \003(\0132\030.rankpk_msg.RankPKRes"
"ult\0223\n\021EnemyRankPKResult\030\005 \003(\0132\030.rankpk_"
"msg.RankPKResult\"\034\n\032MSG_ReqGetSeasonRewa"
"rds_CS\"=\n\032MSG_RetGetSeasonRewards_SC\022\037\n\027"
"season_rewards_received\030\001 \001(\010\"\271\001\n\031MSG_Re"
"tRewardsEveryday_SC\022\025\n\rbattle_number\030\001 \001"
"(\r\022\026\n\016success_number\030\002 \001(\r\022(\n\tpkrewards\030"
"\003 \003(\0132\025.rankpk_msg.PkRewards\022\025\n\rremainde"
"r_day\030\004 \001(\r\022\022\n\nrank_level\030\005 \001(\r\022\030\n\020rewar"
"ds_received\030\006 \001(\010\"\033\n\031MSG_ReqRewardsEvery"
"day_CS\"g\n\tPkRewards\022\016\n\006heroid\030\001 \001(\r\022\014\n\004t"
"ime\030\002 \001(\r\022*\n\007rewards\030\003 \003(\0132\031.rankpk_msg."
"RewardsNumber\022\020\n\010pkresult\030\004 \001(\010\"1\n\rRewar"
"dsNumber\022\020\n\010objectid\030\001 \001(\r\022\016\n\006number\030\002 \001"
"(\r\"1\n\nRankPKHero\022\016\n\006heroid\030\001 \001(\r\022\023\n\013last"
"usetime\030\002 \001(\r\"D\n\033MSG_RetRankPKHeroHistor"
"y_SC\022%\n\005heros\030\001 \003(\0132\026.rankpk_msg.RankPKH"
"ero\"3\n\026MSG_RetUserRankStar_SC\022\013\n\003uid\030\001 \001"
"(\004\022\014\n\004rank\030\002 \001(\r\"c\n\031MSG_RetTeamLeftMemSi"
"ze_SC\022\017\n\007team1id\030\001 \001(\r\022\021\n\tteam1left\030\002 \001("
"\r\022\017\n\007team2id\030\003 \001(\r\022\021\n\tteam2left\030\004 \001(\r\"\032\n"
"\030MSG_ReqRankPKCurStage_CS\"\201\001\n\030MSG_RetRan"
"kPKCurStage_SC\022 \n\010curstage\030\001 \002(\0162\016.msg.S"
"tageType\022\020\n\010duration\030\002 \001(\r\0221\n\005score\030\003 \001("
"\0132\".rankpk_msg.MSG_RetTeamCurScore_SC\"7\n"
"\025MSG_RetPreparedNum_SC\022\016\n\006curnum\030\001 \001(\r\022\016"
"\n\006allnum\030\002 \001(\r\"8\n\027MSG_RetMemPkPrepared_S"
"C\022\r\n\005memid\030\001 \001(\004\022\016\n\006heroid\030\002 \001(\r\".\n\031MSG_"
"RetPKGeneralConfig_SC\022\021\n\tteampknum\030\001 \001(\r"
"\"b\n\026MSG_RetTeamCurScore_SC\022\017\n\007team1id\030\001 "
"\001(\r\022\022\n\nteam1score\030\002 \001(\r\022\017\n\007team2id\030\003 \001(\r"
"\022\022\n\nteam2score\030\004 \001(\r\"\212\001\n\016RankPKListItem\022"
"\020\n\010position\030\001 \001(\r\022\016\n\006charid\030\002 \001(\004\022\014\n\004nam"
"e\030\003 \001(\t\022\021\n\tranklevel\030\004 \001(\r\022\021\n\tguildname\030"
"\005 \001(\t\022\021\n\twinbattle\030\006 \001(\r\022\017\n\007winrate\030\007 \001("
"\r\"@\n\024MSG_ReqRankPKList_CS\022(\n\004type\030\001 \001(\0162"
"\032.rankpk_msg.RankPKListType\"~\n\024MSG_RetRa"
"nkPKList_SC\022(\n\004type\030\001 \001(\0162\032.rankpk_msg.R"
"ankPKListType\022\022\n\nmyposition\030\002 \001(\r\022(\n\004dat"
"a\030\003 \003(\0132\032.rankpk_msg.RankPKListItem*C\n\016R"
"ankPKListType\022\026\n\022RankPKListType_All\020\000\022\031\n"
"\025RankPKListType_Friend\020\001"
;
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_rankpk_5fmsg_2eproto_deps[1] = {
&::descriptor_table_msg_5fenum_2eproto,
};
static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_rankpk_5fmsg_2eproto_sccs[39] = {
&scc_info_MSG_GoToBattle_SC_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_RankPkReqPrepare_CS_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_RankPkReqPrepare_SC_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_ReqChoosePrepared_CS_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_ReqGetSeasonRewards_CS_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_ReqRankPKCurStage_CS_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_ReqRankPKList_CS_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_ReqRewardsEveryday_CS_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_Req_CancelMatch_CS_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_Req_GotoBattle_CS_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_Req_MatchMemberInfo_CS_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_Req_StartMatch_CS_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_RetChoosePrepared_SC_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_RetFightCountDown_SC_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_RetFightFinish_SC_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_RetGetSeasonRewards_SC_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_RetMemPkPrepared_SC_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_RetPKGeneralConfig_SC_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_RetPreparedNum_SC_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_RetRankPKCurStage_SC_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_RetRankPKHeroHistory_SC_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_RetRankPKList_SC_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_RetRewardsEveryday_SC_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_RetSpeedupFight_SC_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_RetStartFight_SC_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_RetStartPrepare_SC_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_RetTeamCurScore_SC_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_RetTeamLeftMemSize_SC_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_RetUserRankStar_SC_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_Ret_CancelMatch_SC_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_Ret_MatchMemberInfo_SC_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_Ret_MatchResult_SC_rankpk_5fmsg_2eproto.base,
&scc_info_MSG_Ret_StartMatch_SC_rankpk_5fmsg_2eproto.base,
&scc_info_PkRewards_rankpk_5fmsg_2eproto.base,
&scc_info_RankPKHero_rankpk_5fmsg_2eproto.base,
&scc_info_RankPKListItem_rankpk_5fmsg_2eproto.base,
&scc_info_RankPKResult_rankpk_5fmsg_2eproto.base,
&scc_info_RewardsNumber_rankpk_5fmsg_2eproto.base,
&scc_info_UserRankPkInfo_rankpk_5fmsg_2eproto.base,
};
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_rankpk_5fmsg_2eproto_once;
static bool descriptor_table_rankpk_5fmsg_2eproto_initialized = false;
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_rankpk_5fmsg_2eproto = {
&descriptor_table_rankpk_5fmsg_2eproto_initialized, descriptor_table_protodef_rankpk_5fmsg_2eproto, "rankpk_msg.proto", 3184,
&descriptor_table_rankpk_5fmsg_2eproto_once, descriptor_table_rankpk_5fmsg_2eproto_sccs, descriptor_table_rankpk_5fmsg_2eproto_deps, 39, 1,
schemas, file_default_instances, TableStruct_rankpk_5fmsg_2eproto::offsets,
file_level_metadata_rankpk_5fmsg_2eproto, 39, file_level_enum_descriptors_rankpk_5fmsg_2eproto, file_level_service_descriptors_rankpk_5fmsg_2eproto,
};
// Force running AddDescriptors() at dynamic initialization time.
static bool dynamic_init_dummy_rankpk_5fmsg_2eproto = (static_cast<void>(::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_rankpk_5fmsg_2eproto)), true);
namespace rankpk_msg {
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* RankPKListType_descriptor() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_rankpk_5fmsg_2eproto);
return file_level_enum_descriptors_rankpk_5fmsg_2eproto[0];
}
bool RankPKListType_IsValid(int value) {
switch (value) {
case 0:
case 1:
return true;
default:
return false;
}
}
// ===================================================================
void UserRankPkInfo::InitAsDefaultInstance() {
}
class UserRankPkInfo::_Internal {
public:
using HasBits = decltype(std::declval<UserRankPkInfo>()._has_bits_);
static void set_has_charid(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
static void set_has_name(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_heroid(HasBits* has_bits) {
(*has_bits)[0] |= 4u;
}
static void set_has_fight(HasBits* has_bits) {
(*has_bits)[0] |= 8u;
}
static void set_has_rank_level(HasBits* has_bits) {
(*has_bits)[0] |= 16u;
}
static void set_has_rank_star(HasBits* has_bits) {
(*has_bits)[0] |= 32u;
}
static void set_has_rank(HasBits* has_bits) {
(*has_bits)[0] |= 64u;
}
static void set_has_hide_score(HasBits* has_bits) {
(*has_bits)[0] |= 128u;
}
static void set_has_all_battles(HasBits* has_bits) {
(*has_bits)[0] |= 256u;
}
static void set_has_success_battles(HasBits* has_bits) {
(*has_bits)[0] |= 512u;
}
static void set_has_battle_score(HasBits* has_bits) {
(*has_bits)[0] |= 1024u;
}
static void set_has_seanson_battles(HasBits* has_bits) {
(*has_bits)[0] |= 2048u;
}
static void set_has_best_rank_level(HasBits* has_bits) {
(*has_bits)[0] |= 4096u;
}
static void set_has_best_rank(HasBits* has_bits) {
(*has_bits)[0] |= 8192u;
}
};
UserRankPkInfo::UserRankPkInfo()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.UserRankPkInfo)
}
UserRankPkInfo::UserRankPkInfo(const UserRankPkInfo& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from._internal_has_name()) {
name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
}
::memcpy(&charid_, &from.charid_,
static_cast<size_t>(reinterpret_cast<char*>(&best_rank_) -
reinterpret_cast<char*>(&charid_)) + sizeof(best_rank_));
// @@protoc_insertion_point(copy_constructor:rankpk_msg.UserRankPkInfo)
}
void UserRankPkInfo::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_UserRankPkInfo_rankpk_5fmsg_2eproto.base);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
::memset(&charid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&best_rank_) -
reinterpret_cast<char*>(&charid_)) + sizeof(best_rank_));
}
UserRankPkInfo::~UserRankPkInfo() {
// @@protoc_insertion_point(destructor:rankpk_msg.UserRankPkInfo)
SharedDtor();
}
void UserRankPkInfo::SharedDtor() {
name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
void UserRankPkInfo::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const UserRankPkInfo& UserRankPkInfo::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_UserRankPkInfo_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void UserRankPkInfo::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.UserRankPkInfo)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000001u) {
name_.ClearNonDefaultToEmptyNoArena();
}
if (cached_has_bits & 0x000000feu) {
::memset(&charid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&hide_score_) -
reinterpret_cast<char*>(&charid_)) + sizeof(hide_score_));
}
if (cached_has_bits & 0x00003f00u) {
::memset(&all_battles_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&best_rank_) -
reinterpret_cast<char*>(&all_battles_)) + sizeof(best_rank_));
}
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* UserRankPkInfo::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional uint32 charid = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_charid(&has_bits);
charid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional string name = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
auto str = _internal_mutable_name();
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
#ifndef NDEBUG
::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "rankpk_msg.UserRankPkInfo.name");
#endif // !NDEBUG
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 heroid = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
_Internal::set_has_heroid(&has_bits);
heroid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 fight = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
_Internal::set_has_fight(&has_bits);
fight_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 rank_level = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
_Internal::set_has_rank_level(&has_bits);
rank_level_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 rank_star = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
_Internal::set_has_rank_star(&has_bits);
rank_star_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 rank = 7;
case 7:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) {
_Internal::set_has_rank(&has_bits);
rank_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 hide_score = 8;
case 8:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) {
_Internal::set_has_hide_score(&has_bits);
hide_score_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 all_battles = 9;
case 9:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72)) {
_Internal::set_has_all_battles(&has_bits);
all_battles_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 success_battles = 10;
case 10:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) {
_Internal::set_has_success_battles(&has_bits);
success_battles_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 battle_score = 11;
case 11:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 88)) {
_Internal::set_has_battle_score(&has_bits);
battle_score_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 seanson_battles = 12;
case 12:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 96)) {
_Internal::set_has_seanson_battles(&has_bits);
seanson_battles_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 best_rank_level = 13;
case 13:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 104)) {
_Internal::set_has_best_rank_level(&has_bits);
best_rank_level_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 best_rank = 14;
case 14:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 112)) {
_Internal::set_has_best_rank(&has_bits);
best_rank_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* UserRankPkInfo::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.UserRankPkInfo)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional uint32 charid = 1;
if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_charid(), target);
}
// optional string name = 2;
if (cached_has_bits & 0x00000001u) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
"rankpk_msg.UserRankPkInfo.name");
target = stream->WriteStringMaybeAliased(
2, this->_internal_name(), target);
}
// optional uint32 heroid = 3;
if (cached_has_bits & 0x00000004u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(3, this->_internal_heroid(), target);
}
// optional uint32 fight = 4;
if (cached_has_bits & 0x00000008u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(4, this->_internal_fight(), target);
}
// optional uint32 rank_level = 5;
if (cached_has_bits & 0x00000010u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(5, this->_internal_rank_level(), target);
}
// optional uint32 rank_star = 6;
if (cached_has_bits & 0x00000020u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(6, this->_internal_rank_star(), target);
}
// optional uint32 rank = 7;
if (cached_has_bits & 0x00000040u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(7, this->_internal_rank(), target);
}
// optional uint32 hide_score = 8;
if (cached_has_bits & 0x00000080u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(8, this->_internal_hide_score(), target);
}
// optional uint32 all_battles = 9;
if (cached_has_bits & 0x00000100u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(9, this->_internal_all_battles(), target);
}
// optional uint32 success_battles = 10;
if (cached_has_bits & 0x00000200u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(10, this->_internal_success_battles(), target);
}
// optional uint32 battle_score = 11;
if (cached_has_bits & 0x00000400u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(11, this->_internal_battle_score(), target);
}
// optional uint32 seanson_battles = 12;
if (cached_has_bits & 0x00000800u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(12, this->_internal_seanson_battles(), target);
}
// optional uint32 best_rank_level = 13;
if (cached_has_bits & 0x00001000u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(13, this->_internal_best_rank_level(), target);
}
// optional uint32 best_rank = 14;
if (cached_has_bits & 0x00002000u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(14, this->_internal_best_rank(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.UserRankPkInfo)
return target;
}
size_t UserRankPkInfo::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.UserRankPkInfo)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x000000ffu) {
// optional string name = 2;
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_name());
}
// optional uint32 charid = 1;
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_charid());
}
// optional uint32 heroid = 3;
if (cached_has_bits & 0x00000004u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_heroid());
}
// optional uint32 fight = 4;
if (cached_has_bits & 0x00000008u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_fight());
}
// optional uint32 rank_level = 5;
if (cached_has_bits & 0x00000010u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_rank_level());
}
// optional uint32 rank_star = 6;
if (cached_has_bits & 0x00000020u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_rank_star());
}
// optional uint32 rank = 7;
if (cached_has_bits & 0x00000040u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_rank());
}
// optional uint32 hide_score = 8;
if (cached_has_bits & 0x00000080u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_hide_score());
}
}
if (cached_has_bits & 0x00003f00u) {
// optional uint32 all_battles = 9;
if (cached_has_bits & 0x00000100u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_all_battles());
}
// optional uint32 success_battles = 10;
if (cached_has_bits & 0x00000200u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_success_battles());
}
// optional uint32 battle_score = 11;
if (cached_has_bits & 0x00000400u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_battle_score());
}
// optional uint32 seanson_battles = 12;
if (cached_has_bits & 0x00000800u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_seanson_battles());
}
// optional uint32 best_rank_level = 13;
if (cached_has_bits & 0x00001000u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_best_rank_level());
}
// optional uint32 best_rank = 14;
if (cached_has_bits & 0x00002000u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_best_rank());
}
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void UserRankPkInfo::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.UserRankPkInfo)
GOOGLE_DCHECK_NE(&from, this);
const UserRankPkInfo* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<UserRankPkInfo>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.UserRankPkInfo)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.UserRankPkInfo)
MergeFrom(*source);
}
}
void UserRankPkInfo::MergeFrom(const UserRankPkInfo& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.UserRankPkInfo)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 0x000000ffu) {
if (cached_has_bits & 0x00000001u) {
_has_bits_[0] |= 0x00000001u;
name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
}
if (cached_has_bits & 0x00000002u) {
charid_ = from.charid_;
}
if (cached_has_bits & 0x00000004u) {
heroid_ = from.heroid_;
}
if (cached_has_bits & 0x00000008u) {
fight_ = from.fight_;
}
if (cached_has_bits & 0x00000010u) {
rank_level_ = from.rank_level_;
}
if (cached_has_bits & 0x00000020u) {
rank_star_ = from.rank_star_;
}
if (cached_has_bits & 0x00000040u) {
rank_ = from.rank_;
}
if (cached_has_bits & 0x00000080u) {
hide_score_ = from.hide_score_;
}
_has_bits_[0] |= cached_has_bits;
}
if (cached_has_bits & 0x00003f00u) {
if (cached_has_bits & 0x00000100u) {
all_battles_ = from.all_battles_;
}
if (cached_has_bits & 0x00000200u) {
success_battles_ = from.success_battles_;
}
if (cached_has_bits & 0x00000400u) {
battle_score_ = from.battle_score_;
}
if (cached_has_bits & 0x00000800u) {
seanson_battles_ = from.seanson_battles_;
}
if (cached_has_bits & 0x00001000u) {
best_rank_level_ = from.best_rank_level_;
}
if (cached_has_bits & 0x00002000u) {
best_rank_ = from.best_rank_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void UserRankPkInfo::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.UserRankPkInfo)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void UserRankPkInfo::CopyFrom(const UserRankPkInfo& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.UserRankPkInfo)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool UserRankPkInfo::IsInitialized() const {
return true;
}
void UserRankPkInfo::InternalSwap(UserRankPkInfo* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
swap(charid_, other->charid_);
swap(heroid_, other->heroid_);
swap(fight_, other->fight_);
swap(rank_level_, other->rank_level_);
swap(rank_star_, other->rank_star_);
swap(rank_, other->rank_);
swap(hide_score_, other->hide_score_);
swap(all_battles_, other->all_battles_);
swap(success_battles_, other->success_battles_);
swap(battle_score_, other->battle_score_);
swap(seanson_battles_, other->seanson_battles_);
swap(best_rank_level_, other->best_rank_level_);
swap(best_rank_, other->best_rank_);
}
::PROTOBUF_NAMESPACE_ID::Metadata UserRankPkInfo::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_Req_MatchMemberInfo_CS::InitAsDefaultInstance() {
}
class MSG_Req_MatchMemberInfo_CS::_Internal {
public:
using HasBits = decltype(std::declval<MSG_Req_MatchMemberInfo_CS>()._has_bits_);
};
MSG_Req_MatchMemberInfo_CS::MSG_Req_MatchMemberInfo_CS()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_Req_MatchMemberInfo_CS)
}
MSG_Req_MatchMemberInfo_CS::MSG_Req_MatchMemberInfo_CS(const MSG_Req_MatchMemberInfo_CS& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_Req_MatchMemberInfo_CS)
}
void MSG_Req_MatchMemberInfo_CS::SharedCtor() {
}
MSG_Req_MatchMemberInfo_CS::~MSG_Req_MatchMemberInfo_CS() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_Req_MatchMemberInfo_CS)
SharedDtor();
}
void MSG_Req_MatchMemberInfo_CS::SharedDtor() {
}
void MSG_Req_MatchMemberInfo_CS::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_Req_MatchMemberInfo_CS& MSG_Req_MatchMemberInfo_CS::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_Req_MatchMemberInfo_CS_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_Req_MatchMemberInfo_CS::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_Req_MatchMemberInfo_CS)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_Req_MatchMemberInfo_CS::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_Req_MatchMemberInfo_CS::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_Req_MatchMemberInfo_CS)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_Req_MatchMemberInfo_CS)
return target;
}
size_t MSG_Req_MatchMemberInfo_CS::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_Req_MatchMemberInfo_CS)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_Req_MatchMemberInfo_CS::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_Req_MatchMemberInfo_CS)
GOOGLE_DCHECK_NE(&from, this);
const MSG_Req_MatchMemberInfo_CS* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_Req_MatchMemberInfo_CS>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_Req_MatchMemberInfo_CS)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_Req_MatchMemberInfo_CS)
MergeFrom(*source);
}
}
void MSG_Req_MatchMemberInfo_CS::MergeFrom(const MSG_Req_MatchMemberInfo_CS& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_Req_MatchMemberInfo_CS)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
}
void MSG_Req_MatchMemberInfo_CS::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_Req_MatchMemberInfo_CS)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_Req_MatchMemberInfo_CS::CopyFrom(const MSG_Req_MatchMemberInfo_CS& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_Req_MatchMemberInfo_CS)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_Req_MatchMemberInfo_CS::IsInitialized() const {
return true;
}
void MSG_Req_MatchMemberInfo_CS::InternalSwap(MSG_Req_MatchMemberInfo_CS* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_Req_MatchMemberInfo_CS::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_Ret_MatchMemberInfo_SC::InitAsDefaultInstance() {
}
class MSG_Ret_MatchMemberInfo_SC::_Internal {
public:
using HasBits = decltype(std::declval<MSG_Ret_MatchMemberInfo_SC>()._has_bits_);
static void set_has_leaderid(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_season_id(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
static void set_has_start_time(HasBits* has_bits) {
(*has_bits)[0] |= 4u;
}
static void set_has_end_time(HasBits* has_bits) {
(*has_bits)[0] |= 8u;
}
static void set_has_leftdays(HasBits* has_bits) {
(*has_bits)[0] |= 16u;
}
};
MSG_Ret_MatchMemberInfo_SC::MSG_Ret_MatchMemberInfo_SC()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_Ret_MatchMemberInfo_SC)
}
MSG_Ret_MatchMemberInfo_SC::MSG_Ret_MatchMemberInfo_SC(const MSG_Ret_MatchMemberInfo_SC& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_),
members_(from.members_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
::memcpy(&leaderid_, &from.leaderid_,
static_cast<size_t>(reinterpret_cast<char*>(&leftdays_) -
reinterpret_cast<char*>(&leaderid_)) + sizeof(leftdays_));
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_Ret_MatchMemberInfo_SC)
}
void MSG_Ret_MatchMemberInfo_SC::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_MSG_Ret_MatchMemberInfo_SC_rankpk_5fmsg_2eproto.base);
::memset(&leaderid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&leftdays_) -
reinterpret_cast<char*>(&leaderid_)) + sizeof(leftdays_));
}
MSG_Ret_MatchMemberInfo_SC::~MSG_Ret_MatchMemberInfo_SC() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_Ret_MatchMemberInfo_SC)
SharedDtor();
}
void MSG_Ret_MatchMemberInfo_SC::SharedDtor() {
}
void MSG_Ret_MatchMemberInfo_SC::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_Ret_MatchMemberInfo_SC& MSG_Ret_MatchMemberInfo_SC::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_Ret_MatchMemberInfo_SC_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_Ret_MatchMemberInfo_SC::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_Ret_MatchMemberInfo_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
members_.Clear();
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x0000001fu) {
::memset(&leaderid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&leftdays_) -
reinterpret_cast<char*>(&leaderid_)) + sizeof(leftdays_));
}
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_Ret_MatchMemberInfo_SC::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// repeated .rankpk_msg.UserRankPkInfo members = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_members(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
} else goto handle_unusual;
continue;
// optional uint64 leaderid = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
_Internal::set_has_leaderid(&has_bits);
leaderid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 season_id = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
_Internal::set_has_season_id(&has_bits);
season_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 start_time = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
_Internal::set_has_start_time(&has_bits);
start_time_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 end_time = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
_Internal::set_has_end_time(&has_bits);
end_time_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 leftdays = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
_Internal::set_has_leftdays(&has_bits);
leftdays_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_Ret_MatchMemberInfo_SC::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_Ret_MatchMemberInfo_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// repeated .rankpk_msg.UserRankPkInfo members = 1;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_members_size()); i < n; i++) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessage(1, this->_internal_members(i), target, stream);
}
cached_has_bits = _has_bits_[0];
// optional uint64 leaderid = 2;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(2, this->_internal_leaderid(), target);
}
// optional uint32 season_id = 3;
if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(3, this->_internal_season_id(), target);
}
// optional uint32 start_time = 4;
if (cached_has_bits & 0x00000004u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(4, this->_internal_start_time(), target);
}
// optional uint32 end_time = 5;
if (cached_has_bits & 0x00000008u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(5, this->_internal_end_time(), target);
}
// optional uint32 leftdays = 6;
if (cached_has_bits & 0x00000010u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(6, this->_internal_leftdays(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_Ret_MatchMemberInfo_SC)
return target;
}
size_t MSG_Ret_MatchMemberInfo_SC::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_Ret_MatchMemberInfo_SC)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .rankpk_msg.UserRankPkInfo members = 1;
total_size += 1UL * this->_internal_members_size();
for (const auto& msg : this->members_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x0000001fu) {
// optional uint64 leaderid = 2;
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size(
this->_internal_leaderid());
}
// optional uint32 season_id = 3;
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_season_id());
}
// optional uint32 start_time = 4;
if (cached_has_bits & 0x00000004u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_start_time());
}
// optional uint32 end_time = 5;
if (cached_has_bits & 0x00000008u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_end_time());
}
// optional uint32 leftdays = 6;
if (cached_has_bits & 0x00000010u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_leftdays());
}
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_Ret_MatchMemberInfo_SC::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_Ret_MatchMemberInfo_SC)
GOOGLE_DCHECK_NE(&from, this);
const MSG_Ret_MatchMemberInfo_SC* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_Ret_MatchMemberInfo_SC>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_Ret_MatchMemberInfo_SC)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_Ret_MatchMemberInfo_SC)
MergeFrom(*source);
}
}
void MSG_Ret_MatchMemberInfo_SC::MergeFrom(const MSG_Ret_MatchMemberInfo_SC& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_Ret_MatchMemberInfo_SC)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
members_.MergeFrom(from.members_);
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 0x0000001fu) {
if (cached_has_bits & 0x00000001u) {
leaderid_ = from.leaderid_;
}
if (cached_has_bits & 0x00000002u) {
season_id_ = from.season_id_;
}
if (cached_has_bits & 0x00000004u) {
start_time_ = from.start_time_;
}
if (cached_has_bits & 0x00000008u) {
end_time_ = from.end_time_;
}
if (cached_has_bits & 0x00000010u) {
leftdays_ = from.leftdays_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void MSG_Ret_MatchMemberInfo_SC::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_Ret_MatchMemberInfo_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_Ret_MatchMemberInfo_SC::CopyFrom(const MSG_Ret_MatchMemberInfo_SC& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_Ret_MatchMemberInfo_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_Ret_MatchMemberInfo_SC::IsInitialized() const {
return true;
}
void MSG_Ret_MatchMemberInfo_SC::InternalSwap(MSG_Ret_MatchMemberInfo_SC* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
members_.InternalSwap(&other->members_);
swap(leaderid_, other->leaderid_);
swap(season_id_, other->season_id_);
swap(start_time_, other->start_time_);
swap(end_time_, other->end_time_);
swap(leftdays_, other->leftdays_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_Ret_MatchMemberInfo_SC::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_Req_StartMatch_CS::InitAsDefaultInstance() {
}
class MSG_Req_StartMatch_CS::_Internal {
public:
using HasBits = decltype(std::declval<MSG_Req_StartMatch_CS>()._has_bits_);
};
MSG_Req_StartMatch_CS::MSG_Req_StartMatch_CS()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_Req_StartMatch_CS)
}
MSG_Req_StartMatch_CS::MSG_Req_StartMatch_CS(const MSG_Req_StartMatch_CS& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_Req_StartMatch_CS)
}
void MSG_Req_StartMatch_CS::SharedCtor() {
}
MSG_Req_StartMatch_CS::~MSG_Req_StartMatch_CS() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_Req_StartMatch_CS)
SharedDtor();
}
void MSG_Req_StartMatch_CS::SharedDtor() {
}
void MSG_Req_StartMatch_CS::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_Req_StartMatch_CS& MSG_Req_StartMatch_CS::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_Req_StartMatch_CS_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_Req_StartMatch_CS::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_Req_StartMatch_CS)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_Req_StartMatch_CS::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_Req_StartMatch_CS::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_Req_StartMatch_CS)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_Req_StartMatch_CS)
return target;
}
size_t MSG_Req_StartMatch_CS::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_Req_StartMatch_CS)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_Req_StartMatch_CS::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_Req_StartMatch_CS)
GOOGLE_DCHECK_NE(&from, this);
const MSG_Req_StartMatch_CS* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_Req_StartMatch_CS>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_Req_StartMatch_CS)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_Req_StartMatch_CS)
MergeFrom(*source);
}
}
void MSG_Req_StartMatch_CS::MergeFrom(const MSG_Req_StartMatch_CS& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_Req_StartMatch_CS)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
}
void MSG_Req_StartMatch_CS::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_Req_StartMatch_CS)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_Req_StartMatch_CS::CopyFrom(const MSG_Req_StartMatch_CS& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_Req_StartMatch_CS)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_Req_StartMatch_CS::IsInitialized() const {
return true;
}
void MSG_Req_StartMatch_CS::InternalSwap(MSG_Req_StartMatch_CS* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_Req_StartMatch_CS::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_Ret_StartMatch_SC::InitAsDefaultInstance() {
}
class MSG_Ret_StartMatch_SC::_Internal {
public:
using HasBits = decltype(std::declval<MSG_Ret_StartMatch_SC>()._has_bits_);
static void set_has_retcode(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
};
MSG_Ret_StartMatch_SC::MSG_Ret_StartMatch_SC()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_Ret_StartMatch_SC)
}
MSG_Ret_StartMatch_SC::MSG_Ret_StartMatch_SC(const MSG_Ret_StartMatch_SC& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
retcode_ = from.retcode_;
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_Ret_StartMatch_SC)
}
void MSG_Ret_StartMatch_SC::SharedCtor() {
retcode_ = 0u;
}
MSG_Ret_StartMatch_SC::~MSG_Ret_StartMatch_SC() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_Ret_StartMatch_SC)
SharedDtor();
}
void MSG_Ret_StartMatch_SC::SharedDtor() {
}
void MSG_Ret_StartMatch_SC::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_Ret_StartMatch_SC& MSG_Ret_StartMatch_SC::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_Ret_StartMatch_SC_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_Ret_StartMatch_SC::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_Ret_StartMatch_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
retcode_ = 0u;
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_Ret_StartMatch_SC::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional uint32 retcode = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_retcode(&has_bits);
retcode_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_Ret_StartMatch_SC::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_Ret_StartMatch_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional uint32 retcode = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_retcode(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_Ret_StartMatch_SC)
return target;
}
size_t MSG_Ret_StartMatch_SC::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_Ret_StartMatch_SC)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// optional uint32 retcode = 1;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_retcode());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_Ret_StartMatch_SC::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_Ret_StartMatch_SC)
GOOGLE_DCHECK_NE(&from, this);
const MSG_Ret_StartMatch_SC* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_Ret_StartMatch_SC>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_Ret_StartMatch_SC)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_Ret_StartMatch_SC)
MergeFrom(*source);
}
}
void MSG_Ret_StartMatch_SC::MergeFrom(const MSG_Ret_StartMatch_SC& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_Ret_StartMatch_SC)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from._internal_has_retcode()) {
_internal_set_retcode(from._internal_retcode());
}
}
void MSG_Ret_StartMatch_SC::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_Ret_StartMatch_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_Ret_StartMatch_SC::CopyFrom(const MSG_Ret_StartMatch_SC& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_Ret_StartMatch_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_Ret_StartMatch_SC::IsInitialized() const {
return true;
}
void MSG_Ret_StartMatch_SC::InternalSwap(MSG_Ret_StartMatch_SC* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
swap(retcode_, other->retcode_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_Ret_StartMatch_SC::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_Req_CancelMatch_CS::InitAsDefaultInstance() {
}
class MSG_Req_CancelMatch_CS::_Internal {
public:
using HasBits = decltype(std::declval<MSG_Req_CancelMatch_CS>()._has_bits_);
};
MSG_Req_CancelMatch_CS::MSG_Req_CancelMatch_CS()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_Req_CancelMatch_CS)
}
MSG_Req_CancelMatch_CS::MSG_Req_CancelMatch_CS(const MSG_Req_CancelMatch_CS& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_Req_CancelMatch_CS)
}
void MSG_Req_CancelMatch_CS::SharedCtor() {
}
MSG_Req_CancelMatch_CS::~MSG_Req_CancelMatch_CS() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_Req_CancelMatch_CS)
SharedDtor();
}
void MSG_Req_CancelMatch_CS::SharedDtor() {
}
void MSG_Req_CancelMatch_CS::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_Req_CancelMatch_CS& MSG_Req_CancelMatch_CS::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_Req_CancelMatch_CS_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_Req_CancelMatch_CS::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_Req_CancelMatch_CS)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_Req_CancelMatch_CS::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_Req_CancelMatch_CS::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_Req_CancelMatch_CS)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_Req_CancelMatch_CS)
return target;
}
size_t MSG_Req_CancelMatch_CS::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_Req_CancelMatch_CS)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_Req_CancelMatch_CS::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_Req_CancelMatch_CS)
GOOGLE_DCHECK_NE(&from, this);
const MSG_Req_CancelMatch_CS* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_Req_CancelMatch_CS>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_Req_CancelMatch_CS)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_Req_CancelMatch_CS)
MergeFrom(*source);
}
}
void MSG_Req_CancelMatch_CS::MergeFrom(const MSG_Req_CancelMatch_CS& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_Req_CancelMatch_CS)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
}
void MSG_Req_CancelMatch_CS::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_Req_CancelMatch_CS)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_Req_CancelMatch_CS::CopyFrom(const MSG_Req_CancelMatch_CS& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_Req_CancelMatch_CS)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_Req_CancelMatch_CS::IsInitialized() const {
return true;
}
void MSG_Req_CancelMatch_CS::InternalSwap(MSG_Req_CancelMatch_CS* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_Req_CancelMatch_CS::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_Ret_CancelMatch_SC::InitAsDefaultInstance() {
}
class MSG_Ret_CancelMatch_SC::_Internal {
public:
using HasBits = decltype(std::declval<MSG_Ret_CancelMatch_SC>()._has_bits_);
static void set_has_retcode(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
};
MSG_Ret_CancelMatch_SC::MSG_Ret_CancelMatch_SC()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_Ret_CancelMatch_SC)
}
MSG_Ret_CancelMatch_SC::MSG_Ret_CancelMatch_SC(const MSG_Ret_CancelMatch_SC& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
retcode_ = from.retcode_;
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_Ret_CancelMatch_SC)
}
void MSG_Ret_CancelMatch_SC::SharedCtor() {
retcode_ = 0u;
}
MSG_Ret_CancelMatch_SC::~MSG_Ret_CancelMatch_SC() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_Ret_CancelMatch_SC)
SharedDtor();
}
void MSG_Ret_CancelMatch_SC::SharedDtor() {
}
void MSG_Ret_CancelMatch_SC::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_Ret_CancelMatch_SC& MSG_Ret_CancelMatch_SC::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_Ret_CancelMatch_SC_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_Ret_CancelMatch_SC::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_Ret_CancelMatch_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
retcode_ = 0u;
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_Ret_CancelMatch_SC::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional uint32 retcode = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_retcode(&has_bits);
retcode_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_Ret_CancelMatch_SC::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_Ret_CancelMatch_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional uint32 retcode = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_retcode(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_Ret_CancelMatch_SC)
return target;
}
size_t MSG_Ret_CancelMatch_SC::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_Ret_CancelMatch_SC)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// optional uint32 retcode = 1;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_retcode());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_Ret_CancelMatch_SC::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_Ret_CancelMatch_SC)
GOOGLE_DCHECK_NE(&from, this);
const MSG_Ret_CancelMatch_SC* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_Ret_CancelMatch_SC>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_Ret_CancelMatch_SC)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_Ret_CancelMatch_SC)
MergeFrom(*source);
}
}
void MSG_Ret_CancelMatch_SC::MergeFrom(const MSG_Ret_CancelMatch_SC& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_Ret_CancelMatch_SC)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from._internal_has_retcode()) {
_internal_set_retcode(from._internal_retcode());
}
}
void MSG_Ret_CancelMatch_SC::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_Ret_CancelMatch_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_Ret_CancelMatch_SC::CopyFrom(const MSG_Ret_CancelMatch_SC& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_Ret_CancelMatch_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_Ret_CancelMatch_SC::IsInitialized() const {
return true;
}
void MSG_Ret_CancelMatch_SC::InternalSwap(MSG_Ret_CancelMatch_SC* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
swap(retcode_, other->retcode_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_Ret_CancelMatch_SC::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_RankPkReqPrepare_CS::InitAsDefaultInstance() {
}
class MSG_RankPkReqPrepare_CS::_Internal {
public:
using HasBits = decltype(std::declval<MSG_RankPkReqPrepare_CS>()._has_bits_);
};
MSG_RankPkReqPrepare_CS::MSG_RankPkReqPrepare_CS()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_RankPkReqPrepare_CS)
}
MSG_RankPkReqPrepare_CS::MSG_RankPkReqPrepare_CS(const MSG_RankPkReqPrepare_CS& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_RankPkReqPrepare_CS)
}
void MSG_RankPkReqPrepare_CS::SharedCtor() {
}
MSG_RankPkReqPrepare_CS::~MSG_RankPkReqPrepare_CS() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_RankPkReqPrepare_CS)
SharedDtor();
}
void MSG_RankPkReqPrepare_CS::SharedDtor() {
}
void MSG_RankPkReqPrepare_CS::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_RankPkReqPrepare_CS& MSG_RankPkReqPrepare_CS::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_RankPkReqPrepare_CS_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_RankPkReqPrepare_CS::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_RankPkReqPrepare_CS)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_RankPkReqPrepare_CS::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_RankPkReqPrepare_CS::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_RankPkReqPrepare_CS)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_RankPkReqPrepare_CS)
return target;
}
size_t MSG_RankPkReqPrepare_CS::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_RankPkReqPrepare_CS)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_RankPkReqPrepare_CS::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_RankPkReqPrepare_CS)
GOOGLE_DCHECK_NE(&from, this);
const MSG_RankPkReqPrepare_CS* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_RankPkReqPrepare_CS>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_RankPkReqPrepare_CS)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_RankPkReqPrepare_CS)
MergeFrom(*source);
}
}
void MSG_RankPkReqPrepare_CS::MergeFrom(const MSG_RankPkReqPrepare_CS& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_RankPkReqPrepare_CS)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
}
void MSG_RankPkReqPrepare_CS::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_RankPkReqPrepare_CS)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_RankPkReqPrepare_CS::CopyFrom(const MSG_RankPkReqPrepare_CS& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_RankPkReqPrepare_CS)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_RankPkReqPrepare_CS::IsInitialized() const {
return true;
}
void MSG_RankPkReqPrepare_CS::InternalSwap(MSG_RankPkReqPrepare_CS* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_RankPkReqPrepare_CS::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_RankPkReqPrepare_SC::InitAsDefaultInstance() {
}
class MSG_RankPkReqPrepare_SC::_Internal {
public:
using HasBits = decltype(std::declval<MSG_RankPkReqPrepare_SC>()._has_bits_);
static void set_has_readystate(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_readynum(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
static void set_has_totalnum(HasBits* has_bits) {
(*has_bits)[0] |= 4u;
}
static void set_has_lefttime(HasBits* has_bits) {
(*has_bits)[0] |= 8u;
}
static void set_has_enemyreadynum(HasBits* has_bits) {
(*has_bits)[0] |= 16u;
}
static void set_has_enemytotalnum(HasBits* has_bits) {
(*has_bits)[0] |= 32u;
}
};
MSG_RankPkReqPrepare_SC::MSG_RankPkReqPrepare_SC()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_RankPkReqPrepare_SC)
}
MSG_RankPkReqPrepare_SC::MSG_RankPkReqPrepare_SC(const MSG_RankPkReqPrepare_SC& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
::memcpy(&readystate_, &from.readystate_,
static_cast<size_t>(reinterpret_cast<char*>(&enemytotalnum_) -
reinterpret_cast<char*>(&readystate_)) + sizeof(enemytotalnum_));
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_RankPkReqPrepare_SC)
}
void MSG_RankPkReqPrepare_SC::SharedCtor() {
::memset(&readystate_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&enemytotalnum_) -
reinterpret_cast<char*>(&readystate_)) + sizeof(enemytotalnum_));
}
MSG_RankPkReqPrepare_SC::~MSG_RankPkReqPrepare_SC() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_RankPkReqPrepare_SC)
SharedDtor();
}
void MSG_RankPkReqPrepare_SC::SharedDtor() {
}
void MSG_RankPkReqPrepare_SC::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_RankPkReqPrepare_SC& MSG_RankPkReqPrepare_SC::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_RankPkReqPrepare_SC_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_RankPkReqPrepare_SC::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_RankPkReqPrepare_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x0000003fu) {
::memset(&readystate_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&enemytotalnum_) -
reinterpret_cast<char*>(&readystate_)) + sizeof(enemytotalnum_));
}
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_RankPkReqPrepare_SC::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// required uint32 readystate = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_readystate(&has_bits);
readystate_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// required uint32 readynum = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
_Internal::set_has_readynum(&has_bits);
readynum_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// required uint32 totalnum = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
_Internal::set_has_totalnum(&has_bits);
totalnum_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 lefttime = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
_Internal::set_has_lefttime(&has_bits);
lefttime_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 enemyreadynum = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
_Internal::set_has_enemyreadynum(&has_bits);
enemyreadynum_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 enemytotalnum = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
_Internal::set_has_enemytotalnum(&has_bits);
enemytotalnum_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_RankPkReqPrepare_SC::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_RankPkReqPrepare_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// required uint32 readystate = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_readystate(), target);
}
// required uint32 readynum = 2;
if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_readynum(), target);
}
// required uint32 totalnum = 3;
if (cached_has_bits & 0x00000004u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(3, this->_internal_totalnum(), target);
}
// optional uint32 lefttime = 4;
if (cached_has_bits & 0x00000008u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(4, this->_internal_lefttime(), target);
}
// optional uint32 enemyreadynum = 5;
if (cached_has_bits & 0x00000010u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(5, this->_internal_enemyreadynum(), target);
}
// optional uint32 enemytotalnum = 6;
if (cached_has_bits & 0x00000020u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(6, this->_internal_enemytotalnum(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_RankPkReqPrepare_SC)
return target;
}
size_t MSG_RankPkReqPrepare_SC::RequiredFieldsByteSizeFallback() const {
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:rankpk_msg.MSG_RankPkReqPrepare_SC)
size_t total_size = 0;
if (_internal_has_readystate()) {
// required uint32 readystate = 1;
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_readystate());
}
if (_internal_has_readynum()) {
// required uint32 readynum = 2;
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_readynum());
}
if (_internal_has_totalnum()) {
// required uint32 totalnum = 3;
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_totalnum());
}
return total_size;
}
size_t MSG_RankPkReqPrepare_SC::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_RankPkReqPrepare_SC)
size_t total_size = 0;
if (((_has_bits_[0] & 0x00000007) ^ 0x00000007) == 0) { // All required fields are present.
// required uint32 readystate = 1;
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_readystate());
// required uint32 readynum = 2;
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_readynum());
// required uint32 totalnum = 3;
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_totalnum());
} else {
total_size += RequiredFieldsByteSizeFallback();
}
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000038u) {
// optional uint32 lefttime = 4;
if (cached_has_bits & 0x00000008u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_lefttime());
}
// optional uint32 enemyreadynum = 5;
if (cached_has_bits & 0x00000010u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_enemyreadynum());
}
// optional uint32 enemytotalnum = 6;
if (cached_has_bits & 0x00000020u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_enemytotalnum());
}
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_RankPkReqPrepare_SC::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_RankPkReqPrepare_SC)
GOOGLE_DCHECK_NE(&from, this);
const MSG_RankPkReqPrepare_SC* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_RankPkReqPrepare_SC>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_RankPkReqPrepare_SC)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_RankPkReqPrepare_SC)
MergeFrom(*source);
}
}
void MSG_RankPkReqPrepare_SC::MergeFrom(const MSG_RankPkReqPrepare_SC& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_RankPkReqPrepare_SC)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 0x0000003fu) {
if (cached_has_bits & 0x00000001u) {
readystate_ = from.readystate_;
}
if (cached_has_bits & 0x00000002u) {
readynum_ = from.readynum_;
}
if (cached_has_bits & 0x00000004u) {
totalnum_ = from.totalnum_;
}
if (cached_has_bits & 0x00000008u) {
lefttime_ = from.lefttime_;
}
if (cached_has_bits & 0x00000010u) {
enemyreadynum_ = from.enemyreadynum_;
}
if (cached_has_bits & 0x00000020u) {
enemytotalnum_ = from.enemytotalnum_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void MSG_RankPkReqPrepare_SC::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_RankPkReqPrepare_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_RankPkReqPrepare_SC::CopyFrom(const MSG_RankPkReqPrepare_SC& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_RankPkReqPrepare_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_RankPkReqPrepare_SC::IsInitialized() const {
if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false;
return true;
}
void MSG_RankPkReqPrepare_SC::InternalSwap(MSG_RankPkReqPrepare_SC* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
swap(readystate_, other->readystate_);
swap(readynum_, other->readynum_);
swap(totalnum_, other->totalnum_);
swap(lefttime_, other->lefttime_);
swap(enemyreadynum_, other->enemyreadynum_);
swap(enemytotalnum_, other->enemytotalnum_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_RankPkReqPrepare_SC::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_GoToBattle_SC::InitAsDefaultInstance() {
}
class MSG_GoToBattle_SC::_Internal {
public:
using HasBits = decltype(std::declval<MSG_GoToBattle_SC>()._has_bits_);
static void set_has_retcode(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
};
MSG_GoToBattle_SC::MSG_GoToBattle_SC()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_GoToBattle_SC)
}
MSG_GoToBattle_SC::MSG_GoToBattle_SC(const MSG_GoToBattle_SC& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
retcode_ = from.retcode_;
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_GoToBattle_SC)
}
void MSG_GoToBattle_SC::SharedCtor() {
retcode_ = 0u;
}
MSG_GoToBattle_SC::~MSG_GoToBattle_SC() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_GoToBattle_SC)
SharedDtor();
}
void MSG_GoToBattle_SC::SharedDtor() {
}
void MSG_GoToBattle_SC::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_GoToBattle_SC& MSG_GoToBattle_SC::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_GoToBattle_SC_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_GoToBattle_SC::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_GoToBattle_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
retcode_ = 0u;
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_GoToBattle_SC::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional uint32 retcode = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_retcode(&has_bits);
retcode_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_GoToBattle_SC::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_GoToBattle_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional uint32 retcode = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_retcode(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_GoToBattle_SC)
return target;
}
size_t MSG_GoToBattle_SC::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_GoToBattle_SC)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// optional uint32 retcode = 1;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_retcode());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_GoToBattle_SC::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_GoToBattle_SC)
GOOGLE_DCHECK_NE(&from, this);
const MSG_GoToBattle_SC* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_GoToBattle_SC>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_GoToBattle_SC)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_GoToBattle_SC)
MergeFrom(*source);
}
}
void MSG_GoToBattle_SC::MergeFrom(const MSG_GoToBattle_SC& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_GoToBattle_SC)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from._internal_has_retcode()) {
_internal_set_retcode(from._internal_retcode());
}
}
void MSG_GoToBattle_SC::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_GoToBattle_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_GoToBattle_SC::CopyFrom(const MSG_GoToBattle_SC& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_GoToBattle_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_GoToBattle_SC::IsInitialized() const {
return true;
}
void MSG_GoToBattle_SC::InternalSwap(MSG_GoToBattle_SC* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
swap(retcode_, other->retcode_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_GoToBattle_SC::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_Ret_MatchResult_SC::InitAsDefaultInstance() {
}
class MSG_Ret_MatchResult_SC::_Internal {
public:
using HasBits = decltype(std::declval<MSG_Ret_MatchResult_SC>()._has_bits_);
static void set_has_retcode(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_lefttime(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
static void set_has_totalnum(HasBits* has_bits) {
(*has_bits)[0] |= 4u;
}
};
MSG_Ret_MatchResult_SC::MSG_Ret_MatchResult_SC()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_Ret_MatchResult_SC)
}
MSG_Ret_MatchResult_SC::MSG_Ret_MatchResult_SC(const MSG_Ret_MatchResult_SC& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
::memcpy(&retcode_, &from.retcode_,
static_cast<size_t>(reinterpret_cast<char*>(&totalnum_) -
reinterpret_cast<char*>(&retcode_)) + sizeof(totalnum_));
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_Ret_MatchResult_SC)
}
void MSG_Ret_MatchResult_SC::SharedCtor() {
::memset(&retcode_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&totalnum_) -
reinterpret_cast<char*>(&retcode_)) + sizeof(totalnum_));
}
MSG_Ret_MatchResult_SC::~MSG_Ret_MatchResult_SC() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_Ret_MatchResult_SC)
SharedDtor();
}
void MSG_Ret_MatchResult_SC::SharedDtor() {
}
void MSG_Ret_MatchResult_SC::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_Ret_MatchResult_SC& MSG_Ret_MatchResult_SC::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_Ret_MatchResult_SC_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_Ret_MatchResult_SC::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_Ret_MatchResult_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000007u) {
::memset(&retcode_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&totalnum_) -
reinterpret_cast<char*>(&retcode_)) + sizeof(totalnum_));
}
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_Ret_MatchResult_SC::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional uint32 retcode = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_retcode(&has_bits);
retcode_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 lefttime = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
_Internal::set_has_lefttime(&has_bits);
lefttime_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 totalnum = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
_Internal::set_has_totalnum(&has_bits);
totalnum_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_Ret_MatchResult_SC::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_Ret_MatchResult_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional uint32 retcode = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_retcode(), target);
}
// optional uint32 lefttime = 2;
if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_lefttime(), target);
}
// optional uint32 totalnum = 3;
if (cached_has_bits & 0x00000004u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(3, this->_internal_totalnum(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_Ret_MatchResult_SC)
return target;
}
size_t MSG_Ret_MatchResult_SC::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_Ret_MatchResult_SC)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000007u) {
// optional uint32 retcode = 1;
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_retcode());
}
// optional uint32 lefttime = 2;
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_lefttime());
}
// optional uint32 totalnum = 3;
if (cached_has_bits & 0x00000004u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_totalnum());
}
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_Ret_MatchResult_SC::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_Ret_MatchResult_SC)
GOOGLE_DCHECK_NE(&from, this);
const MSG_Ret_MatchResult_SC* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_Ret_MatchResult_SC>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_Ret_MatchResult_SC)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_Ret_MatchResult_SC)
MergeFrom(*source);
}
}
void MSG_Ret_MatchResult_SC::MergeFrom(const MSG_Ret_MatchResult_SC& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_Ret_MatchResult_SC)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 0x00000007u) {
if (cached_has_bits & 0x00000001u) {
retcode_ = from.retcode_;
}
if (cached_has_bits & 0x00000002u) {
lefttime_ = from.lefttime_;
}
if (cached_has_bits & 0x00000004u) {
totalnum_ = from.totalnum_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void MSG_Ret_MatchResult_SC::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_Ret_MatchResult_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_Ret_MatchResult_SC::CopyFrom(const MSG_Ret_MatchResult_SC& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_Ret_MatchResult_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_Ret_MatchResult_SC::IsInitialized() const {
return true;
}
void MSG_Ret_MatchResult_SC::InternalSwap(MSG_Ret_MatchResult_SC* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
swap(retcode_, other->retcode_);
swap(lefttime_, other->lefttime_);
swap(totalnum_, other->totalnum_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_Ret_MatchResult_SC::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_Req_GotoBattle_CS::InitAsDefaultInstance() {
}
class MSG_Req_GotoBattle_CS::_Internal {
public:
using HasBits = decltype(std::declval<MSG_Req_GotoBattle_CS>()._has_bits_);
};
MSG_Req_GotoBattle_CS::MSG_Req_GotoBattle_CS()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_Req_GotoBattle_CS)
}
MSG_Req_GotoBattle_CS::MSG_Req_GotoBattle_CS(const MSG_Req_GotoBattle_CS& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_Req_GotoBattle_CS)
}
void MSG_Req_GotoBattle_CS::SharedCtor() {
}
MSG_Req_GotoBattle_CS::~MSG_Req_GotoBattle_CS() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_Req_GotoBattle_CS)
SharedDtor();
}
void MSG_Req_GotoBattle_CS::SharedDtor() {
}
void MSG_Req_GotoBattle_CS::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_Req_GotoBattle_CS& MSG_Req_GotoBattle_CS::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_Req_GotoBattle_CS_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_Req_GotoBattle_CS::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_Req_GotoBattle_CS)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_Req_GotoBattle_CS::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_Req_GotoBattle_CS::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_Req_GotoBattle_CS)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_Req_GotoBattle_CS)
return target;
}
size_t MSG_Req_GotoBattle_CS::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_Req_GotoBattle_CS)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_Req_GotoBattle_CS::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_Req_GotoBattle_CS)
GOOGLE_DCHECK_NE(&from, this);
const MSG_Req_GotoBattle_CS* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_Req_GotoBattle_CS>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_Req_GotoBattle_CS)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_Req_GotoBattle_CS)
MergeFrom(*source);
}
}
void MSG_Req_GotoBattle_CS::MergeFrom(const MSG_Req_GotoBattle_CS& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_Req_GotoBattle_CS)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
}
void MSG_Req_GotoBattle_CS::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_Req_GotoBattle_CS)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_Req_GotoBattle_CS::CopyFrom(const MSG_Req_GotoBattle_CS& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_Req_GotoBattle_CS)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_Req_GotoBattle_CS::IsInitialized() const {
return true;
}
void MSG_Req_GotoBattle_CS::InternalSwap(MSG_Req_GotoBattle_CS* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_Req_GotoBattle_CS::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_RetStartPrepare_SC::InitAsDefaultInstance() {
}
class MSG_RetStartPrepare_SC::_Internal {
public:
using HasBits = decltype(std::declval<MSG_RetStartPrepare_SC>()._has_bits_);
static void set_has_duration(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
};
MSG_RetStartPrepare_SC::MSG_RetStartPrepare_SC()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_RetStartPrepare_SC)
}
MSG_RetStartPrepare_SC::MSG_RetStartPrepare_SC(const MSG_RetStartPrepare_SC& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
duration_ = from.duration_;
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_RetStartPrepare_SC)
}
void MSG_RetStartPrepare_SC::SharedCtor() {
duration_ = 0u;
}
MSG_RetStartPrepare_SC::~MSG_RetStartPrepare_SC() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_RetStartPrepare_SC)
SharedDtor();
}
void MSG_RetStartPrepare_SC::SharedDtor() {
}
void MSG_RetStartPrepare_SC::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_RetStartPrepare_SC& MSG_RetStartPrepare_SC::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_RetStartPrepare_SC_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_RetStartPrepare_SC::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_RetStartPrepare_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
duration_ = 0u;
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_RetStartPrepare_SC::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional uint32 duration = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_duration(&has_bits);
duration_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_RetStartPrepare_SC::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_RetStartPrepare_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional uint32 duration = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_duration(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_RetStartPrepare_SC)
return target;
}
size_t MSG_RetStartPrepare_SC::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_RetStartPrepare_SC)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// optional uint32 duration = 1;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_duration());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_RetStartPrepare_SC::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_RetStartPrepare_SC)
GOOGLE_DCHECK_NE(&from, this);
const MSG_RetStartPrepare_SC* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_RetStartPrepare_SC>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_RetStartPrepare_SC)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_RetStartPrepare_SC)
MergeFrom(*source);
}
}
void MSG_RetStartPrepare_SC::MergeFrom(const MSG_RetStartPrepare_SC& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_RetStartPrepare_SC)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from._internal_has_duration()) {
_internal_set_duration(from._internal_duration());
}
}
void MSG_RetStartPrepare_SC::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_RetStartPrepare_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_RetStartPrepare_SC::CopyFrom(const MSG_RetStartPrepare_SC& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_RetStartPrepare_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_RetStartPrepare_SC::IsInitialized() const {
return true;
}
void MSG_RetStartPrepare_SC::InternalSwap(MSG_RetStartPrepare_SC* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
swap(duration_, other->duration_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_RetStartPrepare_SC::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_ReqChoosePrepared_CS::InitAsDefaultInstance() {
}
class MSG_ReqChoosePrepared_CS::_Internal {
public:
using HasBits = decltype(std::declval<MSG_ReqChoosePrepared_CS>()._has_bits_);
};
MSG_ReqChoosePrepared_CS::MSG_ReqChoosePrepared_CS()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_ReqChoosePrepared_CS)
}
MSG_ReqChoosePrepared_CS::MSG_ReqChoosePrepared_CS(const MSG_ReqChoosePrepared_CS& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_ReqChoosePrepared_CS)
}
void MSG_ReqChoosePrepared_CS::SharedCtor() {
}
MSG_ReqChoosePrepared_CS::~MSG_ReqChoosePrepared_CS() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_ReqChoosePrepared_CS)
SharedDtor();
}
void MSG_ReqChoosePrepared_CS::SharedDtor() {
}
void MSG_ReqChoosePrepared_CS::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_ReqChoosePrepared_CS& MSG_ReqChoosePrepared_CS::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_ReqChoosePrepared_CS_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_ReqChoosePrepared_CS::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_ReqChoosePrepared_CS)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_ReqChoosePrepared_CS::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_ReqChoosePrepared_CS::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_ReqChoosePrepared_CS)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_ReqChoosePrepared_CS)
return target;
}
size_t MSG_ReqChoosePrepared_CS::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_ReqChoosePrepared_CS)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_ReqChoosePrepared_CS::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_ReqChoosePrepared_CS)
GOOGLE_DCHECK_NE(&from, this);
const MSG_ReqChoosePrepared_CS* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_ReqChoosePrepared_CS>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_ReqChoosePrepared_CS)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_ReqChoosePrepared_CS)
MergeFrom(*source);
}
}
void MSG_ReqChoosePrepared_CS::MergeFrom(const MSG_ReqChoosePrepared_CS& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_ReqChoosePrepared_CS)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
}
void MSG_ReqChoosePrepared_CS::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_ReqChoosePrepared_CS)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_ReqChoosePrepared_CS::CopyFrom(const MSG_ReqChoosePrepared_CS& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_ReqChoosePrepared_CS)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_ReqChoosePrepared_CS::IsInitialized() const {
return true;
}
void MSG_ReqChoosePrepared_CS::InternalSwap(MSG_ReqChoosePrepared_CS* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_ReqChoosePrepared_CS::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_RetChoosePrepared_SC::InitAsDefaultInstance() {
}
class MSG_RetChoosePrepared_SC::_Internal {
public:
using HasBits = decltype(std::declval<MSG_RetChoosePrepared_SC>()._has_bits_);
static void set_has_errcode(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
};
MSG_RetChoosePrepared_SC::MSG_RetChoosePrepared_SC()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_RetChoosePrepared_SC)
}
MSG_RetChoosePrepared_SC::MSG_RetChoosePrepared_SC(const MSG_RetChoosePrepared_SC& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
errcode_ = from.errcode_;
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_RetChoosePrepared_SC)
}
void MSG_RetChoosePrepared_SC::SharedCtor() {
errcode_ = 0u;
}
MSG_RetChoosePrepared_SC::~MSG_RetChoosePrepared_SC() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_RetChoosePrepared_SC)
SharedDtor();
}
void MSG_RetChoosePrepared_SC::SharedDtor() {
}
void MSG_RetChoosePrepared_SC::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_RetChoosePrepared_SC& MSG_RetChoosePrepared_SC::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_RetChoosePrepared_SC_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_RetChoosePrepared_SC::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_RetChoosePrepared_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
errcode_ = 0u;
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_RetChoosePrepared_SC::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional uint32 errcode = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_errcode(&has_bits);
errcode_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_RetChoosePrepared_SC::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_RetChoosePrepared_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional uint32 errcode = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_errcode(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_RetChoosePrepared_SC)
return target;
}
size_t MSG_RetChoosePrepared_SC::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_RetChoosePrepared_SC)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// optional uint32 errcode = 1;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_errcode());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_RetChoosePrepared_SC::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_RetChoosePrepared_SC)
GOOGLE_DCHECK_NE(&from, this);
const MSG_RetChoosePrepared_SC* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_RetChoosePrepared_SC>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_RetChoosePrepared_SC)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_RetChoosePrepared_SC)
MergeFrom(*source);
}
}
void MSG_RetChoosePrepared_SC::MergeFrom(const MSG_RetChoosePrepared_SC& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_RetChoosePrepared_SC)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from._internal_has_errcode()) {
_internal_set_errcode(from._internal_errcode());
}
}
void MSG_RetChoosePrepared_SC::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_RetChoosePrepared_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_RetChoosePrepared_SC::CopyFrom(const MSG_RetChoosePrepared_SC& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_RetChoosePrepared_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_RetChoosePrepared_SC::IsInitialized() const {
return true;
}
void MSG_RetChoosePrepared_SC::InternalSwap(MSG_RetChoosePrepared_SC* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
swap(errcode_, other->errcode_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_RetChoosePrepared_SC::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_RetFightCountDown_SC::InitAsDefaultInstance() {
}
class MSG_RetFightCountDown_SC::_Internal {
public:
using HasBits = decltype(std::declval<MSG_RetFightCountDown_SC>()._has_bits_);
static void set_has_duration(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
};
MSG_RetFightCountDown_SC::MSG_RetFightCountDown_SC()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_RetFightCountDown_SC)
}
MSG_RetFightCountDown_SC::MSG_RetFightCountDown_SC(const MSG_RetFightCountDown_SC& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
duration_ = from.duration_;
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_RetFightCountDown_SC)
}
void MSG_RetFightCountDown_SC::SharedCtor() {
duration_ = 0u;
}
MSG_RetFightCountDown_SC::~MSG_RetFightCountDown_SC() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_RetFightCountDown_SC)
SharedDtor();
}
void MSG_RetFightCountDown_SC::SharedDtor() {
}
void MSG_RetFightCountDown_SC::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_RetFightCountDown_SC& MSG_RetFightCountDown_SC::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_RetFightCountDown_SC_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_RetFightCountDown_SC::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_RetFightCountDown_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
duration_ = 0u;
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_RetFightCountDown_SC::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional uint32 duration = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_duration(&has_bits);
duration_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_RetFightCountDown_SC::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_RetFightCountDown_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional uint32 duration = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_duration(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_RetFightCountDown_SC)
return target;
}
size_t MSG_RetFightCountDown_SC::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_RetFightCountDown_SC)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// optional uint32 duration = 1;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_duration());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_RetFightCountDown_SC::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_RetFightCountDown_SC)
GOOGLE_DCHECK_NE(&from, this);
const MSG_RetFightCountDown_SC* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_RetFightCountDown_SC>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_RetFightCountDown_SC)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_RetFightCountDown_SC)
MergeFrom(*source);
}
}
void MSG_RetFightCountDown_SC::MergeFrom(const MSG_RetFightCountDown_SC& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_RetFightCountDown_SC)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from._internal_has_duration()) {
_internal_set_duration(from._internal_duration());
}
}
void MSG_RetFightCountDown_SC::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_RetFightCountDown_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_RetFightCountDown_SC::CopyFrom(const MSG_RetFightCountDown_SC& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_RetFightCountDown_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_RetFightCountDown_SC::IsInitialized() const {
return true;
}
void MSG_RetFightCountDown_SC::InternalSwap(MSG_RetFightCountDown_SC* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
swap(duration_, other->duration_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_RetFightCountDown_SC::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_RetStartFight_SC::InitAsDefaultInstance() {
::rankpk_msg::_MSG_RetStartFight_SC_default_instance_._instance.get_mutable()->score_ = const_cast< ::rankpk_msg::MSG_RetTeamCurScore_SC*>(
::rankpk_msg::MSG_RetTeamCurScore_SC::internal_default_instance());
}
class MSG_RetStartFight_SC::_Internal {
public:
using HasBits = decltype(std::declval<MSG_RetStartFight_SC>()._has_bits_);
static void set_has_duration(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
static const ::rankpk_msg::MSG_RetTeamCurScore_SC& score(const MSG_RetStartFight_SC* msg);
static void set_has_score(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
};
const ::rankpk_msg::MSG_RetTeamCurScore_SC&
MSG_RetStartFight_SC::_Internal::score(const MSG_RetStartFight_SC* msg) {
return *msg->score_;
}
MSG_RetStartFight_SC::MSG_RetStartFight_SC()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_RetStartFight_SC)
}
MSG_RetStartFight_SC::MSG_RetStartFight_SC(const MSG_RetStartFight_SC& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from._internal_has_score()) {
score_ = new ::rankpk_msg::MSG_RetTeamCurScore_SC(*from.score_);
} else {
score_ = nullptr;
}
duration_ = from.duration_;
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_RetStartFight_SC)
}
void MSG_RetStartFight_SC::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_MSG_RetStartFight_SC_rankpk_5fmsg_2eproto.base);
::memset(&score_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&duration_) -
reinterpret_cast<char*>(&score_)) + sizeof(duration_));
}
MSG_RetStartFight_SC::~MSG_RetStartFight_SC() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_RetStartFight_SC)
SharedDtor();
}
void MSG_RetStartFight_SC::SharedDtor() {
if (this != internal_default_instance()) delete score_;
}
void MSG_RetStartFight_SC::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_RetStartFight_SC& MSG_RetStartFight_SC::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_RetStartFight_SC_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_RetStartFight_SC::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_RetStartFight_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000001u) {
GOOGLE_DCHECK(score_ != nullptr);
score_->Clear();
}
duration_ = 0u;
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_RetStartFight_SC::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional uint32 duration = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_duration(&has_bits);
duration_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional .rankpk_msg.MSG_RetTeamCurScore_SC score = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
ptr = ctx->ParseMessage(_internal_mutable_score(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_RetStartFight_SC::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_RetStartFight_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional uint32 duration = 1;
if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_duration(), target);
}
// optional .rankpk_msg.MSG_RetTeamCurScore_SC score = 2;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessage(
2, _Internal::score(this), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_RetStartFight_SC)
return target;
}
size_t MSG_RetStartFight_SC::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_RetStartFight_SC)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000003u) {
// optional .rankpk_msg.MSG_RetTeamCurScore_SC score = 2;
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*score_);
}
// optional uint32 duration = 1;
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_duration());
}
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_RetStartFight_SC::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_RetStartFight_SC)
GOOGLE_DCHECK_NE(&from, this);
const MSG_RetStartFight_SC* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_RetStartFight_SC>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_RetStartFight_SC)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_RetStartFight_SC)
MergeFrom(*source);
}
}
void MSG_RetStartFight_SC::MergeFrom(const MSG_RetStartFight_SC& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_RetStartFight_SC)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 0x00000003u) {
if (cached_has_bits & 0x00000001u) {
_internal_mutable_score()->::rankpk_msg::MSG_RetTeamCurScore_SC::MergeFrom(from._internal_score());
}
if (cached_has_bits & 0x00000002u) {
duration_ = from.duration_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void MSG_RetStartFight_SC::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_RetStartFight_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_RetStartFight_SC::CopyFrom(const MSG_RetStartFight_SC& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_RetStartFight_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_RetStartFight_SC::IsInitialized() const {
return true;
}
void MSG_RetStartFight_SC::InternalSwap(MSG_RetStartFight_SC* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
swap(score_, other->score_);
swap(duration_, other->duration_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_RetStartFight_SC::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_RetSpeedupFight_SC::InitAsDefaultInstance() {
}
class MSG_RetSpeedupFight_SC::_Internal {
public:
using HasBits = decltype(std::declval<MSG_RetSpeedupFight_SC>()._has_bits_);
static void set_has_duration(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
};
MSG_RetSpeedupFight_SC::MSG_RetSpeedupFight_SC()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_RetSpeedupFight_SC)
}
MSG_RetSpeedupFight_SC::MSG_RetSpeedupFight_SC(const MSG_RetSpeedupFight_SC& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
duration_ = from.duration_;
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_RetSpeedupFight_SC)
}
void MSG_RetSpeedupFight_SC::SharedCtor() {
duration_ = 0u;
}
MSG_RetSpeedupFight_SC::~MSG_RetSpeedupFight_SC() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_RetSpeedupFight_SC)
SharedDtor();
}
void MSG_RetSpeedupFight_SC::SharedDtor() {
}
void MSG_RetSpeedupFight_SC::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_RetSpeedupFight_SC& MSG_RetSpeedupFight_SC::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_RetSpeedupFight_SC_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_RetSpeedupFight_SC::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_RetSpeedupFight_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
duration_ = 0u;
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_RetSpeedupFight_SC::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional uint32 duration = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_duration(&has_bits);
duration_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_RetSpeedupFight_SC::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_RetSpeedupFight_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional uint32 duration = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_duration(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_RetSpeedupFight_SC)
return target;
}
size_t MSG_RetSpeedupFight_SC::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_RetSpeedupFight_SC)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// optional uint32 duration = 1;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_duration());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_RetSpeedupFight_SC::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_RetSpeedupFight_SC)
GOOGLE_DCHECK_NE(&from, this);
const MSG_RetSpeedupFight_SC* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_RetSpeedupFight_SC>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_RetSpeedupFight_SC)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_RetSpeedupFight_SC)
MergeFrom(*source);
}
}
void MSG_RetSpeedupFight_SC::MergeFrom(const MSG_RetSpeedupFight_SC& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_RetSpeedupFight_SC)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from._internal_has_duration()) {
_internal_set_duration(from._internal_duration());
}
}
void MSG_RetSpeedupFight_SC::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_RetSpeedupFight_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_RetSpeedupFight_SC::CopyFrom(const MSG_RetSpeedupFight_SC& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_RetSpeedupFight_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_RetSpeedupFight_SC::IsInitialized() const {
return true;
}
void MSG_RetSpeedupFight_SC::InternalSwap(MSG_RetSpeedupFight_SC* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
swap(duration_, other->duration_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_RetSpeedupFight_SC::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void RankPKResult::InitAsDefaultInstance() {
}
class RankPKResult::_Internal {
public:
using HasBits = decltype(std::declval<RankPKResult>()._has_bits_);
static void set_has_charid(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
static void set_has_name(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_heroid(HasBits* has_bits) {
(*has_bits)[0] |= 4u;
}
static void set_has_cure(HasBits* has_bits) {
(*has_bits)[0] |= 8u;
}
static void set_has_hurt(HasBits* has_bits) {
(*has_bits)[0] |= 16u;
}
static void set_has_dead(HasBits* has_bits) {
(*has_bits)[0] |= 32u;
}
static void set_has_kill(HasBits* has_bits) {
(*has_bits)[0] |= 64u;
}
};
RankPKResult::RankPKResult()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.RankPKResult)
}
RankPKResult::RankPKResult(const RankPKResult& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from._internal_has_name()) {
name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
}
::memcpy(&charid_, &from.charid_,
static_cast<size_t>(reinterpret_cast<char*>(&kill_) -
reinterpret_cast<char*>(&charid_)) + sizeof(kill_));
// @@protoc_insertion_point(copy_constructor:rankpk_msg.RankPKResult)
}
void RankPKResult::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_RankPKResult_rankpk_5fmsg_2eproto.base);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
::memset(&charid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&kill_) -
reinterpret_cast<char*>(&charid_)) + sizeof(kill_));
}
RankPKResult::~RankPKResult() {
// @@protoc_insertion_point(destructor:rankpk_msg.RankPKResult)
SharedDtor();
}
void RankPKResult::SharedDtor() {
name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
void RankPKResult::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const RankPKResult& RankPKResult::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_RankPKResult_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void RankPKResult::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.RankPKResult)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000001u) {
name_.ClearNonDefaultToEmptyNoArena();
}
if (cached_has_bits & 0x0000007eu) {
::memset(&charid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&kill_) -
reinterpret_cast<char*>(&charid_)) + sizeof(kill_));
}
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* RankPKResult::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional uint32 charid = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_charid(&has_bits);
charid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional string name = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
auto str = _internal_mutable_name();
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
#ifndef NDEBUG
::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "rankpk_msg.RankPKResult.name");
#endif // !NDEBUG
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 heroid = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
_Internal::set_has_heroid(&has_bits);
heroid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 cure = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
_Internal::set_has_cure(&has_bits);
cure_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 hurt = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
_Internal::set_has_hurt(&has_bits);
hurt_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 dead = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
_Internal::set_has_dead(&has_bits);
dead_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 kill = 7;
case 7:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) {
_Internal::set_has_kill(&has_bits);
kill_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* RankPKResult::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.RankPKResult)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional uint32 charid = 1;
if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_charid(), target);
}
// optional string name = 2;
if (cached_has_bits & 0x00000001u) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
"rankpk_msg.RankPKResult.name");
target = stream->WriteStringMaybeAliased(
2, this->_internal_name(), target);
}
// optional uint32 heroid = 3;
if (cached_has_bits & 0x00000004u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(3, this->_internal_heroid(), target);
}
// optional uint32 cure = 4;
if (cached_has_bits & 0x00000008u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(4, this->_internal_cure(), target);
}
// optional uint32 hurt = 5;
if (cached_has_bits & 0x00000010u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(5, this->_internal_hurt(), target);
}
// optional uint32 dead = 6;
if (cached_has_bits & 0x00000020u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(6, this->_internal_dead(), target);
}
// optional uint32 kill = 7;
if (cached_has_bits & 0x00000040u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(7, this->_internal_kill(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.RankPKResult)
return target;
}
size_t RankPKResult::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.RankPKResult)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x0000007fu) {
// optional string name = 2;
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_name());
}
// optional uint32 charid = 1;
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_charid());
}
// optional uint32 heroid = 3;
if (cached_has_bits & 0x00000004u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_heroid());
}
// optional uint32 cure = 4;
if (cached_has_bits & 0x00000008u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_cure());
}
// optional uint32 hurt = 5;
if (cached_has_bits & 0x00000010u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_hurt());
}
// optional uint32 dead = 6;
if (cached_has_bits & 0x00000020u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_dead());
}
// optional uint32 kill = 7;
if (cached_has_bits & 0x00000040u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_kill());
}
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void RankPKResult::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.RankPKResult)
GOOGLE_DCHECK_NE(&from, this);
const RankPKResult* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<RankPKResult>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.RankPKResult)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.RankPKResult)
MergeFrom(*source);
}
}
void RankPKResult::MergeFrom(const RankPKResult& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.RankPKResult)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 0x0000007fu) {
if (cached_has_bits & 0x00000001u) {
_has_bits_[0] |= 0x00000001u;
name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
}
if (cached_has_bits & 0x00000002u) {
charid_ = from.charid_;
}
if (cached_has_bits & 0x00000004u) {
heroid_ = from.heroid_;
}
if (cached_has_bits & 0x00000008u) {
cure_ = from.cure_;
}
if (cached_has_bits & 0x00000010u) {
hurt_ = from.hurt_;
}
if (cached_has_bits & 0x00000020u) {
dead_ = from.dead_;
}
if (cached_has_bits & 0x00000040u) {
kill_ = from.kill_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void RankPKResult::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.RankPKResult)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void RankPKResult::CopyFrom(const RankPKResult& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.RankPKResult)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool RankPKResult::IsInitialized() const {
return true;
}
void RankPKResult::InternalSwap(RankPKResult* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
swap(charid_, other->charid_);
swap(heroid_, other->heroid_);
swap(cure_, other->cure_);
swap(hurt_, other->hurt_);
swap(dead_, other->dead_);
swap(kill_, other->kill_);
}
::PROTOBUF_NAMESPACE_ID::Metadata RankPKResult::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_RetFightFinish_SC::InitAsDefaultInstance() {
}
class MSG_RetFightFinish_SC::_Internal {
public:
using HasBits = decltype(std::declval<MSG_RetFightFinish_SC>()._has_bits_);
static void set_has_duration(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_winteamid(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
};
MSG_RetFightFinish_SC::MSG_RetFightFinish_SC()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_RetFightFinish_SC)
}
MSG_RetFightFinish_SC::MSG_RetFightFinish_SC(const MSG_RetFightFinish_SC& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_),
rewards_(from.rewards_),
merankpkresult_(from.merankpkresult_),
enemyrankpkresult_(from.enemyrankpkresult_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
::memcpy(&duration_, &from.duration_,
static_cast<size_t>(reinterpret_cast<char*>(&winteamid_) -
reinterpret_cast<char*>(&duration_)) + sizeof(winteamid_));
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_RetFightFinish_SC)
}
void MSG_RetFightFinish_SC::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_MSG_RetFightFinish_SC_rankpk_5fmsg_2eproto.base);
::memset(&duration_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&winteamid_) -
reinterpret_cast<char*>(&duration_)) + sizeof(winteamid_));
}
MSG_RetFightFinish_SC::~MSG_RetFightFinish_SC() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_RetFightFinish_SC)
SharedDtor();
}
void MSG_RetFightFinish_SC::SharedDtor() {
}
void MSG_RetFightFinish_SC::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_RetFightFinish_SC& MSG_RetFightFinish_SC::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_RetFightFinish_SC_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_RetFightFinish_SC::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_RetFightFinish_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
rewards_.Clear();
merankpkresult_.Clear();
enemyrankpkresult_.Clear();
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000003u) {
::memset(&duration_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&winteamid_) -
reinterpret_cast<char*>(&duration_)) + sizeof(winteamid_));
}
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_RetFightFinish_SC::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional uint32 duration = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_duration(&has_bits);
duration_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 winteamid = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
_Internal::set_has_winteamid(&has_bits);
winteamid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// repeated .rankpk_msg.RewardsNumber rewards = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_rewards(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
} else goto handle_unusual;
continue;
// repeated .rankpk_msg.RankPKResult MeRankPKResult = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_merankpkresult(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
} else goto handle_unusual;
continue;
// repeated .rankpk_msg.RankPKResult EnemyRankPKResult = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_enemyrankpkresult(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr));
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_RetFightFinish_SC::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_RetFightFinish_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional uint32 duration = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_duration(), target);
}
// optional uint32 winteamid = 2;
if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_winteamid(), target);
}
// repeated .rankpk_msg.RewardsNumber rewards = 3;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_rewards_size()); i < n; i++) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessage(3, this->_internal_rewards(i), target, stream);
}
// repeated .rankpk_msg.RankPKResult MeRankPKResult = 4;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_merankpkresult_size()); i < n; i++) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessage(4, this->_internal_merankpkresult(i), target, stream);
}
// repeated .rankpk_msg.RankPKResult EnemyRankPKResult = 5;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_enemyrankpkresult_size()); i < n; i++) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessage(5, this->_internal_enemyrankpkresult(i), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_RetFightFinish_SC)
return target;
}
size_t MSG_RetFightFinish_SC::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_RetFightFinish_SC)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .rankpk_msg.RewardsNumber rewards = 3;
total_size += 1UL * this->_internal_rewards_size();
for (const auto& msg : this->rewards_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
// repeated .rankpk_msg.RankPKResult MeRankPKResult = 4;
total_size += 1UL * this->_internal_merankpkresult_size();
for (const auto& msg : this->merankpkresult_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
// repeated .rankpk_msg.RankPKResult EnemyRankPKResult = 5;
total_size += 1UL * this->_internal_enemyrankpkresult_size();
for (const auto& msg : this->enemyrankpkresult_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000003u) {
// optional uint32 duration = 1;
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_duration());
}
// optional uint32 winteamid = 2;
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_winteamid());
}
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_RetFightFinish_SC::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_RetFightFinish_SC)
GOOGLE_DCHECK_NE(&from, this);
const MSG_RetFightFinish_SC* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_RetFightFinish_SC>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_RetFightFinish_SC)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_RetFightFinish_SC)
MergeFrom(*source);
}
}
void MSG_RetFightFinish_SC::MergeFrom(const MSG_RetFightFinish_SC& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_RetFightFinish_SC)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
rewards_.MergeFrom(from.rewards_);
merankpkresult_.MergeFrom(from.merankpkresult_);
enemyrankpkresult_.MergeFrom(from.enemyrankpkresult_);
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 0x00000003u) {
if (cached_has_bits & 0x00000001u) {
duration_ = from.duration_;
}
if (cached_has_bits & 0x00000002u) {
winteamid_ = from.winteamid_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void MSG_RetFightFinish_SC::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_RetFightFinish_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_RetFightFinish_SC::CopyFrom(const MSG_RetFightFinish_SC& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_RetFightFinish_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_RetFightFinish_SC::IsInitialized() const {
return true;
}
void MSG_RetFightFinish_SC::InternalSwap(MSG_RetFightFinish_SC* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
rewards_.InternalSwap(&other->rewards_);
merankpkresult_.InternalSwap(&other->merankpkresult_);
enemyrankpkresult_.InternalSwap(&other->enemyrankpkresult_);
swap(duration_, other->duration_);
swap(winteamid_, other->winteamid_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_RetFightFinish_SC::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_ReqGetSeasonRewards_CS::InitAsDefaultInstance() {
}
class MSG_ReqGetSeasonRewards_CS::_Internal {
public:
using HasBits = decltype(std::declval<MSG_ReqGetSeasonRewards_CS>()._has_bits_);
};
MSG_ReqGetSeasonRewards_CS::MSG_ReqGetSeasonRewards_CS()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_ReqGetSeasonRewards_CS)
}
MSG_ReqGetSeasonRewards_CS::MSG_ReqGetSeasonRewards_CS(const MSG_ReqGetSeasonRewards_CS& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_ReqGetSeasonRewards_CS)
}
void MSG_ReqGetSeasonRewards_CS::SharedCtor() {
}
MSG_ReqGetSeasonRewards_CS::~MSG_ReqGetSeasonRewards_CS() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_ReqGetSeasonRewards_CS)
SharedDtor();
}
void MSG_ReqGetSeasonRewards_CS::SharedDtor() {
}
void MSG_ReqGetSeasonRewards_CS::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_ReqGetSeasonRewards_CS& MSG_ReqGetSeasonRewards_CS::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_ReqGetSeasonRewards_CS_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_ReqGetSeasonRewards_CS::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_ReqGetSeasonRewards_CS)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_ReqGetSeasonRewards_CS::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_ReqGetSeasonRewards_CS::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_ReqGetSeasonRewards_CS)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_ReqGetSeasonRewards_CS)
return target;
}
size_t MSG_ReqGetSeasonRewards_CS::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_ReqGetSeasonRewards_CS)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_ReqGetSeasonRewards_CS::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_ReqGetSeasonRewards_CS)
GOOGLE_DCHECK_NE(&from, this);
const MSG_ReqGetSeasonRewards_CS* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_ReqGetSeasonRewards_CS>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_ReqGetSeasonRewards_CS)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_ReqGetSeasonRewards_CS)
MergeFrom(*source);
}
}
void MSG_ReqGetSeasonRewards_CS::MergeFrom(const MSG_ReqGetSeasonRewards_CS& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_ReqGetSeasonRewards_CS)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
}
void MSG_ReqGetSeasonRewards_CS::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_ReqGetSeasonRewards_CS)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_ReqGetSeasonRewards_CS::CopyFrom(const MSG_ReqGetSeasonRewards_CS& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_ReqGetSeasonRewards_CS)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_ReqGetSeasonRewards_CS::IsInitialized() const {
return true;
}
void MSG_ReqGetSeasonRewards_CS::InternalSwap(MSG_ReqGetSeasonRewards_CS* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_ReqGetSeasonRewards_CS::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_RetGetSeasonRewards_SC::InitAsDefaultInstance() {
}
class MSG_RetGetSeasonRewards_SC::_Internal {
public:
using HasBits = decltype(std::declval<MSG_RetGetSeasonRewards_SC>()._has_bits_);
static void set_has_season_rewards_received(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
};
MSG_RetGetSeasonRewards_SC::MSG_RetGetSeasonRewards_SC()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_RetGetSeasonRewards_SC)
}
MSG_RetGetSeasonRewards_SC::MSG_RetGetSeasonRewards_SC(const MSG_RetGetSeasonRewards_SC& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
season_rewards_received_ = from.season_rewards_received_;
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_RetGetSeasonRewards_SC)
}
void MSG_RetGetSeasonRewards_SC::SharedCtor() {
season_rewards_received_ = false;
}
MSG_RetGetSeasonRewards_SC::~MSG_RetGetSeasonRewards_SC() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_RetGetSeasonRewards_SC)
SharedDtor();
}
void MSG_RetGetSeasonRewards_SC::SharedDtor() {
}
void MSG_RetGetSeasonRewards_SC::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_RetGetSeasonRewards_SC& MSG_RetGetSeasonRewards_SC::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_RetGetSeasonRewards_SC_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_RetGetSeasonRewards_SC::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_RetGetSeasonRewards_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
season_rewards_received_ = false;
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_RetGetSeasonRewards_SC::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional bool season_rewards_received = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_season_rewards_received(&has_bits);
season_rewards_received_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_RetGetSeasonRewards_SC::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_RetGetSeasonRewards_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional bool season_rewards_received = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_season_rewards_received(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_RetGetSeasonRewards_SC)
return target;
}
size_t MSG_RetGetSeasonRewards_SC::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_RetGetSeasonRewards_SC)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// optional bool season_rewards_received = 1;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000001u) {
total_size += 1 + 1;
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_RetGetSeasonRewards_SC::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_RetGetSeasonRewards_SC)
GOOGLE_DCHECK_NE(&from, this);
const MSG_RetGetSeasonRewards_SC* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_RetGetSeasonRewards_SC>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_RetGetSeasonRewards_SC)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_RetGetSeasonRewards_SC)
MergeFrom(*source);
}
}
void MSG_RetGetSeasonRewards_SC::MergeFrom(const MSG_RetGetSeasonRewards_SC& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_RetGetSeasonRewards_SC)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from._internal_has_season_rewards_received()) {
_internal_set_season_rewards_received(from._internal_season_rewards_received());
}
}
void MSG_RetGetSeasonRewards_SC::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_RetGetSeasonRewards_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_RetGetSeasonRewards_SC::CopyFrom(const MSG_RetGetSeasonRewards_SC& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_RetGetSeasonRewards_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_RetGetSeasonRewards_SC::IsInitialized() const {
return true;
}
void MSG_RetGetSeasonRewards_SC::InternalSwap(MSG_RetGetSeasonRewards_SC* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
swap(season_rewards_received_, other->season_rewards_received_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_RetGetSeasonRewards_SC::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_RetRewardsEveryday_SC::InitAsDefaultInstance() {
}
class MSG_RetRewardsEveryday_SC::_Internal {
public:
using HasBits = decltype(std::declval<MSG_RetRewardsEveryday_SC>()._has_bits_);
static void set_has_battle_number(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_success_number(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
static void set_has_remainder_day(HasBits* has_bits) {
(*has_bits)[0] |= 4u;
}
static void set_has_rank_level(HasBits* has_bits) {
(*has_bits)[0] |= 8u;
}
static void set_has_rewards_received(HasBits* has_bits) {
(*has_bits)[0] |= 16u;
}
};
MSG_RetRewardsEveryday_SC::MSG_RetRewardsEveryday_SC()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_RetRewardsEveryday_SC)
}
MSG_RetRewardsEveryday_SC::MSG_RetRewardsEveryday_SC(const MSG_RetRewardsEveryday_SC& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_),
pkrewards_(from.pkrewards_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
::memcpy(&battle_number_, &from.battle_number_,
static_cast<size_t>(reinterpret_cast<char*>(&rewards_received_) -
reinterpret_cast<char*>(&battle_number_)) + sizeof(rewards_received_));
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_RetRewardsEveryday_SC)
}
void MSG_RetRewardsEveryday_SC::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_MSG_RetRewardsEveryday_SC_rankpk_5fmsg_2eproto.base);
::memset(&battle_number_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&rewards_received_) -
reinterpret_cast<char*>(&battle_number_)) + sizeof(rewards_received_));
}
MSG_RetRewardsEveryday_SC::~MSG_RetRewardsEveryday_SC() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_RetRewardsEveryday_SC)
SharedDtor();
}
void MSG_RetRewardsEveryday_SC::SharedDtor() {
}
void MSG_RetRewardsEveryday_SC::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_RetRewardsEveryday_SC& MSG_RetRewardsEveryday_SC::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_RetRewardsEveryday_SC_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_RetRewardsEveryday_SC::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_RetRewardsEveryday_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
pkrewards_.Clear();
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x0000001fu) {
::memset(&battle_number_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&rewards_received_) -
reinterpret_cast<char*>(&battle_number_)) + sizeof(rewards_received_));
}
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_RetRewardsEveryday_SC::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional uint32 battle_number = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_battle_number(&has_bits);
battle_number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 success_number = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
_Internal::set_has_success_number(&has_bits);
success_number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// repeated .rankpk_msg.PkRewards pkrewards = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_pkrewards(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
} else goto handle_unusual;
continue;
// optional uint32 remainder_day = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
_Internal::set_has_remainder_day(&has_bits);
remainder_day_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 rank_level = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
_Internal::set_has_rank_level(&has_bits);
rank_level_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional bool rewards_received = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
_Internal::set_has_rewards_received(&has_bits);
rewards_received_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_RetRewardsEveryday_SC::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_RetRewardsEveryday_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional uint32 battle_number = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_battle_number(), target);
}
// optional uint32 success_number = 2;
if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_success_number(), target);
}
// repeated .rankpk_msg.PkRewards pkrewards = 3;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_pkrewards_size()); i < n; i++) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessage(3, this->_internal_pkrewards(i), target, stream);
}
// optional uint32 remainder_day = 4;
if (cached_has_bits & 0x00000004u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(4, this->_internal_remainder_day(), target);
}
// optional uint32 rank_level = 5;
if (cached_has_bits & 0x00000008u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(5, this->_internal_rank_level(), target);
}
// optional bool rewards_received = 6;
if (cached_has_bits & 0x00000010u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(6, this->_internal_rewards_received(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_RetRewardsEveryday_SC)
return target;
}
size_t MSG_RetRewardsEveryday_SC::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_RetRewardsEveryday_SC)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .rankpk_msg.PkRewards pkrewards = 3;
total_size += 1UL * this->_internal_pkrewards_size();
for (const auto& msg : this->pkrewards_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x0000001fu) {
// optional uint32 battle_number = 1;
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_battle_number());
}
// optional uint32 success_number = 2;
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_success_number());
}
// optional uint32 remainder_day = 4;
if (cached_has_bits & 0x00000004u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_remainder_day());
}
// optional uint32 rank_level = 5;
if (cached_has_bits & 0x00000008u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_rank_level());
}
// optional bool rewards_received = 6;
if (cached_has_bits & 0x00000010u) {
total_size += 1 + 1;
}
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_RetRewardsEveryday_SC::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_RetRewardsEveryday_SC)
GOOGLE_DCHECK_NE(&from, this);
const MSG_RetRewardsEveryday_SC* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_RetRewardsEveryday_SC>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_RetRewardsEveryday_SC)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_RetRewardsEveryday_SC)
MergeFrom(*source);
}
}
void MSG_RetRewardsEveryday_SC::MergeFrom(const MSG_RetRewardsEveryday_SC& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_RetRewardsEveryday_SC)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
pkrewards_.MergeFrom(from.pkrewards_);
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 0x0000001fu) {
if (cached_has_bits & 0x00000001u) {
battle_number_ = from.battle_number_;
}
if (cached_has_bits & 0x00000002u) {
success_number_ = from.success_number_;
}
if (cached_has_bits & 0x00000004u) {
remainder_day_ = from.remainder_day_;
}
if (cached_has_bits & 0x00000008u) {
rank_level_ = from.rank_level_;
}
if (cached_has_bits & 0x00000010u) {
rewards_received_ = from.rewards_received_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void MSG_RetRewardsEveryday_SC::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_RetRewardsEveryday_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_RetRewardsEveryday_SC::CopyFrom(const MSG_RetRewardsEveryday_SC& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_RetRewardsEveryday_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_RetRewardsEveryday_SC::IsInitialized() const {
return true;
}
void MSG_RetRewardsEveryday_SC::InternalSwap(MSG_RetRewardsEveryday_SC* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
pkrewards_.InternalSwap(&other->pkrewards_);
swap(battle_number_, other->battle_number_);
swap(success_number_, other->success_number_);
swap(remainder_day_, other->remainder_day_);
swap(rank_level_, other->rank_level_);
swap(rewards_received_, other->rewards_received_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_RetRewardsEveryday_SC::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_ReqRewardsEveryday_CS::InitAsDefaultInstance() {
}
class MSG_ReqRewardsEveryday_CS::_Internal {
public:
using HasBits = decltype(std::declval<MSG_ReqRewardsEveryday_CS>()._has_bits_);
};
MSG_ReqRewardsEveryday_CS::MSG_ReqRewardsEveryday_CS()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_ReqRewardsEveryday_CS)
}
MSG_ReqRewardsEveryday_CS::MSG_ReqRewardsEveryday_CS(const MSG_ReqRewardsEveryday_CS& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_ReqRewardsEveryday_CS)
}
void MSG_ReqRewardsEveryday_CS::SharedCtor() {
}
MSG_ReqRewardsEveryday_CS::~MSG_ReqRewardsEveryday_CS() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_ReqRewardsEveryday_CS)
SharedDtor();
}
void MSG_ReqRewardsEveryday_CS::SharedDtor() {
}
void MSG_ReqRewardsEveryday_CS::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_ReqRewardsEveryday_CS& MSG_ReqRewardsEveryday_CS::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_ReqRewardsEveryday_CS_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_ReqRewardsEveryday_CS::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_ReqRewardsEveryday_CS)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_ReqRewardsEveryday_CS::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_ReqRewardsEveryday_CS::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_ReqRewardsEveryday_CS)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_ReqRewardsEveryday_CS)
return target;
}
size_t MSG_ReqRewardsEveryday_CS::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_ReqRewardsEveryday_CS)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_ReqRewardsEveryday_CS::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_ReqRewardsEveryday_CS)
GOOGLE_DCHECK_NE(&from, this);
const MSG_ReqRewardsEveryday_CS* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_ReqRewardsEveryday_CS>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_ReqRewardsEveryday_CS)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_ReqRewardsEveryday_CS)
MergeFrom(*source);
}
}
void MSG_ReqRewardsEveryday_CS::MergeFrom(const MSG_ReqRewardsEveryday_CS& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_ReqRewardsEveryday_CS)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
}
void MSG_ReqRewardsEveryday_CS::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_ReqRewardsEveryday_CS)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_ReqRewardsEveryday_CS::CopyFrom(const MSG_ReqRewardsEveryday_CS& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_ReqRewardsEveryday_CS)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_ReqRewardsEveryday_CS::IsInitialized() const {
return true;
}
void MSG_ReqRewardsEveryday_CS::InternalSwap(MSG_ReqRewardsEveryday_CS* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_ReqRewardsEveryday_CS::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void PkRewards::InitAsDefaultInstance() {
}
class PkRewards::_Internal {
public:
using HasBits = decltype(std::declval<PkRewards>()._has_bits_);
static void set_has_heroid(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_time(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
static void set_has_pkresult(HasBits* has_bits) {
(*has_bits)[0] |= 4u;
}
};
PkRewards::PkRewards()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.PkRewards)
}
PkRewards::PkRewards(const PkRewards& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_),
rewards_(from.rewards_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
::memcpy(&heroid_, &from.heroid_,
static_cast<size_t>(reinterpret_cast<char*>(&pkresult_) -
reinterpret_cast<char*>(&heroid_)) + sizeof(pkresult_));
// @@protoc_insertion_point(copy_constructor:rankpk_msg.PkRewards)
}
void PkRewards::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_PkRewards_rankpk_5fmsg_2eproto.base);
::memset(&heroid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&pkresult_) -
reinterpret_cast<char*>(&heroid_)) + sizeof(pkresult_));
}
PkRewards::~PkRewards() {
// @@protoc_insertion_point(destructor:rankpk_msg.PkRewards)
SharedDtor();
}
void PkRewards::SharedDtor() {
}
void PkRewards::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const PkRewards& PkRewards::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_PkRewards_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void PkRewards::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.PkRewards)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
rewards_.Clear();
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000007u) {
::memset(&heroid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&pkresult_) -
reinterpret_cast<char*>(&heroid_)) + sizeof(pkresult_));
}
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* PkRewards::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional uint32 heroid = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_heroid(&has_bits);
heroid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 time = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
_Internal::set_has_time(&has_bits);
time_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// repeated .rankpk_msg.RewardsNumber rewards = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_rewards(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
} else goto handle_unusual;
continue;
// optional bool pkresult = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
_Internal::set_has_pkresult(&has_bits);
pkresult_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* PkRewards::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.PkRewards)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional uint32 heroid = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_heroid(), target);
}
// optional uint32 time = 2;
if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_time(), target);
}
// repeated .rankpk_msg.RewardsNumber rewards = 3;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_rewards_size()); i < n; i++) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessage(3, this->_internal_rewards(i), target, stream);
}
// optional bool pkresult = 4;
if (cached_has_bits & 0x00000004u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_pkresult(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.PkRewards)
return target;
}
size_t PkRewards::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.PkRewards)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .rankpk_msg.RewardsNumber rewards = 3;
total_size += 1UL * this->_internal_rewards_size();
for (const auto& msg : this->rewards_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000007u) {
// optional uint32 heroid = 1;
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_heroid());
}
// optional uint32 time = 2;
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_time());
}
// optional bool pkresult = 4;
if (cached_has_bits & 0x00000004u) {
total_size += 1 + 1;
}
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void PkRewards::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.PkRewards)
GOOGLE_DCHECK_NE(&from, this);
const PkRewards* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<PkRewards>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.PkRewards)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.PkRewards)
MergeFrom(*source);
}
}
void PkRewards::MergeFrom(const PkRewards& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.PkRewards)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
rewards_.MergeFrom(from.rewards_);
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 0x00000007u) {
if (cached_has_bits & 0x00000001u) {
heroid_ = from.heroid_;
}
if (cached_has_bits & 0x00000002u) {
time_ = from.time_;
}
if (cached_has_bits & 0x00000004u) {
pkresult_ = from.pkresult_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void PkRewards::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.PkRewards)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void PkRewards::CopyFrom(const PkRewards& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.PkRewards)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool PkRewards::IsInitialized() const {
return true;
}
void PkRewards::InternalSwap(PkRewards* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
rewards_.InternalSwap(&other->rewards_);
swap(heroid_, other->heroid_);
swap(time_, other->time_);
swap(pkresult_, other->pkresult_);
}
::PROTOBUF_NAMESPACE_ID::Metadata PkRewards::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void RewardsNumber::InitAsDefaultInstance() {
}
class RewardsNumber::_Internal {
public:
using HasBits = decltype(std::declval<RewardsNumber>()._has_bits_);
static void set_has_objectid(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_number(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
};
RewardsNumber::RewardsNumber()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.RewardsNumber)
}
RewardsNumber::RewardsNumber(const RewardsNumber& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
::memcpy(&objectid_, &from.objectid_,
static_cast<size_t>(reinterpret_cast<char*>(&number_) -
reinterpret_cast<char*>(&objectid_)) + sizeof(number_));
// @@protoc_insertion_point(copy_constructor:rankpk_msg.RewardsNumber)
}
void RewardsNumber::SharedCtor() {
::memset(&objectid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&number_) -
reinterpret_cast<char*>(&objectid_)) + sizeof(number_));
}
RewardsNumber::~RewardsNumber() {
// @@protoc_insertion_point(destructor:rankpk_msg.RewardsNumber)
SharedDtor();
}
void RewardsNumber::SharedDtor() {
}
void RewardsNumber::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const RewardsNumber& RewardsNumber::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_RewardsNumber_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void RewardsNumber::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.RewardsNumber)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000003u) {
::memset(&objectid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&number_) -
reinterpret_cast<char*>(&objectid_)) + sizeof(number_));
}
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* RewardsNumber::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional uint32 objectid = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_objectid(&has_bits);
objectid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 number = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
_Internal::set_has_number(&has_bits);
number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* RewardsNumber::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.RewardsNumber)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional uint32 objectid = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_objectid(), target);
}
// optional uint32 number = 2;
if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_number(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.RewardsNumber)
return target;
}
size_t RewardsNumber::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.RewardsNumber)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000003u) {
// optional uint32 objectid = 1;
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_objectid());
}
// optional uint32 number = 2;
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_number());
}
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void RewardsNumber::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.RewardsNumber)
GOOGLE_DCHECK_NE(&from, this);
const RewardsNumber* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<RewardsNumber>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.RewardsNumber)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.RewardsNumber)
MergeFrom(*source);
}
}
void RewardsNumber::MergeFrom(const RewardsNumber& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.RewardsNumber)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 0x00000003u) {
if (cached_has_bits & 0x00000001u) {
objectid_ = from.objectid_;
}
if (cached_has_bits & 0x00000002u) {
number_ = from.number_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void RewardsNumber::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.RewardsNumber)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void RewardsNumber::CopyFrom(const RewardsNumber& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.RewardsNumber)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool RewardsNumber::IsInitialized() const {
return true;
}
void RewardsNumber::InternalSwap(RewardsNumber* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
swap(objectid_, other->objectid_);
swap(number_, other->number_);
}
::PROTOBUF_NAMESPACE_ID::Metadata RewardsNumber::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void RankPKHero::InitAsDefaultInstance() {
}
class RankPKHero::_Internal {
public:
using HasBits = decltype(std::declval<RankPKHero>()._has_bits_);
static void set_has_heroid(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_lastusetime(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
};
RankPKHero::RankPKHero()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.RankPKHero)
}
RankPKHero::RankPKHero(const RankPKHero& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
::memcpy(&heroid_, &from.heroid_,
static_cast<size_t>(reinterpret_cast<char*>(&lastusetime_) -
reinterpret_cast<char*>(&heroid_)) + sizeof(lastusetime_));
// @@protoc_insertion_point(copy_constructor:rankpk_msg.RankPKHero)
}
void RankPKHero::SharedCtor() {
::memset(&heroid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&lastusetime_) -
reinterpret_cast<char*>(&heroid_)) + sizeof(lastusetime_));
}
RankPKHero::~RankPKHero() {
// @@protoc_insertion_point(destructor:rankpk_msg.RankPKHero)
SharedDtor();
}
void RankPKHero::SharedDtor() {
}
void RankPKHero::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const RankPKHero& RankPKHero::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_RankPKHero_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void RankPKHero::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.RankPKHero)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000003u) {
::memset(&heroid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&lastusetime_) -
reinterpret_cast<char*>(&heroid_)) + sizeof(lastusetime_));
}
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* RankPKHero::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional uint32 heroid = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_heroid(&has_bits);
heroid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 lastusetime = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
_Internal::set_has_lastusetime(&has_bits);
lastusetime_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* RankPKHero::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.RankPKHero)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional uint32 heroid = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_heroid(), target);
}
// optional uint32 lastusetime = 2;
if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_lastusetime(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.RankPKHero)
return target;
}
size_t RankPKHero::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.RankPKHero)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000003u) {
// optional uint32 heroid = 1;
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_heroid());
}
// optional uint32 lastusetime = 2;
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_lastusetime());
}
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void RankPKHero::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.RankPKHero)
GOOGLE_DCHECK_NE(&from, this);
const RankPKHero* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<RankPKHero>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.RankPKHero)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.RankPKHero)
MergeFrom(*source);
}
}
void RankPKHero::MergeFrom(const RankPKHero& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.RankPKHero)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 0x00000003u) {
if (cached_has_bits & 0x00000001u) {
heroid_ = from.heroid_;
}
if (cached_has_bits & 0x00000002u) {
lastusetime_ = from.lastusetime_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void RankPKHero::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.RankPKHero)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void RankPKHero::CopyFrom(const RankPKHero& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.RankPKHero)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool RankPKHero::IsInitialized() const {
return true;
}
void RankPKHero::InternalSwap(RankPKHero* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
swap(heroid_, other->heroid_);
swap(lastusetime_, other->lastusetime_);
}
::PROTOBUF_NAMESPACE_ID::Metadata RankPKHero::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_RetRankPKHeroHistory_SC::InitAsDefaultInstance() {
}
class MSG_RetRankPKHeroHistory_SC::_Internal {
public:
using HasBits = decltype(std::declval<MSG_RetRankPKHeroHistory_SC>()._has_bits_);
};
MSG_RetRankPKHeroHistory_SC::MSG_RetRankPKHeroHistory_SC()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_RetRankPKHeroHistory_SC)
}
MSG_RetRankPKHeroHistory_SC::MSG_RetRankPKHeroHistory_SC(const MSG_RetRankPKHeroHistory_SC& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_),
heros_(from.heros_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_RetRankPKHeroHistory_SC)
}
void MSG_RetRankPKHeroHistory_SC::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_MSG_RetRankPKHeroHistory_SC_rankpk_5fmsg_2eproto.base);
}
MSG_RetRankPKHeroHistory_SC::~MSG_RetRankPKHeroHistory_SC() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_RetRankPKHeroHistory_SC)
SharedDtor();
}
void MSG_RetRankPKHeroHistory_SC::SharedDtor() {
}
void MSG_RetRankPKHeroHistory_SC::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_RetRankPKHeroHistory_SC& MSG_RetRankPKHeroHistory_SC::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_RetRankPKHeroHistory_SC_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_RetRankPKHeroHistory_SC::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_RetRankPKHeroHistory_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
heros_.Clear();
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_RetRankPKHeroHistory_SC::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// repeated .rankpk_msg.RankPKHero heros = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_heros(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_RetRankPKHeroHistory_SC::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_RetRankPKHeroHistory_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// repeated .rankpk_msg.RankPKHero heros = 1;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_heros_size()); i < n; i++) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessage(1, this->_internal_heros(i), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_RetRankPKHeroHistory_SC)
return target;
}
size_t MSG_RetRankPKHeroHistory_SC::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_RetRankPKHeroHistory_SC)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .rankpk_msg.RankPKHero heros = 1;
total_size += 1UL * this->_internal_heros_size();
for (const auto& msg : this->heros_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_RetRankPKHeroHistory_SC::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_RetRankPKHeroHistory_SC)
GOOGLE_DCHECK_NE(&from, this);
const MSG_RetRankPKHeroHistory_SC* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_RetRankPKHeroHistory_SC>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_RetRankPKHeroHistory_SC)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_RetRankPKHeroHistory_SC)
MergeFrom(*source);
}
}
void MSG_RetRankPKHeroHistory_SC::MergeFrom(const MSG_RetRankPKHeroHistory_SC& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_RetRankPKHeroHistory_SC)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
heros_.MergeFrom(from.heros_);
}
void MSG_RetRankPKHeroHistory_SC::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_RetRankPKHeroHistory_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_RetRankPKHeroHistory_SC::CopyFrom(const MSG_RetRankPKHeroHistory_SC& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_RetRankPKHeroHistory_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_RetRankPKHeroHistory_SC::IsInitialized() const {
return true;
}
void MSG_RetRankPKHeroHistory_SC::InternalSwap(MSG_RetRankPKHeroHistory_SC* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
heros_.InternalSwap(&other->heros_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_RetRankPKHeroHistory_SC::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_RetUserRankStar_SC::InitAsDefaultInstance() {
}
class MSG_RetUserRankStar_SC::_Internal {
public:
using HasBits = decltype(std::declval<MSG_RetUserRankStar_SC>()._has_bits_);
static void set_has_uid(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_rank(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
};
MSG_RetUserRankStar_SC::MSG_RetUserRankStar_SC()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_RetUserRankStar_SC)
}
MSG_RetUserRankStar_SC::MSG_RetUserRankStar_SC(const MSG_RetUserRankStar_SC& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
::memcpy(&uid_, &from.uid_,
static_cast<size_t>(reinterpret_cast<char*>(&rank_) -
reinterpret_cast<char*>(&uid_)) + sizeof(rank_));
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_RetUserRankStar_SC)
}
void MSG_RetUserRankStar_SC::SharedCtor() {
::memset(&uid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&rank_) -
reinterpret_cast<char*>(&uid_)) + sizeof(rank_));
}
MSG_RetUserRankStar_SC::~MSG_RetUserRankStar_SC() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_RetUserRankStar_SC)
SharedDtor();
}
void MSG_RetUserRankStar_SC::SharedDtor() {
}
void MSG_RetUserRankStar_SC::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_RetUserRankStar_SC& MSG_RetUserRankStar_SC::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_RetUserRankStar_SC_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_RetUserRankStar_SC::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_RetUserRankStar_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000003u) {
::memset(&uid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&rank_) -
reinterpret_cast<char*>(&uid_)) + sizeof(rank_));
}
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_RetUserRankStar_SC::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional uint64 uid = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_uid(&has_bits);
uid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 rank = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
_Internal::set_has_rank(&has_bits);
rank_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_RetUserRankStar_SC::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_RetUserRankStar_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional uint64 uid = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(1, this->_internal_uid(), target);
}
// optional uint32 rank = 2;
if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_rank(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_RetUserRankStar_SC)
return target;
}
size_t MSG_RetUserRankStar_SC::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_RetUserRankStar_SC)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000003u) {
// optional uint64 uid = 1;
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size(
this->_internal_uid());
}
// optional uint32 rank = 2;
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_rank());
}
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_RetUserRankStar_SC::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_RetUserRankStar_SC)
GOOGLE_DCHECK_NE(&from, this);
const MSG_RetUserRankStar_SC* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_RetUserRankStar_SC>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_RetUserRankStar_SC)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_RetUserRankStar_SC)
MergeFrom(*source);
}
}
void MSG_RetUserRankStar_SC::MergeFrom(const MSG_RetUserRankStar_SC& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_RetUserRankStar_SC)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 0x00000003u) {
if (cached_has_bits & 0x00000001u) {
uid_ = from.uid_;
}
if (cached_has_bits & 0x00000002u) {
rank_ = from.rank_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void MSG_RetUserRankStar_SC::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_RetUserRankStar_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_RetUserRankStar_SC::CopyFrom(const MSG_RetUserRankStar_SC& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_RetUserRankStar_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_RetUserRankStar_SC::IsInitialized() const {
return true;
}
void MSG_RetUserRankStar_SC::InternalSwap(MSG_RetUserRankStar_SC* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
swap(uid_, other->uid_);
swap(rank_, other->rank_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_RetUserRankStar_SC::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_RetTeamLeftMemSize_SC::InitAsDefaultInstance() {
}
class MSG_RetTeamLeftMemSize_SC::_Internal {
public:
using HasBits = decltype(std::declval<MSG_RetTeamLeftMemSize_SC>()._has_bits_);
static void set_has_team1id(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_team1left(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
static void set_has_team2id(HasBits* has_bits) {
(*has_bits)[0] |= 4u;
}
static void set_has_team2left(HasBits* has_bits) {
(*has_bits)[0] |= 8u;
}
};
MSG_RetTeamLeftMemSize_SC::MSG_RetTeamLeftMemSize_SC()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_RetTeamLeftMemSize_SC)
}
MSG_RetTeamLeftMemSize_SC::MSG_RetTeamLeftMemSize_SC(const MSG_RetTeamLeftMemSize_SC& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
::memcpy(&team1id_, &from.team1id_,
static_cast<size_t>(reinterpret_cast<char*>(&team2left_) -
reinterpret_cast<char*>(&team1id_)) + sizeof(team2left_));
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_RetTeamLeftMemSize_SC)
}
void MSG_RetTeamLeftMemSize_SC::SharedCtor() {
::memset(&team1id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&team2left_) -
reinterpret_cast<char*>(&team1id_)) + sizeof(team2left_));
}
MSG_RetTeamLeftMemSize_SC::~MSG_RetTeamLeftMemSize_SC() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_RetTeamLeftMemSize_SC)
SharedDtor();
}
void MSG_RetTeamLeftMemSize_SC::SharedDtor() {
}
void MSG_RetTeamLeftMemSize_SC::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_RetTeamLeftMemSize_SC& MSG_RetTeamLeftMemSize_SC::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_RetTeamLeftMemSize_SC_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_RetTeamLeftMemSize_SC::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_RetTeamLeftMemSize_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x0000000fu) {
::memset(&team1id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&team2left_) -
reinterpret_cast<char*>(&team1id_)) + sizeof(team2left_));
}
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_RetTeamLeftMemSize_SC::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional uint32 team1id = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_team1id(&has_bits);
team1id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 team1left = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
_Internal::set_has_team1left(&has_bits);
team1left_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 team2id = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
_Internal::set_has_team2id(&has_bits);
team2id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 team2left = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
_Internal::set_has_team2left(&has_bits);
team2left_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_RetTeamLeftMemSize_SC::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_RetTeamLeftMemSize_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional uint32 team1id = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_team1id(), target);
}
// optional uint32 team1left = 2;
if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_team1left(), target);
}
// optional uint32 team2id = 3;
if (cached_has_bits & 0x00000004u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(3, this->_internal_team2id(), target);
}
// optional uint32 team2left = 4;
if (cached_has_bits & 0x00000008u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(4, this->_internal_team2left(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_RetTeamLeftMemSize_SC)
return target;
}
size_t MSG_RetTeamLeftMemSize_SC::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_RetTeamLeftMemSize_SC)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x0000000fu) {
// optional uint32 team1id = 1;
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_team1id());
}
// optional uint32 team1left = 2;
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_team1left());
}
// optional uint32 team2id = 3;
if (cached_has_bits & 0x00000004u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_team2id());
}
// optional uint32 team2left = 4;
if (cached_has_bits & 0x00000008u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_team2left());
}
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_RetTeamLeftMemSize_SC::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_RetTeamLeftMemSize_SC)
GOOGLE_DCHECK_NE(&from, this);
const MSG_RetTeamLeftMemSize_SC* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_RetTeamLeftMemSize_SC>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_RetTeamLeftMemSize_SC)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_RetTeamLeftMemSize_SC)
MergeFrom(*source);
}
}
void MSG_RetTeamLeftMemSize_SC::MergeFrom(const MSG_RetTeamLeftMemSize_SC& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_RetTeamLeftMemSize_SC)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 0x0000000fu) {
if (cached_has_bits & 0x00000001u) {
team1id_ = from.team1id_;
}
if (cached_has_bits & 0x00000002u) {
team1left_ = from.team1left_;
}
if (cached_has_bits & 0x00000004u) {
team2id_ = from.team2id_;
}
if (cached_has_bits & 0x00000008u) {
team2left_ = from.team2left_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void MSG_RetTeamLeftMemSize_SC::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_RetTeamLeftMemSize_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_RetTeamLeftMemSize_SC::CopyFrom(const MSG_RetTeamLeftMemSize_SC& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_RetTeamLeftMemSize_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_RetTeamLeftMemSize_SC::IsInitialized() const {
return true;
}
void MSG_RetTeamLeftMemSize_SC::InternalSwap(MSG_RetTeamLeftMemSize_SC* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
swap(team1id_, other->team1id_);
swap(team1left_, other->team1left_);
swap(team2id_, other->team2id_);
swap(team2left_, other->team2left_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_RetTeamLeftMemSize_SC::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_ReqRankPKCurStage_CS::InitAsDefaultInstance() {
}
class MSG_ReqRankPKCurStage_CS::_Internal {
public:
using HasBits = decltype(std::declval<MSG_ReqRankPKCurStage_CS>()._has_bits_);
};
MSG_ReqRankPKCurStage_CS::MSG_ReqRankPKCurStage_CS()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_ReqRankPKCurStage_CS)
}
MSG_ReqRankPKCurStage_CS::MSG_ReqRankPKCurStage_CS(const MSG_ReqRankPKCurStage_CS& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_ReqRankPKCurStage_CS)
}
void MSG_ReqRankPKCurStage_CS::SharedCtor() {
}
MSG_ReqRankPKCurStage_CS::~MSG_ReqRankPKCurStage_CS() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_ReqRankPKCurStage_CS)
SharedDtor();
}
void MSG_ReqRankPKCurStage_CS::SharedDtor() {
}
void MSG_ReqRankPKCurStage_CS::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_ReqRankPKCurStage_CS& MSG_ReqRankPKCurStage_CS::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_ReqRankPKCurStage_CS_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_ReqRankPKCurStage_CS::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_ReqRankPKCurStage_CS)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_ReqRankPKCurStage_CS::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_ReqRankPKCurStage_CS::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_ReqRankPKCurStage_CS)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_ReqRankPKCurStage_CS)
return target;
}
size_t MSG_ReqRankPKCurStage_CS::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_ReqRankPKCurStage_CS)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_ReqRankPKCurStage_CS::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_ReqRankPKCurStage_CS)
GOOGLE_DCHECK_NE(&from, this);
const MSG_ReqRankPKCurStage_CS* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_ReqRankPKCurStage_CS>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_ReqRankPKCurStage_CS)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_ReqRankPKCurStage_CS)
MergeFrom(*source);
}
}
void MSG_ReqRankPKCurStage_CS::MergeFrom(const MSG_ReqRankPKCurStage_CS& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_ReqRankPKCurStage_CS)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
}
void MSG_ReqRankPKCurStage_CS::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_ReqRankPKCurStage_CS)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_ReqRankPKCurStage_CS::CopyFrom(const MSG_ReqRankPKCurStage_CS& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_ReqRankPKCurStage_CS)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_ReqRankPKCurStage_CS::IsInitialized() const {
return true;
}
void MSG_ReqRankPKCurStage_CS::InternalSwap(MSG_ReqRankPKCurStage_CS* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_ReqRankPKCurStage_CS::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_RetRankPKCurStage_SC::InitAsDefaultInstance() {
::rankpk_msg::_MSG_RetRankPKCurStage_SC_default_instance_._instance.get_mutable()->score_ = const_cast< ::rankpk_msg::MSG_RetTeamCurScore_SC*>(
::rankpk_msg::MSG_RetTeamCurScore_SC::internal_default_instance());
}
class MSG_RetRankPKCurStage_SC::_Internal {
public:
using HasBits = decltype(std::declval<MSG_RetRankPKCurStage_SC>()._has_bits_);
static void set_has_curstage(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
static void set_has_duration(HasBits* has_bits) {
(*has_bits)[0] |= 4u;
}
static const ::rankpk_msg::MSG_RetTeamCurScore_SC& score(const MSG_RetRankPKCurStage_SC* msg);
static void set_has_score(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
};
const ::rankpk_msg::MSG_RetTeamCurScore_SC&
MSG_RetRankPKCurStage_SC::_Internal::score(const MSG_RetRankPKCurStage_SC* msg) {
return *msg->score_;
}
MSG_RetRankPKCurStage_SC::MSG_RetRankPKCurStage_SC()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_RetRankPKCurStage_SC)
}
MSG_RetRankPKCurStage_SC::MSG_RetRankPKCurStage_SC(const MSG_RetRankPKCurStage_SC& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from._internal_has_score()) {
score_ = new ::rankpk_msg::MSG_RetTeamCurScore_SC(*from.score_);
} else {
score_ = nullptr;
}
::memcpy(&curstage_, &from.curstage_,
static_cast<size_t>(reinterpret_cast<char*>(&duration_) -
reinterpret_cast<char*>(&curstage_)) + sizeof(duration_));
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_RetRankPKCurStage_SC)
}
void MSG_RetRankPKCurStage_SC::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_MSG_RetRankPKCurStage_SC_rankpk_5fmsg_2eproto.base);
::memset(&score_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&duration_) -
reinterpret_cast<char*>(&score_)) + sizeof(duration_));
}
MSG_RetRankPKCurStage_SC::~MSG_RetRankPKCurStage_SC() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_RetRankPKCurStage_SC)
SharedDtor();
}
void MSG_RetRankPKCurStage_SC::SharedDtor() {
if (this != internal_default_instance()) delete score_;
}
void MSG_RetRankPKCurStage_SC::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_RetRankPKCurStage_SC& MSG_RetRankPKCurStage_SC::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_RetRankPKCurStage_SC_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_RetRankPKCurStage_SC::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_RetRankPKCurStage_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000001u) {
GOOGLE_DCHECK(score_ != nullptr);
score_->Clear();
}
if (cached_has_bits & 0x00000006u) {
::memset(&curstage_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&duration_) -
reinterpret_cast<char*>(&curstage_)) + sizeof(duration_));
}
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_RetRankPKCurStage_SC::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// required .msg.StageType curstage = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
if (PROTOBUF_PREDICT_TRUE(::msg::StageType_IsValid(val))) {
_internal_set_curstage(static_cast<::msg::StageType>(val));
} else {
::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
}
} else goto handle_unusual;
continue;
// optional uint32 duration = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
_Internal::set_has_duration(&has_bits);
duration_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional .rankpk_msg.MSG_RetTeamCurScore_SC score = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
ptr = ctx->ParseMessage(_internal_mutable_score(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_RetRankPKCurStage_SC::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_RetRankPKCurStage_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// required .msg.StageType curstage = 1;
if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
1, this->_internal_curstage(), target);
}
// optional uint32 duration = 2;
if (cached_has_bits & 0x00000004u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_duration(), target);
}
// optional .rankpk_msg.MSG_RetTeamCurScore_SC score = 3;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessage(
3, _Internal::score(this), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_RetRankPKCurStage_SC)
return target;
}
size_t MSG_RetRankPKCurStage_SC::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_RetRankPKCurStage_SC)
size_t total_size = 0;
// required .msg.StageType curstage = 1;
if (_internal_has_curstage()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_curstage());
}
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// optional .rankpk_msg.MSG_RetTeamCurScore_SC score = 3;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*score_);
}
// optional uint32 duration = 2;
if (cached_has_bits & 0x00000004u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_duration());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_RetRankPKCurStage_SC::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_RetRankPKCurStage_SC)
GOOGLE_DCHECK_NE(&from, this);
const MSG_RetRankPKCurStage_SC* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_RetRankPKCurStage_SC>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_RetRankPKCurStage_SC)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_RetRankPKCurStage_SC)
MergeFrom(*source);
}
}
void MSG_RetRankPKCurStage_SC::MergeFrom(const MSG_RetRankPKCurStage_SC& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_RetRankPKCurStage_SC)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 0x00000007u) {
if (cached_has_bits & 0x00000001u) {
_internal_mutable_score()->::rankpk_msg::MSG_RetTeamCurScore_SC::MergeFrom(from._internal_score());
}
if (cached_has_bits & 0x00000002u) {
curstage_ = from.curstage_;
}
if (cached_has_bits & 0x00000004u) {
duration_ = from.duration_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void MSG_RetRankPKCurStage_SC::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_RetRankPKCurStage_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_RetRankPKCurStage_SC::CopyFrom(const MSG_RetRankPKCurStage_SC& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_RetRankPKCurStage_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_RetRankPKCurStage_SC::IsInitialized() const {
if ((_has_bits_[0] & 0x00000002) != 0x00000002) return false;
return true;
}
void MSG_RetRankPKCurStage_SC::InternalSwap(MSG_RetRankPKCurStage_SC* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
swap(score_, other->score_);
swap(curstage_, other->curstage_);
swap(duration_, other->duration_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_RetRankPKCurStage_SC::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_RetPreparedNum_SC::InitAsDefaultInstance() {
}
class MSG_RetPreparedNum_SC::_Internal {
public:
using HasBits = decltype(std::declval<MSG_RetPreparedNum_SC>()._has_bits_);
static void set_has_curnum(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_allnum(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
};
MSG_RetPreparedNum_SC::MSG_RetPreparedNum_SC()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_RetPreparedNum_SC)
}
MSG_RetPreparedNum_SC::MSG_RetPreparedNum_SC(const MSG_RetPreparedNum_SC& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
::memcpy(&curnum_, &from.curnum_,
static_cast<size_t>(reinterpret_cast<char*>(&allnum_) -
reinterpret_cast<char*>(&curnum_)) + sizeof(allnum_));
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_RetPreparedNum_SC)
}
void MSG_RetPreparedNum_SC::SharedCtor() {
::memset(&curnum_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&allnum_) -
reinterpret_cast<char*>(&curnum_)) + sizeof(allnum_));
}
MSG_RetPreparedNum_SC::~MSG_RetPreparedNum_SC() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_RetPreparedNum_SC)
SharedDtor();
}
void MSG_RetPreparedNum_SC::SharedDtor() {
}
void MSG_RetPreparedNum_SC::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_RetPreparedNum_SC& MSG_RetPreparedNum_SC::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_RetPreparedNum_SC_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_RetPreparedNum_SC::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_RetPreparedNum_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000003u) {
::memset(&curnum_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&allnum_) -
reinterpret_cast<char*>(&curnum_)) + sizeof(allnum_));
}
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_RetPreparedNum_SC::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional uint32 curnum = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_curnum(&has_bits);
curnum_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 allnum = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
_Internal::set_has_allnum(&has_bits);
allnum_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_RetPreparedNum_SC::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_RetPreparedNum_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional uint32 curnum = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_curnum(), target);
}
// optional uint32 allnum = 2;
if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_allnum(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_RetPreparedNum_SC)
return target;
}
size_t MSG_RetPreparedNum_SC::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_RetPreparedNum_SC)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000003u) {
// optional uint32 curnum = 1;
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_curnum());
}
// optional uint32 allnum = 2;
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_allnum());
}
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_RetPreparedNum_SC::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_RetPreparedNum_SC)
GOOGLE_DCHECK_NE(&from, this);
const MSG_RetPreparedNum_SC* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_RetPreparedNum_SC>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_RetPreparedNum_SC)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_RetPreparedNum_SC)
MergeFrom(*source);
}
}
void MSG_RetPreparedNum_SC::MergeFrom(const MSG_RetPreparedNum_SC& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_RetPreparedNum_SC)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 0x00000003u) {
if (cached_has_bits & 0x00000001u) {
curnum_ = from.curnum_;
}
if (cached_has_bits & 0x00000002u) {
allnum_ = from.allnum_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void MSG_RetPreparedNum_SC::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_RetPreparedNum_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_RetPreparedNum_SC::CopyFrom(const MSG_RetPreparedNum_SC& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_RetPreparedNum_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_RetPreparedNum_SC::IsInitialized() const {
return true;
}
void MSG_RetPreparedNum_SC::InternalSwap(MSG_RetPreparedNum_SC* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
swap(curnum_, other->curnum_);
swap(allnum_, other->allnum_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_RetPreparedNum_SC::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_RetMemPkPrepared_SC::InitAsDefaultInstance() {
}
class MSG_RetMemPkPrepared_SC::_Internal {
public:
using HasBits = decltype(std::declval<MSG_RetMemPkPrepared_SC>()._has_bits_);
static void set_has_memid(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_heroid(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
};
MSG_RetMemPkPrepared_SC::MSG_RetMemPkPrepared_SC()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_RetMemPkPrepared_SC)
}
MSG_RetMemPkPrepared_SC::MSG_RetMemPkPrepared_SC(const MSG_RetMemPkPrepared_SC& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
::memcpy(&memid_, &from.memid_,
static_cast<size_t>(reinterpret_cast<char*>(&heroid_) -
reinterpret_cast<char*>(&memid_)) + sizeof(heroid_));
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_RetMemPkPrepared_SC)
}
void MSG_RetMemPkPrepared_SC::SharedCtor() {
::memset(&memid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&heroid_) -
reinterpret_cast<char*>(&memid_)) + sizeof(heroid_));
}
MSG_RetMemPkPrepared_SC::~MSG_RetMemPkPrepared_SC() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_RetMemPkPrepared_SC)
SharedDtor();
}
void MSG_RetMemPkPrepared_SC::SharedDtor() {
}
void MSG_RetMemPkPrepared_SC::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_RetMemPkPrepared_SC& MSG_RetMemPkPrepared_SC::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_RetMemPkPrepared_SC_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_RetMemPkPrepared_SC::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_RetMemPkPrepared_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000003u) {
::memset(&memid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&heroid_) -
reinterpret_cast<char*>(&memid_)) + sizeof(heroid_));
}
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_RetMemPkPrepared_SC::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional uint64 memid = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_memid(&has_bits);
memid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 heroid = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
_Internal::set_has_heroid(&has_bits);
heroid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_RetMemPkPrepared_SC::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_RetMemPkPrepared_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional uint64 memid = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(1, this->_internal_memid(), target);
}
// optional uint32 heroid = 2;
if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_heroid(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_RetMemPkPrepared_SC)
return target;
}
size_t MSG_RetMemPkPrepared_SC::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_RetMemPkPrepared_SC)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000003u) {
// optional uint64 memid = 1;
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size(
this->_internal_memid());
}
// optional uint32 heroid = 2;
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_heroid());
}
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_RetMemPkPrepared_SC::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_RetMemPkPrepared_SC)
GOOGLE_DCHECK_NE(&from, this);
const MSG_RetMemPkPrepared_SC* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_RetMemPkPrepared_SC>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_RetMemPkPrepared_SC)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_RetMemPkPrepared_SC)
MergeFrom(*source);
}
}
void MSG_RetMemPkPrepared_SC::MergeFrom(const MSG_RetMemPkPrepared_SC& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_RetMemPkPrepared_SC)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 0x00000003u) {
if (cached_has_bits & 0x00000001u) {
memid_ = from.memid_;
}
if (cached_has_bits & 0x00000002u) {
heroid_ = from.heroid_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void MSG_RetMemPkPrepared_SC::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_RetMemPkPrepared_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_RetMemPkPrepared_SC::CopyFrom(const MSG_RetMemPkPrepared_SC& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_RetMemPkPrepared_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_RetMemPkPrepared_SC::IsInitialized() const {
return true;
}
void MSG_RetMemPkPrepared_SC::InternalSwap(MSG_RetMemPkPrepared_SC* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
swap(memid_, other->memid_);
swap(heroid_, other->heroid_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_RetMemPkPrepared_SC::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_RetPKGeneralConfig_SC::InitAsDefaultInstance() {
}
class MSG_RetPKGeneralConfig_SC::_Internal {
public:
using HasBits = decltype(std::declval<MSG_RetPKGeneralConfig_SC>()._has_bits_);
static void set_has_teampknum(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
};
MSG_RetPKGeneralConfig_SC::MSG_RetPKGeneralConfig_SC()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_RetPKGeneralConfig_SC)
}
MSG_RetPKGeneralConfig_SC::MSG_RetPKGeneralConfig_SC(const MSG_RetPKGeneralConfig_SC& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
teampknum_ = from.teampknum_;
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_RetPKGeneralConfig_SC)
}
void MSG_RetPKGeneralConfig_SC::SharedCtor() {
teampknum_ = 0u;
}
MSG_RetPKGeneralConfig_SC::~MSG_RetPKGeneralConfig_SC() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_RetPKGeneralConfig_SC)
SharedDtor();
}
void MSG_RetPKGeneralConfig_SC::SharedDtor() {
}
void MSG_RetPKGeneralConfig_SC::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_RetPKGeneralConfig_SC& MSG_RetPKGeneralConfig_SC::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_RetPKGeneralConfig_SC_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_RetPKGeneralConfig_SC::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_RetPKGeneralConfig_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
teampknum_ = 0u;
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_RetPKGeneralConfig_SC::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional uint32 teampknum = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_teampknum(&has_bits);
teampknum_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_RetPKGeneralConfig_SC::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_RetPKGeneralConfig_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional uint32 teampknum = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_teampknum(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_RetPKGeneralConfig_SC)
return target;
}
size_t MSG_RetPKGeneralConfig_SC::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_RetPKGeneralConfig_SC)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// optional uint32 teampknum = 1;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_teampknum());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_RetPKGeneralConfig_SC::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_RetPKGeneralConfig_SC)
GOOGLE_DCHECK_NE(&from, this);
const MSG_RetPKGeneralConfig_SC* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_RetPKGeneralConfig_SC>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_RetPKGeneralConfig_SC)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_RetPKGeneralConfig_SC)
MergeFrom(*source);
}
}
void MSG_RetPKGeneralConfig_SC::MergeFrom(const MSG_RetPKGeneralConfig_SC& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_RetPKGeneralConfig_SC)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from._internal_has_teampknum()) {
_internal_set_teampknum(from._internal_teampknum());
}
}
void MSG_RetPKGeneralConfig_SC::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_RetPKGeneralConfig_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_RetPKGeneralConfig_SC::CopyFrom(const MSG_RetPKGeneralConfig_SC& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_RetPKGeneralConfig_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_RetPKGeneralConfig_SC::IsInitialized() const {
return true;
}
void MSG_RetPKGeneralConfig_SC::InternalSwap(MSG_RetPKGeneralConfig_SC* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
swap(teampknum_, other->teampknum_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_RetPKGeneralConfig_SC::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_RetTeamCurScore_SC::InitAsDefaultInstance() {
}
class MSG_RetTeamCurScore_SC::_Internal {
public:
using HasBits = decltype(std::declval<MSG_RetTeamCurScore_SC>()._has_bits_);
static void set_has_team1id(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_team1score(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
static void set_has_team2id(HasBits* has_bits) {
(*has_bits)[0] |= 4u;
}
static void set_has_team2score(HasBits* has_bits) {
(*has_bits)[0] |= 8u;
}
};
MSG_RetTeamCurScore_SC::MSG_RetTeamCurScore_SC()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_RetTeamCurScore_SC)
}
MSG_RetTeamCurScore_SC::MSG_RetTeamCurScore_SC(const MSG_RetTeamCurScore_SC& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
::memcpy(&team1id_, &from.team1id_,
static_cast<size_t>(reinterpret_cast<char*>(&team2score_) -
reinterpret_cast<char*>(&team1id_)) + sizeof(team2score_));
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_RetTeamCurScore_SC)
}
void MSG_RetTeamCurScore_SC::SharedCtor() {
::memset(&team1id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&team2score_) -
reinterpret_cast<char*>(&team1id_)) + sizeof(team2score_));
}
MSG_RetTeamCurScore_SC::~MSG_RetTeamCurScore_SC() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_RetTeamCurScore_SC)
SharedDtor();
}
void MSG_RetTeamCurScore_SC::SharedDtor() {
}
void MSG_RetTeamCurScore_SC::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_RetTeamCurScore_SC& MSG_RetTeamCurScore_SC::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_RetTeamCurScore_SC_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_RetTeamCurScore_SC::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_RetTeamCurScore_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x0000000fu) {
::memset(&team1id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&team2score_) -
reinterpret_cast<char*>(&team1id_)) + sizeof(team2score_));
}
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_RetTeamCurScore_SC::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional uint32 team1id = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_team1id(&has_bits);
team1id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 team1score = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
_Internal::set_has_team1score(&has_bits);
team1score_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 team2id = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
_Internal::set_has_team2id(&has_bits);
team2id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 team2score = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
_Internal::set_has_team2score(&has_bits);
team2score_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_RetTeamCurScore_SC::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_RetTeamCurScore_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional uint32 team1id = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_team1id(), target);
}
// optional uint32 team1score = 2;
if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_team1score(), target);
}
// optional uint32 team2id = 3;
if (cached_has_bits & 0x00000004u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(3, this->_internal_team2id(), target);
}
// optional uint32 team2score = 4;
if (cached_has_bits & 0x00000008u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(4, this->_internal_team2score(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_RetTeamCurScore_SC)
return target;
}
size_t MSG_RetTeamCurScore_SC::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_RetTeamCurScore_SC)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x0000000fu) {
// optional uint32 team1id = 1;
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_team1id());
}
// optional uint32 team1score = 2;
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_team1score());
}
// optional uint32 team2id = 3;
if (cached_has_bits & 0x00000004u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_team2id());
}
// optional uint32 team2score = 4;
if (cached_has_bits & 0x00000008u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_team2score());
}
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_RetTeamCurScore_SC::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_RetTeamCurScore_SC)
GOOGLE_DCHECK_NE(&from, this);
const MSG_RetTeamCurScore_SC* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_RetTeamCurScore_SC>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_RetTeamCurScore_SC)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_RetTeamCurScore_SC)
MergeFrom(*source);
}
}
void MSG_RetTeamCurScore_SC::MergeFrom(const MSG_RetTeamCurScore_SC& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_RetTeamCurScore_SC)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 0x0000000fu) {
if (cached_has_bits & 0x00000001u) {
team1id_ = from.team1id_;
}
if (cached_has_bits & 0x00000002u) {
team1score_ = from.team1score_;
}
if (cached_has_bits & 0x00000004u) {
team2id_ = from.team2id_;
}
if (cached_has_bits & 0x00000008u) {
team2score_ = from.team2score_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void MSG_RetTeamCurScore_SC::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_RetTeamCurScore_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_RetTeamCurScore_SC::CopyFrom(const MSG_RetTeamCurScore_SC& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_RetTeamCurScore_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_RetTeamCurScore_SC::IsInitialized() const {
return true;
}
void MSG_RetTeamCurScore_SC::InternalSwap(MSG_RetTeamCurScore_SC* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
swap(team1id_, other->team1id_);
swap(team1score_, other->team1score_);
swap(team2id_, other->team2id_);
swap(team2score_, other->team2score_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_RetTeamCurScore_SC::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void RankPKListItem::InitAsDefaultInstance() {
}
class RankPKListItem::_Internal {
public:
using HasBits = decltype(std::declval<RankPKListItem>()._has_bits_);
static void set_has_position(HasBits* has_bits) {
(*has_bits)[0] |= 8u;
}
static void set_has_charid(HasBits* has_bits) {
(*has_bits)[0] |= 4u;
}
static void set_has_name(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_ranklevel(HasBits* has_bits) {
(*has_bits)[0] |= 16u;
}
static void set_has_guildname(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
static void set_has_winbattle(HasBits* has_bits) {
(*has_bits)[0] |= 32u;
}
static void set_has_winrate(HasBits* has_bits) {
(*has_bits)[0] |= 64u;
}
};
RankPKListItem::RankPKListItem()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.RankPKListItem)
}
RankPKListItem::RankPKListItem(const RankPKListItem& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from._internal_has_name()) {
name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
}
guildname_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from._internal_has_guildname()) {
guildname_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.guildname_);
}
::memcpy(&charid_, &from.charid_,
static_cast<size_t>(reinterpret_cast<char*>(&winrate_) -
reinterpret_cast<char*>(&charid_)) + sizeof(winrate_));
// @@protoc_insertion_point(copy_constructor:rankpk_msg.RankPKListItem)
}
void RankPKListItem::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_RankPKListItem_rankpk_5fmsg_2eproto.base);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
guildname_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
::memset(&charid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&winrate_) -
reinterpret_cast<char*>(&charid_)) + sizeof(winrate_));
}
RankPKListItem::~RankPKListItem() {
// @@protoc_insertion_point(destructor:rankpk_msg.RankPKListItem)
SharedDtor();
}
void RankPKListItem::SharedDtor() {
name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
guildname_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
void RankPKListItem::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const RankPKListItem& RankPKListItem::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_RankPKListItem_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void RankPKListItem::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.RankPKListItem)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000003u) {
if (cached_has_bits & 0x00000001u) {
name_.ClearNonDefaultToEmptyNoArena();
}
if (cached_has_bits & 0x00000002u) {
guildname_.ClearNonDefaultToEmptyNoArena();
}
}
if (cached_has_bits & 0x0000007cu) {
::memset(&charid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&winrate_) -
reinterpret_cast<char*>(&charid_)) + sizeof(winrate_));
}
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* RankPKListItem::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional uint32 position = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
_Internal::set_has_position(&has_bits);
position_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint64 charid = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
_Internal::set_has_charid(&has_bits);
charid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional string name = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
auto str = _internal_mutable_name();
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
#ifndef NDEBUG
::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "rankpk_msg.RankPKListItem.name");
#endif // !NDEBUG
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 ranklevel = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
_Internal::set_has_ranklevel(&has_bits);
ranklevel_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional string guildname = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
auto str = _internal_mutable_guildname();
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
#ifndef NDEBUG
::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "rankpk_msg.RankPKListItem.guildname");
#endif // !NDEBUG
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 winbattle = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
_Internal::set_has_winbattle(&has_bits);
winbattle_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// optional uint32 winrate = 7;
case 7:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) {
_Internal::set_has_winrate(&has_bits);
winrate_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* RankPKListItem::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.RankPKListItem)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional uint32 position = 1;
if (cached_has_bits & 0x00000008u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_position(), target);
}
// optional uint64 charid = 2;
if (cached_has_bits & 0x00000004u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(2, this->_internal_charid(), target);
}
// optional string name = 3;
if (cached_has_bits & 0x00000001u) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
"rankpk_msg.RankPKListItem.name");
target = stream->WriteStringMaybeAliased(
3, this->_internal_name(), target);
}
// optional uint32 ranklevel = 4;
if (cached_has_bits & 0x00000010u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(4, this->_internal_ranklevel(), target);
}
// optional string guildname = 5;
if (cached_has_bits & 0x00000002u) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
this->_internal_guildname().data(), static_cast<int>(this->_internal_guildname().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
"rankpk_msg.RankPKListItem.guildname");
target = stream->WriteStringMaybeAliased(
5, this->_internal_guildname(), target);
}
// optional uint32 winbattle = 6;
if (cached_has_bits & 0x00000020u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(6, this->_internal_winbattle(), target);
}
// optional uint32 winrate = 7;
if (cached_has_bits & 0x00000040u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(7, this->_internal_winrate(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.RankPKListItem)
return target;
}
size_t RankPKListItem::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.RankPKListItem)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x0000007fu) {
// optional string name = 3;
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_name());
}
// optional string guildname = 5;
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_guildname());
}
// optional uint64 charid = 2;
if (cached_has_bits & 0x00000004u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size(
this->_internal_charid());
}
// optional uint32 position = 1;
if (cached_has_bits & 0x00000008u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_position());
}
// optional uint32 ranklevel = 4;
if (cached_has_bits & 0x00000010u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_ranklevel());
}
// optional uint32 winbattle = 6;
if (cached_has_bits & 0x00000020u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_winbattle());
}
// optional uint32 winrate = 7;
if (cached_has_bits & 0x00000040u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_winrate());
}
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void RankPKListItem::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.RankPKListItem)
GOOGLE_DCHECK_NE(&from, this);
const RankPKListItem* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<RankPKListItem>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.RankPKListItem)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.RankPKListItem)
MergeFrom(*source);
}
}
void RankPKListItem::MergeFrom(const RankPKListItem& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.RankPKListItem)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 0x0000007fu) {
if (cached_has_bits & 0x00000001u) {
_has_bits_[0] |= 0x00000001u;
name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
}
if (cached_has_bits & 0x00000002u) {
_has_bits_[0] |= 0x00000002u;
guildname_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.guildname_);
}
if (cached_has_bits & 0x00000004u) {
charid_ = from.charid_;
}
if (cached_has_bits & 0x00000008u) {
position_ = from.position_;
}
if (cached_has_bits & 0x00000010u) {
ranklevel_ = from.ranklevel_;
}
if (cached_has_bits & 0x00000020u) {
winbattle_ = from.winbattle_;
}
if (cached_has_bits & 0x00000040u) {
winrate_ = from.winrate_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void RankPKListItem::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.RankPKListItem)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void RankPKListItem::CopyFrom(const RankPKListItem& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.RankPKListItem)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool RankPKListItem::IsInitialized() const {
return true;
}
void RankPKListItem::InternalSwap(RankPKListItem* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
guildname_.Swap(&other->guildname_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
swap(charid_, other->charid_);
swap(position_, other->position_);
swap(ranklevel_, other->ranklevel_);
swap(winbattle_, other->winbattle_);
swap(winrate_, other->winrate_);
}
::PROTOBUF_NAMESPACE_ID::Metadata RankPKListItem::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_ReqRankPKList_CS::InitAsDefaultInstance() {
}
class MSG_ReqRankPKList_CS::_Internal {
public:
using HasBits = decltype(std::declval<MSG_ReqRankPKList_CS>()._has_bits_);
static void set_has_type(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
};
MSG_ReqRankPKList_CS::MSG_ReqRankPKList_CS()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_ReqRankPKList_CS)
}
MSG_ReqRankPKList_CS::MSG_ReqRankPKList_CS(const MSG_ReqRankPKList_CS& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
type_ = from.type_;
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_ReqRankPKList_CS)
}
void MSG_ReqRankPKList_CS::SharedCtor() {
type_ = 0;
}
MSG_ReqRankPKList_CS::~MSG_ReqRankPKList_CS() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_ReqRankPKList_CS)
SharedDtor();
}
void MSG_ReqRankPKList_CS::SharedDtor() {
}
void MSG_ReqRankPKList_CS::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_ReqRankPKList_CS& MSG_ReqRankPKList_CS::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_ReqRankPKList_CS_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_ReqRankPKList_CS::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_ReqRankPKList_CS)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
type_ = 0;
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_ReqRankPKList_CS::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional .rankpk_msg.RankPKListType type = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
if (PROTOBUF_PREDICT_TRUE(::rankpk_msg::RankPKListType_IsValid(val))) {
_internal_set_type(static_cast<::rankpk_msg::RankPKListType>(val));
} else {
::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
}
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_ReqRankPKList_CS::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_ReqRankPKList_CS)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional .rankpk_msg.RankPKListType type = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
1, this->_internal_type(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_ReqRankPKList_CS)
return target;
}
size_t MSG_ReqRankPKList_CS::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_ReqRankPKList_CS)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// optional .rankpk_msg.RankPKListType type = 1;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_ReqRankPKList_CS::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_ReqRankPKList_CS)
GOOGLE_DCHECK_NE(&from, this);
const MSG_ReqRankPKList_CS* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_ReqRankPKList_CS>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_ReqRankPKList_CS)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_ReqRankPKList_CS)
MergeFrom(*source);
}
}
void MSG_ReqRankPKList_CS::MergeFrom(const MSG_ReqRankPKList_CS& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_ReqRankPKList_CS)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from._internal_has_type()) {
_internal_set_type(from._internal_type());
}
}
void MSG_ReqRankPKList_CS::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_ReqRankPKList_CS)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_ReqRankPKList_CS::CopyFrom(const MSG_ReqRankPKList_CS& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_ReqRankPKList_CS)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_ReqRankPKList_CS::IsInitialized() const {
return true;
}
void MSG_ReqRankPKList_CS::InternalSwap(MSG_ReqRankPKList_CS* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
swap(type_, other->type_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_ReqRankPKList_CS::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void MSG_RetRankPKList_SC::InitAsDefaultInstance() {
}
class MSG_RetRankPKList_SC::_Internal {
public:
using HasBits = decltype(std::declval<MSG_RetRankPKList_SC>()._has_bits_);
static void set_has_type(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_myposition(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
};
MSG_RetRankPKList_SC::MSG_RetRankPKList_SC()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:rankpk_msg.MSG_RetRankPKList_SC)
}
MSG_RetRankPKList_SC::MSG_RetRankPKList_SC(const MSG_RetRankPKList_SC& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_has_bits_(from._has_bits_),
data_(from.data_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
::memcpy(&type_, &from.type_,
static_cast<size_t>(reinterpret_cast<char*>(&myposition_) -
reinterpret_cast<char*>(&type_)) + sizeof(myposition_));
// @@protoc_insertion_point(copy_constructor:rankpk_msg.MSG_RetRankPKList_SC)
}
void MSG_RetRankPKList_SC::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_MSG_RetRankPKList_SC_rankpk_5fmsg_2eproto.base);
::memset(&type_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&myposition_) -
reinterpret_cast<char*>(&type_)) + sizeof(myposition_));
}
MSG_RetRankPKList_SC::~MSG_RetRankPKList_SC() {
// @@protoc_insertion_point(destructor:rankpk_msg.MSG_RetRankPKList_SC)
SharedDtor();
}
void MSG_RetRankPKList_SC::SharedDtor() {
}
void MSG_RetRankPKList_SC::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const MSG_RetRankPKList_SC& MSG_RetRankPKList_SC::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MSG_RetRankPKList_SC_rankpk_5fmsg_2eproto.base);
return *internal_default_instance();
}
void MSG_RetRankPKList_SC::Clear() {
// @@protoc_insertion_point(message_clear_start:rankpk_msg.MSG_RetRankPKList_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
data_.Clear();
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000003u) {
::memset(&type_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&myposition_) -
reinterpret_cast<char*>(&type_)) + sizeof(myposition_));
}
_has_bits_.Clear();
_internal_metadata_.Clear();
}
const char* MSG_RetRankPKList_SC::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// optional .rankpk_msg.RankPKListType type = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
if (PROTOBUF_PREDICT_TRUE(::rankpk_msg::RankPKListType_IsValid(val))) {
_internal_set_type(static_cast<::rankpk_msg::RankPKListType>(val));
} else {
::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
}
} else goto handle_unusual;
continue;
// optional uint32 myposition = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
_Internal::set_has_myposition(&has_bits);
myposition_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// repeated .rankpk_msg.RankPKListItem data = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_data(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* MSG_RetRankPKList_SC::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:rankpk_msg.MSG_RetRankPKList_SC)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional .rankpk_msg.RankPKListType type = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
1, this->_internal_type(), target);
}
// optional uint32 myposition = 2;
if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_myposition(), target);
}
// repeated .rankpk_msg.RankPKListItem data = 3;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_data_size()); i < n; i++) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessage(3, this->_internal_data(i), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:rankpk_msg.MSG_RetRankPKList_SC)
return target;
}
size_t MSG_RetRankPKList_SC::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:rankpk_msg.MSG_RetRankPKList_SC)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .rankpk_msg.RankPKListItem data = 3;
total_size += 1UL * this->_internal_data_size();
for (const auto& msg : this->data_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000003u) {
// optional .rankpk_msg.RankPKListType type = 1;
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type());
}
// optional uint32 myposition = 2;
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
this->_internal_myposition());
}
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void MSG_RetRankPKList_SC::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:rankpk_msg.MSG_RetRankPKList_SC)
GOOGLE_DCHECK_NE(&from, this);
const MSG_RetRankPKList_SC* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MSG_RetRankPKList_SC>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:rankpk_msg.MSG_RetRankPKList_SC)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:rankpk_msg.MSG_RetRankPKList_SC)
MergeFrom(*source);
}
}
void MSG_RetRankPKList_SC::MergeFrom(const MSG_RetRankPKList_SC& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:rankpk_msg.MSG_RetRankPKList_SC)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
data_.MergeFrom(from.data_);
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 0x00000003u) {
if (cached_has_bits & 0x00000001u) {
type_ = from.type_;
}
if (cached_has_bits & 0x00000002u) {
myposition_ = from.myposition_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void MSG_RetRankPKList_SC::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:rankpk_msg.MSG_RetRankPKList_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MSG_RetRankPKList_SC::CopyFrom(const MSG_RetRankPKList_SC& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:rankpk_msg.MSG_RetRankPKList_SC)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MSG_RetRankPKList_SC::IsInitialized() const {
return true;
}
void MSG_RetRankPKList_SC::InternalSwap(MSG_RetRankPKList_SC* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
data_.InternalSwap(&other->data_);
swap(type_, other->type_);
swap(myposition_, other->myposition_);
}
::PROTOBUF_NAMESPACE_ID::Metadata MSG_RetRankPKList_SC::GetMetadata() const {
return GetMetadataStatic();
}
// @@protoc_insertion_point(namespace_scope)
} // namespace rankpk_msg
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::rankpk_msg::UserRankPkInfo* Arena::CreateMaybeMessage< ::rankpk_msg::UserRankPkInfo >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::UserRankPkInfo >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_Req_MatchMemberInfo_CS* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_Req_MatchMemberInfo_CS >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_Req_MatchMemberInfo_CS >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_Ret_MatchMemberInfo_SC* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_Ret_MatchMemberInfo_SC >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_Ret_MatchMemberInfo_SC >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_Req_StartMatch_CS* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_Req_StartMatch_CS >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_Req_StartMatch_CS >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_Ret_StartMatch_SC* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_Ret_StartMatch_SC >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_Ret_StartMatch_SC >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_Req_CancelMatch_CS* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_Req_CancelMatch_CS >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_Req_CancelMatch_CS >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_Ret_CancelMatch_SC* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_Ret_CancelMatch_SC >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_Ret_CancelMatch_SC >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_RankPkReqPrepare_CS* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_RankPkReqPrepare_CS >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_RankPkReqPrepare_CS >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_RankPkReqPrepare_SC* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_RankPkReqPrepare_SC >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_RankPkReqPrepare_SC >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_GoToBattle_SC* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_GoToBattle_SC >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_GoToBattle_SC >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_Ret_MatchResult_SC* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_Ret_MatchResult_SC >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_Ret_MatchResult_SC >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_Req_GotoBattle_CS* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_Req_GotoBattle_CS >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_Req_GotoBattle_CS >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_RetStartPrepare_SC* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_RetStartPrepare_SC >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_RetStartPrepare_SC >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_ReqChoosePrepared_CS* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_ReqChoosePrepared_CS >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_ReqChoosePrepared_CS >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_RetChoosePrepared_SC* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_RetChoosePrepared_SC >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_RetChoosePrepared_SC >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_RetFightCountDown_SC* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_RetFightCountDown_SC >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_RetFightCountDown_SC >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_RetStartFight_SC* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_RetStartFight_SC >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_RetStartFight_SC >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_RetSpeedupFight_SC* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_RetSpeedupFight_SC >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_RetSpeedupFight_SC >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::RankPKResult* Arena::CreateMaybeMessage< ::rankpk_msg::RankPKResult >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::RankPKResult >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_RetFightFinish_SC* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_RetFightFinish_SC >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_RetFightFinish_SC >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_ReqGetSeasonRewards_CS* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_ReqGetSeasonRewards_CS >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_ReqGetSeasonRewards_CS >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_RetGetSeasonRewards_SC* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_RetGetSeasonRewards_SC >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_RetGetSeasonRewards_SC >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_RetRewardsEveryday_SC* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_RetRewardsEveryday_SC >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_RetRewardsEveryday_SC >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_ReqRewardsEveryday_CS* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_ReqRewardsEveryday_CS >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_ReqRewardsEveryday_CS >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::PkRewards* Arena::CreateMaybeMessage< ::rankpk_msg::PkRewards >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::PkRewards >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::RewardsNumber* Arena::CreateMaybeMessage< ::rankpk_msg::RewardsNumber >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::RewardsNumber >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::RankPKHero* Arena::CreateMaybeMessage< ::rankpk_msg::RankPKHero >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::RankPKHero >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_RetRankPKHeroHistory_SC* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_RetRankPKHeroHistory_SC >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_RetRankPKHeroHistory_SC >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_RetUserRankStar_SC* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_RetUserRankStar_SC >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_RetUserRankStar_SC >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_RetTeamLeftMemSize_SC* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_RetTeamLeftMemSize_SC >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_RetTeamLeftMemSize_SC >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_ReqRankPKCurStage_CS* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_ReqRankPKCurStage_CS >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_ReqRankPKCurStage_CS >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_RetRankPKCurStage_SC* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_RetRankPKCurStage_SC >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_RetRankPKCurStage_SC >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_RetPreparedNum_SC* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_RetPreparedNum_SC >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_RetPreparedNum_SC >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_RetMemPkPrepared_SC* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_RetMemPkPrepared_SC >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_RetMemPkPrepared_SC >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_RetPKGeneralConfig_SC* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_RetPKGeneralConfig_SC >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_RetPKGeneralConfig_SC >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_RetTeamCurScore_SC* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_RetTeamCurScore_SC >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_RetTeamCurScore_SC >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::RankPKListItem* Arena::CreateMaybeMessage< ::rankpk_msg::RankPKListItem >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::RankPKListItem >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_ReqRankPKList_CS* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_ReqRankPKList_CS >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_ReqRankPKList_CS >(arena);
}
template<> PROTOBUF_NOINLINE ::rankpk_msg::MSG_RetRankPKList_SC* Arena::CreateMaybeMessage< ::rankpk_msg::MSG_RetRankPKList_SC >(Arena* arena) {
return Arena::CreateInternal< ::rankpk_msg::MSG_RetRankPKList_SC >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
| [
"dblegendsmud@gmail.com"
] | dblegendsmud@gmail.com |
c0d917d8ad1633fbd2dfcb92c61561e7252eb719 | 606baeb206a539bbc007438f532aa958c2046611 | /staruml-cpp/src/grammar/demo.h | cfd61a7d273fc736850c59303216e057462902bf | [] | no_license | StevenTCramer/WhiteStarUml | 412f114bd728fb274a838f77ce20d82e18d60a83 | ce81391423f46d8ef45331cc9243150101bddf37 | refs/heads/master | 2016-09-05T09:29:23.685743 | 2014-06-11T10:50:13 | 2014-06-11T10:50:13 | 21,080,525 | 8 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,958 | h | //----------------------------------------------------------------------------//
// demo.h //
// Copyright (C) 2001 Bruno 'Beosil' Heidelberger //
//----------------------------------------------------------------------------//
// 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 of the License, or (at your option) //
// any later version. //
//----------------------------------------------------------------------------//
#ifndef DEMO_H
#define DEMO_H
//----------------------------------------------------------------------------//
// Includes //
//----------------------------------------------------------------------------//
#include "global.h"
//----------------------------------------------------------------------------//
// Forward declarations //
//----------------------------------------------------------------------------//
class Model;
//----------------------------------------------------------------------------//
// Class declaration //
//----------------------------------------------------------------------------//
class Demo
{
// member variables
protected:
int m_width;
int m_height;
bool m_bFullscreen;
float m_fpsDuration;
int m_fpsFrames;
int m_fps;
GLuint m_cursorTextureId;
GLuint m_logoTextureId;
GLuint m_fpsTextureId;
int m_mouseX;
int m_mouseY;
float m_tiltAngle;
float m_twistAngle;
float m_distance;
bool m_bLeftMouseButtonDown;
bool m_bRightMouseButtonDown;
unsigned int m_lastTick;
std::string m_strDatapath;
std::string m_strCal3D_Datapath;
std::vector<Model *> m_vectorModel;
unsigned int m_currentModel;
bool m_bPaused;
// constructors/destructor
public:
Demo();
virtual ~Demo();
// member functions
public:
std::string getCaption();
std::string getDatapath();
bool getFullscreen();
int getHeight();
Model *getModel();
int getWidth();
bool loadTexture(const std::string& strFllename, GLuint& pId);
void nextModel();
bool onCreate(int argc, char *argv[]);
void onIdle();
bool onInit();
void onKey(unsigned char key, int x, int y);
void onMouseButtonDown(int button, int x, int y);
void onMouseButtonUp(int button, int x, int y);
void onMouseMove(int x, int y);
void onRender();
void onShutdown();
void setDimension(int width, int height);
};
extern Demo theDemo;
#endif
//----------------------------------------------------------------------------//
| [
"janszpilewski@a2c42d12-4202-4d66-bf40-0a7c89270c64"
] | janszpilewski@a2c42d12-4202-4d66-bf40-0a7c89270c64 |
751d0c8fcdf42c75251b3be706b8e46dbc30a2ba | 600df3590cce1fe49b9a96e9ca5b5242884a2a70 | /components/sync/driver/model_associator_mock.h | 0725d595bc7c6f163dc891357d792f639b4db892 | [
"BSD-3-Clause"
] | permissive | metux/chromium-suckless | efd087ba4f4070a6caac5bfbfb0f7a4e2f3c438a | 72a05af97787001756bae2511b7985e61498c965 | refs/heads/orig | 2022-12-04T23:53:58.681218 | 2017-04-30T10:59:06 | 2017-04-30T23:35:58 | 89,884,931 | 5 | 3 | BSD-3-Clause | 2022-11-23T20:52:53 | 2017-05-01T00:09:08 | null | UTF-8 | C++ | false | false | 1,049 | 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_SYNC_DRIVER_MODEL_ASSOCIATOR_MOCK_H__
#define COMPONENTS_SYNC_DRIVER_MODEL_ASSOCIATOR_MOCK_H__
#include "base/location.h"
#include "components/sync/api/sync_error.h"
#include "components/sync/driver/model_associator.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace syncer {
ACTION_P(SetSyncError, type) {
arg0->Reset(FROM_HERE, "test", type);
}
class ModelAssociatorMock : public AssociatorInterface {
public:
ModelAssociatorMock();
virtual ~ModelAssociatorMock();
MOCK_METHOD2(AssociateModels, SyncError(SyncMergeResult*, SyncMergeResult*));
MOCK_METHOD0(DisassociateModels, SyncError());
MOCK_METHOD1(SyncModelHasUserCreatedNodes, bool(bool* has_nodes));
MOCK_METHOD0(AbortAssociation, void());
MOCK_METHOD0(CryptoReadyIfNecessary, bool());
};
} // namespace syncer
#endif // COMPONENTS_SYNC_DRIVER_MODEL_ASSOCIATOR_MOCK_H__
| [
"enrico.weigelt@gr13.net"
] | enrico.weigelt@gr13.net |
762966134d54eafa1f49e19f3f8259f9086cb93b | bb5d7bd4c364f73b01d1d2939af937949a1d8f5c | /dino.h | 59cc2f9ef094834b8a8e70fee2ff1f98c00b69f1 | [] | no_license | Ysmir/WarriorsJourney | 3ec8f6ad8ac9c8a3a3193016ee883d86f3a76a9e | 9d14d8301ecad3100eaaf3b85627591be31d15fa | refs/heads/master | 2022-12-26T10:09:21.327473 | 2020-10-04T12:47:11 | 2020-10-04T12:47:11 | 295,694,634 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 242 | h | #pragma once
#include "game_object.h"
class Dino : public Game_Object
{
public:
Dino(std::string id);
~Dino();
virtual void simulate_AI(Uint32 milliseconds_to_simulate, Assets* assets, Input* input, Scene* scene) override;
}; | [
"gibsonkeanu@gmail.com"
] | gibsonkeanu@gmail.com |
bd2005ae7d07f017b809a4207ae6a633367c8f83 | 1453cd02157d7e34b5e806a9486791a18c2df5c9 | /app/config/ConfigFriend.pb.h | 49e81e6527b2f70a0ca4d30f42b7abd827c3cab9 | [] | no_license | colinblack/game-srv-muduo | 6da0c485b36d766d9cc9b3bd8ef4b6f83fab27f8 | 9fd5c98ba70d51e3fbfd0af0878b92019f242bec | refs/heads/main | 2023-05-15T06:18:45.431480 | 2021-06-07T07:44:48 | 2021-06-07T07:44:48 | 373,710,270 | 1 | 1 | null | 2021-06-04T06:11:54 | 2021-06-04T03:34:48 | null | UTF-8 | C++ | false | true | 10,931 | h | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: ConfigFriend.proto
#ifndef PROTOBUF_ConfigFriend_2eproto__INCLUDED
#define PROTOBUF_ConfigFriend_2eproto__INCLUDED
#include <string>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 2006000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/unknown_field_set.h>
// @@protoc_insertion_point(includes)
namespace ConfigFriend {
// Internal implementation detail -- do not call these.
void protobuf_AddDesc_ConfigFriend_2eproto();
void protobuf_AssignDesc_ConfigFriend_2eproto();
void protobuf_ShutdownFile_ConfigFriend_2eproto();
class LevelNums;
class Friend;
// ===================================================================
class LevelNums : public ::google::protobuf::Message {
public:
LevelNums();
virtual ~LevelNums();
LevelNums(const LevelNums& from);
inline LevelNums& operator=(const LevelNums& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const LevelNums& default_instance();
void Swap(LevelNums* other);
// implements Message ----------------------------------------------
LevelNums* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const LevelNums& from);
void MergeFrom(const LevelNums& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// required uint32 level = 1;
inline bool has_level() const;
inline void clear_level();
static const int kLevelFieldNumber = 1;
inline ::google::protobuf::uint32 level() const;
inline void set_level(::google::protobuf::uint32 value);
// required uint32 concern_nums = 2;
inline bool has_concern_nums() const;
inline void clear_concern_nums();
static const int kConcernNumsFieldNumber = 2;
inline ::google::protobuf::uint32 concern_nums() const;
inline void set_concern_nums(::google::protobuf::uint32 value);
// required uint32 fans_num = 3;
inline bool has_fans_num() const;
inline void clear_fans_num();
static const int kFansNumFieldNumber = 3;
inline ::google::protobuf::uint32 fans_num() const;
inline void set_fans_num(::google::protobuf::uint32 value);
// @@protoc_insertion_point(class_scope:ConfigFriend.LevelNums)
private:
inline void set_has_level();
inline void clear_has_level();
inline void set_has_concern_nums();
inline void clear_has_concern_nums();
inline void set_has_fans_num();
inline void clear_has_fans_num();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::uint32 level_;
::google::protobuf::uint32 concern_nums_;
::google::protobuf::uint32 fans_num_;
friend void protobuf_AddDesc_ConfigFriend_2eproto();
friend void protobuf_AssignDesc_ConfigFriend_2eproto();
friend void protobuf_ShutdownFile_ConfigFriend_2eproto();
void InitAsDefaultInstance();
static LevelNums* default_instance_;
};
// -------------------------------------------------------------------
class Friend : public ::google::protobuf::Message {
public:
Friend();
virtual ~Friend();
Friend(const Friend& from);
inline Friend& operator=(const Friend& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const Friend& default_instance();
void Swap(Friend* other);
// implements Message ----------------------------------------------
Friend* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const Friend& from);
void MergeFrom(const Friend& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// repeated .ConfigFriend.LevelNums nums = 1;
inline int nums_size() const;
inline void clear_nums();
static const int kNumsFieldNumber = 1;
inline const ::ConfigFriend::LevelNums& nums(int index) const;
inline ::ConfigFriend::LevelNums* mutable_nums(int index);
inline ::ConfigFriend::LevelNums* add_nums();
inline const ::google::protobuf::RepeatedPtrField< ::ConfigFriend::LevelNums >&
nums() const;
inline ::google::protobuf::RepeatedPtrField< ::ConfigFriend::LevelNums >*
mutable_nums();
// @@protoc_insertion_point(class_scope:ConfigFriend.Friend)
private:
::google::protobuf::UnknownFieldSet _unknown_fields_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::RepeatedPtrField< ::ConfigFriend::LevelNums > nums_;
friend void protobuf_AddDesc_ConfigFriend_2eproto();
friend void protobuf_AssignDesc_ConfigFriend_2eproto();
friend void protobuf_ShutdownFile_ConfigFriend_2eproto();
void InitAsDefaultInstance();
static Friend* default_instance_;
};
// ===================================================================
// ===================================================================
// LevelNums
// required uint32 level = 1;
inline bool LevelNums::has_level() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void LevelNums::set_has_level() {
_has_bits_[0] |= 0x00000001u;
}
inline void LevelNums::clear_has_level() {
_has_bits_[0] &= ~0x00000001u;
}
inline void LevelNums::clear_level() {
level_ = 0u;
clear_has_level();
}
inline ::google::protobuf::uint32 LevelNums::level() const {
// @@protoc_insertion_point(field_get:ConfigFriend.LevelNums.level)
return level_;
}
inline void LevelNums::set_level(::google::protobuf::uint32 value) {
set_has_level();
level_ = value;
// @@protoc_insertion_point(field_set:ConfigFriend.LevelNums.level)
}
// required uint32 concern_nums = 2;
inline bool LevelNums::has_concern_nums() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void LevelNums::set_has_concern_nums() {
_has_bits_[0] |= 0x00000002u;
}
inline void LevelNums::clear_has_concern_nums() {
_has_bits_[0] &= ~0x00000002u;
}
inline void LevelNums::clear_concern_nums() {
concern_nums_ = 0u;
clear_has_concern_nums();
}
inline ::google::protobuf::uint32 LevelNums::concern_nums() const {
// @@protoc_insertion_point(field_get:ConfigFriend.LevelNums.concern_nums)
return concern_nums_;
}
inline void LevelNums::set_concern_nums(::google::protobuf::uint32 value) {
set_has_concern_nums();
concern_nums_ = value;
// @@protoc_insertion_point(field_set:ConfigFriend.LevelNums.concern_nums)
}
// required uint32 fans_num = 3;
inline bool LevelNums::has_fans_num() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void LevelNums::set_has_fans_num() {
_has_bits_[0] |= 0x00000004u;
}
inline void LevelNums::clear_has_fans_num() {
_has_bits_[0] &= ~0x00000004u;
}
inline void LevelNums::clear_fans_num() {
fans_num_ = 0u;
clear_has_fans_num();
}
inline ::google::protobuf::uint32 LevelNums::fans_num() const {
// @@protoc_insertion_point(field_get:ConfigFriend.LevelNums.fans_num)
return fans_num_;
}
inline void LevelNums::set_fans_num(::google::protobuf::uint32 value) {
set_has_fans_num();
fans_num_ = value;
// @@protoc_insertion_point(field_set:ConfigFriend.LevelNums.fans_num)
}
// -------------------------------------------------------------------
// Friend
// repeated .ConfigFriend.LevelNums nums = 1;
inline int Friend::nums_size() const {
return nums_.size();
}
inline void Friend::clear_nums() {
nums_.Clear();
}
inline const ::ConfigFriend::LevelNums& Friend::nums(int index) const {
// @@protoc_insertion_point(field_get:ConfigFriend.Friend.nums)
return nums_.Get(index);
}
inline ::ConfigFriend::LevelNums* Friend::mutable_nums(int index) {
// @@protoc_insertion_point(field_mutable:ConfigFriend.Friend.nums)
return nums_.Mutable(index);
}
inline ::ConfigFriend::LevelNums* Friend::add_nums() {
// @@protoc_insertion_point(field_add:ConfigFriend.Friend.nums)
return nums_.Add();
}
inline const ::google::protobuf::RepeatedPtrField< ::ConfigFriend::LevelNums >&
Friend::nums() const {
// @@protoc_insertion_point(field_list:ConfigFriend.Friend.nums)
return nums_;
}
inline ::google::protobuf::RepeatedPtrField< ::ConfigFriend::LevelNums >*
Friend::mutable_nums() {
// @@protoc_insertion_point(field_mutable_list:ConfigFriend.Friend.nums)
return &nums_;
}
// @@protoc_insertion_point(namespace_scope)
} // namespace ConfigFriend
#ifndef SWIG
namespace google {
namespace protobuf {
} // namespace google
} // namespace protobuf
#endif // SWIG
// @@protoc_insertion_point(global_scope)
#endif // PROTOBUF_ConfigFriend_2eproto__INCLUDED
| [
"chengpeng424@163.com"
] | chengpeng424@163.com |
1c30113d85b4a59fc7a9c342ab423732b2df6ea2 | 783fddf24188fba6802d5427b086610dc1f3bafb | /src/concurrent/lock_mode.hpp | fb88a0a630c40e24c2571f19e2211d64bd5064fe | [] | no_license | zhanglei/arch | a026fb7ab3a92ab41bd963f93b7746456886764d | ab27fd6c31fe60bbb038b24fc659ffa6cc58b76f | refs/heads/master | 2021-01-16T18:29:02.087625 | 2013-08-01T08:51:29 | 2013-08-01T08:51:29 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 290 | hpp | /*
* lock_mode.hpp
*
* Created on: 2011-4-4
* Author: wqy
*/
#ifndef LOCK_MODE_HPP_
#define LOCK_MODE_HPP_
namespace arch
{
namespace concurrent
{
enum LockMode
{
INVALID_LOCK,
READ_LOCK,
WRITE_LOCK
};
}
}
#endif /* LOCK_MODE_HPP_ */
| [
"yinqiwen@gmail.com"
] | yinqiwen@gmail.com |
fe06956ac8d722e7607d71693093a7660cec2663 | 0668404b877fb65d61f1131ea7529dda622286c8 | /C and C++/Data Structures and Algorithms/Linked List/linked_list_basic.cpp | 2eb9d16b04efc6466dff8e643e6be5aac0cc8288 | [] | no_license | nikhiljsk/Programming | 1137128f787ccd5eef45f8aff91128f740195592 | 8226c2320809d252eb3a49149044c0cd217391b4 | refs/heads/master | 2020-05-03T21:50:56.230712 | 2020-02-28T10:18:22 | 2020-02-28T10:18:22 | 178,832,071 | 0 | 0 | null | 2020-02-20T12:33:26 | 2019-04-01T09:41:38 | HTML | UTF-8 | C++ | false | false | 542 | cpp | #include<iostream>
using namespace std;
struct node{
int data;
node *next;
};
int main(){
node *s,*l,*n,*p;
s=NULL;
int c=0;
int num;
cout<<"Enter the data in linked list \nPress -1 to terminate the process"<<endl;
cin>>num;
while(num != -1)
{
n = new node;
n->data = num;
n->next = NULL;
c+=1;
if(s==NULL)
{
s = n;
l = n;
}
else{
l->next = n;
l = n;
}
cin>>num;
}
p=s;
while(p!=NULL){
cout<<p->data<<endl;
p = p->next;
}
cout<<"count"<<c;
return 0;
}
| [
"nikhiljs@in.ibm.com"
] | nikhiljs@in.ibm.com |
ccec965f91bc0741bd9e8aef095728cf84d8952d | fce8d9c72923ed0123ac9b7ee1b09731084b8faa | /D3D_Base/cCubeMan.h | 8fb16a061ea405631627f412954245015c175c51 | [] | no_license | asy1256/TestGit | b7a68787e79a219c7231797c88110cac4a1cecd0 | 9ac26242c349990dcf08e0403655489e49c27f22 | refs/heads/master | 2021-07-25T10:21:37.475127 | 2017-11-05T07:58:26 | 2017-11-05T07:58:26 | 109,367,418 | 0 | 0 | null | 2017-11-05T07:58:27 | 2017-11-03T07:49:08 | C++ | UTF-8 | C++ | false | false | 427 | h | #pragma once
#include "cCharacter.h"
class cCubeNode;
class cHeightMap;
class cCubeMan : public cCharacter
{
protected:
cCubeNode* m_pRoot;
D3DMATERIAL9 m_stMtl;
LPDIRECT3DTEXTURE9 m_pTexture;
cHeightMap* m_pHiMap;
public:
cCubeMan();
~cCubeMan();
void Setup();
void Update();
void Render();
D3DXVECTOR3& GetPosition(void) { return m_vPosition; }
void SetHeightMap(cHeightMap* map) { m_pHiMap = map; }
};
| [
"asy1256@daum.net"
] | asy1256@daum.net |
0bca35da31143f1d689060e51261b0fee0d91ebd | ebcd60549df3596bf3b4ed563f51c927e012062d | /Student_Information/SubjectPrereq.h | e89b241383daf8e598e174891cece329a0959264 | [] | no_license | Kevin-Chester-Ranara/Student_Information | 8ec98c5d2b8880de60cc6d98b02cfbc96d078106 | e2f2bbec554e7407c4abc208957db0f16312fdfd | refs/heads/master | 2022-12-20T04:58:37.334983 | 2020-09-26T05:16:00 | 2020-09-26T05:16:00 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 212 | h | #pragma once
#include <vector>
#include <string>
class SubjectPrereq
{
public:
SubjectPrereq() = default;
SubjectPrereq(std::string subject);
private:
std::vector<std::vector<std::string>> Prerequisites;
};
| [
"kcsranara@gmail.com"
] | kcsranara@gmail.com |
aa8d9ba907b9ea0348cb4a01c7c67c7e53f542c5 | fa9d5df4d6e32d406c2f0e785d258917363313a2 | /Sorting/Sorting/Sorting/Bubble.h | 667d28f42619fc65200ed49156853643783193f6 | [] | no_license | RyanAlameddine/Cpp-Data-Structures | b4d893a10746da7dd0d2155dafb43c25e6d7b3ec | 060848ff929b19395f40e315685372c22634b3e3 | refs/heads/master | 2020-03-12T11:37:38.535022 | 2018-06-03T19:31:26 | 2018-06-03T19:31:26 | 130,600,911 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 333 | h | #pragma once
#include<vector>
void Bubble(std::vector<int>& values) {
bool success = false;
while (!success) {
success = true;
for (int i = 0; i < values.size() - 1; i++) {
if (values[i] > values[i + 1]) {
success = false;
int temp = values[i];
values[i] = values[i + 1];
values[i + 1] = temp;
}
}
}
} | [
"rhalameddine@gmail.com"
] | rhalameddine@gmail.com |
d5cf8e6629977b8be0c06b19ee5c4b1eda32f34b | aae9e5af97b8ed681cd30142b007210773eb075e | /btree.h | 9f952d956d5c886129005228cfd096b236dfe3fd | [
"MIT"
] | permissive | danielScLima/BTree | a5d12143020548710195bfd0bb53718d18017e18 | fe10b83c8665f712f5fb3460c0da7cb20bc4fd29 | refs/heads/master | 2023-02-16T00:32:57.938289 | 2021-01-15T23:34:13 | 2021-01-15T23:34:13 | 282,651,314 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,450 | h | #ifndef BTREE_H
#define BTREE_H
#include "nodeOfBTree.h"
#include <iostream>
class NodeOfBTree;
/*!
* \brief The BTree class
*/
class BTree
{
public:
/*!
* \brief BTree
* \param degree
*/
BTree(int degree = 4);
~BTree();
/*!
* \brief getDegree
* \return
*/
int getDegree();
/*!
* \brief entriesSize
* \return
*/
int entriesSize();
/*!
* \brief getDotFileContent
* \return
*/
std::string getDotFileContent();
/*!
* \brief insert
* \param number
*/
bool insert(int number);
/*!
* \brief search
* \param number
* \return
*/
NodeOfBTree* search(int number);
/*!
* \brief remove
* \param number
* \return
*/
bool remove(int number);
/*!
* \brief getRoot
* \return
*/
NodeOfBTree* getRoot();
/*!
* \brief dealockNodeOfBTrees
*/
void dealockNodeOfBTrees();
private:
NodeOfBTree* root = nullptr;
//Is the number of cell's son
int degree = 2;
/*!
* \brief fixNodeOfBTreeWithSmallCountOfElements
* \param NodeOfBTreeToFix
*/
void fixNodeOfBTreeWithSmallCountOfElements(NodeOfBTree *nodeOfBTreeToFix);
/*!
* \brief getAncestor
* \param NodeOfBTree
* \param number
* \return
*/
NodeOfBTree *getAncestor(NodeOfBTree *nodeOfBTree, int number);
};
#endif // BTREE_H
| [
"daniel.lima@larces.uece.br"
] | daniel.lima@larces.uece.br |
85e2d5c2ab317d94217d7aef2880e05f910a0d00 | 146c72541d3c60ca7fd53146df4b07f20ee35d95 | /main.cpp | f793339a403314f45aa5bbd197bb7d937d0e18a2 | [] | no_license | gatsukichi/Cafe | 2382db40580220a34d24c15dab85d46776ac3f8a | 027a5935ed1f0c98ca4f347e850c34b6a75a7c27 | refs/heads/master | 2020-07-08T01:55:07.005320 | 2019-08-22T13:06:12 | 2019-08-22T13:06:12 | 203,533,749 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,656 | cpp | #include <iostream>
using namespace std;
#include "Product.h"
#include "ProductTotal.h"
#include "Ingredient.h"
#include "MoneyBox.h"
#include "BuyIngredient.h"
#include "SellProduct.h"
int menu(const char** menuList, int menuCnt);
void sellMenu(ProductList& PL, IngredientList& IL, ProductTotal* PTP, MoneyBox* MBP, int& i);
void buyMenu(IngredientList& IL, MoneyBox* MBP,int& i);
void viewMenu(MoneyBox* MBP, ProductTotal* PTP, IngredientList& IL, int& i);
void displayTitle(string title);
void screen(ProductList& PL, IngredientList& IL, int month_cnt);
int inputInteger(char* message);
int inputInteger(string message);
void myFlush();
bool deadLine(MoneyBox* MBP,int& i);
int main() {
ProductList PL;
IngredientList IL;
int month_cnt;
month_cnt = inputInteger("운영할 개월수를 입력하시오: ");
screen(PL, IL, month_cnt);
getchar(); getchar();
return 0;
}
void screen(ProductList& PL, IngredientList& IL, int month_cnt) {
const char* menuList[] = { "판매","구매","장부","마감하기" };
int i=1;
int menuCnt = sizeof(menuList)/sizeof(menuList[0]);
int menuNum;
bool gogo;
MoneyBox* MBP;
MBP = new MoneyBox[month_cnt+1];
ProductTotal* PTP;
PTP = new ProductTotal[month_cnt+1];
int sm; // 전주인의 총매출 ,재료구입가격
sm = inputInteger("지난달 총매출을 입력하시오 : ");
MBP[0].setSellM(sm);
MBP[0].setBuyM(sm*0.5);
MBP[0].setTax();
MBP[0].setProfit();
MBP[0].setGoalSellM();
MBP[0].setBePoint();
MBP[1].setSellM(sm*0.7);
displayTitle("카페 운영 프로그램");
while (true) {
menuNum = menu(menuList, menuCnt);
switch (menuNum) {
case 1:sellMenu(PL, IL, PTP, MBP, i); break;
case 2:buyMenu(IL, MBP,i); break;
case 3:viewMenu(MBP, PTP, IL, i); break;
case 4:
gogo = deadLine(MBP, i);
if (gogo == false) {
return;
}
break;
default: break;
}
if (i-1 == month_cnt) { break; }
}
displayTitle("카페 운영 프로그램 종료");
delete[] MBP;
delete[] PTP;
return;
}
int menu(const char** menuList, int menuCnt) {
int i;
int menuNum = 0; /* 입력된 메뉴 번호 저장 변수*/
cout << endl << "==================================" << endl;
for (i = 0; i < menuCnt; i++) {
cout << i + 1 << "." << menuList[i] << endl;
}
cout << "==================================" << endl;
while (menuNum<1 || menuNum>menuCnt) { /* 범위 내의 번호가 입력될 때 까지 반복*/
menuNum = inputInteger("# 메뉴번호를 입력하세요 : ");
}
return menuNum;
}
void sellMenu(ProductList& PL, IngredientList& IL, ProductTotal* PTP, MoneyBox* MBP, int& i) {
SellProduct SP;
const char *menuList[] = { "아메리카노","카페라떼","카페모카","홍차","녹차","딸기에이드","레몬에이드","딸기스무디","초코스무디", "종료" };
int menuCnt = sizeof(menuList) / sizeof(menuList[0]);
int menuNum;
int sellCnt;
int sellMoney;
displayTitle("판매");
while (true) {
menuNum = menu(menuList, menuCnt);
if (menuNum == menuCnt) { break; }
sellCnt = inputInteger("몇 잔 판매 하시겠습니까? : ");
if (SP.IngredientCntDecreament(IL, menuNum, sellCnt) != false) {
sellMoney = SP.ProductCntIncreament(PL, menuNum, sellCnt);
SP.MoneyIncreament(MBP[i], sellMoney);
PTP[i].addSellCount(menuNum-1, sellCnt);
} else {
cout << "재료 재고가 부족하여 판매하지 못했습니다" << endl;
}
}
displayTitle("판매 종료");
return;
}
void buyMenu(IngredientList& IL, MoneyBox* MBP, int& i) {
BuyIngredient BI;
const char *menuList[] = {"커피빈","우유", "초코", "홍차", "녹차", "사이다", "딸기", "레몬", "달걀", "밀가루", "설탕", "종료"};
int menuCnt = sizeof(menuList) / sizeof(menuList[0]);
int menuNum;
int buyCnt;
int buyMoney;
displayTitle("구매");
while (true) {
menuNum = menu(menuList, menuCnt);
if (menuNum == menuCnt) { break; }
cout << "(단위: ";
switch (menuNum) {
case 1: cout << 100 << "g) "; break;
case 2: cout << 200 << "g) "; break;
case 3: cout << 150 << "g) "; break;
case 4: cout << 150 << "g) "; break;
case 5: cout << 150 << "g) "; break;
case 6: cout << 200 << "g) "; break;
case 7: cout << 200 << "g) "; break;
case 8: cout << 200 << "g) "; break;
case 9: cout << 10 << "개) "; break;
case 10: cout << 300 << "g) "; break;
case 11: cout << 100 << "g) "; break;
default: break;
}
buyCnt = inputInteger("구매하실 묶음을 입력해주세요 : ");
buyMoney = BI.ProductCntDecreament(IL, menuNum, buyCnt);
BI.IngredientCntIncreament(IL, menuNum, buyCnt);
BI.MoneyIncreament(MBP[i], buyMoney);
}
displayTitle("구매 종료");
return;
}
void viewMenu(MoneyBox* MBP, ProductTotal* PTP, IngredientList& IL, int& i) {
const char* menuList[] = { "판매 현황","재고 현황","회계 내역","목표 매출","종료" };
int menuCnt = sizeof(menuList) / sizeof(menuList[0]);
int menuNum;
displayTitle("장부");
while (true) {
menuNum = menu(menuList, menuCnt);
if (menuNum == menuCnt) { break; }
switch (menuNum) {
case 1: PTP[i].totalView(); break;
case 2: IL.stateview(); break;
case 3: MBP[i].stateView(); break;
case 4: MBP[i-1].goalView(); break;
default:break;
}
}
displayTitle("장부 종료");
return;
}
bool deadLine(MoneyBox* MBP, int& i) {
MBP[i].setTax();
MBP[i].setProfit();
MBP[i].setGoalSellM();
MBP[i].setBePoint();
int j;
for (j = 0; j <= i; j++) {
cout << "===========" << j + 1 << "번째 달 내역" << "============" << endl;
MBP[j].stateView();
cout << "=====================================" << endl;
}
if ( MBP[i-1].getBePoint() >= MBP[i].getProfit() ) {//지난달 손익분기점을 지금현재의순이익이 못넘었을때 return false;
// cout <<MBP[i-1].getBePoint() << endl;
// cout <<MBP[i].getProfit() << endl;
cout << "손익분기점: " << MBP[i-1].getBePoint() << endl;
cout << "손익분기점을 넘지 못해서 쫒겨났어요";
return false;
} else {
MBP[i+1].setSellM(MBP[i].getProfit()*0.7);
}
cout << "손익분기점: " << MBP[i-1].getBePoint() << endl;
if ( MBP[i-1].getGoalSellM() <= MBP[i].getSellM() ) {//흑자 , 적자에 따른 것 검사 문구로 표현해준다.
cout << "목표 달성! 고생했어요";
} else {
cout << "목표 미달! 더 하세요";
}
i++;
return true;
}
void displayTitle(string title) { // 화면 타이틀 출력 함수
cout << endl << "------------------------------" << endl;
cout << " " << title << endl;
cout << "------------------------------" << endl;
}
// message를 출력하고 정수값 입력 받아 리턴(문자, 실수값 예외 처리)
int inputInteger(char* message) {
int number;
while (1) {
cout << message;
cin >> number;
if (number>0 && cin.get() == '\n') {
return number;
}
myFlush();
}
}
// message를 출력하고 정수값 입력 받아 리턴(문자, 실수값 예외 처리)
int inputInteger(string message) {
int number;
while (1) {
cout << message;
cin >> number;
if (number>0 && cin.get() == '\n') {
return number;
}
myFlush();
}
}
// 기능 : cin입력 버퍼를 모두 비우고 fail상태를 초기상태로 재설정
void myFlush() {
cin.clear(); // 에러로 설정되어있는 flag멤버의 값을 0으로 재초기화
while (cin.get() != '\n') {
; // 개행문자가 나올때까지 버퍼내의 모든 문자 지움
}
return;
}
| [
"noreply@github.com"
] | noreply@github.com |
e71efea52425a861d3b60259fed57016a68f2e48 | d6135170e6156a12d4f64cff0373ee0b00ca644b | /tensorflow/core/profiler/lib/traceme.h | 5a5ba5248565196743691c3af671e8ea1ab0374b | [
"Apache-2.0"
] | permissive | eladeban/tensorflow | 12499b0972b8aafde277b61da7bbdb1c59aa1d2a | 0d4485677356a761f21ad7223759cd89bcc9034c | refs/heads/master | 2020-06-04T03:28:24.373618 | 2019-06-13T22:37:52 | 2019-06-13T22:49:52 | 191,843,388 | 4 | 1 | Apache-2.0 | 2019-06-13T22:54:36 | 2019-06-13T22:54:36 | null | UTF-8 | C++ | false | false | 8,528 | h | /* Copyright 2018 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.
==============================================================================*/
#ifndef TENSORFLOW_CORE_PROFILER_LIB_TRACEME_H_
#define TENSORFLOW_CORE_PROFILER_LIB_TRACEME_H_
#include <string>
#include "absl/strings/string_view.h"
#include "tensorflow/core/platform/env.h"
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/types.h"
#include "tensorflow/core/profiler/internal/traceme_recorder.h"
namespace tensorflow {
namespace profiler {
// This is specifically used for instrumenting Tensorflow ops.
// Takes input as whether a TF op is expensive or not and returns the TraceMe
// level to be assigned to trace that particular op. Assigns level 2 for
// expensive ops (these are high-level details and shown by default in profiler
// UI). Assigns level 3 for cheap ops (low-level details not shown by default).
inline int GetTFTraceMeLevel(bool is_expensive) { return is_expensive ? 2 : 3; }
// Predefined levels:
// - Level 1 (kCritical) is the default and used only for user instrumentation.
// - Level 2 (kInfo) is used by profiler for instrumenting high level program
// execution details (expensive TF ops, XLA ops, etc).
// - Level 3 (kVerbose) is also used by profiler to instrument more verbose
// (low-level) program execution details (cheap TF ops, etc).
enum TraceMeLevel {
kCritical = 1,
kInfo = 2,
kVerbose = 3,
};
// This class permits user-specified (CPU) tracing activities. A trace activity
// is started when an object of this class is created and stopped when the
// object is destroyed.
//
// CPU tracing can be useful when trying to understand what parts of GPU
// computation (e.g., kernels and memcpy) correspond to higher level activities
// in the overall program. For instance, a collection of kernels maybe
// performing one "step" of a program that is better visualized together than
// interspersed with kernels from other "steps". Therefore, a TraceMe object
// can be created at each "step".
//
// Two APIs are provided:
// (1) Scoped object: a TraceMe object starts tracing on construction, and
// stops tracing when it goes out of scope.
// {
// TraceMe trace("step");
// ... do some work ...
// }
// TraceMe objects can be members of a class, or allocated on the heap.
// (2) Static methods: ActivityStart and ActivityEnd may be called in pairs.
// auto id = ActivityStart("step");
// ... do some work ...
// ActivityEnd(id);
class TraceMe {
public:
// Constructor that traces a user-defined activity labeled with activity_name
// in the UI. Level defines the trace priority, used for filtering TraceMe
// events. By default, traces with TraceMe level <= 2 are recorded. Levels:
// - Must be a positive integer.
// - Can be a value in enum TraceMeLevel.
// Users are welcome to use level > 3 in their code, if they wish to filter
// out their host traces based on verbosity.
explicit TraceMe(absl::string_view activity_name, int level = 1) {
DCHECK_GE(level, 1);
if (TraceMeRecorder::Active(level)) {
new (&no_init_.name) string(activity_name);
start_time_ = Env::Default()->NowNanos();
} else {
start_time_ = kUntracedActivity;
}
}
// string&& constructor to prevent an unnecessary string copy, e.g. when a
// TraceMe is constructed based on the result of a StrCat operation.
// Note: We can't take the string by value because a) it would make the
// overloads ambiguous, and b) we want lvalue strings to use the string_view
// constructor so we avoid copying them when tracing is disabled.
explicit TraceMe(string &&activity_name, int level = 1) {
DCHECK_GE(level, 1);
if (TraceMeRecorder::Active(level)) {
new (&no_init_.name) string(std::move(activity_name));
start_time_ = Env::Default()->NowNanos();
} else {
start_time_ = kUntracedActivity;
}
}
// Do not allow passing strings by reference or value since the caller
// may unintentionally maintain ownership of the activity_name.
// Explicitly std::move the activity_name or wrap it in a string_view if
// you really wish to maintain ownership.
explicit TraceMe(const string &activity_name, int level = 1) = delete;
// This overload is necessary to make TraceMe's with string literals work.
// Otherwise, the string&& and the string_view constructor would be equally
// good overload candidates.
explicit TraceMe(const char *raw, int level = 1)
: TraceMe(absl::string_view(raw), level) {}
// This overload only generates the activity name if tracing is enabled.
// Useful for avoiding things like string concatenation when tracing is
// disabled. The |name_generator| may be a lambda or functor that returns a
// type that the string() constructor can take.
// name_generator is templated, rather than a std::function to avoid
// allocations std::function might make even if never called.
// Usage: profiler::TraceMe([&]{ return StrCat(prefix, ":", postfix); });
template <typename NameGeneratorT>
explicit TraceMe(NameGeneratorT name_generator, int level = 1) {
DCHECK_GE(level, 1);
if (TraceMeRecorder::Active(level)) {
new (&no_init_.name) string(name_generator());
start_time_ = Env::Default()->NowNanos();
} else {
start_time_ = kUntracedActivity;
}
}
// Stop tracing the activity. Called by the destructor, but exposed to allow
// stopping tracing before the object goes out of scope. Only has an effect
// the first time it is called.
void Stop() {
// We do not need to check the trace level again here.
// - If tracing wasn't active to start with, we have kUntracedActivity.
// - If tracing was active and was stopped, we have
// TraceMeRecorder::Active().
// - If tracing was active and was restarted at a lower level, we may
// spuriously record the event. This is extremely rare, and acceptable as
// event will be discarded when its start timestamp fall outside of the
// start/stop session timestamp.
if (start_time_ != kUntracedActivity) {
if (TraceMeRecorder::Active()) {
TraceMeRecorder::Record({kCompleteActivity, std::move(no_init_.name),
start_time_, Env::Default()->NowNanos()});
}
no_init_.name.~string();
start_time_ = kUntracedActivity;
}
}
~TraceMe() { Stop(); }
// TraceMe is not movable or copyable.
TraceMe(const TraceMe &) = delete;
TraceMe &operator=(const TraceMe &) = delete;
// Static API, for use when scoped objects are inconvenient.
// Record the start time of an activity.
// Returns the activity ID, which is used to stop the activity.
static uint64 ActivityStart(absl::string_view name, int level = 1) {
return TraceMeRecorder::Active(level) ? ActivityStartImpl(name)
: kUntracedActivity;
}
// Record the end time of an activity started by ActivityStart().
static void ActivityEnd(uint64 activity_id) {
// We don't check the level again (see ~TraceMe()).
if (activity_id != kUntracedActivity) {
if (TraceMeRecorder::Active()) {
ActivityEndImpl(activity_id);
}
}
}
private:
// Activity ID or start time used when tracing is disabled.
constexpr static uint64 kUntracedActivity = 0;
// Activity ID used as a placeholder when both start and end are present.
constexpr static uint64 kCompleteActivity = 1;
static uint64 ActivityStartImpl(absl::string_view activity_name);
static void ActivityEndImpl(uint64 activity_id);
// Wrap the name into a union so that we can avoid the cost of string
// initialization when tracing is disabled.
union NoInit {
NoInit() {}
~NoInit() {}
string name;
} no_init_;
uint64 start_time_;
};
} // namespace profiler
} // namespace tensorflow
#endif // TENSORFLOW_CORE_PROFILER_LIB_TRACEME_H_
| [
"gardener@tensorflow.org"
] | gardener@tensorflow.org |
db70f3155aa2b3b2f9463f647758a897063d6a11 | 89dfc7acf9c1bdccb12ea2a4f1b73b250fced2f9 | /C/ex_0/hw.cpp | 4b518a06f9ce00e4cf284ef73514e32380f0f6af | [] | no_license | kes021/test | dfa802cc6e30dfe0305b5fbe40dccc04033fa424 | 11be4c65e23408965da3b8da08f32b17fe17a107 | refs/heads/master | 2020-03-18T18:13:13.604945 | 2018-05-27T20:21:15 | 2018-05-27T20:21:15 | 135,077,289 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 547 | cpp | #include <iostream>
// we need the following include for setw() in some c++ implementations
#include <iomanip>
using namespace std;
int main() {
// set up cout to right-align
cout << setiosflags(ios::left);
// the first for loop will handle the rows
for (int i = 0; i < 6; i++) {
// the second for loop will handle the columns
for (int j = 0; j < 4 ; j++)
// setw(int) sets the column width
cout << "Hello World!";
// this next line is a part of the first for loop
// and causes the new line
cout << endl;
}
return 0;
}
| [
"samedduzlu@Sameds-MBP.local"
] | samedduzlu@Sameds-MBP.local |
699847ca68b7571cfb1d55d249c7dc5ae07bda27 | ab69d345c479ae918380c8cb7e4102ab256bf336 | /REAPER/Plugin/3rd_party/taglib/include/mpeg/mpegutils.h | 1cee918a6cddc78f3d3832adc2770c0a4484b031 | [
"MIT"
] | permissive | Pfaufisch/ultraschall-3 | 0e4a1ae978460b5d5f2181f5f5c09a1d7aacaa83 | 78493e92086445e6ecaf50cd79783578ba5d465d | refs/heads/master | 2020-04-15T21:16:15.554632 | 2018-01-17T20:23:18 | 2018-01-17T20:23:18 | 165,026,741 | 0 | 0 | MIT | 2019-01-10T09:04:05 | 2019-01-10T09:04:05 | null | UTF-8 | C++ | false | false | 2,670 | h | /***************************************************************************
copyright : (C) 2015 by Tsuda Kageyu
email : tsuda.kageyu@gmail.com
***************************************************************************/
/***************************************************************************
* This library is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License version *
* 2.1 as published by the Free Software Foundation. *
* *
* 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., 51 Franklin Street, Fifth Floor, Boston, MA *
* 02110-1301 USA *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#ifndef TAGLIB_MPEGUTILS_H
#define TAGLIB_MPEGUTILS_H
// THIS FILE IS NOT A PART OF THE TAGLIB API
#ifndef DO_NOT_DOCUMENT // tell Doxygen not to document this header
namespace TagLib
{
namespace MPEG
{
namespace
{
/*!
* MPEG frames can be recognized by the bit pattern 11111111 111, so the
* first byte is easy to check for, however checking to see if the second byte
* starts with \e 111 is a bit more tricky, hence these functions.
*
* \note This does not check the length of the vector, since this is an
* internal utility function.
*/
inline bool isFrameSync(const ByteVector &bytes)
{
// 0xFF in the second byte is possible in theory, but it's very unlikely.
const unsigned char b1 = bytes[0];
const unsigned char b2 = bytes[1];
return (b1 == 0xFF && b2 != 0xFF && (b2 & 0xE0) == 0xE0);
}
}
}
}
#endif
#endif
| [
"heiko@panjas.com"
] | heiko@panjas.com |
0b385493ad4314d56fd9ea22f3f847696a7b7e27 | 8dc84558f0058d90dfc4955e905dab1b22d12c08 | /net/third_party/spdy/core/hpack/hpack_round_trip_test.cc | f60d376227868e25faff46f23bda712aa4ebdf09 | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause"
] | permissive | meniossin/src | 42a95cc6c4a9c71d43d62bc4311224ca1fd61e03 | 44f73f7e76119e5ab415d4593ac66485e65d700a | refs/heads/master | 2022-12-16T20:17:03.747113 | 2020-09-03T10:43:12 | 2020-09-03T10:43:12 | 263,710,168 | 1 | 0 | BSD-3-Clause | 2020-05-13T18:20:09 | 2020-05-13T18:20:08 | null | UTF-8 | C++ | false | false | 8,119 | cc | // 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.
#include <cmath>
#include <ctime>
#include <vector>
#include "base/rand_util.h"
#include "net/third_party/spdy/core/hpack/hpack_constants.h"
#include "net/third_party/spdy/core/hpack/hpack_decoder_adapter.h"
#include "net/third_party/spdy/core/hpack/hpack_encoder.h"
#include "net/third_party/spdy/core/spdy_test_utils.h"
#include "net/third_party/spdy/platform/api/spdy_string.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace spdy {
namespace test {
namespace {
// Supports testing with the input split at every byte boundary.
enum InputSizeParam { ALL_INPUT, ONE_BYTE, ZERO_THEN_ONE_BYTE };
class HpackRoundTripTest : public ::testing::TestWithParam<InputSizeParam> {
protected:
HpackRoundTripTest() : encoder_(ObtainHpackHuffmanTable()), decoder_() {}
void SetUp() override {
// Use a small table size to tickle eviction handling.
encoder_.ApplyHeaderTableSizeSetting(256);
decoder_.ApplyHeaderTableSizeSetting(256);
}
bool RoundTrip(const SpdyHeaderBlock& header_set) {
SpdyString encoded;
encoder_.EncodeHeaderSet(header_set, &encoded);
bool success = true;
if (GetParam() == ALL_INPUT) {
// Pass all the input to the decoder at once.
success = decoder_.HandleControlFrameHeadersData(encoded.data(),
encoded.size());
} else if (GetParam() == ONE_BYTE) {
// Pass the input to the decoder one byte at a time.
const char* data = encoded.data();
for (size_t ndx = 0; ndx < encoded.size() && success; ++ndx) {
success = decoder_.HandleControlFrameHeadersData(data + ndx, 1);
}
} else if (GetParam() == ZERO_THEN_ONE_BYTE) {
// Pass the input to the decoder one byte at a time, but before each
// byte pass an empty buffer.
const char* data = encoded.data();
for (size_t ndx = 0; ndx < encoded.size() && success; ++ndx) {
success = (decoder_.HandleControlFrameHeadersData(data + ndx, 0) &&
decoder_.HandleControlFrameHeadersData(data + ndx, 1));
}
} else {
ADD_FAILURE() << "Unknown param: " << GetParam();
}
if (success) {
success = decoder_.HandleControlFrameHeadersComplete(nullptr);
}
EXPECT_EQ(header_set, decoder_.decoded_block());
return success;
}
size_t SampleExponential(size_t mean, size_t sanity_bound) {
return std::min<size_t>(-std::log(base::RandDouble()) * mean, sanity_bound);
}
HpackEncoder encoder_;
HpackDecoderAdapter decoder_;
};
INSTANTIATE_TEST_CASE_P(Tests,
HpackRoundTripTest,
::testing::Values(ALL_INPUT,
ONE_BYTE,
ZERO_THEN_ONE_BYTE));
TEST_P(HpackRoundTripTest, ResponseFixtures) {
{
SpdyHeaderBlock headers;
headers[":status"] = "302";
headers["cache-control"] = "private";
headers["date"] = "Mon, 21 Oct 2013 20:13:21 GMT";
headers["location"] = "https://www.example.com";
EXPECT_TRUE(RoundTrip(headers));
}
{
SpdyHeaderBlock headers;
headers[":status"] = "200";
headers["cache-control"] = "private";
headers["date"] = "Mon, 21 Oct 2013 20:13:21 GMT";
headers["location"] = "https://www.example.com";
EXPECT_TRUE(RoundTrip(headers));
}
{
SpdyHeaderBlock headers;
headers[":status"] = "200";
headers["cache-control"] = "private";
headers["content-encoding"] = "gzip";
headers["date"] = "Mon, 21 Oct 2013 20:13:22 GMT";
headers["location"] = "https://www.example.com";
headers["set-cookie"] =
"foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU;"
" max-age=3600; version=1";
headers["multivalue"] = SpdyString("foo\0bar", 7);
EXPECT_TRUE(RoundTrip(headers));
}
}
TEST_P(HpackRoundTripTest, RequestFixtures) {
{
SpdyHeaderBlock headers;
headers[":authority"] = "www.example.com";
headers[":method"] = "GET";
headers[":path"] = "/";
headers[":scheme"] = "http";
headers["cookie"] = "baz=bing; foo=bar";
EXPECT_TRUE(RoundTrip(headers));
}
{
SpdyHeaderBlock headers;
headers[":authority"] = "www.example.com";
headers[":method"] = "GET";
headers[":path"] = "/";
headers[":scheme"] = "http";
headers["cache-control"] = "no-cache";
headers["cookie"] = "foo=bar; spam=eggs";
EXPECT_TRUE(RoundTrip(headers));
}
{
SpdyHeaderBlock headers;
headers[":authority"] = "www.example.com";
headers[":method"] = "GET";
headers[":path"] = "/index.html";
headers[":scheme"] = "https";
headers["custom-key"] = "custom-value";
headers["cookie"] = "baz=bing; fizzle=fazzle; garbage";
headers["multivalue"] = SpdyString("foo\0bar", 7);
EXPECT_TRUE(RoundTrip(headers));
}
}
TEST_P(HpackRoundTripTest, RandomizedExamples) {
// Grow vectors of names & values, which are seeded with fixtures and then
// expanded with dynamically generated data. Samples are taken using the
// exponential distribution.
std::vector<SpdyString> pseudo_header_names, random_header_names;
pseudo_header_names.push_back(":authority");
pseudo_header_names.push_back(":path");
pseudo_header_names.push_back(":status");
// TODO(jgraettinger): Enable "cookie" as a name fixture. Crumbs may be
// reconstructed in any order, which breaks the simple validation used here.
std::vector<SpdyString> values;
values.push_back("/");
values.push_back("/index.html");
values.push_back("200");
values.push_back("404");
values.push_back("");
values.push_back("baz=bing; foo=bar; garbage");
values.push_back("baz=bing; fizzle=fazzle; garbage");
int seed = std::time(NULL);
LOG(INFO) << "Seeding with srand(" << seed << ")";
srand(seed);
for (size_t i = 0; i != 2000; ++i) {
SpdyHeaderBlock headers;
// Choose a random number of headers to add, and of these a random subset
// will be HTTP/2 pseudo headers.
size_t header_count = 1 + SampleExponential(7, 50);
size_t pseudo_header_count =
std::min(header_count, 1 + SampleExponential(7, 50));
EXPECT_LE(pseudo_header_count, header_count);
for (size_t j = 0; j != header_count; ++j) {
SpdyString name, value;
// Pseudo headers must be added before regular headers.
if (j < pseudo_header_count) {
// Choose one of the defined pseudo headers at random.
size_t name_index = base::RandGenerator(pseudo_header_names.size());
name = pseudo_header_names[name_index];
} else {
// Randomly reuse an existing header name, or generate a new one.
size_t name_index = SampleExponential(20, 200);
if (name_index >= random_header_names.size()) {
name = base::RandBytesAsString(1 + SampleExponential(5, 30));
// A regular header cannot begin with the pseudo header prefix ":".
if (name[0] == ':') {
name[0] = 'x';
}
random_header_names.push_back(name);
} else {
name = random_header_names[name_index];
}
}
// Randomly reuse an existing value, or generate a new one.
size_t value_index = SampleExponential(20, 200);
if (value_index >= values.size()) {
SpdyString newvalue =
base::RandBytesAsString(1 + SampleExponential(15, 75));
// Currently order is not preserved in the encoder. In particular,
// when a value is decomposed at \0 delimiters, its parts might get
// encoded out of order if some but not all of them already exist in
// the header table. For now, avoid \0 bytes in values.
std::replace(newvalue.begin(), newvalue.end(), '\x00', '\x01');
values.push_back(newvalue);
value = values.back();
} else {
value = values[value_index];
}
headers[name] = value;
}
EXPECT_TRUE(RoundTrip(headers));
}
}
} // namespace
} // namespace test
} // namespace spdy
| [
"arnaud@geometry.ee"
] | arnaud@geometry.ee |
d20ccff39be644b7d137c8ad79fee7b351968fae | 2590a403359ff526884c20d855837c1384d38d0d | /src/doctor_scan/axis.cpp | cde8877a43f0944bbb0237f8f85712dce065e327 | [] | no_license | jerusalem-science-museum/hbp_doctor_scan | 2fb2e532d925e4f4c4a1fdf2ca92d996457301a4 | fdcca4f04e465a1036a5a307b52ab3e399883f24 | refs/heads/master | 2020-06-29T03:19:46.783366 | 2019-08-03T21:59:45 | 2019-08-03T21:59:45 | 200,424,582 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 641 | cpp | #include "axis.h"
Axis::Axis(uint8_t step_pin, uint8_t dir_pin, uint8_t en_pin, uint8_t led_pin)
{
_step_pin = step_pin;
_dir_pin = dir_pin;
_en_pin = en_pin;
_led_pin = led_pin;
}
void Axis::init(void)
{
pinMode(_en_pin, OUTPUT);
pinMode(_led_pin, OUTPUT);
set_led(false);
move(0);
SpeedyStepper::connectToPins(_step_pin, _dir_pin);
SpeedyStepper::setAccelerationInStepsPerSecondPerSecond(AXIS_ACCL);
}
void Axis::move(int16_t steps, uint16_t speed)
{
digitalWrite(_en_pin, false);
SpeedyStepper::moveRelativeInSteps(steps);
digitalWrite(_en_pin, true);
}
void Axis::set_led(bool is_on)
{
digitalWrite(_led_pin, is_on);
}
| [
"arduino12@users.noreply.github.com"
] | arduino12@users.noreply.github.com |
42e6d1f41d36fe268fa5689b5f2643a5d0c169ce | f048aeb9134fd47caf267a22d15633212a101b1b | /enc_temp_folder/8f4466dcdc2b5e97b5fe6b4fcb373b72/PickupSpawnPoint.cpp | f6c99d75171ceaef0e54a0d405467b45b5c95750 | [] | no_license | ventz-lgtm/Yr2VehicleProject | 313ce7be23e759b609f752ff12e32f6433bac28d | d63cc7f66ea4f30171b98549ded4819dc47cc933 | refs/heads/master | 2022-08-07T19:23:51.600702 | 2018-12-14T21:18:04 | 2018-12-14T21:18:04 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,136 | cpp | // Fill out your copyright notice in the Description page of Project Settings.
#include "PickupSpawnPoint.h"
#include "Runtime/Engine/Classes/Engine/World.h"
// Sets default values
APickupSpawnPoint::APickupSpawnPoint()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
}
// Called when the game starts or when spawned
void APickupSpawnPoint::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void APickupSpawnPoint::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
APickup* APickupSpawnPoint::SpawnActor() {
UWorld* pWorld = GetWorld();
FVector position = GetActorLocation() + FVector(0, 50.f, 0);
FRotator angle = FRotator(0, 0, 0);
FActorSpawnParameters params;
params.Owner = this;
int len = SpawnClasses.Num();
if (len <= 0) { return NULL; }
int index = (int)FMath::RandRange(1, len) - 1;
if (index > len) { index = len; }
TSubclassOf<APickup> spawnClass = SpawnClasses[index];
APickup* pSpawned = pWorld->SpawnActor<APickup>(spawnClass, position, angle, params);
return pSpawned;
}
| [
"dhog10@googlemail.com"
] | dhog10@googlemail.com |
c6b6fad1c471d31ad10a4c6d4df0f63ef4ddeb08 | b5fefbef78d47291be2459bea41dff62dc48a5a7 | /samples/table_sample.cpp | e500f3de08fe9a7c70c9c83dadca2eb933509cc4 | [] | no_license | NebukinaVA/Table | 67f319042ebc1dba80b178a8ab5fce8760196e54 | 9558c8d759478e6959ed4ed0af82c2446edc28bb | refs/heads/master | 2023-08-21T04:23:02.201396 | 2021-10-11T15:51:50 | 2021-10-11T15:51:50 | 361,729,401 | 0 | 0 | null | 2021-05-28T00:18:39 | 2021-04-26T11:44:22 | C++ | UTF-8 | C++ | false | false | 194 | cpp | #include <iostream>
#include "table.h"
void main()
{
OrderedTable<int> ot;
ot.insert(1, 10);
ot.insert(4, 20);
ot.insert(10, 1);
ot.insert(2, 50);
ot.insert(12, 40);
std::cout << ot;
}
| [
"sadpool@mail.ru"
] | sadpool@mail.ru |
76d5fae821f5ddc30cd290d9d767fe623083039f | 9745a3677f650227f6f6d0ff11431222238df019 | /v2_module/t_DoG_at_OGMs.cpp | b3d41f00f704442950b67eb993c44c9ea52ae532 | [] | no_license | ky8778/VeinRecognition | c2f7c7effee70e1fc6ae0610bac6b3fb78af0761 | b0d42ca4a783e022a7dfd392208199f0f206df23 | refs/heads/main | 2023-05-12T13:46:45.667920 | 2021-06-04T11:26:24 | 2021-06-04T11:26:24 | 368,803,873 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,141 | cpp | //#define OGMs
#ifdef OGMs
#include<opencv2/imgproc.hpp>
#include<opencv2/highgui.hpp>
#include<opencv2/imgcodecs.hpp>
#include<stdio.h>
#include<iostream>
#include<math.h>
#include<stdlib.h>
#define Pi 3.14159265359
using namespace cv;
using namespace std;
Mat src, src_gray;
int kernel_12[9] = { -1,0,1,-1,0,1,-1,0,1 };
int kernel_34[9] = { -1,-1,-1,0,0,0,1,1,1 };
int kernel_56[9] = { 1,0,-1,1,0,-1,1,0,-1 };
int kernel_70[9] = { 1,1,1,0,0,0,-1,-1,-1 };
int thresh = 160;
double gaussian_kernel[5][5];
double gaussian_kernel_k[5][5];
int main() {
printf("Oriented Gradient Maps (OGMs)\n");
src = imread("palm_1.png", IMREAD_COLOR);
cvtColor(src, src_gray, COLOR_BGR2GRAY);
int scale = 3;
int kscale;
kscale = (int)scale * 1.6;
if (kscale % 2 == 0)
kscale++;
if (src.empty())
{
cout << "Could not open or find the image!\n" << endl;
//cout << "Usage: " << argv[0] << " <Input image>" << endl;
return -1;
}
imshow("original", src);
// create gaussian kernel
double r, s = (double)(2.0 * scale * scale); // Assigning standard deviation to 1.0
double sum = 0.0; // Initialization of sun for normalization
int x, y;
for (x = -2; x <= 2; x++) // Loop to generate 5x5 kernel
{
for (y = -2; y <= 2; y++)
{
r = sqrt(x*x + y * y);
gaussian_kernel[x + 2][y + 2] = (exp(-(r*r) / s)) / (Pi * s);
sum += gaussian_kernel[x + 2][y + 2];
}
}
for (int i = 0; i < 5; ++i) // Loop to normalize the kernel
for (int j = 0; j < 5; ++j)
gaussian_kernel[i][j] /= sum;
/*
for (int i = 0; i < 5; ++i) // loop to display the generated 5 x 5 Gaussian filter
{
for (int j = 0; j < 5; ++j)
cout << gaussian_kernel[i][j] << "\t";
cout << endl;
}
*/
// create k gaussian kernel
s = (double)(2.0 * kscale * kscale);
sum = 0.0;
for (x = -2; x <= 2; x++) // Loop to generate 5x5 kernel
{
for (y = -2; y <= 2; y++)
{
r = sqrt(x*x + y * y);
gaussian_kernel_k[x + 2][y + 2] = (exp(-(r*r) / s)) / (Pi * s);
sum += gaussian_kernel_k[x + 2][y + 2];
}
}
for (int i = 0; i < 5; ++i) // Loop to normalize the kernel
for (int j = 0; j < 5; ++j)
gaussian_kernel_k[i][j] /= sum;
/*
for (int i = 0; i < 5; ++i) // loop to display the generated 5 x 5 Gaussian filter
{
for (int j = 0; j < 5; ++j)
cout << gaussian_kernel_k[i][j] << "\t";
cout << endl;
}
*/
int height = src.rows;
int width = src.cols;
int I = 0;
Mat dst = Mat::zeros(src.size(), CV_32FC1);
Mat dst_gaussian = Mat::zeros(src.size(), CV_32FC1);
Mat dst_kgaussian = Mat::zeros(src.size(), CV_32FC1);
// create OGMs
/* dir 1,3,5,7 */
for (int j = 2; j < height-2; j++) {
for (int i = 2; i < width-2; i++) {
for(int m=0;m<9;m++){
x = i - 2 + m / 3 + m % 3;
y = j + m / 3 - m % 3;
I+=(src_gray.at<uchar>(y, x)*kernel_56[m]);
}
//printf("%d\t", I);
if (I < 0) I = 0;
dst.at<float>(j, i) = (float)I;
I = 0;
}
}
/* dir 0,2,4,6
for (int j = 1; j < height - 1; j++) {
for (int i = 1; i < width - 1; i++) {
for (int m = 0; m < 9; m++) {
x = i + m % 3 - 1;
y = j + m / 3 - 1;
I += (src_gray.at<uchar>(y, x)*kernel_56[m]);
}
if (I < 0) I = 0;
dst.at<float>(j, i) = (float)I;
I = 0;
}
}
*/
// normalize OGMs
Mat dst_norm, dst_norm_scaled;
normalize(dst, dst_norm, 0, 255, NORM_MINMAX, CV_32FC1, Mat());
convertScaleAbs(dst_norm, dst_norm_scaled);
double G = 0.0;
// gaussian filtering
for (int j = 2; j < height-2; j++) {
for (int i = 2; i < width-2; i++) {
for (x = -2; x <= 2; x++) // Loop to generate 5x5 kernel
for (y = -2; y <= 2; y++)
G += ((double)dst.at<float>(j + y,i+x)*gaussian_kernel[x + 2][y + 2]);
dst_gaussian.at<float>(j, i) = (float)G;
G = 0.0;
}
}
// k_gaussian filtering
for (int j = 2; j < height - 2; j++) {
for (int i = 2; i < width - 2; i++) {
for (x = -2; x <= 2; x++) // Loop to generate 5x5 kernel
for (y = -2; y <= 2; y++)
G += ((double)dst.at<float>(j + y, i + x)*gaussian_kernel_k[x + 2][y + 2]);
dst_kgaussian.at<float>(j, i) = (float)G;
G = 0.0;
}
}
// DoG at OGMs
for (int j = 0; j < height; j++) {
for (int i = 0; i < width; i++) {
dst.at<float>(j, i) = dst_gaussian.at<float>(j, i) - dst_kgaussian.at<float>(j, i);
}
}
// normalize DoG at OGMs
Mat dog_norm, dog_norm_scaled;
normalize(dst, dog_norm, 0, 255, NORM_MINMAX, CV_32FC1, Mat());
convertScaleAbs(dog_norm, dog_norm_scaled);
int num = 0,temp;
// print DoG at OGMs
for (int j = 0; j < height; j++) {
for (int i = 0; i < width; i++) {
temp = dog_norm_scaled.at<uchar>(j, i);
//printf("%d\t", temp);
if (temp > thresh) {
num++;
circle(dog_norm_scaled, Point(i, j), scale, Scalar(0, 0, 255), 2, 8, 0);
circle(src, Point(i, j), scale, Scalar(0, 0, 255), 2, 8, 0);
}
}
}
printf("%d", num);
imshow("OGMs", dst_norm_scaled);
imshow("DoG at OGMs", dog_norm_scaled);
imshow("red circle", src);
waitKey();
return 0;
}
#endif | [
"gunyoung8778@gmail.com"
] | gunyoung8778@gmail.com |
fe59fdb5579cc5cac0b928493466f57ca9a2897a | f68c94cbb18fe51bb7e90965b61d97c2b481f385 | /Siddhesh/Leetcode/SingleNumber.cpp | 2f41d55b85d916c445ee826be4b9f89a9c4624c8 | [] | no_license | piyushnbali/competitive-coding | d75b953926e860248aa4f22eed8592f064ff88cf | f16bb1c62ff7f7328b05c664dffdbc051c7f3c8f | refs/heads/master | 2021-05-25T15:09:16.806077 | 2021-03-23T06:48:33 | 2021-03-23T06:48:33 | 253,802,117 | 15 | 36 | null | 2023-08-30T10:28:33 | 2020-04-07T13:32:08 | JavaScript | UTF-8 | C++ | false | false | 913 | cpp | /* MY INITIAL APPROACH:: Time O(n), Space O(n)
Used a haspmap...
class Solution {
public:
int singleNumber(vector<int>& nums) {
map<int,int> m;
for(int a:nums){
m[a]++;
}
for (auto b:m){
if(b.second==1){
return b.first;
break;
}
}
return 0;
}
};
*/
/*Following is a better approach which uses xor operator: Time O(n), Space O(1) ... runs in 12ms
NOTE: 1. 0 ^ (xor) a number = that number itself
2. number ^ same number = 0
3. thus if a number comes two times then value of xor always becomes 0.
4. if a number occurs only once then the final value after all xor operations is equal to that number!
*/
class Solution {
public:
int singleNumber(vector<int>& nums) {
int x=0;
for (int a: nums){
x=x^a;
}
return x;
}
};
| [
"noreply@github.com"
] | noreply@github.com |
f4c7ac799f06f716eff34c612bb41649eba6619d | b309e5b90d5eb3bd25ec4474cc4d4e9bc0ae1d2b | /klist/0.0.0/Klist.h | 9bf8e7ff131460eb5b9df07cdb2e6af1fc4d934a | [] | no_license | keyu-tian/Data-Structure-Cpp11 | 6c2447c87563dac41fa2b6bf5e224d39ae162e45 | 00c88bd9fd7ab301f15b0624f64585b2f7f2ae54 | refs/heads/master | 2021-09-22T22:22:50.759311 | 2018-09-17T17:18:51 | 2018-09-17T17:18:51 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,475 | h | /*
名称: 双向循环链表模板类
作者: Kevin
创建日期: 2018/09/03 22:45
当前最高版本: 0.0.0
0.0 概况:
-0 链表的首版本
-1 实现链表的基本操作
-2 没有实现迭代器
0.0.0 更新: 2018/09/03 22:45
-0 新增加了链表的构造、析构函数
-1 新增加了链表的判断空和获取结点个数函数
-2 新增加了链表的获取头尾数据函数
-3 新增加了链表的清空、顺序打印、逆序打印函数
-4 新增加了链表的头尾增删操作函数
*/
#ifndef INC_KLIST
#define INC_KLIST
#include <iostream>
namespace kstl
{
template <typename Type>
class Klist
{
private:
// 内部类:链表的结点
struct Node
{
Type data;
Node *prev;
Node *next;
Node(void) { }
Node(Type data) : data(data) { }
Node(Node *prev, Node *next, Type data) :
prev(prev), next(next), data(data) { }
};
// 基础变量:
unsigned int cnt; // 记录链表当前结点个数
Node *head; // 链表头指针
Node *tail; // 链表尾指针
private:
// 向空链表中插入第一个结点
inline void push_first(Type first_data)
{
Node *pNewNode = new Node(first_data);
pNewNode->next = pNewNode->prev = pNewNode;
head = tail = pNewNode;
cnt = 1;
}
// 删除单节点链表的唯一结点
inline void pop_last(void)
{
delete head;
head = tail = nullptr;
cnt = 0;
}
// 删除指针指向的结点
inline void delete_node(Node *pNode)
{
pNode->prev->next = pNode->next;
pNode->next->prev = pNode->prev;
delete pNode;
--cnt;
}
// 向指针指向结点之前插入节点
inline void insert_prev(Node *pNode, Type data)
{
Node *pNewNode = new Node(pNode->prev, pNode, data);
pNode->prev->next = pNewNode;
pNode->prev = pNewNode;
cnt++;
}
// 向指针指向结点之后插入节点
inline void insert_next(Node *pNode, Type data)
{
Node *pNewNode = new Node(pNode, pNode->next, data);
pNode->next->prev = pNewNode;
pNode->next = pNewNode;
cnt++;
}
public:
Klist(void) : cnt(0), head(nullptr), tail(nullptr) { }
Klist(Type *array, unsigned int len)
{
push_first(array[0]); // 向空链表内插入第一个结点
for(int i=1; i<len; i++) // 按序插入剩下的结点
{
push_back(array[i]);
}
}
~Klist(void)
{
clear();
}
bool empty(void)
{
return 0 == cnt;
}
unsigned int size(void)
{
return cnt;
}
const Type &front(void)
{
if (cnt) // 链表不空,才可获取
{
return head->data;
}
}
const Type &back(void)
{
if (cnt) // 链表不空,才可获取
{
return tail->data;
}
}
void clear(void)
{
if (cnt) // 链表不空,才需清除
{
for (Node *now=head, *next; now!=tail; now=next)
{
next = now->next;
delete now;
}
delete tail;
}
}
// 整个打印链表(结点数据需要支持 std::cout)
void print(void)
{
if (cnt) // 链表不空,才可打印
{
for(Node *p=head; p!=tail; p=p->next)
{
std::cout << p->data << " <-> ";
}
std::cout << tail->data << std::endl;
}
}
// 逆序打印整个链表(结点数据需要支持 std::cout)
void rprint(void)
{
if (cnt) // 链表不空,才可打印
{
for(Node *p=tail; p!=head; p=p->prev)
{
std::cout << p->data << " <-> ";
}
std::cout << head->data << std::endl;
}
}
void push_front(const Type &data)
{
if (cnt) // 链表不空,正常头插
{
insert_prev(head, data);
head = head->prev;
}
else // 否则用data初始化链表
{
push_first(data);
}
}
void push_back(const Type &data)
{
if (cnt) // 链表不空,正常尾插
{
insert_next(tail, data);
tail = tail->next;
}
else // 否则用data初始化链表
{
push_first(data);
}
}
void pop_front(void)
{
if ( 1==cnt ) // 链表只有一个元素
{
pop_last();
}
else if ( 1<cnt ) // 链表不只有一个结点,正常删除头结点
{
Node *oldHead = head;
head = head->next;
delete_node(oldHead);
}
}
void pop_back(void)
{
if ( 1==cnt ) // 链表只有一个元素
{
pop_last();
}
else if ( 1<cnt ) // 链表不只有一个结点,正常删除尾结点
{
Node *oldTail = tail;
tail = tail->prev;
delete_node(oldTail);
}
}
};
} // namespace kstl
#endif // INC_KLIST
| [
"noreply@github.com"
] | noreply@github.com |
371eed21ffc46c44db63a9c0907c431abca5dc3b | 3330465c811fd8e17b43ba191693550cf7da77c1 | /FMFG/cfg/RHS/TraderCategoriesRHS.hpp | 7a7d5f0bc075adacbd22991d1a8760e4ea682dc3 | [] | no_license | red281gt/FMFGExile.Namalsk | cc37aa2a3d6fbec354840d4da1c4708d2d2b6851 | 8a3eb3947ba2ba5a27150343e7a531375c88c8a6 | refs/heads/master | 2021-01-10T05:07:02.921797 | 2016-03-30T04:49:33 | 2016-03-30T04:49:33 | 53,828,601 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,234 | hpp | class RHSUniforms
{
name = "RHS Uniforms";
icon = "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\uniform_ca.paa";
items[] =
{
"rhs_uniform_cu_ocp",
"rhs_uniform_cu_ucp",
"rhs_uniform_cu_ocp_101st",
"rhs_uniform_df15",
"rhs_uniform_m88_patchless",
"rhs_uniform_emr_patchless",
"rhs_uniform_flora_patchless",
"rhs_uniform_flora_patchless_alt",
"rhs_uniform_FROG01_m81",
"rhs_uniform_FROG01_d",
"rhs_uniform_FROG01_wd",
"rhs_uniform_m88_patchless",
"rhs_uniform_mflora_patchless",
"rhs_uniform_vdv_mflora",
"rhs_chdkz_uniform_1",
"rhs_chdkz_uniform_2",
"rhs_chdkz_uniform_3",
"rhs_chdkz_uniform_4",
"rhs_chdkz_uniform_5"
};
};
class RHSVests
{
name = "RHS Vests";
icon = "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\vest_ca.paa";
items[] =
{
"rhs_6sh92",
"rhs_6sh92_radio",
"rhs_6sh92_vog",
"rhs_6sh92_vog_headset",
"rhs_6sh92_headset",
"rhs_6sh92_digi",
"rhs_6sh92_digi_radio",
"rhs_6sh92_digi_vog",
"rhs_6sh92_digi_vog_headset",
"rhs_6sh92_digi_headset",
"rhs_6sh92_vog_head",
"rhs_vydra_3m",
"rhs_6b13",
"rhs_6b13_EMR",
"rhsusf_iotv_ocp",
"rhsusf_iotv_ocp_Rifleman",
"rhsusf_iotv_ocp_Squadleader",
"rhsusf_spc_rifleman"
};
};
class RHSHeadgear
{
name = "RHS Headgear";
icon = "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\headgear_ca.paa";
items[] =
{
"rhs_6b26",
"rhs_6b26_ess",
"rhs_6b26_bala_green",
"rhs_6b27m ",
"rhs_6b27m_ml",
"rhs_6b27m_green_ess",
"rhs_6b28_flora",
"rhs_6b28_ess",
"rhs_6b28_flora_ess",
"rhs_6b28_green_ess_bala",
"rhs_tsh4",
"rhs_tsh4_ess",
"rhs_tsh4_bala",
"rhsusf_lwh_helmet_marpatwd_ess",
"rhsusf_lwh_helmet_marpatwd",
"rhsusf_mich_helmet_marpatwd",
"rhsusf_mich_helmet_marpatwd_headset",
"rhsusf_mich_helmet_marpatwd_norotos",
"rhsusf_mich_bare",
"rhsusf_mich_bare_alt",
"rhsusf_mich_bare_tan",
"rhs_ssh68"
};
};
class RHSPointerAttachments
{
name = "RHS Pointer Attachments";
icon = "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\itemacc_ca.paa";
items[] =
{
"rhsusf_acc_anpeq15side",
"rhsusf_acc_anpeq15",
"rhsusf_acc_anpeq15A",
"rhsusf_acc_anpeq15_light"
};
};
class RHSBipodAttachments
{
name = "RHS Bipod Attachments";
icon = "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\itembipod_ca.paa";
items[] =
{
"rhsusf_acc_harris_bipod"
};
};
class RHSMuzzleAttachments
{
name = "RHS Suppressor Attachments";
icon = "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\itemmuzzle_ca.paa";
items[] =
{
"rhsusf_acc_rotex5_grey",
"rhsusf_acc_rotex5_tan",
"rhsusf_acc_nt4_black",
"rhsusf_acc_nt4_tan",
"rhsusf_acc_SF3P556",
"rhsusf_acc_SFMB556",
"rhsusf_acc_SR25S",
"rhsusf_acc_M2010S",
"rhs_acc_dtk4short",
"rhs_acc_dtk4long",
"rhs_acc_dtk4screws",
"rhs_acc_tgpa",
"rhs_acc_pbs1",
"rhs_acc_dtk3",
"rhs_acc_dtk1",
"rhs_acc_dtk",
"rhs_acc_dtk1l",
"rhs_acc_ak5"
};
};
class RHSOpticAttachments
{
name = "RHS Scopes";
icon = "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\itemoptic_ca.paa";
items[] =
{
"rhsusf_acc_eotech_552",
"rhsusf_acc_LEUPOLDMK4",
"rhsusf_acc_ELCAN",
"rhsusf_acc_ELCAN_pip",
"rhsusf_acc_ACOG",
"rhsusf_acc_ACOG_pip",
"rhs_acc_1pn93_2",
"rhsusf_acc_ACOG2",
"rhsusf_acc_ACOG_USMC",
"rhsusf_acc_ACOG2_USMC",
"rhsusf_acc_ACOG3_USMC",
"rhsusf_acc_LEUPOLDMK4_2",
"rhsusf_acc_EOTECH",
"rhs_acc_1p29",
"rhs_acc_1p78",
"rhs_acc_pkas",
"rhs_acc_1p63",
"rhs_acc_ekp1",
"rhs_acc_pso1m2",
"rhs_acc_pgo7v",
"rhs_acc_1pn93_1",
"rhs_acc_pso1m21"
};
};
class RHSPistols
{
name = "RHS Pistols";
icon = "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\itemacc_ca.paa";
items[]=
{
"rhs_weap_pya",
"rhs_weap_makarov_pmm",
"rhsusf_weap_m1911a1",
"rhsusf_weap_glock17g4",
"rhsusf_weap_m9"
};
};
class RHSLightMachineGuns
{
name = "RHS Light Machine Guns";
icon = "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\itemacc_ca.paa";
items[]=
{
"rhs_weap_m249_pip_L",
"rhs_weap_m249_pip_L_para",
"rhs_weap_m249_pip_L_vfg",
"rhs_weap_m249_pip_S",
"rhs_weap_m249_pip_S_para",
"rhs_weap_m249_pip_S_vfg",
"rhs_weap_m240B",
"rhs_weap_m240B_CAP",
"rhs_weap_m240G",
"rhs_weap_pkm",
"rhs_weap_pkp"
};
};
class RHSAssaultRifles
{
name = "RHS Assault Rifles";
icon = "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\itemacc_ca.paa";
items[]=
{
"rhs_weap_M590_5RD",
"rhs_weap_M590_8RD",
"rhs_weap_m16a4",
"rhs_weap_m16a4_carryhandle",
"rhs_weap_m16a4_carryhandle_grip",
"rhs_weap_m16a4_carryhandle_grip_pmag",
"rhs_weap_m16a4_carryhandle_M203",
"rhs_weap_m16a4_carryhandle_pmag",
"rhs_weap_m16a4_grip",
"rhs_weap_m4",
"rhs_weap_m4_grip2",
"rhs_weap_m4_carryhandle",
"rhs_weap_m4_carryhandle_pmag",
"rhs_weap_m4_grip",
"rhs_weap_m4_m203",
"rhs_weap_m4_m320",
"rhs_weap_m4a1_carryhandle",
"rhs_weap_m4a1_carryhandle_grip2",
"rhs_weap_m4a1_carryhandle_pmag",
"rhs_weap_m4a1_carryhandle_m203",
"rhs_weap_m4a1",
"rhs_weap_m4a1_grip2",
"rhs_weap_m4a1_grip",
"rhs_weap_m4a1_m203",
"rhs_weap_m4a1_m320",
"rhs_weap_m4a1_blockII",
"rhs_weap_m4a1_blockII_KAC",
"rhs_weap_m4a1_blockII_grip2",
"rhs_weap_m4a1_blockII_grip2_KAC",
"rhs_weap_m4a1_blockII_M203",
"rhs_weap_mk18",
"rhs_weap_mk18_KAC",
"rhs_weap_mk18_grip2",
"rhs_weap_mk18_grip2_KAC",
"rhs_weap_mk18_m320",
"rhs_weap_ak103",
"rhs_weap_ak103_npz",
"rhs_weap_ak103_1",
"rhs_weap_ak74m",
"rhs_weap_ak74m_2mag",
"rhs_weap_ak74m_2mag_camo",
"rhs_weap_ak74m_2mag_npz",
"rhs_weap_ak74m_camo",
"rhs_weap_ak74m_desert",
"rhs_weap_ak74m_desert_npz",
"rhs_weap_ak74m_desert_folded",
"rhs_weap_ak74m_plummag_folded",
"rhs_weap_ak74m_folded",
"rhs_weap_ak74m_camo_folded",
"rhs_weap_ak74m_gp25",
"rhs_weap_ak74m_gp25_npz",
"rhs_weap_ak74m_npz",
"rhs_weap_ak74m_plummag",
"rhs_weap_ak74m_plummag_npz",
"rhs_weap_akm",
"rhs_weap_akm_gp25",
"rhs_weap_akms",
"rhs_weap_akms_gp25",
"rhs_weap_asval",
"rhs_weap_asval_npz",
"rhs_weap_ak104",
"rhs_weap_ak104_npz",
"rhs_weap_ak105",
"rhs_weap_ak105_npz"
};
};
class RHSSniperRifles
{
name = "RHS Sniper Rifles";
icon = "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\itemacc_ca.paa";
items[]=
{
"rhs_weap_sr25",
"rhs_weap_sr25_ec",
"rhs_weap_m14ebrri",
"rhs_weap_XM2010",
"rhs_weap_XM2010_wd",
"rhs_weap_XM2010_d",
"rhs_weap_XM2010_sa",
"rhs_weap_svd",
"rhs_weap_svdp_wd",
"rhs_weap_svdp_wd_npz",
"rhs_weap_svdp_npz",
"rhs_weap_svds",
"rhs_weap_svds_npz",
"rhs_weap_m110"
};
};
class RHSAmmo
{
name = "RHS Ammo";
icon = "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\itemacc_ca.paa";
items[]=
{
"rhsusf_mag_7x45acp_MHP",
"rhs_mag_9x18_12_57N181S",
"rhs_mag_9x19_17",
"rhs_mag_30Rnd_556x45_Mk318_Stanag",
"rhs_mag_30Rnd_556x45_Mk262_Stanag",
"rhs_mag_30Rnd_556x45_M855A1_Stanag",
"rhs_mag_30Rnd_556x45_M855A1_Stanag_No_Tracer",
"rhs_mag_30Rnd_556x45_M855A1_Stanag_Tracer_Red",
"rhs_mag_30Rnd_556x45_M855A1_Stanag_Tracer_Green",
"rhs_mag_30Rnd_556x45_M855A1_Stanag_Tracer_Yellow",
"rhs_200rnd_556x45_M_SAW",
"rhs_200rnd_556x45_B_SAW",
"rhs_200rnd_556x45_T_SAW",
"rhsusf_50Rnd_762x51",
"rhsusf_50Rnd_762x51_m993",
"rhsusf_50Rnd_762x51_m80a1epr",
"rhsusf_100Rnd_762x51",
"rhsusf_100Rnd_762x51_m993",
"rhsusf_100Rnd_762x51_m80a1epr",
"rhsusf_5Rnd_00Buck",
"rhsusf_5Rnd_Slug",
"rhsusf_8Rnd_00Buck",
"rhsusf_8Rnd_Slug",
"rhsusf_20Rnd_762x51_m993_Mag",
"rhsusf_5Rnd_300winmag_xm2010",
"rhsusf_8Rnd_HE",
"rhsusf_8Rnd_FRAG",
"rhsusf_100Rnd_762x51_m61_ap",
"rhs_30Rnd_762x39mm",
"rhs_30Rnd_762x39mm_tracer",
"rhs_30Rnd_762x39mm_89",
"rhs_30Rnd_545x39_AK",
"rhs_30Rnd_545x39_AK_no_tracers",
"rhs_30Rnd_545x39_7N10_AK",
"rhs_30Rnd_545x39_7N22_AK",
"rhs_30Rnd_545x39_AK_green",
"rhs_45Rnd_545X39_AK",
"rhs_45Rnd_545X39_7N10_AK",
"rhs_45Rnd_545X39_7N22_AK",
"rhs_45Rnd_545X39_AK_Green",
"rhs_100Rnd_762x54mmR",
"rhs_100Rnd_762x54mmR_green",
"rhs_10Rnd_762x54mmR_7N1"
};
};
class RHSVehicles
{
name = "RHS Vehicles";
icon = "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\itemacc_ca.paa";
items[]=
{
"rhsusf_m1025_d",
"rhsusf_m1025_w",
"rhsusf_m1025_w_s",
"rhsusf_m1025_d_s",
"rhsusf_m998_w_2dr",
"rhsusf_m998_d_s_2dr",
"rhs_tigr_vmf",
"rhs_tigr_3camo_vmf",
"rhs_tigr_ffv_vmf",
"rhs_tigr_ffv_3camo_vdv",
"rhs_tigr_ffv_3camo_vv",
"rhs_tigr_m_msv",
"rhs_tigr_m_3camo_vdv",
"rhsusf_m998_w_2dr_fulltop",
"rhsusf_m998_d_2dr_fulltop",
"RHS_UAZ_MSV_01",
"rhs_uaz_open_MSV_01",
"rhs_uaz_dshkm_chdkz",
"RHS_Ural_Flat_MSV_01",
"RHS_Ural_MSV_01",
"RHS_Ural_Open_Civ_03",
"rhsusf_m1025_w_m2",
"rhsusf_m1025_d_m2",
"rhsusf_M1078A1P2_B_M2_wd_fmtv_usarmy",
"rhsusf_M1078A1P2_B_M2_wd_flatbed_fmtv_usarmy",
"rhsusf_M1078A1P2_B_M2_d_fmtv_usarmy",
"rhsusf_M1078A1P2_B_M2_d_flatbed_fmtv_usarmy",
"rhs_btr60_chdkz"
};
};
class RHSHelicopters
{
name = "RHS Helicopters";
icon = "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\itemacc_ca.paa";
items[]=
{
"RHS_UH60M_MEV",
"RHS_UH1Y_UNARMED",
"RHS_UH1Y_UNARMED_d",
"RHS_Mi8mt_cargo_vdv",
"RHS_Mi8amt_civilian",
"rhs_ka60_c",
"rhs_ka60_grey",
"RHS_CH_47F",
"RHS_CH_47F_light",
"RHS_UH60M",
"RHS_Mi8mt_vvs",
"RHS_Mi8amt_chdkz",
"RHS_UH1Y",
"RHS_Mi24Vt_vvs",
"rhsusf_CH53E_USMC"
};
};
class RHSMines
{
name = "RHS Mines";
icon = "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\cargothrow_ca.paa";
items[]=
{
"rhs_mine_pmn2_mag",
"rhs_mine_tm62m_mag",
"rhsusf_m112_mag",
"rhsusf_m112x4_mag",
"rhs_weap_rpg7",
"rhs_weap_igla",
"rhs_mag_9k38_rocket",
"rhs_rpg7_PG7VL_mag",
"rhs_rpg7_PG7VR_mag",
"rhs_rpg7_TBG7V_mag",
"rhs_rpg7_OG7V_mag",
"rhs_mine_m19_mag"
};
};
class RHSPlanes
{
name = "RHS Planes";
icon = "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\itemacc_ca.paa";
items[] =
{
"RHS_C130J",
"GNT_C185F"
};
}; | [
"red281gt@fmfclandivision.com"
] | red281gt@fmfclandivision.com |
9de4ccabe1ec5b5d65c98c989f7031313ec5a801 | e30105b97d3694c037175c67168eb17752348532 | /x11-toolkits/gtkmathview/dragonfly/patch-src_common_String.hh | 17b86c990b7327b6fc1dbb8aa7f51a76ecf8539a | [
"BSD-2-Clause"
] | permissive | daftaupe/DPorts | 2e9a0096dba06e5cb052734a0e4be5cc4e0f9d1d | cf931cbfd87e663f070fb3d67c6d3539c6ac5cb2 | refs/heads/master | 2022-04-17T21:05:57.056161 | 2020-04-07T07:55:31 | 2020-04-07T07:55:31 | 256,270,358 | 0 | 0 | NOASSERTION | 2020-04-16T16:29:20 | 2020-04-16T16:29:19 | null | UTF-8 | C++ | false | false | 266 | hh | --- src/common/String.hh.orig 2007-08-17 13:02:45.000000000 +0300
+++ src/common/String.hh
@@ -20,6 +20,8 @@
#define __String_hh__
#include <string>
+#include <cstdio> // for snprintf vsnprintf
+#include <cstring>
#include "gmv_defines.h"
#include "Char.hh"
| [
"nobody@home.ok"
] | nobody@home.ok |
2804e8c8c3e5b628f64b86644f8f9a2cbd0568e8 | 19f546bd37ea6222516f4e8742b6fb5b17a679a1 | /include/sde/CGeoSymbol.h | 0564d69316c5e89a59d70d65a6b5170c3ba4561e | [] | no_license | caojianwudong/delerrorgit | d48ed862acecda7c979a0a5f7077f1e156595a4f | c416091f955398283495b2bb8ac0f2a1ef0d8996 | refs/heads/master | 2020-04-12T17:53:44.766853 | 2018-12-21T03:55:53 | 2018-12-21T03:55:53 | 162,661,227 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,983 | h | //## begin module%1.2%.codegen_version preserve=yes
// Read the documentation to learn more about C++ code generator
// versioning.
//## end module%1.2%.codegen_version
//## begin module%40B009580157.cm preserve=no
// %X% %Q% %Z% %W%
//## end module%40B009580157.cm
//## begin module%40B009580157.cp preserve=no
//## end module%40B009580157.cp
//## Module: CGeoSymbol%40B009580157; Pseudo Package specification
#ifndef CGeoSymbol_h
#define CGeoSymbol_h 1
//## begin module%40B009580157.additionalIncludes preserve=no
//## end module%40B009580157.additionalIncludes
//## begin module%40B009580157.includes preserve=yes
//## end module%40B009580157.includes
#include "CGeometry.h"
#include "CGeopoints.h"
//## begin module%40B009580157.additionalDeclarations preserve=yes
//## end module%40B009580157.additionalDeclarations
class CFeature ;
//## begin CGeoSymbol%40B009580157.preface preserve=yes
//## end CGeoSymbol%40B009580157.preface
//## Class: CGeoSymbol%40B009580157
//## Category: CGeometry%407001E50071
//## Persistence: Transient
//## Cardinality/Multiplicity: n
//##ModelId=46B7B83E0242
class __declspec(dllexport) CGeoSymbol : public CGeometry //## Inherits: <unnamed>%40B0096C035B
{
//## begin CGeoSymbol%40B009580157.initialDeclarations preserve=yes
//## end CGeoSymbol%40B009580157.initialDeclarations
public:
//##ModelId=46B7B83E0244
void SetOwnerLayerID ( LAYER layer_id ) ;
//##ModelId=46B7B83E0246
LAYER GetOwnerLayerID() ;
//##ModelId=46B7B83E0251
void SetVSLevel ( int level ) ;
//##ModelId=46B7B83E0253
int GetVSLevel ( ) ;
//##ModelId=46B7B83E0254
void SetOwnerFeatureID ( OID feature_id ) ;
//##ModelId=46B7B83E0256
OID GetOwnerFeatureID() ;
//##ModelId=46B7B83E0257
void SetTruePoint( SGeoPoint point );
//##ModelId=46B7B83E0259
SGeoPoint GetTruePoint();
//##ModelId=46B7B83E0261
void SetDisplayPoint( SGeoPoint point );
//##ModelId=46B7B83E0263
SGeoPoint GetDisplayPoint();
//##ModelId=46B7B83E0264
int GetSymbolCode( ) ;
//##ModelId=46B7B83E0265
void SetSymbolCode ( int code ) ;
//##ModelId=46B7B83E0267
double GetSymbolSize() ;
//##ModelId=46B7B83E0268
void SetSymbolSize( double size ) ;
//##ModelId=46B7B83E026A
SGeoRect GetSymbolBound() ;
//## Constructors (generated)
//##ModelId=46B7B83E0271
CGeoSymbol(CFeature* m_pOwner);
//## Destructor (generated)
//##ModelId=46B7B83E0273
~CGeoSymbol();
//## Other Operations (specified)
//## Operation: GetGeoType%40B00958015D
//##ModelId=46B7B83E0274
int GetGeoType ();
// Additional Public Declarations
//## begin CGeoSymbol%40B009580157.public preserve=yes
//## end CGeoSymbol%40B009580157.public
protected:
// Additional Protected Declarations
//## begin CGeoSymbol%40B009580157.protected preserve=yes
//## end CGeoSymbol%40B009580157.protected
private:
// Additional Private Declarations
//## begin CGeoSymbol%40B009580157.private preserve=yes
//## end CGeoSymbol%40B009580157.private
private: //## implementation
// Data Members for Class Attributes
//##ModelId=45502F80005B
//## Attribute: pString%40B009580167
//## begin CGeoSymbol::pString%40B009580167.attr preserve=no private: char* {U} 0
//##ModelId=46B7B83E0276
SGeoPoint m_TruePoint ;
//##ModelId=46B7B83E0281
SGeoPoint m_DisplayPoint ;
//## end CGeoSymbol::pString%40B009580167.attr
//##ModelId=46B7B83E0285
int m_SymbolCode;
//##ModelId=46B7B83E0286
double m_SymbolSize ;
//##ModelId=46B7B83E0291
SGeoRect m_SymbolRect ;
//##ModelId=46B7B83E0295
LAYER m_OwnerLayerID ;
//##ModelId=46B7B83E029F
OID m_OwnerFeatureID ;
//##ModelId=46B7B83E02A0
int m_VSLevel ;
};
//## begin CGeoSymbol%40B009580157.postscript preserve=yes
//## end CGeoSymbol%40B009580157.postscript
// Class CGeoSymbol
//## begin module%40B009580157.epilog preserve=yes
//## end module%40B009580157.epilog
#endif
| [
"wangchaohuid1@163.com"
] | wangchaohuid1@163.com |
fba6c1a5ef6b8de315b24b044f2a9dcf860732aa | acaecfdb339ba73a27cec139f9e65854aa781342 | /Projects/Game/src/Structure/SandboxLayer2.h | c0e17e959fdaeb719ad14d793a79247c190b6c8b | [] | no_license | jonathan2222/YamiEngine | d3fa0ff60c2d457959a9831e0edb3aff458fca81 | b8ed8c0031e101747937b4f0df0bd11e7b9e965b | refs/heads/master | 2020-07-26T11:32:38.599045 | 2020-01-09T23:36:57 | 2020-01-09T23:36:57 | 208,630,378 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 735 | h | #pragma once
#include "Engine/Core/Layer.h"
#include "Engine/Core/Camera.h"
#include "Engine/Core/Graphics/UniformBuffer.h"
#include "Engine/Core/Graphics/Texture.h"
class SandboxLayer2 : public ym::Layer
{
public:
struct MatrixBuffer
{
glm::mat4 world;
glm::mat4 view;
glm::mat4 projection;
};
void onStart() override;
void onUpdate(float dt) override;
void onRender() override;
void onRenderImGui() override;
void onQuit() override;
private:
float m_defaultSpeed;
float m_factor;
float m_defaultRotSpeed;
MatrixBuffer m_matrixBuffer;
ym::UniformBuffer* m_uniformBuffer;
ym::Camera* m_camera;
ym::Shader* m_shader;
glm::mat4 m_world;
ym::Model m_model;
ym::Texture* m_texture;
ym::Sampler m_sampler;
}; | [
"jonathan9609082000@gmail.com"
] | jonathan9609082000@gmail.com |
47e754eb25e24ca373451972788e55608f060d1e | 2e133b709f619d20e996e7d14252a48569e1cb1c | /genMino.cpp | d4fcec5d92a67ffeaaf222d84faa3a4e422a3bf3 | [] | no_license | f74036051/lab7 | 851569d4fce9f81727ee0179939f88dbd22a84db | 6eb015c8d7b20bec2b73c10378ac9a8b5b069d4e | refs/heads/master | 2021-01-22T04:43:56.513141 | 2015-06-09T06:15:45 | 2015-06-09T06:15:45 | 37,113,694 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 480 | cpp | #include <cstdlib>
#include "genMino.h"
#define NUM_MINO 5
#define MINO_S 0
#define MINO_I 1
#define MINO_T 2
#define MINO_Z 3
#define MINO_J 4
Mino * genMino()
{
int mino_type;
Mino * ptr;
mino_type = random() % NUM_MINO;
switch(mino_type) {
case MINO_S:
ptr = new MinoS;
break;
case MINO_I:
ptr = new MinoI;
break;
case MINO_T:
ptr = new MinoT;
break;
case MINO_Z:
ptr = new MinoZ;
break;
case MINO_J:
ptr = new MinoJ;
break;
}
return ptr;
}
| [
"f74036051@ncku.edu.tw"
] | f74036051@ncku.edu.tw |
c89874e857e51d0b763eb5882e7b6404b62f7360 | a3ea669e19359a3b27c1babe7ba2ed8018a19519 | /libs/main/KoDocumentInfoDlg.h | c710a87e3d772e327c3746e18aa6052cd7e9a5d9 | [] | no_license | NavyZhao1978/QCalligra | 67a5f64632528e4dcbca6b7b7d185f9984b5bb51 | 2eefdc843aca6ced31d4cab84742ea632d455f7f | refs/heads/master | 2021-01-20T09:01:54.679815 | 2012-11-05T08:33:52 | 2012-11-05T08:33:52 | 4,645,434 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,351 | h | /* This file is part of the KDE project
Copyright (c) 2000 Simon Hausmann <hausmann@kde.org>
2006 Martin Pfeiffer <hubipete@gmx.net>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __koDocumentInfoDlg_h__
#define __koDocumentInfoDlg_h__
#include "KoShapeController.h"
#include <QtCore>
#include <QtGui>
class KoDocumentInfo;
class KoDocumentRdfBase;
//class KPageWidgetItem;
/**
* @short The dialog that shows information about the document
* @author Simon Hausmann <hausmann@kde.org>
* @author Martin Pfeiffer <hubipete@gmx.net>
* @see KoDocumentInfo
*
* This dialog is invoked by KoMainWindow and shows the content
* of the given KoDocumentInfo class. It consists of several pages,
* one showing general information about the document and an other
* showing information about the author.
* This dialog implements only things that are stored in the OASIS
* meta.xml file and therefore available through the KoDocumentInfo
* class.
* The widgets shown in the tabs are koDocumentInfoAboutWidget and
* koDocumentInfoAuthorWidget. This class here is derived from
* KoTabDialog and uses the face type Tabbed.
*/
class KoDocumentInfoDlg : public KoTabDialog
{
Q_OBJECT
public:
/**
* The constructor
* @param parent a pointer to the parent widget
* @param docInfo a pointer to the shown KoDocumentInfo
*/
KoDocumentInfoDlg(QWidget *parent, KoDocumentInfo* docInfo, KoDocumentRdfBase* docRdf = 0);
/** The destructor */
virtual ~KoDocumentInfoDlg();
QList<QWidget *> pages() const;
/** Returns true if the document was saved when the dialog was closed */
bool isDocumentSaved();
/** Sets all fields to read-only mode. Used by the property dialog. */
void setReadOnly(bool ro);
public slots:
/** Connected to the okClicked() signal */
void slotApply();
private slots:
/** Connected with clicked() from pbReset - Reset parts of the metadata */
void slotResetMetaData();
/** Connected with clicked() from pbEncrypt - Toggle the encryption of the document */
void slotToggleEncryption();
/** Saves the document with changed encryption */
void slotSaveEncryption();
private:
/** Sets up the aboutWidget and fills the widgets with content */
void initAboutTab();
/** Sets up the authorWidget and fills the widgets with content */
void initAuthorTab();
/** Saves the changed data back to the KoDocumentInfo class */
void saveAboutData();
void slotButtonClicked(int button);
class KoDocumentInfoDlgPrivate;
KoDocumentInfoDlgPrivate * const d;
};
#endif
| [
"13851687818@163.com"
] | 13851687818@163.com |
d781b88463438de88be722e0e154286134ecfc4d | 4942e6f057e4787441a268fa46026983afc022c6 | /Data_Structures/m_HTable.hpp | 61491409e633b8c7581cb5901705588d78e07814 | [] | no_license | sncodeGit/University_Tasks | 1d5bafc16ccd006a1b3054875ac58180645cddde | d63912b9afae5bf5ea076a8e7dde3368fb4da359 | refs/heads/master | 2020-07-19T02:13:49.645065 | 2020-05-15T05:01:31 | 2020-05-15T05:01:31 | 206,357,701 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 774 | hpp | #ifndef M_HTABLE_HPP_INCLUDED
#define M_HTABLE_HPP_INCLUDED
class IncorrectSymbol {
char symb;
public:
IncorrectSymbol(char e_symb) : symb(e_symb) {}
char getSymb() { return symb; }
};
class m_HTable {
size_t data[52];
int hashFunc(char e_key) {
if (e_key > 96) return e_key - 71;
else return e_key - 65;
}
public:
m_HTable() { for (int i = 0; i < 52; i++) data[i] = 0; }
void addElem(char e_key) {
if (!(((e_key >= 'a') && (e_key <= 'z')) || ((e_key >= 'A') && (e_key <= 'Z')))) throw IncorrectSymbol(e_key);
data[hashFunc(e_key)]++;
}
size_t getElem(char e_key) {
if (!(((e_key >= 'a') && (e_key <= 'z')) || ((e_key >= 'A') && (e_key <= 'Z')))) throw IncorrectSymbol(e_key);
return data[hashFunc(e_key)];
}
};
#endif // M_HTABLE_HPP_INCLUDED
| [
"noreply@github.com"
] | noreply@github.com |
e583d3eb920f95be38ad9d870f4729f5a2d5a56e | 519a60cd0c8e83be0c4eb4ab823187f56a38ed46 | /polygon.h | 653185a967984a00e58148d6861ff6ea02a2c406 | [] | no_license | domoench/Quadtree | afdeb8ad09a19083cd9e9296b431a0d7ce082174 | 8c259400afc19ae99bfb5b136735fd01b37327bf | refs/heads/master | 2021-01-04T14:06:03.512849 | 2014-05-07T18:20:37 | 2014-05-07T18:20:37 | 18,926,510 | 13 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 1,231 | h | #ifndef __DOM_POLYGON_H__
#define __DOM_POLYGON_H__
#include <vector>
#include <OpenGL/gl3.h> // For mac
#include "glm/glm.hpp"
using namespace std;
using namespace glm;
/*----------------------------------------------------------------------------*\
POLYGON
A polygon is defined by a set of points in counter-clockwise order. Edges are
between adjacent points in this order.
This class helps to dynamically generate and work with vertex vectors
representing polygons.
\*----------------------------------------------------------------------------*/
class Polygon
{
public:
/*!
Vertices must be ordered counter-clockwise. First vertex is NOT repeated
at the end of the list.
*/
vector<vec2>* _verts;
Polygon();
Polygon(const vector<vec2>& vertices);
Polygon(const Polygon& other);
~Polygon();
Polygon& operator=(const Polygon& other);
void add(vec2 vert);
void clip(const Polygon& clip_box);
void clipOneSide(vec2 a, vec2 b);
GLfloat area() const;
// Static Helpers. TODO: Is there a better place for them?
static int onLeftSide(vec2 a, vec2 b, vec2 p);
static vec2 lineIntersect(vec2 a1, vec2 a2, vec2 b1, vec2 b2);
};
#endif
| [
"domoench@gmail.com"
] | domoench@gmail.com |
97a047b143d902d75715ffec33922d36a2b37a8d | ebe5507a0b06918e76be420df07be20f01ced144 | /tydefs.h | c1c96b596b79e6530336f0c00601daeaecf9e2df | [] | no_license | gorvin/bmu | 3076ad9172dab4a2bfbd6f0fbfb30f6fcf4ce30e | 9b0b667609c03dbb7c986311ab8d8f30840323bf | refs/heads/master | 2020-05-21T08:11:59.318316 | 2017-03-10T21:22:23 | 2017-03-10T21:22:23 | 84,601,375 | 0 | 0 | null | null | null | null | WINDOWS-1250 | C++ | false | false | 4,083 | h | #pragma once
#include <string>
#include <sstream>
#include <boost/shared_ptr.hpp>
namespace beam_me_up {}
namespace bmu = beam_me_up;
namespace beam_me_up{
// The typedefs for 8-bit, 16-bit and 32-bit unsigned integers
// You may need to change them to match your system.
typedef unsigned char u8unit_t;
typedef unsigned short u16unit_t;
typedef unsigned int u32char_t;//codepoint utf-32
/** UTF-8:
U+00000000 - U+0000007F: 0xxxxxxx (only here code unit coresponds to codepoint)
U+00000080 - U+000007FF: 110xxxxx 10xxxxxx
U+00000800 - U+0000FFFF: 1110xxxx 10xxxxxx 10xxxxxx
U+00010000 - U+001FFFFF: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
U+00200000 - U+03FFFFFF: 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
U+04000000 - U+7FFFFFFF: 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
UTF-8 predstavlja Unicode znakove (codepoint) sa 1 do 6 okteta. Dakle dužina znaka nije fiksne
dužine pa nije najpogodnije predstavljanje UTF-8 pomo?u std::basic_string, najviše iz razloga da
size() ne daje broj karaktera u UTF-8 ve? broj osnovnih jedinica kontejnera npr. okteta ili rijeci.
Još jedan razlog je što treba izbje?i korištenje standardnih funkcija za promjenu veli?ine slova
jer Unicode karakteri nemaju 1-1 korespodenciju malih i velikih "slova" mogu?e je:
- karakter jedne veli?ine se mapira u 2 karaktera pri promjeni veli?ne npr. njema?ko "oštro s" odgovara SS
- isti karakter se dobija pri promjeni veli?ine više razli?itih karaktera zavisno od lokalizacije npr.
- u turskom jeziku slovu "I" odgovara malo "i bez ta?kice" a velikom slovu "I sa ta?kicom" odgovara "i"
- u zapadnim jezicima slovu "I" odgovara malo "i"
što nije mogu?e ostvariti sa standardnim funkcijama koje podrazumijevaju da su karakteri obrazovani
od fiksnog broja okteta i da postoji 1-1 korespodencija malih i velikih slova.
Ipak basic_string po mnogo ?emu odgovara predstavljanju UTF-8 stringa pa ?u ga ipak koristiti ali
da izbjegnem previde pri radu sa UTF-8 stavi?u da osnovna jedinica nije char ve? unsigned char.
*/
typedef std::basic_string<u8unit_t> u8vector_t;
typedef u8vector_t::iterator u8vector_it;
/** Ovo prakti?no i ne koristim jer je UTF-16 bitan samo pri korištenju Xerces- a on ima svoju reprezentaciju */
typedef std::basic_string<u16unit_t> u16vector_t;
typedef u16vector_t::iterator u16vector_it;
/** Daje kontejner u kome je sadržaj iz zadanog c-stringa. Koristim radi preglednosti. */
inline u8vector_t ascii_utf8(char const* const cstr)
{
return u8vector_t(cstr, cstr + std::char_traits<char>::length(cstr));
}
/** Daje string u kome je sadržaj iz zadanog utf8 stringa.
Koristim radi preglednosti pri kopiranju kad su imena varijabli preduga?ka.
*/
inline std::string utf8_string(u8vector_t const& vu8)
{
return std::string(vu8.begin(), vu8.end());
}
/** Daje kontejner u kome je sadržaj iz zadanog c-stringa.
Koristim radi preglednosti pri kopiranju kad su imena varijabli preduga?ka.
*/
inline u8vector_t utf8_vector(std::string const& str)
{
return u8vector_t(str.begin(), str.end());
}
/** Pretvaranje stringa u broj sa zadanom osnovom npr. std::dec. False ako u stringu nije broj. */
template <typename T> inline
bool from_string(T& t, std::string const& s, std::ios_base& (*f)(std::ios_base&))
{
std::istringstream ss(s); return !(ss >> f >> t).fail();
}
/** Pretvaranje broja sa zadanom osnovom u string. */
template <class T> inline
std::string to_string(T const& t, std::ios_base& (*f)(std::ios_base&))
{
return static_cast<std::ostringstream&>(std::ostringstream() << f << t).str();
}
/** Pomo?ni tip koji koristim da bih izbjegao kopiranje gdje ne mogu koristiti referencu na
\ref u8vector npr. pri radu sa libpqxx. */
struct rawcontent_t {
u8unit_t const* content;
size_t length;
};
template<typename _T>
class ExternalOne {
public:
typedef std::remove_reference<_T> value_type;
static void set_one(boost::shared_ptr<value_type> external_one) { one = external_one; }
static value_type* get_one(void) { return one.get(); }
private:
static boost::shared_ptr<value_type> one;
};
}
| [
"igor.n.vincic@gmail.com"
] | igor.n.vincic@gmail.com |
5bbbdc8ee6e2f9827dc5f7385bf116c35ff90dec | a1809f8abdb7d0d5bbf847b076df207400e7b08a | /Simpsons Hit&Run/game/libs/pure3d/p3d/lzr.cpp | 767e01ca161c433a900ccc76c63bc4f3e93aea8f | [] | no_license | RolphWoggom/shr.tar | 556cca3ff89fff3ff46a77b32a16bebca85acabf | 147796d55e69f490fb001f8cbdb9bf7de9e556ad | refs/heads/master | 2023-07-03T19:15:13.649803 | 2021-08-27T22:24:13 | 2021-08-27T22:24:13 | 400,380,551 | 8 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,129 | cpp | /*===========================================================================
File:: lzr.cpp
A compression format designed for speedy decompression
Copyright (c) 2001 Radical Entertainment, Inc. All rights reserved.
The format of LZR (Lempel - Ziv - Radical) is as follows:
The file consists of sequences of literal runs, or dictionary matches.
A literal run is specified with a byte from 0-15, specifying the length
of the run. If the byte is 0, the length is 15 + the next byte. If that
byte is 0, add 255 and continue...
eg:
Bytes Length
14 14
0 1 16 (15 + 1)
0 24 39 (15 + 24)
0 0 1 271 (15 + 255 + 1)
0 0 0 1 526 (15 + 255 + 255 + 1)
A match begins with a byte greater than 15. Matches encode an offset into
previously decompressed characters, and a count of characters.
The count is stored in the low 4 bits of the first byte, and uses the same
rules as the literal run for extending the count beyond 15. The offset is
stored in the high 4 bits, plus 16 * the next byte (after count extensions).
eg:
Code bytes Offset Count
17 (0x11) 0 1 1
234 (0xEA) 1 30 10
64 (0x40) 43 52 836 58
This compressor does NOT encode EOF. The caller must pass in the correct
output size.
===========================================================================*/
#include <p3d/lzr.hpp>
#include <p3d/error.hpp>
#include <string.h>
void lzr_decompress (const unsigned char* input, unsigned int inputsize,
unsigned char* output, unsigned int outputsize)
{
unsigned int outputcount = 0;
while(outputcount < outputsize)
{
unsigned int code = *input++;
if(code > 15)
{
// a match
int matchlength = code & 15;
if(matchlength == 0)
{
matchlength += 15;
while (*input == 0)
{
matchlength += 255;
input++;
}
matchlength += *input++;
}
int offset = (code >> 4) | (*input++) << 4;
unsigned char* match_ptr = output - offset;
// shortest match is 4 characters, so we can unroll the loop
int len = matchlength>>2;
matchlength -= len<<2;
do
{
*output++ = *match_ptr++;
*output++ = *match_ptr++;
*output++ = *match_ptr++;
*output++ = *match_ptr++;
outputcount += 4;
} while(--len);
while(matchlength)
{
*output++ = *match_ptr++;
outputcount++;
matchlength--;
}
}
else
{
// A literal run
int runlength = code;
if(runlength == 0)
{
while (*input == 0)
{
runlength += 255;
input++;
}
runlength += *input++;
*output++ = *input++;
*output++ = *input++;
*output++ = *input++;
*output++ = *input++;
*output++ = *input++;
*output++ = *input++;
*output++ = *input++;
*output++ = *input++;
*output++ = *input++;
*output++ = *input++;
*output++ = *input++;
*output++ = *input++;
*output++ = *input++;
*output++ = *input++;
*output++ = *input++;
outputcount += 15;
}
do
{
*output++ = *input++;
outputcount++;
} while(--runlength);
}
}
}
| [
"81568815+RolphWoggom@users.noreply.github.com"
] | 81568815+RolphWoggom@users.noreply.github.com |
e353e2205e0860a47b605f529e2547cfc58cb6d0 | 19eb97436a3be9642517ea9c4095fe337fd58a00 | /private/shell/ext/webcheck/droptrgt.cpp | 538ba251649002e7bc8055579e5582cd0ad9e2b9 | [] | no_license | oturan-boga/Windows2000 | 7d258fd0f42a225c2be72f2b762d799bd488de58 | 8b449d6659840b6ba19465100d21ca07a0e07236 | refs/heads/main | 2023-04-09T23:13:21.992398 | 2021-04-22T11:46:21 | 2021-04-22T11:46:21 | 360,495,781 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 15,339 | cpp | #include "private.h"
#include "offl_cpp.h"
#include "subsmgrp.h"
HRESULT _GetURLData(IDataObject *, int, TCHAR *, TCHAR *);
HRESULT _ConvertHDROPData(IDataObject *, BOOL);
HRESULT ScheduleDefault(LPCTSTR, LPCTSTR);
#define CITBDTYPE_HDROP 1
#define CITBDTYPE_URL 2
#define CITBDTYPE_TEXT 3
//
// Constructor
//
COfflineDropTarget::COfflineDropTarget(HWND hwndParent)
{
m_cRefs = 1;
m_hwndParent = hwndParent;
m_pDataObj = NULL;
m_grfKeyStateLast = 0;
m_fHasHDROP = FALSE;
m_fHasSHELLURL = FALSE;
m_fHasTEXT = FALSE;
m_dwEffectLastReturned = 0;
DllAddRef();
}
//
// Destructor
//
COfflineDropTarget::~COfflineDropTarget()
{
DllRelease();
}
//
// QueryInterface
//
STDMETHODIMP COfflineDropTarget::QueryInterface(REFIID riid, LPVOID *ppv)
{
HRESULT hr = E_NOINTERFACE;
*ppv = NULL;
// Any interface on this object is the object pointer
if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_IDropTarget))
{
*ppv = (LPDROPTARGET)this;
AddRef();
hr = NOERROR;
}
return hr;
}
//
// AddRef
//
STDMETHODIMP_(ULONG) COfflineDropTarget::AddRef()
{
return ++m_cRefs;
}
//
// Release
//
STDMETHODIMP_(ULONG) COfflineDropTarget::Release()
{
if (0L != --m_cRefs)
{
return m_cRefs;
}
delete this;
return 0L;
}
//
// DragEnter
//
STDMETHODIMP COfflineDropTarget::DragEnter(LPDATAOBJECT pDataObj,
DWORD grfKeyState,
POINTL pt,
LPDWORD pdwEffect)
{
// Release any old data object we might have
// TraceMsg(TF_SUBSFOLDER, TEXT("odt - DragEnter"));
if (m_pDataObj)
{
m_pDataObj->Release();
}
m_grfKeyStateLast = grfKeyState;
m_pDataObj = pDataObj;
//
// See if we will be able to get CF_HDROP from this guy
//
if (pDataObj)
{
pDataObj->AddRef();
TCHAR url[INTERNET_MAX_URL_LENGTH], name[MAX_NAME_QUICKLINK];
FORMATETC fe = {(CLIPFORMAT) RegisterClipboardFormat(CFSTR_SHELLURL),
NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
m_fHasSHELLURL = m_fHasHDROP = m_fHasTEXT = FALSE;
if (NOERROR == pDataObj->QueryGetData(&fe))
{
TraceMsg(TF_SUBSFOLDER, "odt - DragEnter : SHELLURL!");
m_fHasSHELLURL =
(NOERROR == _GetURLData(pDataObj,CITBDTYPE_URL,url,name));
}
if (fe.cfFormat = CF_HDROP, NOERROR == pDataObj->QueryGetData(&fe))
{
TraceMsg(TF_SUBSFOLDER, "odt - DragEnter : HDROP!");
m_fHasHDROP = (NOERROR ==
_ConvertHDROPData(pDataObj, FALSE));
}
if (fe.cfFormat = CF_TEXT, NOERROR == pDataObj->QueryGetData(&fe))
{
TraceMsg(TF_SUBSFOLDER, "odt - DragEnter : TEXT!");
m_fHasTEXT =
(NOERROR == _GetURLData(pDataObj,CITBDTYPE_TEXT,url,name));
}
}
// Save the drop effect
if (pdwEffect)
{
*pdwEffect = m_dwEffectLastReturned = GetDropEffect(pdwEffect);
}
return S_OK;
}
//
// GetDropEffect
//
DWORD COfflineDropTarget::GetDropEffect(LPDWORD pdwEffect)
{
ASSERT(pdwEffect);
if (m_fHasSHELLURL || m_fHasTEXT)
{
return *pdwEffect & (DROPEFFECT_COPY | DROPEFFECT_LINK);
}
else if (m_fHasHDROP) {
return *pdwEffect & (DROPEFFECT_COPY );
}
else
{
return DROPEFFECT_NONE;
}
}
//
// DragOver
//
STDMETHODIMP COfflineDropTarget::DragOver(DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect)
{
// TraceMsg(TF_SUBSFOLDER, TEXT("odt - DragOver"));
if (m_grfKeyStateLast == grfKeyState)
{
// Return the effect we saved at dragenter time
if (*pdwEffect)
{
*pdwEffect = m_dwEffectLastReturned;
}
}
else
{
if (*pdwEffect)
{
*pdwEffect = m_dwEffectLastReturned = GetDropEffect(pdwEffect);
}
}
m_grfKeyStateLast = grfKeyState;
return S_OK;
}
//
// DragLeave
//
STDMETHODIMP COfflineDropTarget::DragLeave()
{
// TraceMsg(TF_SUBSFOLDER, TEXT("odt - DragLeave"));
if (m_pDataObj)
{
m_pDataObj->Release();
m_pDataObj = NULL;
}
return S_OK;
}
//
// Drop
//
STDMETHODIMP COfflineDropTarget::Drop(LPDATAOBJECT pDataObj,
DWORD grfKeyState,
POINTL pt,
LPDWORD pdwEffect)
{
// UINT idCmd; // Choice from drop popup menu
HRESULT hr = S_OK;
//
// Take the new data object, since OLE can give us a different one than
// it did in DragEnter
//
// TraceMsg(TF_SUBSFOLDER, TEXT("odt - Drop"));
if (m_pDataObj)
{
m_pDataObj->Release();
}
m_pDataObj = pDataObj;
if (pDataObj)
{
pDataObj->AddRef();
}
// If the dataobject doesn't have an HDROP, its not much good to us
*pdwEffect &= DROPEFFECT_COPY|DROPEFFECT_LINK;
if (!(*pdwEffect)) {
DragLeave();
return S_OK;
}
hr = E_NOINTERFACE;
if (m_fHasHDROP)
hr = _ConvertHDROPData(pDataObj, TRUE);
else {
TCHAR url[INTERNET_MAX_URL_LENGTH], name[MAX_NAME_QUICKLINK];
if (m_fHasSHELLURL)
hr = _GetURLData(pDataObj, CITBDTYPE_URL, url, name);
if (FAILED(hr) && m_fHasTEXT)
hr = _GetURLData(pDataObj, CITBDTYPE_TEXT, url, name);
if (SUCCEEDED(hr)) {
TraceMsg(TF_SUBSFOLDER, "URL: %s, Name: %s", url, name);
hr = ScheduleDefault(url, name);
}
}
if (FAILED(hr))
{
TraceMsg(TF_SUBSFOLDER, "Couldn't DROP");
}
DragLeave();
return hr;
}
HRESULT _CLSIDFromExtension(
LPCTSTR pszExt,
CLSID *pclsid)
{
TCHAR szProgID[80];
long cb = SIZEOF(szProgID);
if (RegQueryValue(HKEY_CLASSES_ROOT, pszExt, szProgID, &cb) == ERROR_SUCCESS)
{
TCHAR szCLSID[80];
StrCatN(szProgID, TEXT("\\CLSID"), ARRAYSIZE(szProgID));
cb = SIZEOF(szCLSID);
if (RegQueryValue(HKEY_CLASSES_ROOT, szProgID, szCLSID, &cb) == ERROR_SUCCESS)
{
// BUGBUG (scotth): call shell32's SHCLSIDFromString once it
// exports A/W versions. This would clean this
// up.
#ifdef UNICODE
return CLSIDFromString(szCLSID, pclsid);
#else
WCHAR wszCLSID[80];
MultiByteToWideChar(CP_ACP, 0, szCLSID, -1, wszCLSID, ARRAYSIZE(wszCLSID));
return CLSIDFromString(wszCLSID, pclsid);
#endif
}
}
return E_FAIL;
}
// get the target of a shortcut. this uses IShellLink which
// Internet Shortcuts (.URL) and Shell Shortcuts (.LNK) support so
// it should work generally
//
HRESULT _GetURLTarget(LPCTSTR pszPath, LPTSTR pszTarget, UINT cch)
{
IShellLink *psl;
HRESULT hr = E_FAIL;
CLSID clsid;
if (FAILED(_CLSIDFromExtension(PathFindExtension(pszPath), &clsid)))
clsid = CLSID_ShellLink; // assume it's a shell link
hr = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID *)&psl);
if (SUCCEEDED(hr))
{
IPersistFile *ppf;
hr = psl->QueryInterface(IID_IPersistFile, (void **)&ppf);
if (SUCCEEDED(hr))
{
#ifdef UNICODE
hr = ppf->Load(pszPath, 0);
#else
WCHAR wszPath[MAX_PATH];
MultiByteToWideChar(CP_ACP, 0, pszPath, -1, wszPath, ARRAYSIZE(wszPath));
hr = ppf->Load (wszPath, 0);
#endif
ppf->Release();
}
if (SUCCEEDED(hr)) {
IUniformResourceLocator * purl;
hr = psl->QueryInterface(IID_IUniformResourceLocator,(void**)&purl);
if (SUCCEEDED(hr))
purl->Release();
}
if (SUCCEEDED(hr))
hr = psl->GetPath(pszTarget, cch, NULL, SLGP_UNCPRIORITY);
psl->Release();
}
return hr;
}
HRESULT _ConvertHDROPData(IDataObject *pdtobj, BOOL bSubscribe)
{
HRESULT hRes = NOERROR;
STGMEDIUM stgmedium;
FORMATETC formatetc;
TCHAR url[INTERNET_MAX_URL_LENGTH];
TCHAR name[MAX_NAME_QUICKLINK];
name[0] = 0;
url[0] = 0;
formatetc.cfFormat = CF_HDROP;
formatetc.ptd = NULL;
formatetc.dwAspect = DVASPECT_CONTENT;
formatetc.lindex = -1;
formatetc.tymed = TYMED_HGLOBAL;
// Get the parse string
hRes = pdtobj->GetData(&formatetc, &stgmedium);
if (SUCCEEDED(hRes))
{
LPTSTR pszURLData = (LPTSTR)GlobalLock(stgmedium.hGlobal);
if (pszURLData) {
TCHAR szPath[MAX_PATH];
SHFILEINFO sfi;
int cFiles, i;
HDROP hDrop = (HDROP)stgmedium.hGlobal;
hRes = S_FALSE;
cFiles = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0);
for (i = 0; i < cFiles; i ++) {
DragQueryFile(hDrop, i, szPath, SIZEOF(szPath));
// defaults...
StrCpyN(name, szPath, MAX_NAME_QUICKLINK);
if (SHGetFileInfo(szPath, 0, &sfi, sizeof(sfi), SHGFI_DISPLAYNAME))
StrCpyN(name, sfi.szDisplayName, MAX_NAME_QUICKLINK);
if (SHGetFileInfo(szPath, 0, &sfi, sizeof(sfi),SHGFI_ATTRIBUTES)
&& (sfi.dwAttributes & SFGAO_LINK))
{
if (SUCCEEDED(_GetURLTarget(szPath, url, INTERNET_MAX_URL_LENGTH)))
{
TraceMsg(TF_SUBSFOLDER, "URL: %s, Name: %s", url, name);
// If we just want to see whether there is some urls
// here, we can break now.
if (!bSubscribe)
{
if ((IsHTTPPrefixed(url)) &&
(!SHRestricted2(REST_NoAddingSubscriptions, url, 0)))
{
hRes = S_OK;
}
break;
}
hRes = ScheduleDefault(url, name);
}
}
}
GlobalUnlock(stgmedium.hGlobal);
if (bSubscribe)
hRes = S_OK;
} else
hRes = S_FALSE;
ReleaseStgMedium(&stgmedium);
}
return hRes;
}
// Takes a variety of inputs and returns a string for drop targets.
// szUrl: the URL
// szName: the name (for quicklinks and the confo dialog boxes)
// returns: NOERROR if succeeded
//
HRESULT _GetURLData(IDataObject *pdtobj, int iDropType, TCHAR *pszUrl, TCHAR *pszName)
{
HRESULT hRes = NOERROR;
STGMEDIUM stgmedium;
FORMATETC formatetc;
*pszName = 0;
*pszUrl = 0;
switch (iDropType)
{
case CITBDTYPE_URL:
formatetc.cfFormat = (CLIPFORMAT) RegisterClipboardFormat(CFSTR_SHELLURL);
break;
case CITBDTYPE_TEXT:
formatetc.cfFormat = CF_TEXT;
break;
default:
return E_UNEXPECTED;
}
formatetc.ptd = NULL;
formatetc.dwAspect = DVASPECT_CONTENT;
formatetc.lindex = -1;
formatetc.tymed = TYMED_HGLOBAL;
// Get the parse string
hRes = pdtobj->GetData(&formatetc, &stgmedium);
if (SUCCEEDED(hRes))
{
LPTSTR pszURLData = (LPTSTR)GlobalLock(stgmedium.hGlobal);
if (pszURLData)
{
if (iDropType == CITBDTYPE_URL)
{
STGMEDIUM stgmediumFGD;
// defaults
StrCpyN(pszUrl, pszURLData, INTERNET_MAX_URL_LENGTH);
StrCpyN(pszName, pszURLData, MAX_NAME_QUICKLINK);
formatetc.cfFormat = (CLIPFORMAT) RegisterClipboardFormat(CFSTR_FILEDESCRIPTOR);
if (SUCCEEDED(pdtobj->GetData(&formatetc, &stgmediumFGD)))
{
FILEGROUPDESCRIPTOR *pfgd = (FILEGROUPDESCRIPTOR *)GlobalLock(stgmediumFGD.hGlobal);
if (pfgd)
{
TCHAR szPath[MAX_PATH];
StrCpyN(szPath, pfgd->fgd[0].cFileName, SIZEOF(szPath));
PathRemoveExtension(szPath);
StrCpyN(pszName, szPath, MAX_NAME_QUICKLINK);
GlobalUnlock(stgmediumFGD.hGlobal);
}
ReleaseStgMedium(&stgmediumFGD);
}
}
else if (iDropType == CITBDTYPE_TEXT)
{
if (PathIsURL(pszURLData)) {
StrCpyN(pszUrl, pszURLData, INTERNET_MAX_URL_LENGTH);
StrCpyN(pszName, pszURLData, MAX_NAME_QUICKLINK);
} else
hRes = E_FAIL;
}
GlobalUnlock(stgmedium.hGlobal);
}
ReleaseStgMedium(&stgmedium);
}
if (SUCCEEDED(hRes))
{
if (!IsHTTPPrefixed(pszUrl) || SHRestricted2(REST_NoAddingSubscriptions, pszUrl, 0))
{
hRes = E_FAIL;
}
}
return hRes;
}
HRESULT ScheduleDefault(LPCTSTR url, LPCTSTR name)
{
if (!IsHTTPPrefixed(url))
return E_INVALIDARG;
ISubscriptionMgr * pSub= NULL;
HRESULT hr = CoInitialize(NULL);
RETURN_ON_FAILURE(hr);
hr = CoCreateInstance(CLSID_SubscriptionMgr, NULL, CLSCTX_INPROC_SERVER,
IID_ISubscriptionMgr, (void **)&pSub);
CoUninitialize();
RETURN_ON_FAILURE(hr);
ASSERT(pSub);
BSTR bstrURL = NULL, bstrName = NULL;
hr = CreateBSTRFromTSTR(&bstrURL, url);
if (S_OK == hr)
hr = CreateBSTRFromTSTR(&bstrName, name);
// BUGBUG. We need a perfectly valid structure.
SUBSCRIPTIONINFO subInfo;
ZeroMemory((void *)&subInfo, sizeof (SUBSCRIPTIONINFO));
subInfo.cbSize = sizeof(SUBSCRIPTIONINFO);
if (S_OK == hr)
hr = pSub->CreateSubscription(NULL, bstrURL, bstrName,
CREATESUBS_NOUI, SUBSTYPE_URL, &subInfo);
SAFERELEASE(pSub);
SAFEFREEBSTR(bstrURL);
SAFEFREEBSTR(bstrName);
if (FAILED(hr)) {
TraceMsg(TF_ALWAYS, "Failed to add default object.");
TraceMsg(TF_ALWAYS, " hr = 0x%x\n", hr);
return (FAILED(hr))?hr:E_FAIL;
} else if (hr == S_FALSE) {
TraceMsg(TF_SUBSFOLDER, "%s(%s) is already there.", url, name);
return hr;
}
return S_OK;
}
| [
"mehmetyilmaz3371@gmail.com"
] | mehmetyilmaz3371@gmail.com |
50dbe6fb98c149f64154afde597713e73bdc8f50 | 67233ab008d07efb37e6ed33c6959fc6215e5048 | /CodeTestZone/10_Process/src/CMutexByRecordLockingAndPThread.cpp | d23fe9791b64be3a7c4a4eb4a0348fb3609f9954 | [] | no_license | yinjingyu/LinuxDevelopment | 0e9350ec985c40e2a29c9544297e5118a21192a3 | 5e5c57f3b233507c16cd5e56d4b9682c01a7bdbc | refs/heads/master | 2021-01-22T05:15:27.000512 | 2013-12-03T09:28:29 | 2013-12-03T09:28:29 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,129 | cpp | /*
* =====================================================================================
*
* Filename: CMutexByRecordLockingAndPThread.cpp
*
* Description:
*
* Version: 1.0
* Created: 2013年11月07日 03时55分02秒
* Revision: none
* Compiler: gcc
*
* Author: YOUR NAME (),
* Organization:
*
* =====================================================================================
*/
#include <iostream>
#include <pthread.h>
#include "CMutexByRecordLockingAndPThread.h"
#include "CStatus.h"
using namespace std;
//让类内部自己new pthread_mutex_t
CMutexByRecordLockingAndPThread :: CMutexByRecordLockingAndPThread(const char * pstrFileName) :
m_ProcessMutex(pstrFileName, MUTEX_USE_RECORD_LOCK)
{
}
//使用外部提供的pthread_mutex_t变量来构造互斥量
CMutexByRecordLockingAndPThread :: CMutexByRecordLockingAndPThread(const char * pstrFileName, pthread_mutex_t * pMutex) :
m_ThreadMutex(pMutex), m_ProcessMutex(pstrFileName, MUTEX_USE_RECORD_LOCK)
{
}
CMutexByRecordLockingAndPThread :: ~CMutexByRecordLockingAndPThread()
{
}
CStatus CMutexByRecordLockingAndPThread :: Initialize()
{
return CStatus(0,0);
}
CStatus CMutexByRecordLockingAndPThread :: Uninitialize()
{
return CStatus(0,0);
}
CStatus CMutexByRecordLockingAndPThread :: Lock()
{
if( !m_ThreadMutex.Lock().IsSuccess() )
{
cout << "In CMutexByRecordLockingAndPThread::Lock, m_ThreadMutex.lock failed!" << endl;
return CStatus(-1,0);
}
if( !m_ProcessMutex.Lock().IsSuccess() )
{
cout << "In CMutexByRecordLockingAndPThread::Lock, m_ProcessMutex->lock failed!" << endl;
return CStatus(-1,0);
}
return CStatus(0,0);
}
CStatus CMutexByRecordLockingAndPThread :: Unlock()
{
if( !m_ProcessMutex.Unlock().IsSuccess() )
{
cout << "In CMutexByRecordLockingAndPThread::Unlock , m_ProcessMutex.Unlock failed!" << endl;
return CStatus(-1,0);
}
if( !m_ThreadMutex.Unlock().IsSuccess() )
{
cout<<"In CMutexByRecordLockingAndPThread::Unlock,m_ThreadMutex.Unlock failed!"<<endl;
return CStatus(-1,0);
}
return CStatus(0,0);
}
| [
"yin_jingyu@126.com"
] | yin_jingyu@126.com |
d264a823662d8f86aa4d7c4211e5d1a4a78e22d7 | b8376621d63394958a7e9535fc7741ac8b5c3bdc | /lib/lib_mech/src/base/Interface/jIWinUtil.h | cc4f323344eac02763c7e45df8c3b4ffe381154e | [] | no_license | 15831944/job_mobile | 4f1b9dad21cb7866a35a86d2d86e79b080fb8102 | ebdf33d006025a682e9f2dbb670b23d5e3acb285 | refs/heads/master | 2021-12-02T10:58:20.932641 | 2013-01-09T05:20:33 | 2013-01-09T05:20:33 | null | 0 | 0 | null | null | null | null | WINDOWS-1252 | C++ | false | false | 724 | h | /* file : jIWinUtil.h
Coder : by icandoit ( mech12@nate.com)
Date : 2007-11-05 12:10:25
comp.: jgame.co.kr
title :
desc :
*/
#ifndef __jIWinUtil_header__
#define __jIWinUtil_header__
#pragma once
namespace nMech
{
namespace nUtil
{
#define jINTERFACE_jIWinUtil(x) public: \
virtual void SaveWindowPos(HWND hWnd,cstr name) ##x \
virtual RECT LoadWindowPos(HWND hWnd,cstr name,DWORD flag =SWP_NOSIZE | SWP_SHOWWINDOW ) ##x \
virtual RECT LoadConsolePos(cstr regName) ##x \
virtual void SaveConsolePos(cstr regName) ##x \
jINTERFACE_END_BASE1(jIWinUtil,nInterface::jIInterface);
// »ç¿ë¹ý
// jIWinUtil* pjIWinUtil = jCREATE_INTERFACE(nMech::nUtil::jIWinUtil);
}
}
#endif // __jIWinUtil_header__
| [
"whdnrfo@gmail.com"
] | whdnrfo@gmail.com |
033eb2386f3ce0b8faa0bb8181f9dd577e964d80 | 847056145036966495171a6627ad373468347e03 | /College/09_10_2014/I.cpp | c0bb7a5787f144fb8db9f64479fe295751f09e6e | [] | no_license | cocokechun/Programming | f5f3e0b0a1fbdc105b718469c1bf893280cddba3 | 9a400ba2d38cdbb4af50d07b09273adb8bcbf427 | refs/heads/master | 2021-01-22T01:14:23.328035 | 2017-09-02T18:02:28 | 2017-09-02T18:02:28 | 102,213,453 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,593 | cpp | #include <iostream>
#include <algorithm>
#include <cmath>
#include <utility>
#include <queue>
#include <stack>
#include <cstring>
#include <set>
#include <cstdlib>
#include <cstdio>
#include <functional>
#include <map>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define MAX 2500
#define INF 250000
int rows, cols, V;
int grid[45][45];
vector<pii> graph[MAX];
bool mst[MAX];
int key[MAX];
int is_valid(int r, int c) {
return r >= 0 && r < rows && c >= 0 && c < cols;
}
pii minKey() {
int mini = INF;
int min_index;
for (int v = 0; v < V; v++) {
if (mst[v] == false && key[v] < mini) {
mini = key[v];
min_index = v;
}
}
return make_pair(min_index, mini);
}
int main() {
cin >> cols >> rows;
V = cols * rows;
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
cin >> grid[i][j];
}
}
// build the directed graph
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
int cur = i * cols + j;
//cout << i << ' ' << j << endl;
int w = grid[i][j];
if (is_valid(i-1, j)) {
int up = (i-1) * cols + j;
int x = grid[i-1][j];
graph[cur].push_back(make_pair(up,min(w, x)));
}
if (is_valid(i+1, j)) {
int down = (i+1) * cols + j;
int x = grid[i+1][j];
graph[cur].push_back(make_pair(down,min(w,x)));
}
if (is_valid(i, j-1)) {
int left = i * cols + j - 1;
int x = grid[i][j-1];
graph[cur].push_back(make_pair(left,min(w,x)));
}
if (is_valid(i, j+1)) {
int right = i * cols + j + 1;
int x = grid[i][j+1];
graph[cur].push_back(make_pair(right,min(w,x)));
}
}
}
// Prim's algrotihm
for (int i = 0; i < V; i++) {
key[i] = INF;
}
key[0] = 0;
int sum = 0;
for (int i = 0; i < V; i++) {
pii mins = minKey();
int u = mins.first;
sum += mins.second;
//cout << u << ' ' << mins.second << endl;
mst[u] = true;
vector<pii> nghrs = graph[u];
for (int j = 0; j < nghrs.size(); j++) {
int v = nghrs[j].first;
int w = nghrs[j].second;
if (mst[v] == false && w < key[v]) {
key[v] = w;
}
}
}
cout << sum << endl;
return 0;
}
| [
"kechunmao@KechuntekiMacBook-Pro.local"
] | kechunmao@KechuntekiMacBook-Pro.local |
e3bc4bc37b31a39c76d363d36c17d20bd349a1ea | b22588340d7925b614a735bbbde1b351ad657ffc | /athena/TileCalorimeter/TileG4/TileAncillary/MuonWall/src/MuonWallTool.h | dee9ddc9f179c4ad97f118293b86fdc9b9008bdc | [] | 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 | 817 | h | /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef MUONWALL_MUONWALLTOOL_H
#define MUONWALL_MUONWALLTOOL_H
// Base class header
#include "G4AtlasTools/DetectorGeometryBase.h"
// STL library
#include <string>
/** @class MuonWallTool MuonWallTool.h "MuonWall/MuonWallTool.h"
*
* Tool for building the MuonWall detector.
*/
class MuonWallTool final : public DetectorGeometryBase {
public:
// Basic constructor and destructor
MuonWallTool(const std::string& type, const std::string& name, const IInterface *parent);
~MuonWallTool();
/** Override DetectorGeometryBase::BuildGeometry method */
virtual void BuildGeometry() override final;
private:
double m_zLength;
double m_yLength;
double m_xLength;
};
#endif //MUONWALL_MUONWALLTOOL_H
| [
"rushioda@lxplus754.cern.ch"
] | rushioda@lxplus754.cern.ch |
43981d05fb0f80e497b8a07be47e6a5d5b10e95e | d93159d0784fc489a5066d3ee592e6c9563b228b | /SimDataFormats/CrossingFrame/interface/PCrossingFrame.h | 03f89d279800025369b17d7f28b8689890016c39 | [] | permissive | simonecid/cmssw | 86396e31d41a003a179690f8c322e82e250e33b2 | 2559fdc9545b2c7e337f5113b231025106dd22ab | refs/heads/CAallInOne_81X | 2021-08-15T23:25:02.901905 | 2016-09-13T08:10:20 | 2016-09-13T08:53:42 | 176,462,898 | 0 | 1 | Apache-2.0 | 2019-03-19T08:30:28 | 2019-03-19T08:30:24 | null | UTF-8 | C++ | false | false | 2,399 | h | #ifndef PCROSSING_FRAME_H
#define PCROSSING_FRAME_H
/** \class PCrossingFrame
*
* PCrossingFrame allow the write the transient CrossingFrame
*
* \author EmiliaBecheva, Claude Charlot, LLR Palaiseau
*
* \version 1st Version April 2009
*
************************************************************/
#include "SimDataFormats/CrossingFrame/interface/CrossingFrame.h"
template <class T>
class PCrossingFrame
{
public:
PCrossingFrame(){}
PCrossingFrame(const CrossingFrame<T>& cf);
PCrossingFrame(const PCrossingFrame<T> &pcf){};
~PCrossingFrame() {;}
// getters for data members of PCrossingFrame
edm::EventID getEventID() const {return Pid_;}
std::vector<const T *> getPileups() const {return PCFpileups_;}
int getBunchSpace() const {return PbunchSpace_;}
unsigned int getMaxNbSources() const {return PmaxNbSources_; }
std::string getSubDet() const { return PCFsubdet_;}
unsigned int getPileupFileNr() const {return PCFpileupFileNr_;}
edm::EventID getIdFirstPileup() const {return PCFidFirstPileup_;}
std::vector<unsigned int> getPileupOffsetsBcr() const {return PCFpileupOffsetsBcr_;}
std::vector< std::vector<unsigned int> > getPileupOffsetsSource() const {return PCFpileupOffsetsSource_;} //one per source
std::pair<int,int> getBunchRange() const {return std::pair<int,int>(firstPCrossing_,lastPCrossing_);}
private:
unsigned int PmaxNbSources_;
int PbunchSpace_;
edm::EventID Pid_;
int firstPCrossing_;
int lastPCrossing_;
std::vector<const T * > PCFpileups_;
std::vector<const T * > PCFsignals_;
std::string PCFsubdet_;
unsigned int PCFpileupFileNr_;
edm::EventID PCFidFirstPileup_;
std::vector<unsigned int> PCFpileupOffsetsBcr_;
std::vector< std::vector<unsigned int> > PCFpileupOffsetsSource_;
};
template <class T>
PCrossingFrame<T>::PCrossingFrame(const CrossingFrame<T>& cf)
{
//get data members from CrossingFrame
PmaxNbSources_= cf.getMaxNbSources();
PbunchSpace_ = cf.getBunchSpace();
Pid_ = cf.getEventID();
firstPCrossing_ = cf.getBunchRange().first;
lastPCrossing_ = cf.getBunchRange().second;
PCFpileups_ = cf.getPileups();
PCFsignals_ = cf.getSignal();
PCFsubdet_ = cf.getSubDet();
PCFpileupFileNr_ = cf.getPileupFileNr();
PCFidFirstPileup_ = cf.getIdFirstPileup();
PCFpileupOffsetsBcr_ = cf.getPileupOffsetsBcr();
PCFpileupOffsetsSource_ = cf.getPileupOffsetsSource();
}
#endif
| [
"giulio.eulisse@gmail.com"
] | giulio.eulisse@gmail.com |
5337105e33f8c5cf4231013d34cbad0ab178f4e7 | e398a585764f16511a70d0ef33a3b61da0733b69 | /7600.16385.1/src/print/XPSDrvSmpl/src/ui/xdsmplptprov.cpp | cadb1b0a9c13816e41ddbfeba3f370d1a0b832c5 | [
"MIT"
] | permissive | MichaelDavidGK/WinDDK | f9e4fc6872741ee742f8eace04b2b3a30b049495 | eea187e357d61569e67292ff705550887c4df908 | refs/heads/master | 2020-05-30T12:26:40.125588 | 2019-06-01T13:28:10 | 2019-06-01T13:28:10 | 189,732,991 | 0 | 0 | null | 2019-06-01T12:58:11 | 2019-06-01T12:58:11 | null | UTF-8 | C++ | false | false | 23,167 | cpp | /*++
Copyright (c) 2005 Microsoft Corporation
All rights reserved.
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
File Name:
xdsmplptprov.cpp
Abstract:
Implementation of the PrintTicket provider plugin. This is responsible for
handling PrintTicket features that are too complex for the GPD->PrintTicket
automapping facility.
--*/
#include "precomp.h"
#include "debug.h"
#include "globals.h"
#include "xdexcept.h"
#include "xdstring.h"
#include "xdsmplptprov.h"
#include "wmdmptcnv.h"
#include "pgscdmptcnv.h"
#include "bkdmptcnv.h"
#include "nupptcnv.h"
#include "coldmptcnv.h"
#include "pthndlr.h"
#include "pchndlr.h"
static LPCWSTR PRIVATE_URI = L"http://schemas.microsoft.com/windows/2003/08/printing/XPSDrv_Feature_Sample";
/*++
Routine Name:
CXDSmplPTProvider::CXDSmplPTProvider
Routine Description:
CXDSmplPTProvider class constructor
Arguments:
None
Return Value:
None
Throws CXDException(HRESULT) on an error
--*/
CXDSmplPTProvider::CXDSmplPTProvider() :
CUnknown<IPrintOemPrintTicketProvider>(IID_IPrintOemPrintTicketProvider),
m_hPrinterCached(NULL),
m_pCoreHelper(NULL),
m_bstrPrivateNS(PRIVATE_URI)
{
HRESULT hr = S_OK;
IFeatureDMPTConvert* pHandler = NULL;
//
// This Prefast warning indicates that memory could be leaked
// in the event of an exception. We suppress this false positive because we
// know that the local try/catch block will clean up a single
// IFeatureDMPTConvert, and the destructor will clean up any that are
// successfully added to the vector.
//
#pragma prefast(push)
#pragma prefast(disable:__WARNING_ALIASED_MEMORY_LEAK_EXCEPTION)
try
{
//
// Populate the feature DM<->PT conversion vector
//
pHandler = new CWatermarkDMPTConv();
if (SUCCEEDED(hr = CHECK_POINTER(pHandler, E_OUTOFMEMORY)))
{
m_vectFtrDMPTConverters.push_back(pHandler);
}
if (SUCCEEDED(hr))
{
pHandler = new CPageScalingDMPTConv();
if (SUCCEEDED(hr = CHECK_POINTER(pHandler, E_OUTOFMEMORY)))
{
m_vectFtrDMPTConverters.push_back(pHandler);
}
}
if (SUCCEEDED(hr))
{
pHandler = new CBookletDMPTConv();
if (SUCCEEDED(hr = CHECK_POINTER(pHandler, E_OUTOFMEMORY)))
{
m_vectFtrDMPTConverters.push_back(pHandler);
}
}
if (SUCCEEDED(hr))
{
pHandler = new CNUpDMPTConv();
if (SUCCEEDED(hr = CHECK_POINTER(pHandler, E_OUTOFMEMORY)))
{
m_vectFtrDMPTConverters.push_back(pHandler);
}
}
if (SUCCEEDED(hr))
{
pHandler = new CColorProfileDMPTConv();
if (SUCCEEDED(hr = CHECK_POINTER(pHandler, E_OUTOFMEMORY)))
{
m_vectFtrDMPTConverters.push_back(pHandler);
}
}
}
catch (exception& DBG_ONLY(e))
{
ERR(e.what());
hr = E_FAIL;
}
if (FAILED(hr))
{
//
// If we successfully created a handler but failed to push it onto
// the handler vector we need to free the allocated handler
//
if (pHandler != NULL)
{
delete pHandler;
pHandler = NULL;
}
//
// Delete any DM<->PT converters that were successfully instantiated
//
DeleteConverters();
throw CXDException(hr);
}
#pragma prefast(pop)
}
/*++
Routine Name:
CXDSmplPTProvider::~CXDSmplPTProvider
Routine Description:
CXDSmplPTProvider class destructor
Arguments:
None
Return Value:
None
--*/
CXDSmplPTProvider::~CXDSmplPTProvider()
{
//
// Clean up all DM<->PT converters
//
DeleteConverters();
}
/*++
Routine Name:
CXDSmplPTProvider::GetSupportedVersions
Routine Description:
The routine returns major versions of Printschema schema supported by the plug-in Provider.
Arguments:
hPrinter - Printer Handle
ppVersions - OUT pointer to array of version numbers to be filled in by the plug-in
cVersions - OUT pointer to count of Number of versions supported by plug-in
Return Value:
HRESULT
S_OK - On success
E_* - On error
--*/
HRESULT STDMETHODCALLTYPE
CXDSmplPTProvider::GetSupportedVersions(
__in HANDLE,
__deref_out_ecount(*pcVersions) INT* ppVersions[],
__out INT* pcVersions
)
{
HRESULT hr = S_OK;
//
// Check if input parameters are valid
//
if (SUCCEEDED(hr = CHECK_POINTER(ppVersions, E_POINTER)) &&
SUCCEEDED(hr = CHECK_POINTER(pcVersions, E_POINTER)))
{
*pcVersions = 0;
//
// The Plug-in Provider need to allocate memory for the input version array and
// then fill it with version information
//
*ppVersions = static_cast<INT*>(CoTaskMemAlloc(sizeof(INT)));
if (*ppVersions != NULL)
{
//
// version number 1 is the only version supported currently
//
*pcVersions = 1;
(*ppVersions)[0] = PRINTSCHEMA_VERSION_NUMBER;
}
else
{
hr = E_OUTOFMEMORY;
}
}
ERR_ON_HR(hr);
return hr;
}
/*++
Routine Name:
CXDSmplPTProvider::BindPrinter
Routine Description:
Bind Printer is the part of the Unidrv's activity to bind to a device. It allows the plug-in to cache
certain information that can be used later on such as the private namespaces used by the plug-in.
Arguments:
hPrinter - Printer Handle supplied by Unidrv
version - version of Printschema
pOptions - Flags passed out to set configurable options supported by caller
cNamespaces - Count of private namespaces of plug-in
ppNamespaces - OUT pointer to the array of Namespace URIs filled in by plug-in
Return Value:
HRESULT
S_OK - On success
E_VERSION_NOT_SUPPORTED - if printer version specified is not supported by plug-in
E_* - On any other failure
--*/
HRESULT STDMETHODCALLTYPE
CXDSmplPTProvider::BindPrinter(
__in HANDLE hPrinter,
__in INT version,
__out POEMPTOPTS pOptions,
__out INT* pcNamespaces,
__deref_out_ecount_opt(*pcNamespaces) BSTR** ppNamespaces
)
{
HRESULT hr = S_OK;
//
// Printer Handle should be provided by Unidrv in this call, which is cached by plug-in provider and
// is later on used while making calls to Plug-in Helper Interface methods.
//
if (SUCCEEDED(hr = CHECK_POINTER(pOptions, E_POINTER)) &&
SUCCEEDED(hr = CHECK_POINTER(pcNamespaces, E_POINTER)) &&
SUCCEEDED(hr = CHECK_POINTER(ppNamespaces, E_POINTER)) &&
SUCCEEDED(hr = CHECK_POINTER(hPrinter, E_HANDLE)))
{
*ppNamespaces = NULL;
*pcNamespaces = 0;
//
// Agree on the Printschema version with Unidrv Version 1 is the only
// version currently supported
//
if (PRINTSCHEMA_VERSION_NUMBER == version)
{
//
// Cache the printer handle for further use
//
m_hPrinterCached = hPrinter;
//
// Flags to set configurable options, OEMPT_DEFAULT defined in prcomoem.h
//
*pOptions = OEMPT_NOSNAPSHOT;
//
// Publish the private namespace
//
*pcNamespaces = 1;
*ppNamespaces = static_cast<BSTR*>(CoTaskMemAlloc(sizeof(BSTR)));
if (SUCCEEDED(hr = CHECK_POINTER(*ppNamespaces, E_OUTOFMEMORY)))
{
hr = m_bstrPrivateNS.CopyTo(*ppNamespaces);
}
}
else
{
hr = E_VERSION_NOT_SUPPORTED;
}
}
ERR_ON_HR_EXC(hr, E_VERSION_NOT_SUPPORTED);
return hr;
}
/*++
Routine Name:
CXDSmplPTProvider::PublishPrintTicketHelperInterface
Routine Description:
For a number of operations, the plug-in needs to use the Helper Interface utilities provided by
Unidrv. Unidrv uses this method to publish the PrintTicket Helper Interface, IPrintCoreHelper.
Plug-in should return SUCCESS after successfully incrementing the reference count of the interface.
Arguments:
pHelper - IPrintCoreHelper interface pointer
Return Value:
HRESULT
S_OK - On success
E_* - On error
--*/
HRESULT STDMETHODCALLTYPE
CXDSmplPTProvider::PublishPrintTicketHelperInterface(
__in IUnknown *pHelper
)
{
HRESULT hr = S_OK;
if (SUCCEEDED(hr = CHECK_POINTER(pHelper, E_POINTER)))
{
//
// Need to store pointer to Driver Helper functions, if we already haven't.
//
if (m_pCoreHelper == NULL)
{
hr = pHelper->QueryInterface(IID_IPrintCoreHelperUni, reinterpret_cast<VOID**>(&m_pCoreHelper));
}
//
// It's possible that this routine will publish other interfaces in the future.
// If the object published did not support the desired interface, this routine
// should still succeed.
//
// If the helper interface is needed, but for some reason was not published
// (this would be an error on the OS's part), you should detect this and fail
// during the call-back where you intended to use the helper interface.
//
if (E_NOINTERFACE == hr)
{
hr = S_OK;
}
else
{
try
{
//
// Iterate over all PrintTicket feature converters publishing the helper interface
//
DMPTConvCollection::iterator iterConverters = m_vectFtrDMPTConverters.begin();
for (; iterConverters != m_vectFtrDMPTConverters.end() && SUCCEEDED(hr); iterConverters++)
{
hr = (*iterConverters)->PublishPrintTicketHelperInterface(m_pCoreHelper);
}
}
catch (exception& DBG_ONLY(e))
{
ERR(e.what());
hr = E_FAIL;
}
}
}
ERR_ON_HR(hr);
return hr;
}
/*++
Routine Name:
CXDSmplPTProvider::QueryDeviceDefaultNamespace
Routine Description:
This method provides the plug-in with the opportunity to specify the name of the
Private namespace URI that Unidrv should be using to handle any features defined
in the GPD that Unidrv does not recognize. The plug-in may specify a set of
namespaces as a result of the call to BindPrinter method, and Unidrv needs to know
which of them is to be used as default namespace so that, for all the features that
Unidrv does not recognize, it will put them under this namespace in the PrintTicket.
Note: It is Unidrv's responsibility to add the private namespace URI that plug-in
has specified through this call in the root node of the DOM document, and also define
a prefix for it so that plug-in should use the prefix defined by Unidrv when it wishes
to add any new node to the PrintTicket under its private namespace. Plug-in should
not define its own prefix for this default private namespace URI.
Arguments:
pbstrNamespaceUri - OUT Pointer to namespace URI to be filled in and returned by plug-in
Return Value:
HRESULT
S_OK - On success
E_NOTIMPL - The plugin does not require a private namespace
E_* - On error
--*/
HRESULT STDMETHODCALLTYPE
CXDSmplPTProvider::QueryDeviceDefaultNamespace(
__out BSTR* pbstrNamespaceUri
)
{
HRESULT hr = S_OK;
if (SUCCEEDED(hr = CHECK_POINTER(pbstrNamespaceUri, E_POINTER)))
{
hr = m_bstrPrivateNS.CopyTo(pbstrNamespaceUri);
}
ERR_ON_HR(hr);
return hr;
}
/*++
Routine Name:
CXDSmplPTProvider::ConvertPrintTicketToDevMode
Routine Description:
Unidrv will call this routine before it performs its part of PT->DM
conversion. The plug-in is passed with an input PrintTicket that is
fully populated, and Devmode which has default settings in it.
This routine merely passes the call on to the individual feature handlers.
Arguments:
pPrintTicket - pointer to input PrintTicket
cbDevmode - size in bytes of input full devmode
pDevmode - pointer to input full devmode buffer
cbDrvPrivateSize - buffer size in bytes of plug-in private devmode
pPrivateDevmode - pointer to plug-in private devmode buffer
Return Value:
HRESULT
S_OK - On success
E_* - On error
--*/
HRESULT STDMETHODCALLTYPE
CXDSmplPTProvider::ConvertPrintTicketToDevMode(
__in IXMLDOMDocument2* pPrintTicket,
__in ULONG cbDevmode,
__inout PDEVMODE pDevmode,
__in ULONG cbDrvPrivateSize,
__in PVOID pPrivateDevmode
)
{
HRESULT hr = S_OK;
//
// Validate parameters
//
if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) &&
SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER)) &&
SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER)))
{
if (cbDevmode < sizeof(DEVMODE) ||
cbDrvPrivateSize == 0)
{
hr = E_INVALIDARG;
}
}
try
{
if (SUCCEEDED(hr))
{
//
// Iterate over all PrintTicket feature converters letting them
// provide the conversion
//
DMPTConvCollection::iterator iterConverters = m_vectFtrDMPTConverters.begin();
for (; iterConverters != m_vectFtrDMPTConverters.end() && SUCCEEDED(hr); iterConverters++)
{
hr = (*iterConverters)->ConvertPrintTicketToDevMode(pPrintTicket, cbDevmode, pDevmode, cbDrvPrivateSize, pPrivateDevmode);
}
}
}
catch (exception& DBG_ONLY(e))
{
ERR(e.what());
hr = E_FAIL;
}
ERR_ON_HR(hr);
return hr;
}
/*++
Routine Name:
CXDSmplPTProvider::ConvertDevModeToPrintTicket
Routine Description:
Unidrv will call the routine with an Input PrintTicket that is populated
with public and Unidrv private features. For those features in the GPD that
Unidrv does not understand, it puts them in the PT under the private namespace
(either specified by the plug-in through QueryDeviceDefaultNamespace or created
by itself). It is the plug-in's responsibility to read the corresponding features
from the input PT and put them in public printschema namespace, so that any higher
level application making use of a PrintTicket can read and interpret these settings.
This routine merely passes the call on to the individual feature handlers.
Arguments:
cbDevmode - size in bytes of input full devmode
pDevmode - pointer to input full devmode buffer
cbDrvPrivateSize - buffer size in bytes of plug-in private devmode
pPrivateDevmode - pointer to plug-in private devmode buffer
pPrintTicket - pointer to input PrintTicket
Return Value:
HRESULT
S_OK - On success
E_* - On error
--*/
HRESULT STDMETHODCALLTYPE
CXDSmplPTProvider::ConvertDevModeToPrintTicket(
__in ULONG cbDevmode,
__in PDEVMODE pDevmode,
__in ULONG cbDrvPrivateSize,
__in PVOID pPrivateDevmode,
__inout IXMLDOMDocument2* pPrintTicket
)
{
HRESULT hr = S_OK;
//
// Validate parameters
//
if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) &&
SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER)) &&
SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER)))
{
if (cbDevmode < sizeof(DEVMODE) ||
cbDrvPrivateSize == 0)
{
hr = E_INVALIDARG;
}
}
try
{
if (SUCCEEDED(hr))
{
//
// Iterate over all PrintTicket feature converters letting them
// provide the conversion
//
DMPTConvCollection::iterator iterConverters = m_vectFtrDMPTConverters.begin();
for (; iterConverters != m_vectFtrDMPTConverters.end() && SUCCEEDED(hr); iterConverters++)
{
hr = (*iterConverters)->ConvertDevModeToPrintTicket(cbDevmode, pDevmode, cbDrvPrivateSize, pPrivateDevmode, pPrintTicket);
}
//
// Delete all the private features generated by the Unidrv parser from the GPD.
// These are not required in the PrintTicket as they are only used to control
// features in the public PrintSchema and have no meaning outside the config
// module.
//
if (SUCCEEDED(hr))
{
CPTHandler ptHandler(pPrintTicket);
hr = ptHandler.DeletePrivateFeatures(m_bstrPrivateNS);
}
}
}
catch (exception& DBG_ONLY(e))
{
ERR(e.what());
hr = E_FAIL;
}
ERR_ON_HR(hr);
return hr;
}
/*++
Routine Name:
CXDSmplPTProvider::CompletePrintCapabilities
Routine Description:
Unidrv calls this routine with an input Device Capabilities Document
that is partially populated with Device capabilities information
filled in by Unidrv for features that it understands. The plug-in
needs to read any private features in the input PrintTicket, delete
them and add them back under Printschema namespace so that higher
level applications can understand them and make use of them.
The XPSDrv sample driver does not define any private device capabilities
so this method merely returns S_OK
Arguments:
pPrintTicket - pointer to input PrintTicket
pCapabilities - pointer to Device Capabilities Document.
Return Value:
HRESULT
S_OK - Always
--*/
HRESULT STDMETHODCALLTYPE
CXDSmplPTProvider::CompletePrintCapabilities(
__in_opt IXMLDOMDocument2* pPrintTicket,
__inout IXMLDOMDocument2* pPrintCapabilities
)
{
HRESULT hr = S_OK;
//
// Validate parameters
//
if (SUCCEEDED(hr = CHECK_POINTER(pPrintCapabilities, E_POINTER)))
{
try
{
//
// Iterate over all PrintTicket feature converters letting them
// provide the conversion
//
DMPTConvCollection::iterator iterConverters = m_vectFtrDMPTConverters.begin();
for (; iterConverters != m_vectFtrDMPTConverters.end() && SUCCEEDED(hr); iterConverters++)
{
hr = (*iterConverters)->CompletePrintCapabilities(pPrintTicket, pPrintCapabilities);
}
//
// Delete all the private features generated by the Unidrv parser from the GPD.
// These are not required in the PrintCapabilities as they are only used to control
// features in the public PrintSchema and have no meaning outside the config
// module.
//
if (SUCCEEDED(hr))
{
CPCHandler pcHandler(pPrintCapabilities);
hr = pcHandler.DeletePrivateFeatures(m_bstrPrivateNS);
}
}
catch (exception& DBG_ONLY(e))
{
ERR(e.what());
hr = E_FAIL;
}
}
ERR_ON_HR(hr);
return hr;
}
/*++
Routine Name:
CXDSmplPTProvider::ExpandIntentOptions
Routine Description:
As part of its Merge and Validate Procedure, the Unidrv/Postscript driver
will call this routine to give the plug-in a chance to expand options
which represent intent into their individual settings in other features
in the PrintTicket. This has two important effects: the client sees the
results of the intent expansion, and unidrv resolves constraints against
the individual features which are affected by the intent.
The XPSDrv sample driver plug-in does not support any intent features, therefore
simply returns S_OK.
Arguments:
pPrintTicket - Pointer to input PrintTicket.
Return Value:
HRESULT
S_OK - Always
--*/
HRESULT STDMETHODCALLTYPE
CXDSmplPTProvider::ExpandIntentOptions(
__inout IXMLDOMDocument2 *
)
{
return S_OK;
}
/*++
Routine Name:
CXDSmplPTProvider::ValidatePrintTicket
Routine Description:
The plug-in might need to delete any feature under private namespace
from input PT that are also in the public namespace because of Merge
and Validate.
The Validate method should also perform any conflict resolution if
necessary looking at the settings made in public and unidrv private
part of PrintTicket, to make sure that the resultant PrintTicket is a
valid one, and has all constraints resolved.
This routine merely passes the validate call on to the feature handlers
Arguments:
pPrintTicket - Pointer to input PrintTicket.
Return Value:
HRESULT
S_NO_CONFLICT/S_CONFLICT_RESOLVED - On success
E_* - On error
--*/
HRESULT STDMETHODCALLTYPE
CXDSmplPTProvider::ValidatePrintTicket(
__inout IXMLDOMDocument2* pPrintTicket
)
{
HRESULT hr = S_NO_CONFLICT;
//
// Validate parameters
//
if (pPrintTicket != NULL)
{
try
{
//
// Iterate over all PrintTicket feature converters letting them
// provide the validation
//
DMPTConvCollection::iterator iterConverters = m_vectFtrDMPTConverters.begin();
for (; iterConverters != m_vectFtrDMPTConverters.end() && SUCCEEDED(hr); iterConverters++)
{
HRESULT hrConverter = (*iterConverters)->ValidatePrintTicket(pPrintTicket);
if (FAILED(hrConverter) ||
hrConverter == static_cast<HRESULT>(S_CONFLICT_RESOLVED))
{
hr = hrConverter;
}
}
}
catch (...)
{
hr = E_FAIL;
}
}
else
{
hr = E_POINTER;
}
ERR_ON_HR(hr);
return hr;
}
/*++
Routine Name:
CXDSmplPTProvider::DeleteConverters
Routine Description:
This routine cleans up the vector of DM <-> PT converters.
Arguments:
NONE
Return Value:
HRESULT
S_OK - On success
E_* - On error
--*/
HRESULT
CXDSmplPTProvider::DeleteConverters(
VOID
)
{
HRESULT hr = S_OK;
try
{
while (!m_vectFtrDMPTConverters.empty())
{
if (m_vectFtrDMPTConverters.back() != NULL)
{
delete m_vectFtrDMPTConverters.back();
m_vectFtrDMPTConverters.back() = NULL;
}
m_vectFtrDMPTConverters.pop_back();
}
}
catch (exception& DBG_ONLY(e))
{
ERR(e.what());
hr = E_FAIL;
}
ERR_ON_HR(hr);
return hr;
}
| [
"blindtiger@foxmail.com"
] | blindtiger@foxmail.com |
263a567555251ed963302bfc554f58b681d88e52 | a1fbf16243026331187b6df903ed4f69e5e8c110 | /cs/sdk/3d_sdk/maya/ver-2008/devkit/plug-ins/meshRemapTool.h | ce2c5e35a963fd2536962721310b55430505aeb0 | [
"LicenseRef-scancode-warranty-disclaimer",
"BSD-2-Clause"
] | permissive | OpenXRay/xray-15 | ca0031cf1893616e0c9795c670d5d9f57ca9beff | 1390dfb08ed20997d7e8c95147ea8e8cb71f5e86 | refs/heads/xd_dev | 2023-07-17T23:42:14.693841 | 2021-09-01T23:25:34 | 2021-09-01T23:25:34 | 23,224,089 | 64 | 23 | NOASSERTION | 2019-04-03T17:50:18 | 2014-08-22T12:09:41 | C++ | UTF-8 | C++ | false | false | 3,377 | h | //
// Author: Bruce Hickey
//
// Description:
//
// A context to allow remapping vertex/edge lists from one mesh to another
//
#ifndef _MESH_REMAP_TOOL_H_
#define _MESH_REMAP_TOOL_H_
#include <maya/MString.h>
#include <maya/MItSelectionList.h>
#include <maya/MPxContextCommand.h>
#include <maya/MPxContext.h>
#include <maya/MPxSelectionContext.h>
#include <maya/MEvent.h>
#include <maya/M3dView.h>
#include <maya/MObjectArray.h>
#include <maya/MDagPathArray.h>
#include <maya/MIntArray.h>
#include <meshRemapCmd.h>
class meshRemapTool : public MPxSelectionContext
//class meshRemapTool : public MPxContext
{
public:
meshRemapTool();
virtual ~meshRemapTool();
void* creator();
void toolOnSetup( MEvent & event );
MStatus doRelease( MEvent& );
private:
void helpStateHasChanged();
void reset();
MSelectionList fSelectionList;
MObjectArray fSelectedComponentSrc;
MDagPathArray fSelectedPathSrc;
MObjectArray fSelectedComponentDst;
MDagPathArray fSelectedPathDst;
MIntArray fSelectVtxSrc;
MIntArray fSelectVtxDst;
MString fCurrentHelpString;
int fSelectedFaceSrc;
int fSelectedFaceDst;
int fNumSelectedPoints;
meshRemapCommand *fCmd;
};
//////////////////////////////////////////////
// Command to create contexts
//////////////////////////////////////////////
class meshRemapContextCmd : public MPxContextCommand
{
public:
meshRemapContextCmd() {};
virtual MPxContext* makeObj();
static void* creator();
};
#endif
//-
// ==========================================================================
// Copyright (C) 1995 - 2006 Autodesk, Inc. and/or its licensors. All
// rights reserved.
//
// The coded instructions, statements, computer programs, and/or related
// material (collectively the "Data") in these files contain unpublished
// information proprietary to Autodesk, Inc. ("Autodesk") and/or its
// licensors, which is protected by U.S. and Canadian federal copyright
// law and by international treaties.
//
// The Data is provided for use exclusively by You. You have the right
// to use, modify, and incorporate this Data into other products for
// purposes authorized by the Autodesk software license agreement,
// without fee.
//
// The copyright notices in the Software and this entire statement,
// including the above license grant, this restriction and the
// following disclaimer, must be included in all copies of the
// Software, in whole or in part, and all derivative works of
// the Software, unless such copies or derivative works are solely
// in the form of machine-executable object code generated by a
// source language processor.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
// AUTODESK DOES NOT MAKE AND HEREBY DISCLAIMS ANY EXPRESS OR IMPLIED
// WARRANTIES INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES OF
// NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
// PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE, OR
// TRADE PRACTICE. IN NO EVENT WILL AUTODESK AND/OR ITS LICENSORS
// BE LIABLE FOR ANY LOST REVENUES, DATA, OR PROFITS, OR SPECIAL,
// DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES, EVEN IF AUTODESK
// AND/OR ITS LICENSORS HAS BEEN ADVISED OF THE POSSIBILITY
// OR PROBABILITY OF SUCH DAMAGES.
//
// ==========================================================================
//+
| [
"paul-kv@yandex.ru"
] | paul-kv@yandex.ru |
8718fcab76dd9dd781aa09b60d40373b2a95d032 | ff4cf3fcaa85d785f04cf92fa29c2fea199db845 | /ros/src/control/include/control/lon_controller.h | 054d6e4086ac9dbcce1650f72df429df762ada06 | [] | no_license | mr-d-self-driving/auto-car | 6a5ba3648634860e200b9e8d3eba5e61c0a6c13c | 6fa1b3b6d51ee0dbb9a9421c2b527e11876f22cb | refs/heads/master | 2022-01-12T12:33:51.974028 | 2018-11-13T05:53:34 | 2018-11-13T05:53:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,384 | h | #ifndef LON_CONTROLLER_H_
#define LON_CONTROLLER_H_
#include "control/controller.h"
#include "control/pid_controller.h"
#include "car_msgs/control_cmd.h"
#include "car_msgs/chassis.h"
#include "car_msgs/localization.h"
#include "car_msgs/trajectory.h"
#include "car_msgs/trajectory_point.h"
#include "control/trajectory_analyzer.h"
namespace control {
class LonControllerConf{
public:
LonControllerConf(){};
virtual ~LonControllerConf(){};
double ts;
PidConf station_pid_conf;
PidConf speed_pid_conf;
};
class LonController {
public:
LonController();
void Init(const LonControllerConf *control_conf);
/**
* @brief compute brake / throttle values based on current vehicle status
* and target trajectory_path
* @param localization vehicle location
* @param chassis vehicle status e.g., speed, acceleration
* @param trajectory_path trajectory_path generated by planning
* @param cmd control command
* @return Status computation status
*/
void ComputeControlCommand(
const car_msgs::trajectory *planning_published_trajectory,
const VehicleState *vehicle_state,
car_msgs::control_cmd *control_cmd,
SimpleLongitudinalDebug *debug);
void ComputeLongitudinalErrors(
const double x,
const double y,
const double theta,
const double linear_velocity,
const TrajectoryAnalyzer &trajectory_analyzer,
SimpleLongitudinalDebug *debug);
/**
* @brief reset longitudinal controller
* @return Status reset status
*/
bool Reset();
/**
* @brief stop longitudinal controller
*/
void Stop();
protected:
const std::string name_;
double ts_;
TrajectoryAnalyzer trajectory_analyzer_;
PIDController station_pid_controller_;
PIDController speed_pid_controller_;
};
}//namespace control
#endif // LON_CONTROLLER_H_
| [
"1002925853@qq.com"
] | 1002925853@qq.com |
0e2a83d1bf79a7b5f56a6b0626fcb22d5c66eb6f | c28f48ab0207c0e09a3883b170cf33e1ebbe9198 | /Command/main.cpp | a126276605866a6272d235d85f592cfb02cb486a | [] | no_license | csp123/DesignPattern | 7e5f618a77db72f29a52709dcad7640e5653c942 | 3d175d9eae69d4e2cf11530f043e520c253215ca | refs/heads/master | 2020-06-11T04:55:19.449370 | 2019-06-26T08:27:27 | 2019-06-26T08:27:27 | 193,854,836 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 315 | cpp |
#include <iostream>
#include "command.h"
#include "Reciver.h"
#include "Invoker.h"
using namespace std;
int main(int argc,char *argv[])
{
Reciver *recv = new Reciver();
Command *cmd = new ConcreteCommand(recv);
Invoker * ivk = new Invoker(cmd);
ivk->DoInvoker();
getchar();
return 0;
} | [
"1097370976@qq.com"
] | 1097370976@qq.com |
c5b083942ff789a29ecece25266c7b27f39a439f | 77a08ec51aa16191986a739267fd9d4379bbb208 | /bc/50B.cpp | b73226804a49c7a7005300efd317cfb3adf4daa0 | [] | 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 | 476 | cpp | #include<stdio.h>
#include<string.h>
#include<algorithm>
#include<math.h>
using namespace std;
typedef long long ll;
ll dp[65];
int read(){
int x=0;
char c=getchar();
while(c>'9'||c<'0')c=getchar();
while(c>='0'&&c<='9'){
x=x*10+c-'0';
c=getchar();
}
return x;
}
void init(){
dp[1]=1;
dp[2]=2;
dp[3]=3;
for(int i=4;i<=60;i++){
dp[i]=dp[i-3]+1+dp[i-1];
}
}
int main(){
int n;
init();
while(scanf("%d",&n)!=EOF){
printf("%lld\n",dp[n]);
}
return 0;
}
| [
"810988849@qq.com"
] | 810988849@qq.com |
5aceaa03b02e00c7243e273a5fef70f2fb243651 | d1495e408b0cef493f61c43ccf7b6eb863514a37 | /src/cbs/components/Manager.h | c15e353637f66f6564781c8ee0c183fa5ba1c92f | [
"MIT"
] | permissive | Yossari4n/SolarSystem | 5ffdd9ee94a851663d7b36c5b8110d1862be78b5 | c6fae48c459cc097019a44d8c2404330a599b0fb | refs/heads/master | 2022-07-12T16:32:08.212101 | 2022-06-24T16:59:28 | 2022-06-24T16:59:28 | 154,016,481 | 5 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 867 | h | #ifndef Manager_h
#define Manager_h
#include "IComponent.h"
#include "FirstPersonController.h"
#include "ThirdPersonController.h"
#include "../../utilities/Time.h"
#include "../../utilities/Input.h"
#include <array>
class Manager : public IComponent {
public:
Manager(std::array<class Object *, 9> planets, FirstPersonController* fpc, ThirdPersonController* tpc);
void Initialize() override;
void Update() override;
private:
// Drawing mode
bool m_Realistic;
// Camera controllers
FirstPersonController* m_FPC;
ThirdPersonController* m_TPC;
// Time
bool m_Paused;
unsigned int m_TimeMultiplayersIndex;
std::array<int, 5> m_TimeMultiplayers;
// Planets
int m_CurrentPlanetIndex;
std::array<class Object*, 9> m_AstronomicalObjects;
std::array<float, 9> m_Radiuses;
};
#endif
| [
"j.stokowski97@gmail.com"
] | j.stokowski97@gmail.com |
5af744779408ec36eaa6b9f6e64e37f31324d226 | 2496a1ae2ac0d0ace6a70ce8d2ada38a63a33401 | /tensorflow/compiler/xla/client/executable_build_options.h | 34f95b35e0fd8cb6e2539db0c7a7fa345f94b959 | [
"LicenseRef-scancode-generic-cla",
"Apache-2.0",
"BSD-2-Clause"
] | permissive | plaidml/tensorflow | d78ba08f8fac6455b467e9001f17ad975d7580a2 | 607ae43f43426421642f26a6abaf350a20b5ffbe | refs/heads/master | 2022-09-20T22:33:39.225897 | 2022-08-11T13:31:22 | 2022-08-11T13:35:05 | 215,591,809 | 1 | 1 | Apache-2.0 | 2022-04-22T18:49:14 | 2019-10-16T16:15:50 | C++ | UTF-8 | C++ | false | false | 8,685 | h | /* Copyright 2018 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.
==============================================================================*/
#ifndef TENSORFLOW_COMPILER_XLA_CLIENT_EXECUTABLE_BUILD_OPTIONS_H_
#define TENSORFLOW_COMPILER_XLA_CLIENT_EXECUTABLE_BUILD_OPTIONS_H_
#include <optional>
#include <vector>
#include "absl/strings/string_view.h"
#include "tensorflow/compiler/xla/service/computation_placer.h"
#include "tensorflow/compiler/xla/shape.h"
#include "tensorflow/compiler/xla/util.h"
#include "tensorflow/compiler/xla/xla.pb.h"
#include "tensorflow/compiler/xla/xla_data.pb.h"
#include "tensorflow/core/platform/threadpool.h"
namespace stream_executor {
// Forward-declared to avoid StreamExecutor dependency.
class DeviceMemoryAllocator;
} // namespace stream_executor
namespace xla {
// Class containing options for building an LocalExecutable with
// LocalClient::Compile.
class ExecutableBuildOptions {
public:
// If set, this is the device to build the computation for. Valid
// device_ordinal values are: 0 to # of devices - 1. These values are
// identical to the device ordinal values used by StreamExecutor. The built
// executable will be executable on any device equivalent to the specified
// device as determined by Backend::devices_equivalent(). A value of -1
// indicates this option has not been set.
ExecutableBuildOptions& set_device_ordinal(int device_ordinal);
int device_ordinal() const;
// If set, this specifies the layout of the result of the computation. If not
// set, the service will chose the layout of the result. A Shape is used to
// store the layout to accommodate tuple result shapes. A value of nullptr
// indicates the option has not been set.
ExecutableBuildOptions& set_result_layout(const Shape& shape_with_layout);
const Shape* result_layout() const;
// Expose access to the XLA debug options which will be passed to the
// compilation process.
bool has_debug_options() const { return debug_options_.has_value(); }
const DebugOptions& debug_options() const { return *debug_options_; }
DebugOptions* mutable_debug_options();
// If set, this specifies an allocator that can be used to allocate temporary
// space on the device during compilation. For example, the compiler might
// want to run various algorithms on the device and pick the fastest one -- it
// might allocate buffers for use by these algorithms using this allocator.
//
// This does not need to be the same as the se::DeviceMemoryAllocator passed
// when running the executable.
ExecutableBuildOptions& set_device_allocator(
se::DeviceMemoryAllocator* allocator);
se::DeviceMemoryAllocator* device_allocator() const;
// Returns a string representation of the build options, suitable for
// debugging.
std::string ToString() const;
// The number of replicas of this computation that are to be executed.
// Defaults to 1.
int num_replicas() const { return num_replicas_; }
ExecutableBuildOptions& set_num_replicas(int num_replicas);
// The number of partitions in this computation. Defaults to 1.
int num_partitions() const { return num_partitions_; }
ExecutableBuildOptions& set_num_partitions(int num_partitions);
// Indicates whether to use SPMD (true) or MPMD (false) partitioning when
// num_partitions > 1 and XLA is requested to partition the input program.
bool use_spmd_partitioning() const { return use_spmd_partitioning_; }
ExecutableBuildOptions& set_use_spmd_partitioning(bool use_spmd_partitioning);
// Whether to automatically generate XLA shardings for SPMD partitioner.
bool use_auto_spmd_partitioning() const {
return use_auto_spmd_partitioning_;
}
ExecutableBuildOptions& set_use_auto_spmd_partitioning(
bool use_auto_spmd_partitioning);
std::vector<int64_t> auto_spmd_partitioning_mesh_shape() const {
return auto_spmd_partitioning_mesh_shape_;
}
ExecutableBuildOptions& set_auto_spmd_partitioning_mesh_shape(
std::vector<int64_t> mesh_shape);
std::vector<int64_t> auto_spmd_partitioning_mesh_ids() const {
return auto_spmd_partitioning_mesh_ids_;
}
ExecutableBuildOptions& set_auto_spmd_partitioning_mesh_ids(
std::vector<int64_t> mesh_ids);
bool deduplicate_hlo() const { return deduplicate_hlo_; }
ExecutableBuildOptions& set_deduplicate_hlo(bool deduplicate_hlo);
// If set, this specifies a static device assignment for the computation.
// Otherwise, the computation will be compiled generically and can be run with
// any device assignment compatible with the computation's replica and
// partition counts.
bool has_device_assignment() const { return device_assignment_.has_value(); }
ExecutableBuildOptions& set_device_assignment(
const DeviceAssignment& device_assignment);
const DeviceAssignment& device_assignment() const {
CHECK(device_assignment_.has_value());
return device_assignment_.value();
}
// Whether input and output buffers are aliased if the associated parameter is
// passed-through XLA modules without being changed.
bool alias_passthrough_params() const { return alias_passthrough_params_; }
void set_alias_passthrough_params(bool alias_passthrough_params) {
alias_passthrough_params_ = alias_passthrough_params;
}
bool run_backend_only() const { return run_backend_only_; }
// By default, XLA builds an executable by invoking standard compilation, i.e,
// running Compiler::Compile, or both Compiler::RunHloPasses and
// Compiler::RunBackend. When run_backend_only is set to true, XLA builds an
// executable by invoking only RunBackend and skip invoking RunHloPasses,
// which can be used to compile post-optimizations HLO modules.
ExecutableBuildOptions& set_run_backend_only(bool run_backend_only) {
run_backend_only_ = run_backend_only;
return *this;
}
bool allow_spmd_sharding_propagation_to_output() const {
return allow_spmd_sharding_propagation_to_output_;
}
// Allows sharding propagation to propagate to the outputs. This changes the
// output shape of the computation (which is undesirable), but it can be used
// to allow to run partial compilation to determine what would be the output
// sharding of a computation if XLA would be allowed to propagate the sharding
// which can be used by higher level framework as a way to query intermediate
// sharding of operations when multiple computation would be chained and
// merged together.
ExecutableBuildOptions& set_allow_spmd_sharding_propagation_to_output(
bool allow_spmd_sharding_propagation_to_output) {
allow_spmd_sharding_propagation_to_output_ =
allow_spmd_sharding_propagation_to_output;
return *this;
}
// Thread pool for parallel compilation.
tensorflow::thread::ThreadPool* compile_thread_pool() const {
return compile_thread_pool_;
}
ExecutableBuildOptions& set_compile_thread_pool(
tensorflow::thread::ThreadPool* compile_thread_pool) {
compile_thread_pool_ = compile_thread_pool;
return *this;
}
private:
int device_ordinal_ = -1;
Shape result_layout_;
bool result_layout_set_ = false;
std::optional<DebugOptions> debug_options_;
se::DeviceMemoryAllocator* device_allocator_ = nullptr;
int num_replicas_ = 1;
int num_partitions_ = 1;
bool use_spmd_partitioning_ = false;
bool use_auto_spmd_partitioning_ = false;
std::vector<int64_t> auto_spmd_partitioning_mesh_shape_;
std::vector<int64_t> auto_spmd_partitioning_mesh_ids_;
bool deduplicate_hlo_ = false;
bool broadcast_replicated_params_ = false;
std::optional<DeviceAssignment> device_assignment_;
bool alias_passthrough_params_ = false;
bool run_backend_only_ = false;
bool allow_spmd_sharding_propagation_to_output_ = false;
tensorflow::thread::ThreadPool* compile_thread_pool_ = nullptr;
};
// Creates an ExecutionOptions based on a given ExecutableBuildOptions and
// ProgramShape.
ExecutionOptions CreateExecutionOptions(
const ExecutableBuildOptions& build_options,
const ProgramShape* program_shape);
} // namespace xla
#endif // TENSORFLOW_COMPILER_XLA_CLIENT_EXECUTABLE_BUILD_OPTIONS_H_
| [
"gardener@tensorflow.org"
] | gardener@tensorflow.org |
ac02e47e92949076045d7a3b2550075472bd9224 | 46d0a341c0a7a005c9b72ecba2ae94b9e33a75cf | /LocalAI/LevelThreeAI.h | 11c908e7e52c4a5271f22cff792089e21589fc38 | [
"Apache-2.0"
] | permissive | hunterrees/challengeChessMachineLearning | 83f0e9087ad1678029063d6e86fc807166872132 | 0a85a8d3c8b43778af902b7274569c867db5cf75 | refs/heads/master | 2021-06-13T20:39:00.833838 | 2017-02-21T17:37:44 | 2017-02-21T17:37:44 | 80,304,222 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 98 | h | #pragma once
#include <iostream>
using namespace std;
class LevelThreeAI {
public:
private:
};
| [
"Brian@Brians-MacBook-Air-3.local"
] | Brian@Brians-MacBook-Air-3.local |
ee0a3f7223cd8919fb2547d2bbbe40749c86f844 | 08f7efa231dc94b5f590378b5aeb070dc44047a8 | /Average/Average/Average.cpp | 1d549b7f14b11ae362009584b41b910fb0dc6ee2 | [] | no_license | JekaKuldoshin/LB_0 | 7c1995a9cf158ea813fa1652445a6e988ed0cc4b | 5db88a80afca3ab413a1de0e52dd9342a8dfc8ae | refs/heads/master | 2023-04-12T06:34:47.888456 | 2021-04-29T10:50:07 | 2021-04-29T10:50:07 | 302,296,353 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 296 | cpp | #include<iostream>
using namespace std;
int main()
{
setlocale(LC_ALL, "rus");
double sum;
double avar;
sum = 0.0014162+
0.0006818+
0.0006426+
0.0007586+
0.0006841+
0.0002581+
0.0006487+
0.0006279+
0.0006398+
0.000733;
avar = sum / 10;
cout << avar << endl;
} | [
"JekaKuldoshin@users.noreply.github.com"
] | JekaKuldoshin@users.noreply.github.com |
0d6a608784fa19895f26fc91377556f727504c5c | fb0005fac139e251ddd0eb4b4c6e6c2eb1b088fa | /modules/imgproc/test/ocl/test_color.cpp | 02d91ad362e028126c46ab71057eadeef42c34cf | [
"BSD-3-Clause"
] | permissive | vcfriend/opencv | a6a1499a1c6a68a2a3ede22051c163c70b41dc23 | eba1be711cebef33b1c30ef7e638cd44f7c8904a | refs/heads/master | 2020-12-30T18:14:41.302708 | 2014-05-08T13:33:26 | 2014-05-08T13:33:27 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 17,844 | cpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2010-2012, Multicoreware, Inc., all rights reserved.
// Copyright (C) 2010-2012, Advanced Micro Devices, Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// @Authors
// Peng Xiao, pengxiao@multicorewareinc.com
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors as is and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#include "test_precomp.hpp"
#include "opencv2/ts/ocl_test.hpp"
#ifdef HAVE_OPENCL
namespace cvtest {
namespace ocl {
///////////////////////////////////////////////////////////////////////////////////////////////////////
// cvtColor
PARAM_TEST_CASE(CvtColor, MatDepth, bool)
{
int depth;
bool use_roi;
TEST_DECLARE_INPUT_PARAMETER(src);
TEST_DECLARE_OUTPUT_PARAMETER(dst);
virtual void SetUp()
{
depth = GET_PARAM(0);
use_roi = GET_PARAM(1);
}
virtual void generateTestData(int channelsIn, int channelsOut)
{
const int srcType = CV_MAKE_TYPE(depth, channelsIn);
const int dstType = CV_MAKE_TYPE(depth, channelsOut);
Size roiSize = randomSize(1, MAX_VALUE);
Border srcBorder = randomBorder(0, use_roi ? MAX_VALUE : 0);
randomSubMat(src, src_roi, roiSize, srcBorder, srcType, 2, 100);
Border dstBorder = randomBorder(0, use_roi ? MAX_VALUE : 0);
randomSubMat(dst, dst_roi, roiSize, dstBorder, dstType, 5, 16);
UMAT_UPLOAD_INPUT_PARAMETER(src);
UMAT_UPLOAD_OUTPUT_PARAMETER(dst);
}
void Near(double threshold)
{
OCL_EXPECT_MATS_NEAR(dst, threshold);
}
void performTest(int channelsIn, int channelsOut, int code, double threshold = 1e-3)
{
for (int j = 0; j < test_loop_times; j++)
{
generateTestData(channelsIn, channelsOut);
OCL_OFF(cv::cvtColor(src_roi, dst_roi, code, channelsOut));
OCL_ON(cv::cvtColor(usrc_roi, udst_roi, code, channelsOut));
Near(threshold);
}
}
};
#define CVTCODE(name) COLOR_ ## name
// RGB[A] <-> BGR[A]
OCL_TEST_P(CvtColor, BGR2BGRA) { performTest(3, 4, CVTCODE(BGR2BGRA)); }
OCL_TEST_P(CvtColor, RGB2RGBA) { performTest(3, 4, CVTCODE(RGB2RGBA)); }
OCL_TEST_P(CvtColor, BGRA2BGR) { performTest(4, 3, CVTCODE(BGRA2BGR)); }
OCL_TEST_P(CvtColor, RGBA2RGB) { performTest(4, 3, CVTCODE(RGBA2RGB)); }
OCL_TEST_P(CvtColor, BGR2RGBA) { performTest(3, 4, CVTCODE(BGR2RGBA)); }
OCL_TEST_P(CvtColor, RGB2BGRA) { performTest(3, 4, CVTCODE(RGB2BGRA)); }
OCL_TEST_P(CvtColor, RGBA2BGR) { performTest(4, 3, CVTCODE(RGBA2BGR)); }
OCL_TEST_P(CvtColor, BGRA2RGB) { performTest(4, 3, CVTCODE(BGRA2RGB)); }
OCL_TEST_P(CvtColor, BGR2RGB) { performTest(3, 3, CVTCODE(BGR2RGB)); }
OCL_TEST_P(CvtColor, RGB2BGR) { performTest(3, 3, CVTCODE(RGB2BGR)); }
OCL_TEST_P(CvtColor, BGRA2RGBA) { performTest(4, 4, CVTCODE(BGRA2RGBA)); }
OCL_TEST_P(CvtColor, RGBA2BGRA) { performTest(4, 4, CVTCODE(RGBA2BGRA)); }
// RGB <-> Gray
OCL_TEST_P(CvtColor, RGB2GRAY) { performTest(3, 1, CVTCODE(RGB2GRAY)); }
OCL_TEST_P(CvtColor, GRAY2RGB) { performTest(1, 3, CVTCODE(GRAY2RGB)); }
OCL_TEST_P(CvtColor, BGR2GRAY) { performTest(3, 1, CVTCODE(BGR2GRAY)); }
OCL_TEST_P(CvtColor, GRAY2BGR) { performTest(1, 3, CVTCODE(GRAY2BGR)); }
OCL_TEST_P(CvtColor, RGBA2GRAY) { performTest(4, 1, CVTCODE(RGBA2GRAY)); }
OCL_TEST_P(CvtColor, GRAY2RGBA) { performTest(1, 4, CVTCODE(GRAY2RGBA)); }
OCL_TEST_P(CvtColor, BGRA2GRAY) { performTest(4, 1, CVTCODE(BGRA2GRAY)); }
OCL_TEST_P(CvtColor, GRAY2BGRA) { performTest(1, 4, CVTCODE(GRAY2BGRA)); }
// RGB <-> YUV
OCL_TEST_P(CvtColor, RGB2YUV) { performTest(3, 3, CVTCODE(RGB2YUV)); }
OCL_TEST_P(CvtColor, BGR2YUV) { performTest(3, 3, CVTCODE(BGR2YUV)); }
OCL_TEST_P(CvtColor, RGBA2YUV) { performTest(4, 3, CVTCODE(RGB2YUV)); }
OCL_TEST_P(CvtColor, BGRA2YUV) { performTest(4, 3, CVTCODE(BGR2YUV)); }
OCL_TEST_P(CvtColor, YUV2RGB) { performTest(3, 3, CVTCODE(YUV2RGB)); }
OCL_TEST_P(CvtColor, YUV2BGR) { performTest(3, 3, CVTCODE(YUV2BGR)); }
OCL_TEST_P(CvtColor, YUV2RGBA) { performTest(3, 4, CVTCODE(YUV2RGB)); }
OCL_TEST_P(CvtColor, YUV2BGRA) { performTest(3, 4, CVTCODE(YUV2BGR)); }
// RGB <-> YCrCb
OCL_TEST_P(CvtColor, RGB2YCrCb) { performTest(3, 3, CVTCODE(RGB2YCrCb)); }
OCL_TEST_P(CvtColor, BGR2YCrCb) { performTest(3, 3, CVTCODE(BGR2YCrCb)); }
OCL_TEST_P(CvtColor, RGBA2YCrCb) { performTest(4, 3, CVTCODE(RGB2YCrCb)); }
OCL_TEST_P(CvtColor, BGRA2YCrCb) { performTest(4, 3, CVTCODE(BGR2YCrCb)); }
OCL_TEST_P(CvtColor, YCrCb2RGB) { performTest(3, 3, CVTCODE(YCrCb2RGB)); }
OCL_TEST_P(CvtColor, YCrCb2BGR) { performTest(3, 3, CVTCODE(YCrCb2BGR)); }
OCL_TEST_P(CvtColor, YCrCb2RGBA) { performTest(3, 4, CVTCODE(YCrCb2RGB)); }
OCL_TEST_P(CvtColor, YCrCb2BGRA) { performTest(3, 4, CVTCODE(YCrCb2BGR)); }
// RGB <-> XYZ
#if IPP_VERSION_X100 > 0
#define IPP_EPS depth <= CV_32S ? 1 : 5e-5
#else
#define IPP_EPS 1e-3
#endif
OCL_TEST_P(CvtColor, RGB2XYZ) { performTest(3, 3, CVTCODE(RGB2XYZ), IPP_EPS); }
OCL_TEST_P(CvtColor, BGR2XYZ) { performTest(3, 3, CVTCODE(BGR2XYZ), IPP_EPS); }
OCL_TEST_P(CvtColor, RGBA2XYZ) { performTest(4, 3, CVTCODE(RGB2XYZ), IPP_EPS); }
OCL_TEST_P(CvtColor, BGRA2XYZ) { performTest(4, 3, CVTCODE(BGR2XYZ), IPP_EPS); }
OCL_TEST_P(CvtColor, XYZ2RGB) { performTest(3, 3, CVTCODE(XYZ2RGB), IPP_EPS); }
OCL_TEST_P(CvtColor, XYZ2BGR) { performTest(3, 3, CVTCODE(XYZ2BGR), IPP_EPS); }
OCL_TEST_P(CvtColor, XYZ2RGBA) { performTest(3, 4, CVTCODE(XYZ2RGB), IPP_EPS); }
OCL_TEST_P(CvtColor, XYZ2BGRA) { performTest(3, 4, CVTCODE(XYZ2BGR), IPP_EPS); }
#undef IPP_EPS
// RGB <-> HSV
#if IPP_VERSION_X100 > 0
#define IPP_EPS depth <= CV_32S ? 1 : 4e-5
#else
#define IPP_EPS 1e-3
#endif
typedef CvtColor CvtColor8u32f;
OCL_TEST_P(CvtColor8u32f, RGB2HSV) { performTest(3, 3, CVTCODE(RGB2HSV), IPP_EPS); }
OCL_TEST_P(CvtColor8u32f, BGR2HSV) { performTest(3, 3, CVTCODE(BGR2HSV), IPP_EPS); }
OCL_TEST_P(CvtColor8u32f, RGBA2HSV) { performTest(4, 3, CVTCODE(RGB2HSV), IPP_EPS); }
OCL_TEST_P(CvtColor8u32f, BGRA2HSV) { performTest(4, 3, CVTCODE(BGR2HSV), IPP_EPS); }
OCL_TEST_P(CvtColor8u32f, RGB2HSV_FULL) { performTest(3, 3, CVTCODE(RGB2HSV_FULL), IPP_EPS); }
OCL_TEST_P(CvtColor8u32f, BGR2HSV_FULL) { performTest(3, 3, CVTCODE(BGR2HSV_FULL), IPP_EPS); }
OCL_TEST_P(CvtColor8u32f, RGBA2HSV_FULL) { performTest(4, 3, CVTCODE(RGB2HSV_FULL), IPP_EPS); }
OCL_TEST_P(CvtColor8u32f, BGRA2HSV_FULL) { performTest(4, 3, CVTCODE(BGR2HSV_FULL), IPP_EPS); }
#undef IPP_EPS
OCL_TEST_P(CvtColor8u32f, HSV2RGB) { performTest(3, 3, CVTCODE(HSV2RGB), depth == CV_8U ? 1 : 4e-1); }
OCL_TEST_P(CvtColor8u32f, HSV2BGR) { performTest(3, 3, CVTCODE(HSV2BGR), depth == CV_8U ? 1 : 4e-1); }
OCL_TEST_P(CvtColor8u32f, HSV2RGBA) { performTest(3, 4, CVTCODE(HSV2RGB), depth == CV_8U ? 1 : 4e-1); }
OCL_TEST_P(CvtColor8u32f, HSV2BGRA) { performTest(3, 4, CVTCODE(HSV2BGR), depth == CV_8U ? 1 : 4e-1); }
OCL_TEST_P(CvtColor8u32f, HSV2RGB_FULL) { performTest(3, 3, CVTCODE(HSV2RGB_FULL), depth == CV_8U ? 1 : 4e-1); }
OCL_TEST_P(CvtColor8u32f, HSV2BGR_FULL) { performTest(3, 3, CVTCODE(HSV2BGR_FULL), depth == CV_8U ? 1 : 4e-1); }
OCL_TEST_P(CvtColor8u32f, HSV2RGBA_FULL) { performTest(3, 4, CVTCODE(HSV2BGR_FULL), depth == CV_8U ? 1 : 4e-1); }
OCL_TEST_P(CvtColor8u32f, HSV2BGRA_FULL) { performTest(3, 4, CVTCODE(HSV2BGR_FULL), depth == CV_8U ? 1 : 4e-1); }
// RGB <-> HLS
#if IPP_VERSION_X100 > 0
#define IPP_EPS depth == CV_8U ? 2 : 1e-3
#else
#define IPP_EPS depth == CV_8U ? 1 : 1e-3
#endif
OCL_TEST_P(CvtColor8u32f, RGB2HLS) { performTest(3, 3, CVTCODE(RGB2HLS), depth == CV_8U ? 1 : 1e-3); }
OCL_TEST_P(CvtColor8u32f, BGR2HLS) { performTest(3, 3, CVTCODE(BGR2HLS), depth == CV_8U ? 1 : 1e-3); }
OCL_TEST_P(CvtColor8u32f, RGBA2HLS) { performTest(4, 3, CVTCODE(RGB2HLS), depth == CV_8U ? 1 : 1e-3); }
OCL_TEST_P(CvtColor8u32f, BGRA2HLS) { performTest(4, 3, CVTCODE(BGR2HLS), depth == CV_8U ? 1 : 1e-3); }
OCL_TEST_P(CvtColor8u32f, RGB2HLS_FULL) { performTest(3, 3, CVTCODE(RGB2HLS_FULL), IPP_EPS); }
OCL_TEST_P(CvtColor8u32f, BGR2HLS_FULL) { performTest(3, 3, CVTCODE(BGR2HLS_FULL), IPP_EPS); }
OCL_TEST_P(CvtColor8u32f, RGBA2HLS_FULL) { performTest(4, 3, CVTCODE(RGB2HLS_FULL), IPP_EPS); }
OCL_TEST_P(CvtColor8u32f, BGRA2HLS_FULL) { performTest(4, 3, CVTCODE(BGR2HLS_FULL), IPP_EPS); }
OCL_TEST_P(CvtColor8u32f, HLS2RGB) { performTest(3, 3, CVTCODE(HLS2RGB), 1); }
OCL_TEST_P(CvtColor8u32f, HLS2BGR) { performTest(3, 3, CVTCODE(HLS2BGR), 1); }
OCL_TEST_P(CvtColor8u32f, HLS2RGBA) { performTest(3, 4, CVTCODE(HLS2RGB), 1); }
OCL_TEST_P(CvtColor8u32f, HLS2BGRA) { performTest(3, 4, CVTCODE(HLS2BGR), 1); }
OCL_TEST_P(CvtColor8u32f, HLS2RGB_FULL) { performTest(3, 3, CVTCODE(HLS2RGB_FULL), 1); }
OCL_TEST_P(CvtColor8u32f, HLS2BGR_FULL) { performTest(3, 3, CVTCODE(HLS2BGR_FULL), 1); }
OCL_TEST_P(CvtColor8u32f, HLS2RGBA_FULL) { performTest(3, 4, CVTCODE(HLS2RGB_FULL), 1); }
OCL_TEST_P(CvtColor8u32f, HLS2BGRA_FULL) { performTest(3, 4, CVTCODE(HLS2BGR_FULL), 1); }
#undef IPP_EPS
// RGB5x5 <-> RGB
typedef CvtColor CvtColor8u;
OCL_TEST_P(CvtColor8u, BGR5652BGR) { performTest(2, 3, CVTCODE(BGR5652BGR)); }
OCL_TEST_P(CvtColor8u, BGR5652RGB) { performTest(2, 3, CVTCODE(BGR5652RGB)); }
OCL_TEST_P(CvtColor8u, BGR5652BGRA) { performTest(2, 4, CVTCODE(BGR5652BGRA)); }
OCL_TEST_P(CvtColor8u, BGR5652RGBA) { performTest(2, 4, CVTCODE(BGR5652RGBA)); }
OCL_TEST_P(CvtColor8u, BGR5552BGR) { performTest(2, 3, CVTCODE(BGR5552BGR)); }
OCL_TEST_P(CvtColor8u, BGR5552RGB) { performTest(2, 3, CVTCODE(BGR5552RGB)); }
OCL_TEST_P(CvtColor8u, BGR5552BGRA) { performTest(2, 4, CVTCODE(BGR5552BGRA)); }
OCL_TEST_P(CvtColor8u, BGR5552RGBA) { performTest(2, 4, CVTCODE(BGR5552RGBA)); }
OCL_TEST_P(CvtColor8u, BGR2BGR565) { performTest(3, 2, CVTCODE(BGR2BGR565)); }
OCL_TEST_P(CvtColor8u, RGB2BGR565) { performTest(3, 2, CVTCODE(RGB2BGR565)); }
OCL_TEST_P(CvtColor8u, BGRA2BGR565) { performTest(4, 2, CVTCODE(BGRA2BGR565)); }
OCL_TEST_P(CvtColor8u, RGBA2BGR565) { performTest(4, 2, CVTCODE(RGBA2BGR565)); }
OCL_TEST_P(CvtColor8u, BGR2BGR555) { performTest(3, 2, CVTCODE(BGR2BGR555)); }
OCL_TEST_P(CvtColor8u, RGB2BGR555) { performTest(3, 2, CVTCODE(RGB2BGR555)); }
OCL_TEST_P(CvtColor8u, BGRA2BGR555) { performTest(4, 2, CVTCODE(BGRA2BGR555)); }
OCL_TEST_P(CvtColor8u, RGBA2BGR555) { performTest(4, 2, CVTCODE(RGBA2BGR555)); }
// RGB5x5 <-> Gray
OCL_TEST_P(CvtColor8u, BGR5652GRAY) { performTest(2, 1, CVTCODE(BGR5652GRAY)); }
OCL_TEST_P(CvtColor8u, BGR5552GRAY) { performTest(2, 1, CVTCODE(BGR5552GRAY)); }
OCL_TEST_P(CvtColor8u, GRAY2BGR565) { performTest(1, 2, CVTCODE(GRAY2BGR565)); }
OCL_TEST_P(CvtColor8u, GRAY2BGR555) { performTest(1, 2, CVTCODE(GRAY2BGR555)); }
// RGBA <-> mRGBA
#if IPP_VERSION_X100 > 0
#define IPP_EPS depth <= CV_32S ? 1 : 1e-3
#else
#define IPP_EPS 1e-3
#endif
OCL_TEST_P(CvtColor8u, RGBA2mRGBA) { performTest(4, 4, CVTCODE(RGBA2mRGBA), IPP_EPS); }
OCL_TEST_P(CvtColor8u, mRGBA2RGBA) { performTest(4, 4, CVTCODE(mRGBA2RGBA)); }
// RGB <-> Lab
OCL_TEST_P(CvtColor8u32f, BGR2Lab) { performTest(3, 3, CVTCODE(BGR2Lab)); }
OCL_TEST_P(CvtColor8u32f, RGB2Lab) { performTest(3, 3, CVTCODE(RGB2Lab)); }
OCL_TEST_P(CvtColor8u32f, LBGR2Lab) { performTest(3, 3, CVTCODE(LBGR2Lab), IPP_EPS); }
OCL_TEST_P(CvtColor8u32f, LRGB2Lab) { performTest(3, 3, CVTCODE(LRGB2Lab), IPP_EPS); }
OCL_TEST_P(CvtColor8u32f, BGRA2Lab) { performTest(4, 3, CVTCODE(BGR2Lab)); }
OCL_TEST_P(CvtColor8u32f, RGBA2Lab) { performTest(4, 3, CVTCODE(RGB2Lab)); }
OCL_TEST_P(CvtColor8u32f, LBGRA2Lab) { performTest(4, 3, CVTCODE(LBGR2Lab), IPP_EPS); }
OCL_TEST_P(CvtColor8u32f, LRGBA2Lab) { performTest(4, 3, CVTCODE(LRGB2Lab), IPP_EPS); }
#undef IPP_EPS
OCL_TEST_P(CvtColor8u32f, Lab2BGR) { performTest(3, 3, CVTCODE(Lab2BGR), depth == CV_8U ? 1 : 1e-5); }
OCL_TEST_P(CvtColor8u32f, Lab2RGB) { performTest(3, 3, CVTCODE(Lab2RGB), depth == CV_8U ? 1 : 1e-5); }
OCL_TEST_P(CvtColor8u32f, Lab2LBGR) { performTest(3, 3, CVTCODE(Lab2LBGR), depth == CV_8U ? 1 : 1e-5); }
OCL_TEST_P(CvtColor8u32f, Lab2LRGB) { performTest(3, 3, CVTCODE(Lab2LRGB), depth == CV_8U ? 1 : 1e-5); }
OCL_TEST_P(CvtColor8u32f, Lab2BGRA) { performTest(3, 4, CVTCODE(Lab2BGR), depth == CV_8U ? 1 : 1e-5); }
OCL_TEST_P(CvtColor8u32f, Lab2RGBA) { performTest(3, 4, CVTCODE(Lab2RGB), depth == CV_8U ? 1 : 1e-5); }
OCL_TEST_P(CvtColor8u32f, Lab2LBGRA) { performTest(3, 4, CVTCODE(Lab2LBGR), depth == CV_8U ? 1 : 1e-5); }
OCL_TEST_P(CvtColor8u32f, Lab2LRGBA) { performTest(3, 4, CVTCODE(Lab2LRGB), depth == CV_8U ? 1 : 1e-5); }
// RGB -> Luv
OCL_TEST_P(CvtColor8u32f, BGR2Luv) { performTest(3, 3, CVTCODE(BGR2Luv), depth == CV_8U ? 1 : 1e-2); }
OCL_TEST_P(CvtColor8u32f, RGB2Luv) { performTest(3, 3, CVTCODE(RGB2Luv), depth == CV_8U ? 1 : 1e-2); }
OCL_TEST_P(CvtColor8u32f, LBGR2Luv) { performTest(3, 3, CVTCODE(LBGR2Luv), depth == CV_8U ? 1 : 3e-3); }
OCL_TEST_P(CvtColor8u32f, LRGB2Luv) { performTest(3, 3, CVTCODE(LRGB2Luv), depth == CV_8U ? 1 : 4e-3); }
OCL_TEST_P(CvtColor8u32f, BGRA2Luv) { performTest(4, 3, CVTCODE(BGR2Luv), depth == CV_8U ? 1 : 8e-3); }
OCL_TEST_P(CvtColor8u32f, RGBA2Luv) { performTest(4, 3, CVTCODE(RGB2Luv), depth == CV_8U ? 1 : 7e-3); }
OCL_TEST_P(CvtColor8u32f, LBGRA2Luv) { performTest(4, 3, CVTCODE(LBGR2Luv), depth == CV_8U ? 1 : 4e-3); }
OCL_TEST_P(CvtColor8u32f, LRGBA2Luv) { performTest(4, 3, CVTCODE(LRGB2Luv), depth == CV_8U ? 1 : 4e-3); }
OCL_TEST_P(CvtColor8u32f, Luv2BGR) { performTest(3, 3, CVTCODE(Luv2BGR), depth == CV_8U ? 1 : 7e-5); }
OCL_TEST_P(CvtColor8u32f, Luv2RGB) { performTest(3, 3, CVTCODE(Luv2RGB), depth == CV_8U ? 1 : 7e-5); }
OCL_TEST_P(CvtColor8u32f, Luv2LBGR) { performTest(3, 3, CVTCODE(Luv2LBGR), depth == CV_8U ? 1 : 1e-5); }
OCL_TEST_P(CvtColor8u32f, Luv2LRGB) { performTest(3, 3, CVTCODE(Luv2LRGB), depth == CV_8U ? 1 : 1e-5); }
OCL_TEST_P(CvtColor8u32f, Luv2BGRA) { performTest(3, 4, CVTCODE(Luv2BGR), depth == CV_8U ? 1 : 7e-5); }
OCL_TEST_P(CvtColor8u32f, Luv2RGBA) { performTest(3, 4, CVTCODE(Luv2RGB), depth == CV_8U ? 1 : 7e-5); }
OCL_TEST_P(CvtColor8u32f, Luv2LBGRA) { performTest(3, 4, CVTCODE(Luv2LBGR), depth == CV_8U ? 1 : 1e-5); }
OCL_TEST_P(CvtColor8u32f, Luv2LRGBA) { performTest(3, 4, CVTCODE(Luv2LRGB), depth == CV_8U ? 1 : 1e-5); }
// YUV -> RGBA_NV12
struct CvtColor_YUV420 :
public CvtColor
{
void generateTestData(int channelsIn, int channelsOut)
{
const int srcType = CV_MAKE_TYPE(depth, channelsIn);
const int dstType = CV_MAKE_TYPE(depth, channelsOut);
Size roiSize = randomSize(1, MAX_VALUE);
roiSize.width *= 2;
roiSize.height *= 3;
Border srcBorder = randomBorder(0, use_roi ? MAX_VALUE : 0);
randomSubMat(src, src_roi, roiSize, srcBorder, srcType, 2, 100);
Border dstBorder = randomBorder(0, use_roi ? MAX_VALUE : 0);
randomSubMat(dst, dst_roi, roiSize, dstBorder, dstType, 5, 16);
UMAT_UPLOAD_INPUT_PARAMETER(src);
UMAT_UPLOAD_OUTPUT_PARAMETER(dst);
}
};
OCL_TEST_P(CvtColor_YUV420, YUV2RGBA_NV12) { performTest(1, 4, COLOR_YUV2RGBA_NV12); }
OCL_TEST_P(CvtColor_YUV420, YUV2BGRA_NV12) { performTest(1, 4, COLOR_YUV2BGRA_NV12); }
OCL_TEST_P(CvtColor_YUV420, YUV2RGB_NV12) { performTest(1, 3, COLOR_YUV2RGB_NV12); }
OCL_TEST_P(CvtColor_YUV420, YUV2BGR_NV12) { performTest(1, 3, COLOR_YUV2BGR_NV12); }
OCL_INSTANTIATE_TEST_CASE_P(ImgProc, CvtColor8u,
testing::Combine(testing::Values(MatDepth(CV_8U)), Bool()));
OCL_INSTANTIATE_TEST_CASE_P(ImgProc, CvtColor8u32f,
testing::Combine(testing::Values(MatDepth(CV_8U), MatDepth(CV_32F)), Bool()));
OCL_INSTANTIATE_TEST_CASE_P(ImgProc, CvtColor,
testing::Combine(
testing::Values(MatDepth(CV_8U), MatDepth(CV_16U), MatDepth(CV_32F)),
Bool()));
OCL_INSTANTIATE_TEST_CASE_P(ImgProc, CvtColor_YUV420,
testing::Combine(
testing::Values(MatDepth(CV_8U)),
Bool()));
} } // namespace cvtest::ocl
#endif
| [
"ilya.lavrenov@itseez.com"
] | ilya.lavrenov@itseez.com |
caa9209f0b0fa8c6d5c6eacc0db654d1d84cda8b | bdde911c6ba652ec9caf58d5cc528e4afac4f41b | /src/sensors/BD7411G.cpp | 1552f27f912dc9e6762001ddfedb4d00bf7057ac | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | L-i-n-d-s-a-y/RohmMultiSensor | d7ae6a05e9d0cae285c24c9ef3491ef7351a86fc | 4d4907872c427d9eccb8b14bb6c01af6fb39569d | refs/heads/master | 2023-05-28T23:30:06.851613 | 2020-03-03T15:11:16 | 2020-03-03T15:11:16 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 774 | cpp | #ifndef _ROHM_MULTI_SENSOR_BD7411G_CPP
#define _ROHM_MULTI_SENSOR_BD7411G_CPP
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include "Sensor.cpp"
class BD7411G: public Sensor {
public:
//Measurement variables
bool magField = false; //magnetic field presence
//Default constructor
BD7411G(void) {}
//Initialization function
uint8_t init(uint8_t pin = 0) {
_pin = pin;
return 0;
}
//Measurement function
uint8_t measure() {
//if the sensor output is LOW, magnetic field was detected
if(digitalRead(_pin) == 0) {
magField = true;
} else {
magField = false;
}
return(0);
}
private:
uint8_t _pin = 0;
};
#endif
| [
"jgromes@users.noreply.github.com"
] | jgromes@users.noreply.github.com |
cf64f9ee25185e2853e16397d472f7ab491e484a | 0332f2f39b08249d148305379799682c56edaf99 | /14503.cpp | 0f5b3cf6bea63934801132a4b6f75ebf9f931e21 | [] | no_license | olnayoung/coding | bdfa958690b1b6adf1fa96a88521b2debc97dd3e | 7b72af0d0d88d6bd312edb93389d88e3e764aed4 | refs/heads/master | 2021-07-13T11:09:41.049016 | 2020-07-03T10:36:05 | 2020-07-03T10:36:05 | 173,938,230 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,367 | cpp | #include <iostream>
int hei, wid;
int r, c, w;
int count = 0, check = 0;
int map[50][50];
int visit[50][50];
int direc[4] = { 0, 1, 2, 3 };
int dx[4] = {0, -1, 0, 1};
int dy[4] = {1, 0, -1, 0};
int left_dx[4] = {-1, 0, 1, 0};
int left_dy[4] = {0, -1, 0, 1};
int clean(int r, int c, int w, int check) {
if ((map[r][c] == 0) && (visit[r][c] == 0)) {
visit[r][c] = 1;
count++;
}
for (int t = 0; t < 4; t++) {
if (w == direc[t]) { // 현재 방향 찾기
if (check == 4) {
if ((r + dy[t] > -1) && (r + dy[t] < hei) && (c + dx[t] > -1) && (c + dx[t] < wid) && (map[r + dy[t]][c + dx[t]] == 0)) {
clean(r + dy[t], c + dx[t], w, 0);
}
else {
printf("%d", count);
exit(0);
}
}
if ((r + left_dy[t] > -1) && (r + left_dy[t] < hei) && (c + left_dx[t] > -1) && (c + left_dx[t] < wid)) { // map 내부인지 확인
w = (w + 3) % 4;
if ((visit[r + left_dy[t]][c + left_dx[t]] == 0) && (map[r + left_dy[t]][c + left_dx[t]] == 0)) clean(r + left_dy[t], c + left_dx[t], w, 0);
else clean(r, c, w, check + 1);
}
else clean(r, c, (w + 3) % 4, check + 1);
}
}
return 0;
}
int main() {
scanf("%d %d", &hei, &wid);
scanf("%d %d %d", &r, &c, &w);
for (int y = 0; y < hei; y++) {
for (int x = 0; x < wid; x++) {
scanf("%d", &map[y][x]);
visit[y][x] = 0;
}
}
clean(r, c, w, check);
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
86ade22a3bca5e22b51ca5be24d7ef25b01b9b29 | 8cdf5cc611e77a2c4ea169f18dcc3b49d95eed22 | /src/qt/paymentserver.h | ffdf7c71f511b838b6588175586ddbbbfe4c48c0 | [
"MIT"
] | permissive | moorecoin/MooreCoinMiningAlgorithm | 987a442488e59e41db016609a2bd398853427dca | fe6a153e1392f6e18110b1e69481aa5c3c8b4a1d | refs/heads/master | 2021-01-10T06:06:26.034995 | 2015-11-14T13:40:25 | 2015-11-14T13:40:25 | 46,176,042 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,146 | h | // copyright (c) 2011-2014 the moorecoin core developers
// distributed under the mit software license, see the accompanying
// file copying or http://www.opensource.org/licenses/mit-license.php.
#ifndef moorecoin_qt_paymentserver_h
#define moorecoin_qt_paymentserver_h
// this class handles payment requests from clicking on
// moorecoin: uris
//
// this is somewhat tricky, because we have to deal with
// the situation where the user clicks on a link during
// startup/initialization, when the splash-screen is up
// but the main window (and the send coins tab) is not.
//
// so, the strategy is:
//
// create the server, and register the event handler,
// when the application is created. save any uris
// received at or during startup in a list.
//
// when startup is finished and the main window is
// shown, a signal is sent to slot uiready(), which
// emits a receivedurl() signal for any payment
// requests that happened during startup.
//
// after startup, receivedurl() happens as usual.
//
// this class has one more feature: a static
// method that finds uris passed in the command line
// and, if a server is running in another process,
// sends them to the server.
//
#include "paymentrequestplus.h"
#include "walletmodel.h"
#include <qobject>
#include <qstring>
class optionsmodel;
class cwallet;
qt_begin_namespace
class qapplication;
class qbytearray;
class qlocalserver;
class qnetworkaccessmanager;
class qnetworkreply;
class qsslerror;
class qurl;
qt_end_namespace
// bip70 max payment request size in bytes (dos protection)
extern const qint64 bip70_max_paymentrequest_size;
class paymentserver : public qobject
{
q_object
public:
// parse uris on command line
// returns false on error
static void ipcparsecommandline(int argc, char *argv[]);
// returns true if there were uris on the command line
// which were successfully sent to an already-running
// process.
// note: if a payment request is given, selectparams(main/testnet)
// will be called so we startup in the right mode.
static bool ipcsendcommandline();
// parent should be qapplication object
paymentserver(qobject* parent, bool startlocalserver = true);
~paymentserver();
// load root certificate authorities. pass null (default)
// to read from the file specified in the -rootcertificates setting,
// or, if that's not set, to use the system default root certificates.
// if you pass in a store, you should not x509_store_free it: it will be
// freed either at exit or when another set of cas are loaded.
static void loadrootcas(x509_store* store = null);
// return certificate store
static x509_store* getcertstore() { return certstore; }
// optionsmodel is used for getting proxy settings and display unit
void setoptionsmodel(optionsmodel *optionsmodel);
// this is now public, because we use it in paymentservertests.cpp
static bool readpaymentrequestfromfile(const qstring& filename, paymentrequestplus& request);
// verify that the payment request network matches the client network
static bool verifynetwork(const payments::paymentdetails& requestdetails);
// verify if the payment request is expired
static bool verifyexpired(const payments::paymentdetails& requestdetails);
// verify the payment request amount is valid
static bool verifyamount(const camount& requestamount);
signals:
// fired when a valid payment request is received
void receivedpaymentrequest(sendcoinsrecipient);
// fired when a valid paymentack is received
void receivedpaymentack(const qstring &paymentackmsg);
// fired when a message should be reported to the user
void message(const qstring &title, const qstring &message, unsigned int style);
public slots:
// signal this when the main window's ui is ready
// to display payment requests to the user
void uiready();
// submit payment message to a merchant, get back paymentack:
void fetchpaymentack(cwallet* wallet, sendcoinsrecipient recipient, qbytearray transaction);
// handle an incoming uri, uri with local file scheme or file
void handleuriorfile(const qstring& s);
private slots:
void handleuriconnection();
void netrequestfinished(qnetworkreply*);
void reportsslerrors(qnetworkreply*, const qlist<qsslerror> &);
void handlepaymentack(const qstring& paymentackmsg);
protected:
// constructor registers this on the parent qapplication to
// receive qevent::fileopen and qevent:drop events
bool eventfilter(qobject *object, qevent *event);
private:
bool processpaymentrequest(const paymentrequestplus& request, sendcoinsrecipient& recipient);
void fetchrequest(const qurl& url);
// setup networking
void initnetmanager();
bool saveuris; // true during startup
qlocalserver* uriserver;
static x509_store* certstore; // trusted root certificates
static void freecertstore();
qnetworkaccessmanager* netmanager; // used to fetch payment requests
optionsmodel *optionsmodel;
};
#endif // moorecoin_qt_paymentserver_h
| [
"mooreccc@foxmail.com"
] | mooreccc@foxmail.com |
6d2b7704cf5707895f9c93bdf4cf4f54bb1d3c7f | 166e61181905160821c1c7e5d8d3487f5a6ed5b5 | /SimpleDesktopTool/myqstyleditemdelegate.h | 90cceffc61c8a5dd5f9bd4dedd65a69cb056ef4f | [] | no_license | toiime/MyTools | dc7bada3e1bd957fd3c3f24bc9ebac05afcfe2e9 | 84a95a228a15da885d6d9a6c3903cc040d2c1b60 | refs/heads/master | 2020-03-14T02:38:30.894457 | 2018-05-01T14:59:54 | 2018-05-01T14:59:54 | 131,403,129 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 404 | h | #ifndef MYQSTYLEDITEMDELEGATE_H
#define MYQSTYLEDITEMDELEGATE_H
#include <QStyledItemDelegate>
class MyQStyledItemDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
explicit MyQStyledItemDelegate(QObject *parent = 0);
void paint(QPainter *painter,
const QStyleOptionViewItem &option, const QModelIndex &index) const;
private:
};
#endif // MYQSTYLEDITEMDELEGATE_H
| [
"toiime@sina.com"
] | toiime@sina.com |
3ebe50c3ca4b79ba74f39a10507c8f6662ebe8b1 | 68c945fe64de58f4790ecea62a9a2c720e345d54 | /compiler/compiler/GeneratorContext.h | f3538ae97599ff0f04d5ff2f86bb794cc0451543 | [] | no_license | nesu/vuesc | c7b9e1d8cac8b9bc0e9df8ce75baf13e1c418cb0 | 6d2de2cdd29a7a86750a77604c6952a75c256706 | refs/heads/master | 2020-05-20T06:22:14.698495 | 2019-05-13T05:04:08 | 2019-05-13T05:04:08 | 185,427,170 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,977 | h | #ifndef _GENERATOR_CONTEXT_H
#define _GENERATOR_CONTEXT_H
#include <stack>
#include "llvm/ExecutionEngine/GenericValue.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Support/TargetRegistry.h"
#include "AbstractSyntaxTree.h"
#include "Registry.h"
using namespace llvm;
class GeneratorBlock
{
public:
LocalRegistry* locals;
GeneratorBlock() {
locals = new LocalRegistry();
}
BasicBlock* block;
Value* ret;
bool terminated() {
return block->getTerminator() != nullptr;
}
};
class GeneratorContext
{
LLVMContext context;
Function* entry_point;
std::stack<GeneratorBlock*> block_stack;
public:
GeneratorContext();
Module* module;
llvm::Type* i1, *i8, *i8_ptr, *i32, *i64, *void_, *double_;
void generate(Block& root);
llvm::Type* typeof(const Identifier& type);
void internal_methods();
LLVMContext& llvmc() {
return context;
}
BasicBlock* llvm_block() {
return current_block()->block;
}
GeneratorBlock* current_block() {
return block_stack.top();
}
LocalRegistry* locals() {
return block_stack.top()->locals;
}
void push(BasicBlock* block)
{
GeneratorBlock* gbl = new GeneratorBlock();
gbl->ret = nullptr;
if (block == nullptr) {
block = llvm::BasicBlock::Create(context, "scope");
}
gbl->block = block;
block_stack.push(gbl);
}
void pop()
{
auto* it = block_stack.top();
block_stack.pop();
delete it;
}
};
#endif // !_GENERATOR_CONTEXT_H
| [
"salted.mail@gmail.com"
] | salted.mail@gmail.com |
28faa468cab1a7e846b49bfa8f5355de4c4e595a | d0fb46aecc3b69983e7f6244331a81dff42d9595 | /ens/src/model/DescribeDataDistResultRequest.cc | be1092266e1d09e46310e6f72ed6e2620cb70fdb | [
"Apache-2.0"
] | permissive | aliyun/aliyun-openapi-cpp-sdk | 3d8d051d44ad00753a429817dd03957614c0c66a | e862bd03c844bcb7ccaa90571bceaa2802c7f135 | refs/heads/master | 2023-08-29T11:54:00.525102 | 2023-08-29T03:32:48 | 2023-08-29T03:32:48 | 115,379,460 | 104 | 82 | NOASSERTION | 2023-09-14T06:13:33 | 2017-12-26T02:53:27 | C++ | UTF-8 | C++ | false | false | 3,554 | cc | /*
* Copyright 2009-2017 Alibaba Cloud 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 <alibabacloud/ens/model/DescribeDataDistResultRequest.h>
using AlibabaCloud::Ens::Model::DescribeDataDistResultRequest;
DescribeDataDistResultRequest::DescribeDataDistResultRequest()
: RpcServiceRequest("ens", "2017-11-10", "DescribeDataDistResult") {
setMethod(HttpRequest::Method::Post);
}
DescribeDataDistResultRequest::~DescribeDataDistResultRequest() {}
std::string DescribeDataDistResultRequest::getDataVersions() const {
return dataVersions_;
}
void DescribeDataDistResultRequest::setDataVersions(const std::string &dataVersions) {
dataVersions_ = dataVersions;
setParameter(std::string("DataVersions"), dataVersions);
}
std::string DescribeDataDistResultRequest::getInstanceIds() const {
return instanceIds_;
}
void DescribeDataDistResultRequest::setInstanceIds(const std::string &instanceIds) {
instanceIds_ = instanceIds;
setParameter(std::string("InstanceIds"), instanceIds);
}
std::string DescribeDataDistResultRequest::getMaxDate() const {
return maxDate_;
}
void DescribeDataDistResultRequest::setMaxDate(const std::string &maxDate) {
maxDate_ = maxDate;
setParameter(std::string("MaxDate"), maxDate);
}
int DescribeDataDistResultRequest::getPageNumber() const {
return pageNumber_;
}
void DescribeDataDistResultRequest::setPageNumber(int pageNumber) {
pageNumber_ = pageNumber;
setParameter(std::string("PageNumber"), std::to_string(pageNumber));
}
int DescribeDataDistResultRequest::getPageSize() const {
return pageSize_;
}
void DescribeDataDistResultRequest::setPageSize(int pageSize) {
pageSize_ = pageSize;
setParameter(std::string("PageSize"), std::to_string(pageSize));
}
std::vector<DescribeDataDistResultRequest::std::string> DescribeDataDistResultRequest::getEnsRegionIds() const {
return ensRegionIds_;
}
void DescribeDataDistResultRequest::setEnsRegionIds(const std::vector<DescribeDataDistResultRequest::std::string> &ensRegionIds) {
ensRegionIds_ = ensRegionIds;
for(int dep1 = 0; dep1 != ensRegionIds.size(); dep1++) {
setParameter(std::string("EnsRegionIds") + "." + std::to_string(dep1 + 1), ensRegionIds[dep1]);
}
}
std::string DescribeDataDistResultRequest::getMinDate() const {
return minDate_;
}
void DescribeDataDistResultRequest::setMinDate(const std::string &minDate) {
minDate_ = minDate;
setParameter(std::string("MinDate"), minDate);
}
std::string DescribeDataDistResultRequest::getAppId() const {
return appId_;
}
void DescribeDataDistResultRequest::setAppId(const std::string &appId) {
appId_ = appId;
setParameter(std::string("AppId"), appId);
}
std::string DescribeDataDistResultRequest::getDataNames() const {
return dataNames_;
}
void DescribeDataDistResultRequest::setDataNames(const std::string &dataNames) {
dataNames_ = dataNames;
setParameter(std::string("DataNames"), dataNames);
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
c353c6196d6218bb243d6b6332471969eb14c91d | 940aaac318b38b8bed19b2cd0c70a0fd2d26d535 | /fuse/src/main.cpp | cbe03f506f430af1e1ed24cd911d425245382bdf | [] | no_license | dparnell/cppmyth | 2e392a6db1895dfc68db7ec62c47d8a2275d0f4b | 6c5a1d61021273e00daed583796842bd351f1ca3 | refs/heads/master | 2021-01-19T11:51:27.309352 | 2016-10-16T11:03:12 | 2016-10-16T11:03:12 | 69,774,712 | 0 | 0 | null | 2016-10-02T02:23:52 | 2016-10-02T02:23:52 | null | UTF-8 | C++ | false | false | 7,217 | cpp | #if (defined(_WIN32) || defined(_WIN64))
#define __WINDOWS__
#endif
#ifdef __WINDOWS__
#include <winsock2.h>
#include <Windows.h>
#include <time.h>
#define usleep(t) Sleep((DWORD)(t)/1000)
#define sleep(t) Sleep((DWORD)(t)*1000)
#else
#include <unistd.h>
#include <sys/time.h>
#endif
#include <mythcontrol.h>
#include <mytheventhandler.h>
#include <mythdebug.h>
#define FUSE_USE_VERSION 26
#include <fuse/fuse.h>
#include <fuse/fuse_opt.h>
#include <iostream>
#include <cstdio>
#include <stdlib.h>
#include <signal.h>
#include <map>
#include <list>
#include <set>
#include <string>
#include <iterator>
#include <string.h>
#include <mutex>
#define MYTAG "[MYTHTVFS] "
#define DEBUG
static Myth::Control *mythtv = NULL;
static Myth::EventHandler *event_handler = NULL;
//// FUSE setup and options
struct mythtvfs_options
{
mythtvfs_options() : displayHelp(0),
showVersion(0), backend((char*)"127.0.0.1"), protoPort(6543), wsapiPort(6544), recordings(NULL), pin((char*)"0000") {}
int displayHelp;
int showVersion;
char* recordings;
char* backend;
int protoPort;
int wsapiPort;
char *pin;
};
static struct fuse_opt mythtvfs_opts[] = {
{"-h", offsetof(struct mythtvfs_options, displayHelp), 1},
{"--help", offsetof(struct mythtvfs_options, displayHelp), 1},
{"--backend=%s", offsetof(struct mythtvfs_options, backend),0},
{"--port=%i", offsetof(struct mythtvfs_options, protoPort), 0},
{"--wsport=%i", offsetof(struct mythtvfs_options, wsapiPort), 0},
{"--recordings=%s", offsetof(struct mythtvfs_options, recordings),0},
{"-V", offsetof(struct mythtvfs_options, showVersion),1},
{"--version", offsetof(struct mythtvfs_options, showVersion),1},
FUSE_OPT_END
};
static struct fuse_operations mythtvfs_oper = {
0,
};
static mythtvfs_options options;
//// Utility functions
class PathInfo {
public:
PathInfo(const char *path) : show(NULL), episode(NULL) {
if(strcmp(path, "/") != 0) {
const char *sep = strstr(path + 1, "/");
if(sep) {
show = strndup(path + 1, sep - path - 1);
episode = strdup(sep + 1);
} else {
show = strdup(path + 1);
}
}
}
~PathInfo() {
if(show) {
free(show);
}
if(episode) {
free(episode);
}
}
char *show;
char *episode;
};
//// Mythtv State
class MythRecording {
public:
MythRecording(struct Myth::Program &program) {
title = program.title;
filename = program.fileName;
std::size_t p = filename.find_last_of(".");
subTitle = program.subTitle + filename.substr(p);
}
std::string title;
std::string subTitle;
std::string filename;
};
class MythtvState : public Myth::EventSubscriber {
public:
std::list<MythRecording> shows;
std::mutex state_lock;
void fillShows() {
std::lock_guard<std::mutex> guard(state_lock);
shows.clear();
Myth::ProgramListPtr progs = mythtv->GetRecordedList();
int L = progs->size();
for (size_t i = 0; i < L; ++i) {
Myth::ProgramPtr prog = (*progs)[i];
MythRecording *rec = new MythRecording(*prog);
shows.push_back(*rec);
}
}
// void HandleRecordingListChange(const Myth::EventMessage& msg) {
// }
void HandleBackendMessage(Myth::EventMessagePtr msg) {
switch (msg->event) {
case Myth::EVENT_RECORDING_LIST_CHANGE:
// got a change to the recordings
break;
}
}
void enumerateShows(void* buf, fuse_fill_dir_t filler) {
std::lock_guard<std::mutex> guard(state_lock);
std::set<std::string> seen;
for(auto it : shows) {
if(seen.count(it.title) == 0) {
seen.insert(it.title);
filler(buf, it.title.c_str(), NULL, 0);
}
}
}
int enumerateEpisodes(std::string show, void* buf, fuse_fill_dir_t filler) {
std::lock_guard<std::mutex> guard(state_lock);
for(auto it : shows) {
if(it.title == show) {
filler(buf, it.subTitle.c_str(), NULL, 0);
}
}
return 0;
}
};
static MythtvState *state = NULL;
//// FUSE operations
extern "C" int mythtvfs_getattr(const char* pathStr, struct stat* info) {
#ifdef DEBUG
fprintf(stderr, MYTAG "DEBUG: mythtvfs_getattr - %s\n", pathStr);
#endif
PathInfo path(pathStr);
if(path.episode) {
info->st_mode = S_IFLNK | 0444;
} else {
info->st_mode = S_IFDIR | 0555;
}
info->st_uid = 0;
info->st_gid = 0;
return 0;
}
extern "C" int mythtvfs_readdir(const char* pathStr, void* buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi) {
#ifdef DEBUG
fprintf(stderr, MYTAG "DEBUG: mythtvfs_readdir - %s\n", pathStr);
#endif
if(mythtv->IsOpen()) {
filler(buf, ".", NULL, 0);
filler(buf, "..", NULL, 0);
PathInfo path(pathStr);
if(path.show) {
#ifdef DEBUG
fprintf(stderr, MYTAG "DEBUG: mythtvfs_readdir - listing episodes for '%s'\n", path.show);
#endif
return state->enumerateEpisodes(path.show, buf, filler);
} else {
// enumerate the shows
state->enumerateShows(buf, filler);
}
return 0;
}
return -ENOTCONN;
}
extern "C" int mythtvfs_readlink(const char *pathStr, char *buf, size_t size) {
#ifdef DEBUG
fprintf(stderr, MYTAG "DEBUG: mythtvfs_readlink - %s\n", pathStr);
#endif
return 0;
}
extern "C" int mythtvfs_unlink(const char *pathStr) {
#ifdef DEBUG
fprintf(stderr, MYTAG "DEBUG: mythtvfs_unlink - %s\n", pathStr);
#endif
return 0;
}
int main(int argc, char** argv)
{
int ret;
#ifdef __WINDOWS__
//Initialize Winsock
WSADATA wsaData;
if ((ret = WSAStartup(MAKEWORD(2, 2), &wsaData)))
return ret;
#endif /* __WINDOWS__ */
mythtvfs_oper.getattr = mythtvfs_getattr;
mythtvfs_oper.readdir = mythtvfs_readdir;
mythtvfs_oper.readlink = mythtvfs_readlink;
mythtvfs_oper.unlink = mythtvfs_unlink;
struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
if (fuse_opt_parse(&args, &options, mythtvfs_opts,0)==-1) {
std::cerr << "Error parsing arguments" << std::endl;
return -1;
}
if (options.displayHelp) {
fuse_opt_add_arg(&args, "-h");
} else if (options.showVersion) {
fuse_opt_add_arg(&args, "-V");
}
if(options.recordings) {
mythtv = new Myth::Control(options.backend, options.protoPort, options.wsapiPort, options.pin);
if(!mythtv->Open()) {
fprintf(stderr, MYTAG "ERROR: can not connect to the MythTV backend %s:%d\n", options.backend, options.protoPort);
return -1;
}
event_handler = new Myth::EventHandler(options.backend, options.protoPort);
state = new MythtvState();
state->fillShows();
} else {
fprintf(stderr, MYTAG "USAGE: %s --recordings {path to mythtv recordings}\n", argv[0]);
return -1;
}
ret = fuse_main(args.argc, args.argv, &mythtvfs_oper, NULL);
if (options.displayHelp)
{
std::cout << std::endl << "mythtvfs options:" << std::endl;
std::cout << " --backend=<host> The IP address of the MythTV back end to connect to"<< std::endl;
std::cout << " --port=<port> The port the MythTV back end is listening on"<< std::endl;
std::cout << " --recordings=<path> The path containing MythTV recordings"<< std::endl;
}
#ifdef __WINDOWS__
WSACleanup();
#endif /* __WINDOWS__ */
return ret;
}
| [
"me@danielparnell.com"
] | me@danielparnell.com |
2a685c5a6bb31ac2f3271ea6d343dc8d56f085e7 | 3498b2fa77e4da812e18bf2701b17538f3905108 | /screen_6.hpp | 1d6e1b1d46af8ee9ea2da6eb833f49a651410fa9 | [] | no_license | HiiYL/uttc | b0888075848c98e32202cf306175ee449fc080a9 | 7aad1733430b85d4a02835dd9a7460bc00f70759 | refs/heads/master | 2020-08-27T04:05:19.195136 | 2015-10-09T06:55:21 | 2015-10-09T06:55:21 | 23,778,615 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,913 | hpp | #ifndef SCREEN_6_HPP_INCLUDED
#define SCREEN_6_HPP_INCLUDED
class screen_6 : public cScreen {
public:
screen_6(ResourceHolder *res_container) {resources = res_container;};
virtual int Run(sf::RenderWindow &App);
private:
ResourceHolder *resources;
sf::Texture banner_background;
TextureHolder textures;
FontHolder fonts;
};
int screen_6::Run(sf::RenderWindow &App) {
bool Running = true;
bool player1_turn = true;
Replay replay(App, resources);
Sidebar sidebar(App, resources);
Cursor mouse_cursor(App,resources->textures.get("MouseCursor"));
sf::Sprite background;
background.setTexture(resources->textures.get("GameBackground"));
srand (time(0));
int starting_index = rand()%9;
resources->start_index = starting_index;
Board board(starting_index, App, resources);
board.move(0,50);
board.animateMovement(sf::Vector2f(200,50),3);
Player* player1 (new Player(board.getBoardGrid(), 'X'));
Player* player2 (new Player(board.getBoardGrid(),'O'));
Player* curr_player;
Player* oppo_player;
player1->setTexture(&resources->textures.get("Player1Mark"));
player2->setTexture(&resources->textures.get("Player2Mark"));
sf::Text header_text;
header_text.setPosition(App.getSize().x/3, App.getSize().y*0.01);
header_text.setColor(sf::Color::Red);
header_text.setFont(resources->fonts.get("KenVecFuture"));
VictoryBanner vic(App,player1,player2,replay, resources);
PauseOverlay pause_screen(App, resources, false);
while (Running)
{
sf::Event Event;
while (App.pollEvent(Event))
{
board.handleEvents(Event);
if(sidebar.updateEvents(Event))
pause_screen.setPaused(true);
if(pause_screen.updateEvent(Event))
{
return pause_screen.getActionKeyCode();
}
if(vic.handleEvents((Event)))
{
return vic.getActionKeyCode();
}
if (Event.type == sf::Event::Closed)
{
return (-1);
}
}
if(player1_turn) {
curr_player = player1;
oppo_player = player2;
header_text.setString("Player 1's Turn");
}
else {
curr_player = player2;
oppo_player = player1;
header_text.setString("Player 2's Turn");
}
mouse_cursor.update(); //tracks the mouse_cursor
if(!board.game_done && !board.tie) { //checks if game is done
if(sidebar.checkTimer(resources->isTimerActivated,resources->turn_timer)) {
if(player1_turn)
board.update(curr_player); //updates all variables
else
board.updateAI(curr_player, oppo_player); //updates all variables
if(board.round_done) {
player1_turn = !player1_turn;
sidebar.restartClock(); //restarts the timer
board.round_done = false;
}
}
else {
player1_turn = !player1_turn;
sidebar.restartClock();
}
replay.record();
}
else
{
header_text.setString("");
replay.save();
sidebar.stopMusic();
vic.displayBanner();
}
board.updateAnimation();
App.clear();
App.draw(background);
App.draw(board);
App.draw(sidebar);
App.draw(header_text);
if(vic.getShowBanner()) {
App.draw(vic);
}
if(pause_screen.isPaused()) {
App.draw(pause_screen);
}
App.draw(mouse_cursor);
App.display();
}
return (-1);
}
#endif // SCREEN_6_HPP_INCLUDED
| [
"yonglian146@gmail.com"
] | yonglian146@gmail.com |
f9d705d99af53fe8f54559b3717dff81495e6db5 | 3b4696f5353468e08377283726ff8ac3b44a1f62 | /black-box/black-box/template_manage.cpp | 62de5b841f89560bd4f36e304162c8fd94e563a9 | [] | no_license | hmguan/grace | 7b8e14b07b35eb12c153765ba9f2189230fcd224 | d4da5ec4b668720be6ff5c9b88a9d92d040e8bc1 | refs/heads/master | 2020-03-26T20:56:00.460868 | 2018-08-20T11:21:58 | 2018-08-20T11:21:58 | 145,356,104 | 0 | 0 | null | 2018-08-20T02:27:21 | 2018-08-20T02:27:21 | null | GB18030 | C++ | false | false | 2,817 | cpp | #include "template_manage.h"
#include "group_edit.h"
#include <QtWidgets\QMessageBox.h>
template_manage::template_manage(QWidget *parent)
: QDialog(parent)
{
ui.setupUi(this);
}
template_manage::~template_manage()
{
}
void template_manage::init_page()
{
for (auto&iter : map_log_types_){
QListWidgetItem *item = new QListWidgetItem(QString::fromLocal8Bit(iter.first.c_str()));//列表只显示IP
item->setCheckState(Qt::Unchecked);
ui.listWidget->addItem(item);
}
int i = 0;
ui.tabWidget->clear();
for (auto&iter : template_type_){
group_edit*tab_page = new group_edit(this);
tab_page->set_group_data(iter.second);
tab_page->group_name_ = iter.first;
tab_page->map_log_types_ = map_log_types_;
tab_page->template_type_ = template_type_;
tab_page->index = i;
ui.tabWidget->insertTab(i, tab_page, QString::fromLocal8Bit(iter.first.c_str()));
i++;
}
}
void template_manage::on_pushButton_clicked()
{
if (ui.lineEdit->text()==""){
QMessageBox::information(this, QStringLiteral("warning:"), QStringLiteral("new name is empty!"), QMessageBox::Ok);//没有勾选日志类型
return;
}
int count = 0;
std::vector<std::string>new_template;
for (int row = 0; row < ui.listWidget->count(); ++row){
if (ui.listWidget->item(row)->checkState() == Qt::Checked){
new_template.push_back(ui.listWidget->item(row)->text().toStdString());
count++;
}
}
if (ui.positionBox->checkState() == Qt::Checked){//获取定位图
new_template.push_back("localization");
}
if (ui.repositionBox->checkState() == Qt::Checked){//获取二次定位图
new_template.push_back("deviation");
}
if (ui.systemLogBox->checkState() == Qt::Checked){
new_template.push_back("system_log");
}
if (count == 0){
QMessageBox::information(this, QStringLiteral("warning:"), QStringLiteral("select any log type!"), QMessageBox::Ok);//没有勾选日志类型
return;
}
template_type_.insert(std::make_pair(ui.lineEdit->text().toStdString(), new_template));
//int i = ui.tabWidget->count();
//group_edit*tab_page = new group_edit(this);
//tab_page->set_group_data(new_template);
//tab_page->group_name_ = ui.lineEdit->text().toStdString();
//tab_page->map_log_types_ = map_log_types_;
//tab_page->template_type_ = template_type_;
//ui.tabWidget->insertTab(i + 1, tab_page, ui.lineEdit->text());
ui.tabWidget->clear();
int i = 0;
for (auto&iter : template_type_){
group_edit*tab_page = new group_edit(this);
tab_page->set_group_data(iter.second);
tab_page->group_name_ = iter.first;
tab_page->map_log_types_ = map_log_types_;
tab_page->template_type_ = template_type_;
tab_page->index = i;
ui.tabWidget->insertTab(i, tab_page, QString::fromLocal8Bit(iter.first.c_str()));
i++;
}
} | [
"250603123@qq.com"
] | 250603123@qq.com |
e42fc1275d55ad395b44f3c1990986a922e699db | ea0effaa074b1a8ff56db9ef5b48dd08813bdbfb | /cpp/src/hfc/include/lang/Exception.hpp | b7e27cc1b79285a324c480c59fa9d25308e9328b | [] | no_license | youkejiang/HFRM | f06e24380803ac3661daabd1c10faa025ca2c871 | 7651ce56120fe2d1b1b178522573bea4b2223615 | refs/heads/master | 2021-01-19T07:07:29.252854 | 2016-03-16T09:09:11 | 2016-03-16T09:09:11 | 54,016,747 | 0 | 0 | null | 2016-03-16T09:08:08 | 2016-03-16T09:08:08 | null | UTF-8 | C++ | false | false | 505 | hpp | #ifndef __EXCEPTION_HPP__
#define __EXCEPTION_HPP__
#include "../hfc_def.hpp"
#include "String.hpp"
namespace hfc {
namespace lang{
class HFC_API Exception {
public:
int m_iErrno;
String m_strErrstr;
public:
Exception() {
}
Exception(const int errno) {
m_iErrno = errno;
}
Exception(const String& errstr) {
m_strErrstr = errstr;
}
Exception(const int errno, const String& errstr) {
m_iErrno = errno;
m_strErrstr = errstr;
}
};
}
}
#endif
| [
"hoheart@163.com"
] | hoheart@163.com |
5ecf55d5e05806b46f957a54b59aa7558ef57444 | 41a1ab4067e49c2839ddf9913e983ec17c7bfec7 | /Source/Prototype/Tree.cpp | 660491ad102c9f544c89bff844d7a448c82916f7 | [] | no_license | Ryuuz/GameProject | 0df03d5771ae3ed25ddd7fd32f5113661414688c | 623f500b283eda80128f55cf00124edc342801a8 | refs/heads/master | 2021-01-19T09:21:26.996377 | 2017-05-24T11:53:10 | 2017-05-24T11:53:10 | 82,101,740 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,036 | cpp | // Fill out your copyright notice in the Description page of Project Settings.
#include "Prototype.h"
#include "Tree.h"
// Sets default values
ATree::ATree()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("RootComponent"));
TreeMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("TreeMesh"));
TreeMesh->SetupAttachment(RootComponent);
//Sets mesh
static ConstructorHelpers::FObjectFinder<UStaticMesh> TreeAsset(TEXT("StaticMesh'/Game/Meshes/hostfarger.hostfarger'"));
if (TreeAsset.Succeeded())
{
TreeMesh->SetStaticMesh(TreeAsset.Object);
}
}
// Called when the game starts or when spawned
void ATree::BeginPlay()
{
Super::BeginPlay();
Tags.Add(FName("Tree"));
}
// Called every frame
void ATree::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
//Make the actor visible if hidden
if (bHidden)
{
SetActorHiddenInGame(false);
}
}
| [
"cmodegaard@gmail.com"
] | cmodegaard@gmail.com |
b11154af2b47fd4e9af590c77425e386e52a001d | d0c44dd3da2ef8c0ff835982a437946cbf4d2940 | /cmake-build-debug/programs_tiling/function14715/function14715_schedule_43/function14715_schedule_43_wrapper.cpp | 56b400d990f074646eadc98669ca5a6ca7508684 | [] | no_license | IsraMekki/tiramisu_code_generator | 8b3f1d63cff62ba9f5242c019058d5a3119184a3 | 5a259d8e244af452e5301126683fa4320c2047a3 | refs/heads/master | 2020-04-29T17:27:57.987172 | 2019-04-23T16:50:32 | 2019-04-23T16:50:32 | 176,297,755 | 1 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 1,544 | cpp | #include "Halide.h"
#include "function14715_schedule_43_wrapper.h"
#include "tiramisu/utils.h"
#include <cstdlib>
#include <iostream>
#include <time.h>
#include <fstream>
#include <chrono>
#define MAX_RAND 200
int main(int, char **){
Halide::Buffer<int32_t> buf00(256, 2048);
Halide::Buffer<int32_t> buf01(256);
Halide::Buffer<int32_t> buf02(256, 2048);
Halide::Buffer<int32_t> buf03(2048);
Halide::Buffer<int32_t> buf04(2048, 128);
Halide::Buffer<int32_t> buf05(256);
Halide::Buffer<int32_t> buf06(256);
Halide::Buffer<int32_t> buf07(2048);
Halide::Buffer<int32_t> buf08(128);
Halide::Buffer<int32_t> buf09(2048, 128);
Halide::Buffer<int32_t> buf0(256, 2048, 128);
init_buffer(buf0, (int32_t)0);
auto t1 = std::chrono::high_resolution_clock::now();
function14715_schedule_43(buf00.raw_buffer(), buf01.raw_buffer(), buf02.raw_buffer(), buf03.raw_buffer(), buf04.raw_buffer(), buf05.raw_buffer(), buf06.raw_buffer(), buf07.raw_buffer(), buf08.raw_buffer(), buf09.raw_buffer(), buf0.raw_buffer());
auto t2 = std::chrono::high_resolution_clock::now();
std::chrono::duration<double> diff = t2 - t1;
std::ofstream exec_times_file;
exec_times_file.open("../data/programs/function14715/function14715_schedule_43/exec_times.txt", std::ios_base::app);
if (exec_times_file.is_open()){
exec_times_file << diff.count() * 1000000 << "us" <<std::endl;
exec_times_file.close();
}
return 0;
} | [
"ei_mekki@esi.dz"
] | ei_mekki@esi.dz |
77d62dc3a8752b9b536816774f121e0df8104b4d | ba0cbdae81c171bd4be7b12c0594de72bd6d625a | /MyToontown/Panda3D-1.9.0/include/conditionVarFull.h | 254fe0e3f1352b111abadb833c28d6bc50f01c08 | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | sweep41/Toontown-2016 | 65985f198fa32a832e762fa9c59e59606d6a40a3 | 7732fb2c27001264e6dd652c057b3dc41f9c8a7d | refs/heads/master | 2021-01-23T16:04:45.264205 | 2017-06-04T02:47:34 | 2017-06-04T02:47:34 | 93,279,679 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,798 | h | // Filename: conditionVarFull.h
// Created by: drose (28Aug06)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You should have received a copy of this license along
// with this source code in a file named "LICENSE."
//
////////////////////////////////////////////////////////////////////
#ifndef CONDITIONVARFULL_H
#define CONDITIONVARFULL_H
#include "pandabase.h"
#include "conditionVarFullDebug.h"
#include "conditionVarFullDirect.h"
////////////////////////////////////////////////////////////////////
// Class : ConditionVarFull
// Description : This class implements a condition variable; see
// ConditionVar for a brief introduction to this class.
// The ConditionVarFull class provides a more complete
// implementation than ConditionVar; in particular, it
// provides the notify_all() method, which is guaranteed
// to wake up all threads currently waiting on the
// condition (whereas notify() is guaranteed to wake up
// at least one thread, but may or may not wake up all
// of them).
//
// This class exists because on certain platforms
// (e.g. Win32), implementing notify_all() requires more
// overhead, so you should use ConditionVar for cases
// when you do not require the notify_all() semantics.
//
// There are still some minor semantics that POSIX
// condition variables provide which this implementation
// does not. For instance, it is required (not
// optional) that the caller of notify() or notify_all()
// is holding the condition variable's mutex before the
// call.
//
// This class inherits its implementation either from
// ConditionVarFullDebug or ConditionVarFullDirect,
// depending on the definition of DEBUG_THREADS.
////////////////////////////////////////////////////////////////////
#ifdef DEBUG_THREADS
class EXPCL_PANDA_PIPELINE ConditionVarFull : public ConditionVarFullDebug
#else
class EXPCL_PANDA_PIPELINE ConditionVarFull : public ConditionVarFullDirect
#endif // DEBUG_THREADS
{
PUBLISHED:
INLINE ConditionVarFull(Mutex &mutex);
INLINE ~ConditionVarFull();
private:
INLINE ConditionVarFull(const ConditionVarFull ©);
INLINE void operator = (const ConditionVarFull ©);
PUBLISHED:
INLINE Mutex &get_mutex() const;
};
#include "conditionVarFull.I"
#endif
| [
"sweep14@gmail.com"
] | sweep14@gmail.com |
41b0effd69e44ee9f68c4c9d09e908f8bbc09d13 | 31b33fd6d6500964b2f4aa29186451c3db30ea1b | /Userland/Libraries/LibGemini/GeminiResponse.h | 791ac3c5c693300fd26bbb55585d4f4932e39420 | [
"BSD-2-Clause"
] | permissive | jcs/serenity | 4ca6f6eebdf952154d50d74516cf5c17dbccd418 | 0f1f92553213c6c2c7268078c9d39b813c24bb49 | refs/heads/master | 2022-11-27T13:12:11.214253 | 2022-11-21T17:01:22 | 2022-11-22T20:13:35 | 229,094,839 | 10 | 2 | BSD-2-Clause | 2019-12-19T16:25:40 | 2019-12-19T16:25:39 | null | UTF-8 | C++ | false | false | 648 | h | /*
* Copyright (c) 2020-2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/String.h>
#include <LibCore/NetworkResponse.h>
namespace Gemini {
class GeminiResponse : public Core::NetworkResponse {
public:
virtual ~GeminiResponse() override = default;
static NonnullRefPtr<GeminiResponse> create(int status, String meta)
{
return adopt_ref(*new GeminiResponse(status, meta));
}
int status() const { return m_status; }
String meta() const { return m_meta; }
private:
GeminiResponse(int status, String);
int m_status { 0 };
String m_meta;
};
}
| [
"kling@serenityos.org"
] | kling@serenityos.org |
4f0c9c787b79e5f2452945578194048f0c8988d4 | 1c93fd6ef2abad29c9956c4b311af395c2c2e162 | /build-videoDisplay-Desktop_Qt_5_2_0_MSVC2010_32bit_OpenGL-Debug/ui_mainwindow.h | 96dc92a1db03b9b50a81b55241da3e7e960a0dc2 | [] | no_license | LogisticFreedom/Moving-Objects-Detected-and-Recongnation-System | 6f7010c1ebc93ea0eed11dede08a2898d3490357 | 92f9c3feb7256287616d58556e43dedb4191dc5a | refs/heads/master | 2021-01-20T21:00:07.890719 | 2016-07-13T00:58:03 | 2016-07-13T00:58:03 | 63,201,620 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 12,938 | h | /********************************************************************************
** Form generated from reading UI file 'mainwindow.ui'
**
** Created by: Qt User Interface Compiler version 5.2.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_MAINWINDOW_H
#define UI_MAINWINDOW_H
#include <QtCore/QVariant>
#include <QtWidgets/QAction>
#include <QtWidgets/QApplication>
#include <QtWidgets/QButtonGroup>
#include <QtWidgets/QComboBox>
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QHeaderView>
#include <QtWidgets/QLCDNumber>
#include <QtWidgets/QLabel>
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QMenu>
#include <QtWidgets/QMenuBar>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QStatusBar>
#include <QtWidgets/QToolBar>
#include <QtWidgets/QVBoxLayout>
#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
class Ui_MainWindow
{
public:
QAction *actionOpen;
QWidget *centralWidget;
QLabel *motionVideo;
QLabel *originalVideo;
QLabel *sailencyMapVideo;
QLabel *label;
QLabel *label_2;
QLabel *label_3;
QLCDNumber *fpsLCD;
QWidget *layoutWidget;
QVBoxLayout *verticalLayout_2;
QPushButton *openVideoButton;
QVBoxLayout *verticalLayout;
QHBoxLayout *horizontalLayout_3;
QComboBox *algorithmChoice;
QPushButton *selectButton;
QHBoxLayout *horizontalLayout_2;
QHBoxLayout *horizontalLayout;
QPushButton *playButton;
QPushButton *stopButton;
QWidget *layoutWidget1;
QVBoxLayout *verticalLayout_4;
QVBoxLayout *verticalLayout_3;
QComboBox *detectChoice;
QPushButton *StartDetectButton;
QPushButton *ApplyDetectButton;
QPushButton *stopDetectButton;
QLabel *showClassify;
QWidget *layoutWidget2;
QVBoxLayout *verticalLayout_6;
QPushButton *connect;
QVBoxLayout *verticalLayout_5;
QPushButton *transport;
QPushButton *stopSend;
QPushButton *openRemote;
QMenuBar *menuBar;
QMenu *menuFile;
QToolBar *mainToolBar;
QStatusBar *statusBar;
void setupUi(QMainWindow *MainWindow)
{
if (MainWindow->objectName().isEmpty())
MainWindow->setObjectName(QStringLiteral("MainWindow"));
MainWindow->resize(837, 679);
actionOpen = new QAction(MainWindow);
actionOpen->setObjectName(QStringLiteral("actionOpen"));
centralWidget = new QWidget(MainWindow);
centralWidget->setObjectName(QStringLiteral("centralWidget"));
motionVideo = new QLabel(centralWidget);
motionVideo->setObjectName(QStringLiteral("motionVideo"));
motionVideo->setGeometry(QRect(100, 360, 54, 12));
originalVideo = new QLabel(centralWidget);
originalVideo->setObjectName(QStringLiteral("originalVideo"));
originalVideo->setGeometry(QRect(90, 70, 54, 12));
sailencyMapVideo = new QLabel(centralWidget);
sailencyMapVideo->setObjectName(QStringLiteral("sailencyMapVideo"));
sailencyMapVideo->setGeometry(QRect(470, 70, 54, 12));
label = new QLabel(centralWidget);
label->setObjectName(QStringLiteral("label"));
label->setGeometry(QRect(90, 40, 101, 16));
label_2 = new QLabel(centralWidget);
label_2->setObjectName(QStringLiteral("label_2"));
label_2->setGeometry(QRect(470, 40, 91, 16));
label_3 = new QLabel(centralWidget);
label_3->setObjectName(QStringLiteral("label_3"));
label_3->setGeometry(QRect(100, 330, 71, 16));
fpsLCD = new QLCDNumber(centralWidget);
fpsLCD->setObjectName(QStringLiteral("fpsLCD"));
fpsLCD->setGeometry(QRect(530, 380, 161, 51));
layoutWidget = new QWidget(centralWidget);
layoutWidget->setObjectName(QStringLiteral("layoutWidget"));
layoutWidget->setGeometry(QRect(530, 460, 164, 91));
verticalLayout_2 = new QVBoxLayout(layoutWidget);
verticalLayout_2->setSpacing(6);
verticalLayout_2->setContentsMargins(11, 11, 11, 11);
verticalLayout_2->setObjectName(QStringLiteral("verticalLayout_2"));
verticalLayout_2->setContentsMargins(0, 0, 0, 0);
openVideoButton = new QPushButton(layoutWidget);
openVideoButton->setObjectName(QStringLiteral("openVideoButton"));
verticalLayout_2->addWidget(openVideoButton);
verticalLayout = new QVBoxLayout();
verticalLayout->setSpacing(6);
verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
horizontalLayout_3 = new QHBoxLayout();
horizontalLayout_3->setSpacing(6);
horizontalLayout_3->setObjectName(QStringLiteral("horizontalLayout_3"));
algorithmChoice = new QComboBox(layoutWidget);
algorithmChoice->setObjectName(QStringLiteral("algorithmChoice"));
horizontalLayout_3->addWidget(algorithmChoice);
selectButton = new QPushButton(layoutWidget);
selectButton->setObjectName(QStringLiteral("selectButton"));
horizontalLayout_3->addWidget(selectButton);
verticalLayout->addLayout(horizontalLayout_3);
horizontalLayout_2 = new QHBoxLayout();
horizontalLayout_2->setSpacing(6);
horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2"));
horizontalLayout = new QHBoxLayout();
horizontalLayout->setSpacing(6);
horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));
playButton = new QPushButton(layoutWidget);
playButton->setObjectName(QStringLiteral("playButton"));
horizontalLayout->addWidget(playButton);
horizontalLayout_2->addLayout(horizontalLayout);
stopButton = new QPushButton(layoutWidget);
stopButton->setObjectName(QStringLiteral("stopButton"));
horizontalLayout_2->addWidget(stopButton);
verticalLayout->addLayout(horizontalLayout_2);
verticalLayout_2->addLayout(verticalLayout);
layoutWidget1 = new QWidget(centralWidget);
layoutWidget1->setObjectName(QStringLiteral("layoutWidget1"));
layoutWidget1->setGeometry(QRect(710, 460, 79, 111));
verticalLayout_4 = new QVBoxLayout(layoutWidget1);
verticalLayout_4->setSpacing(6);
verticalLayout_4->setContentsMargins(11, 11, 11, 11);
verticalLayout_4->setObjectName(QStringLiteral("verticalLayout_4"));
verticalLayout_4->setContentsMargins(0, 0, 0, 0);
verticalLayout_3 = new QVBoxLayout();
verticalLayout_3->setSpacing(6);
verticalLayout_3->setObjectName(QStringLiteral("verticalLayout_3"));
detectChoice = new QComboBox(layoutWidget1);
detectChoice->setObjectName(QStringLiteral("detectChoice"));
verticalLayout_3->addWidget(detectChoice);
StartDetectButton = new QPushButton(layoutWidget1);
StartDetectButton->setObjectName(QStringLiteral("StartDetectButton"));
verticalLayout_3->addWidget(StartDetectButton);
ApplyDetectButton = new QPushButton(layoutWidget1);
ApplyDetectButton->setObjectName(QStringLiteral("ApplyDetectButton"));
verticalLayout_3->addWidget(ApplyDetectButton);
verticalLayout_4->addLayout(verticalLayout_3);
stopDetectButton = new QPushButton(layoutWidget1);
stopDetectButton->setObjectName(QStringLiteral("stopDetectButton"));
verticalLayout_4->addWidget(stopDetectButton);
showClassify = new QLabel(centralWidget);
showClassify->setObjectName(QStringLiteral("showClassify"));
showClassify->setGeometry(QRect(520, 330, 161, 31));
showClassify->setStyleSheet(QLatin1String("No Objectsrgb(255, 0, 0)\n"
"font: 22pt \"04b_21\";\n"
"font: 16pt \"04b_21\";\n"
"font: 75 14pt \"04b_21\";\n"
"font: 75 22pt \"04b_21\";\n"
"font: 18pt \"04b_21\";"));
layoutWidget2 = new QWidget(centralWidget);
layoutWidget2->setObjectName(QStringLiteral("layoutWidget2"));
layoutWidget2->setGeometry(QRect(710, 350, 79, 85));
verticalLayout_6 = new QVBoxLayout(layoutWidget2);
verticalLayout_6->setSpacing(6);
verticalLayout_6->setContentsMargins(11, 11, 11, 11);
verticalLayout_6->setObjectName(QStringLiteral("verticalLayout_6"));
verticalLayout_6->setContentsMargins(0, 0, 0, 0);
connect = new QPushButton(layoutWidget2);
connect->setObjectName(QStringLiteral("connect"));
verticalLayout_6->addWidget(connect);
verticalLayout_5 = new QVBoxLayout();
verticalLayout_5->setSpacing(6);
verticalLayout_5->setObjectName(QStringLiteral("verticalLayout_5"));
transport = new QPushButton(layoutWidget2);
transport->setObjectName(QStringLiteral("transport"));
verticalLayout_5->addWidget(transport);
stopSend = new QPushButton(layoutWidget2);
stopSend->setObjectName(QStringLiteral("stopSend"));
verticalLayout_5->addWidget(stopSend);
verticalLayout_6->addLayout(verticalLayout_5);
openRemote = new QPushButton(centralWidget);
openRemote->setObjectName(QStringLiteral("openRemote"));
openRemote->setGeometry(QRect(530, 570, 161, 23));
MainWindow->setCentralWidget(centralWidget);
menuBar = new QMenuBar(MainWindow);
menuBar->setObjectName(QStringLiteral("menuBar"));
menuBar->setGeometry(QRect(0, 0, 837, 23));
menuFile = new QMenu(menuBar);
menuFile->setObjectName(QStringLiteral("menuFile"));
MainWindow->setMenuBar(menuBar);
mainToolBar = new QToolBar(MainWindow);
mainToolBar->setObjectName(QStringLiteral("mainToolBar"));
MainWindow->addToolBar(Qt::TopToolBarArea, mainToolBar);
statusBar = new QStatusBar(MainWindow);
statusBar->setObjectName(QStringLiteral("statusBar"));
MainWindow->setStatusBar(statusBar);
menuBar->addAction(menuFile->menuAction());
menuFile->addAction(actionOpen);
retranslateUi(MainWindow);
QMetaObject::connectSlotsByName(MainWindow);
} // setupUi
void retranslateUi(QMainWindow *MainWindow)
{
MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0));
actionOpen->setText(QApplication::translate("MainWindow", "Open", 0));
motionVideo->setText(QApplication::translate("MainWindow", "TextLabel", 0));
originalVideo->setText(QApplication::translate("MainWindow", "TextLabel", 0));
sailencyMapVideo->setText(QApplication::translate("MainWindow", "TextLabel", 0));
label->setText(QApplication::translate("MainWindow", "Original Video", 0));
label_2->setText(QApplication::translate("MainWindow", "Saliency Map", 0));
label_3->setText(QApplication::translate("MainWindow", "Motion Map", 0));
openVideoButton->setText(QApplication::translate("MainWindow", "Open Carmera", 0));
algorithmChoice->clear();
algorithmChoice->insertItems(0, QStringList()
<< QApplication::translate("MainWindow", "DIVOG", 0)
<< QApplication::translate("MainWindow", "SR", 0)
<< QApplication::translate("MainWindow", "NEW FT", 0)
<< QApplication::translate("MainWindow", "Itti", 0)
<< QApplication::translate("MainWindow", "LC", 0)
<< QApplication::translate("MainWindow", "GMM", 0)
<< QApplication::translate("MainWindow", "GMM GRAY", 0)
);
selectButton->setText(QApplication::translate("MainWindow", "Apply", 0));
playButton->setText(QApplication::translate("MainWindow", "Play", 0));
stopButton->setText(QApplication::translate("MainWindow", "Stop", 0));
detectChoice->clear();
detectChoice->insertItems(0, QStringList()
<< QApplication::translate("MainWindow", "Car", 0)
<< QApplication::translate("MainWindow", "People", 0)
);
StartDetectButton->setText(QApplication::translate("MainWindow", "Start", 0));
ApplyDetectButton->setText(QApplication::translate("MainWindow", "Apply", 0));
stopDetectButton->setText(QApplication::translate("MainWindow", "Stop detect", 0));
showClassify->setText(QApplication::translate("MainWindow", "<html><head/><body><p><span style=\" font-size:18pt;\">No Objects!</span></p></body></html>", 0));
connect->setText(QApplication::translate("MainWindow", "Connect", 0));
transport->setText(QApplication::translate("MainWindow", "Send", 0));
stopSend->setText(QApplication::translate("MainWindow", "stop send", 0));
openRemote->setText(QApplication::translate("MainWindow", "Open Remote Camera", 0));
menuFile->setTitle(QApplication::translate("MainWindow", "File(&F)", 0));
} // retranslateUi
};
namespace Ui {
class MainWindow: public Ui_MainWindow {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_MAINWINDOW_H
| [
"takeyourminds@qq.com"
] | takeyourminds@qq.com |
8c55164400b94de5f6772496d9a3bf89278072f4 | e63caeb2dd77b2fc634e383e5df152c21ac66d38 | /LuaDuiLib/LuaDuiLib/LuaDuiLib.cpp | 15603a1d9957e9199b29d443e6bc5b3ac1c9cffb | [] | no_license | uvbs/myduilib | fde32154943333f412cc7612d71145ba8285016a | a9846c932c8a6e8237d2952f17fe88afcc1824a0 | refs/heads/master | 2021-01-24T03:38:14.104596 | 2015-08-20T01:32:01 | 2015-08-20T01:32:01 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 101 | cpp | // LuaDuiLib.cpp : Defines the exported functions for the DLL application.
//
#include "stdafx.h"
| [
"389465209@qq.com"
] | 389465209@qq.com |
ce7fa0d30e6ab1fb13f0dd46beb4658f7e06c5f0 | 67b8ae040c557c94780f3e6c10ca888cd37ebc4d | /GameEngine/Entity/IEntity.cpp | dc72df221a8a6b189e74a4da92fde00ff1c7aa86 | [] | no_license | qjroundy/GameEngine | 8a7f64a9a4b5a83243d24e2c63c2f50c2394f228 | 906513d057540db049f519033c94e2b2da880311 | refs/heads/master | 2023-04-07T05:15:40.148824 | 2018-12-28T03:15:27 | 2018-12-28T03:15:27 | 105,471,130 | 0 | 1 | null | 2023-03-20T14:01:43 | 2017-10-01T20:13:17 | C++ | UTF-8 | C++ | false | false | 72 | cpp | #include "IEntity.h"
IEntity::IEntity()
{
}
IEntity::~IEntity()
{
}
| [
"qjroundy@gmail.com"
] | qjroundy@gmail.com |
740aec828d3d27b6634d1724b2e4fe59a02bbc14 | 7ab6651acbacc5b7640508fbaf913a9010fdb74f | /april_9_2/test_comb.ino | f02ed4a771a93f6bd28ee5b562a2a5edf593e839 | [] | no_license | incredulouss/thrust-vector | e9125a7477966ef4de5dcff0c116ad938c3522e0 | 201106bbce9c8f782d7661b7037f1ed84ef5439f | refs/heads/master | 2022-11-02T09:24:39.296826 | 2020-06-12T12:30:47 | 2020-06-12T12:30:47 | 261,825,346 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 651 | ino | int normalizeRoll =0 ;
int normalizePitch = 0;
void test()
{
int rollX = (int)rollVal();
int pitchY = (int)pitchVal()+4;
normalizeRoll = constrain(map(rollX,-70,70,minAngleX,maxAngleX),40,100);
normalizePitch = constrain(map(pitchY,-70,70,minAngleY,maxAngleY),40,100);
Serial.print(normalizeRoll);
Serial.print( ',' );
Serial.println(normalizePitch);
// rotateServo(rollX ,normalizeRoll,'X');
//rotateServo(pitchY ,normalizePitch,'Y');
myservoX.write(normalizeRoll);
myservoY.write(normalizePitch);
delay(15);
//rotateSudden(normalizeRoll , 'X');
///rotateSudden(mormalizePitch , 'Y');
}
| [
"noreply@github.com"
] | noreply@github.com |
2f08db00cd6901753b06d4be79e6cbb83bd9c2bc | 63b86a87323842aaf46920925919f58abfc1a68f | /SimpleBFS_RCM/Graph.h | f59a896abeaa113206ab41f3192b48f5a84c75b9 | [
"MIT"
] | permissive | SanazGheibi/CommunityDetection | e4d02e17039c4d1d7128673f4f1f8713f972bcf5 | 7457d11e8f4e30fe46703cfe32bfd24572b1f73b | refs/heads/master | 2022-12-12T18:50:50.806075 | 2020-09-12T14:34:50 | 2020-09-12T14:34:50 | 207,192,897 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,090 | h | /*
MIT License
Copyright (c) 2016, Hao Wei.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _GRAPH_H
#define _GRAPH_H
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <queue>
#include <algorithm>
#include <utility>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <cstdint>
#include <chrono>
#include "Util.h"
#include "UnitHeap.h"
using namespace std;
class Vertex{
public:
int outstart;
int outdegree;
int instart;
int indegree;
Vertex(){
outdegree=indegree=0;
outstart=instart=-1;
}
};
class Graph{
public:
int vsize;
long long edgenum;
string name;
vector<Vertex> graph;
vector<int> outedge;
vector<int> inedge;
string getFilename();
void setFilename(string name);
Graph();
~Graph();
void clear();
void readGraph(const string& fullname);
void PrintReOrderedGraph(const vector<int>& order);
void RCMOrder(vector<int>& order);
};
#endif
| [
"noreply@github.com"
] | noreply@github.com |
e8ae827971df9188d324f4d4642192b7bc2241f7 | ea02017f2a5bd6ac68791993083b249da60b2602 | /include/DynamicObjectMagicRayController.h | c75e83298b2cbe4481424ff8e1db9e2762c962be | [] | no_license | aarribas/WizardsAndOrcs | fc7fbdb888f17f1f677ea0ddbd650eeff9ba0aff | c8e7e1c9ae0f6f1f852ac5f7f80fe8ccc902fdba | refs/heads/master | 2020-05-19T07:38:34.978921 | 2013-09-20T18:41:33 | 2013-09-20T18:41:33 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 673 | h |
#pragma once
#include "DynamicObjectController.h"
#include "DynamicObjectMagicRayModel.h"
#include "DynamicObjectMagicRayView.h"
#include "DynamicObjectMagicRayLogicCalculator.h"
#include "LevelModel.h"
class DynamicObjectMagicRayController : public DynamicObjectController
{
public:
DynamicObjectMagicRayController();
~DynamicObjectMagicRayController();
public:
void init(LevelModel* levelModel, DynamicObjectView* dynamicObjectView, DynamicObjectLogicCalculator* dynamicObjectLogicCalculator, int key);
private:
//start to be given (requires sound management)
void startMove(DynamicObjectModel::DynamicObjectState);
void startImpact();
void startVanish();
};
| [
"andres.arribas@gmail.com"
] | andres.arribas@gmail.com |
344fa311bff7625db8cf53df715e750e86af4145 | 558b75f4715273ebb01e36e0b92446130c1a5c08 | /ui/src/inputoutputpatcheditor.h | 14ab19312c0b2ab61a7747a9173d293741706295 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | sbenejam/qlcplus | c5c83efe36830dcd75d41b3fba50944dc22019e1 | 2f2197ff086f2441d755c03f7d67c11f72ad21df | refs/heads/master | 2023-08-25T09:06:57.397956 | 2023-08-17T16:02:42 | 2023-08-17T16:02:42 | 502,436,497 | 0 | 0 | Apache-2.0 | 2022-06-11T19:17:52 | 2022-06-11T19:17:51 | null | UTF-8 | C++ | false | false | 4,151 | h | /*
Q Light Controller
inputoutputpatcheditor.h
Copyright (C) Massimo Callegari
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0.txt
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef INPUTOUTPUTPATCHEDITOR_H
#define INPUTOUTPUTPATCHEDITOR_H
#include <QWidget>
#include "ui_inputoutputpatcheditor.h"
class InputOutputMap;
class AudioCapture;
class OutputPatch;
class InputPatch;
class Doc;
/** @addtogroup ui_io
* @{
*/
class InputOutputPatchEditor : public QWidget, public Ui_InputOutputPatchEditor
{
Q_OBJECT
Q_DISABLE_COPY(InputOutputPatchEditor)
/********************************************************************
* Initialization
********************************************************************/
public:
/**
* Create a new output patch editor for the given universe.
*
* @param parent The owning parent widget
* @param universe The universe whose settings to edit
* @param outputMap The output map object that handles DMX output
*/
InputOutputPatchEditor(QWidget* parent, quint32 universe, InputOutputMap* ioMap, Doc* doc);
~InputOutputPatchEditor();
signals:
/** Tells that the mapping settings have changed */
void mappingChanged();
/** Tells that the audio input device has changed */
void audioInputDeviceChanged();
private:
InputOutputMap* m_ioMap;
Doc *m_doc;
quint32 m_universe; //! The input universe that is being edited
QString m_currentInputPluginName;
quint32 m_currentInput;
QString m_currentOutputPluginName;
quint32 m_currentOutput;
QString m_currentProfileName;
QString m_currentFeedbackPluginName;
quint32 m_currentFeedback;
/************************************************************************
* Mapping page
************************************************************************/
private:
InputPatch* patch() const;
QTreeWidgetItem* currentlyMappedItem() const;
void setupMappingPage();
QTreeWidgetItem *itemLookup(QString pluginName, QString devName);
void fillMappingTree();
QTreeWidgetItem* pluginItem(const QString& pluginName);
void showPluginMappingError();
private slots:
void slotMapCurrentItemChanged(QTreeWidgetItem* item);
void slotMapItemChanged(QTreeWidgetItem* item, int col);
void slotConfigureInputClicked();
void slotPluginConfigurationChanged(const QString& pluginName, bool success);
void slotHotpluggingChanged(bool checked);
/************************************************************************
* Profile page
************************************************************************/
private:
void setupProfilePage();
void fillProfileTree();
void updateProfileItem(const QString& name, QTreeWidgetItem* item);
QString fullProfilePath(const QString& manufacturer, const QString& model) const;
private slots:
void slotProfileItemChanged(QTreeWidgetItem* item);
void slotAddProfileClicked();
void slotRemoveProfileClicked();
void slotEditProfileClicked();
/************************************************************************
* Audio page
************************************************************************/
private:
void initAudioTab();
private slots:
void slotAudioDeviceItemChanged(QTreeWidgetItem* item, int col);
void slotSampleRateIndexChanged(int index);
void slotAudioChannelsChanged(int index);
void slotAudioInputPreview(bool enable);
void slotAudioUpdateLevel(double *spectrumBands, int size, double maxMagnitude, quint32 power);
private:
AudioCapture *m_inputCapture;
};
/** @} */
#endif /* INPUTOUTPUTPATCHEDITOR_H */
| [
"massimocallegari@yahoo.it"
] | massimocallegari@yahoo.it |
6ee907a2ac9aeee2472eeb72d7cbfb0e450ddcbe | c4fcddc2c5f0b02bbf3602f6f9b0c89484a2662b | /src/LightInk3D/Physics/RigidBody.cpp | bfdafa791ef7788d9e54f044bee98afba2f8b95f | [
"MIT"
] | permissive | ternence-li/LightInk3D | a54971ccd50fb15be8a4c019a038655ed9b1b9ea | 7b35419d164c9c939359f9106264841dc8c283a2 | refs/heads/master | 2021-06-11T20:21:44.810389 | 2017-01-20T09:59:44 | 2017-01-20T09:59:44 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 32,571 | cpp | //
// Copyright (c) 2008-2016 the Urho3D project.
//
// 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.
//
#include "Precompiled.h"
#include "Core/Context.h"
#include "Core/Profiler.h"
#include "IO/Log.h"
#include "IO/MemoryBuffer.h"
#include "Physics/CollisionShape.h"
#include "Physics/Constraint.h"
#include "Physics/PhysicsUtils.h"
#include "Physics/PhysicsWorld.h"
#include "Physics/RigidBody.h"
#include "Resource/ResourceCache.h"
#include "Resource/ResourceEvents.h"
#include "Scene/Scene.h"
#include "Scene/SceneEvents.h"
#include "Scene/SmoothedTransform.h"
#include <Bullet/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h>
#include <Bullet/BulletDynamics/Dynamics/btRigidBody.h>
#include <Bullet/BulletCollision/CollisionShapes/btCompoundShape.h>
namespace Urho3D
{
static const float DEFAULT_MASS = 0.0f;
static const float DEFAULT_FRICTION = 0.5f;
static const float DEFAULT_RESTITUTION = 0.0f;
static const float DEFAULT_ROLLING_FRICTION = 0.0f;
static const unsigned DEFAULT_COLLISION_LAYER = 0x1;
static const unsigned DEFAULT_COLLISION_MASK = M_MAX_UNSIGNED;
static const char* collisionEventModeNames[] =
{
"Never",
"When Active",
"Always",
0
};
extern const char* PHYSICS_CATEGORY;
RigidBody::RigidBody(Context* context) :
Component(context),
body_(0),
compoundShape_(0),
shiftedCompoundShape_(0),
gravityOverride_(Vector3::ZERO),
centerOfMass_(Vector3::ZERO),
mass_(DEFAULT_MASS),
collisionLayer_(DEFAULT_COLLISION_LAYER),
collisionMask_(DEFAULT_COLLISION_MASK),
collisionEventMode_(COLLISION_ACTIVE),
lastPosition_(Vector3::ZERO),
lastRotation_(Quaternion::IDENTITY),
kinematic_(false),
trigger_(false),
useGravity_(true),
readdBody_(false),
inWorld_(false),
enableMassUpdate_(true),
hasSimulated_(false)
{
compoundShape_ = new btCompoundShape();
shiftedCompoundShape_ = new btCompoundShape();
}
RigidBody::~RigidBody()
{
ReleaseBody();
if (physicsWorld_)
physicsWorld_->RemoveRigidBody(this);
delete compoundShape_;
compoundShape_ = 0;
delete shiftedCompoundShape_;
shiftedCompoundShape_ = 0;
}
void RigidBody::RegisterObject(Context* context)
{
context->RegisterFactory<RigidBody>(PHYSICS_CATEGORY);
URHO3D_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
URHO3D_MIXED_ACCESSOR_ATTRIBUTE("Physics Rotation", GetRotation, SetRotation, Quaternion, Quaternion::IDENTITY, AM_FILE | AM_NOEDIT);
URHO3D_MIXED_ACCESSOR_ATTRIBUTE("Physics Position", GetPosition, SetPosition, Vector3, Vector3::ZERO, AM_FILE | AM_NOEDIT);
URHO3D_ATTRIBUTE("Mass", float, mass_, DEFAULT_MASS, AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("Friction", GetFriction, SetFriction, float, DEFAULT_FRICTION, AM_DEFAULT);
URHO3D_MIXED_ACCESSOR_ATTRIBUTE("Anisotropic Friction", GetAnisotropicFriction, SetAnisotropicFriction, Vector3, Vector3::ONE,
AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("Rolling Friction", GetRollingFriction, SetRollingFriction, float, DEFAULT_ROLLING_FRICTION, AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("Restitution", GetRestitution, SetRestitution, float, DEFAULT_RESTITUTION, AM_DEFAULT);
URHO3D_MIXED_ACCESSOR_ATTRIBUTE("Linear Velocity", GetLinearVelocity, SetLinearVelocity, Vector3, Vector3::ZERO,
AM_DEFAULT | AM_LATESTDATA);
URHO3D_MIXED_ACCESSOR_ATTRIBUTE("Angular Velocity", GetAngularVelocity, SetAngularVelocity, Vector3, Vector3::ZERO, AM_FILE);
URHO3D_MIXED_ACCESSOR_ATTRIBUTE("Linear Factor", GetLinearFactor, SetLinearFactor, Vector3, Vector3::ONE, AM_DEFAULT);
URHO3D_MIXED_ACCESSOR_ATTRIBUTE("Angular Factor", GetAngularFactor, SetAngularFactor, Vector3, Vector3::ONE, AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("Linear Damping", GetLinearDamping, SetLinearDamping, float, 0.0f, AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("Angular Damping", GetAngularDamping, SetAngularDamping, float, 0.0f, AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("Linear Rest Threshold", GetLinearRestThreshold, SetLinearRestThreshold, float, 0.8f, AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("Angular Rest Threshold", GetAngularRestThreshold, SetAngularRestThreshold, float, 1.0f, AM_DEFAULT);
URHO3D_ATTRIBUTE("Collision Layer", int, collisionLayer_, DEFAULT_COLLISION_LAYER, AM_DEFAULT);
URHO3D_ATTRIBUTE("Collision Mask", int, collisionMask_, DEFAULT_COLLISION_MASK, AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("Contact Threshold", GetContactProcessingThreshold, SetContactProcessingThreshold, float, BT_LARGE_FLOAT,
AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("CCD Radius", GetCcdRadius, SetCcdRadius, float, 0.0f, AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("CCD Motion Threshold", GetCcdMotionThreshold, SetCcdMotionThreshold, float, 0.0f, AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("Network Angular Velocity", GetNetAngularVelocityAttr, SetNetAngularVelocityAttr, PODVector<unsigned char>,
Variant::emptyBuffer, AM_NET | AM_LATESTDATA | AM_NOEDIT);
URHO3D_ENUM_ATTRIBUTE("Collision Event Mode", collisionEventMode_, collisionEventModeNames, COLLISION_ACTIVE, AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("Use Gravity", GetUseGravity, SetUseGravity, bool, true, AM_DEFAULT);
URHO3D_ATTRIBUTE("Is Kinematic", bool, kinematic_, false, AM_DEFAULT);
URHO3D_ATTRIBUTE("Is Trigger", bool, trigger_, false, AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("Gravity Override", GetGravityOverride, SetGravityOverride, Vector3, Vector3::ZERO, AM_DEFAULT);
}
void RigidBody::OnSetAttribute(const AttributeInfo& attr, const Variant& src)
{
Serializable::OnSetAttribute(attr, src);
// Change of any non-accessor attribute requires the rigid body to be re-added to the physics world
if (!attr.accessor_)
readdBody_ = true;
}
void RigidBody::ApplyAttributes()
{
if (readdBody_)
AddBodyToWorld();
}
void RigidBody::OnSetEnabled()
{
bool enabled = IsEnabledEffective();
if (enabled && !inWorld_)
AddBodyToWorld();
else if (!enabled && inWorld_)
RemoveBodyFromWorld();
}
void RigidBody::getWorldTransform(btTransform& worldTrans) const
{
// We may be in a pathological state where a RigidBody exists without a scene node when this callback is fired,
// so check to be sure
if (node_)
{
lastPosition_ = node_->GetWorldPosition();
lastRotation_ = node_->GetWorldRotation();
worldTrans.setOrigin(ToBtVector3(lastPosition_ + lastRotation_ * centerOfMass_));
worldTrans.setRotation(ToBtQuaternion(lastRotation_));
}
hasSimulated_ = true;
}
void RigidBody::setWorldTransform(const btTransform& worldTrans)
{
Quaternion newWorldRotation = ToQuaternion(worldTrans.getRotation());
Vector3 newWorldPosition = ToVector3(worldTrans.getOrigin()) - newWorldRotation * centerOfMass_;
RigidBody* parentRigidBody = 0;
// It is possible that the RigidBody component has been kept alive via a shared pointer,
// while its scene node has already been destroyed
if (node_)
{
// If the rigid body is parented to another rigid body, can not set the transform immediately.
// In that case store it to PhysicsWorld for delayed assignment
Node* parent = node_->GetParent();
if (parent != GetScene() && parent)
parentRigidBody = parent->GetComponent<RigidBody>();
if (!parentRigidBody)
ApplyWorldTransform(newWorldPosition, newWorldRotation);
else
{
DelayedWorldTransform delayed;
delayed.rigidBody_ = this;
delayed.parentRigidBody_ = parentRigidBody;
delayed.worldPosition_ = newWorldPosition;
delayed.worldRotation_ = newWorldRotation;
physicsWorld_->AddDelayedWorldTransform(delayed);
}
MarkNetworkUpdate();
}
hasSimulated_ = true;
}
void RigidBody::DrawDebugGeometry(DebugRenderer* debug, bool depthTest)
{
if (debug && physicsWorld_ && body_ && IsEnabledEffective())
{
physicsWorld_->SetDebugRenderer(debug);
physicsWorld_->SetDebugDepthTest(depthTest);
btDiscreteDynamicsWorld* world = physicsWorld_->GetWorld();
world->debugDrawObject(body_->getWorldTransform(), shiftedCompoundShape_, IsActive() ? btVector3(1.0f, 1.0f, 1.0f) :
btVector3(0.0f, 1.0f, 0.0f));
physicsWorld_->SetDebugRenderer(0);
}
}
void RigidBody::SetMass(float mass)
{
mass = Max(mass, 0.0f);
if (mass != mass_)
{
mass_ = mass;
AddBodyToWorld();
MarkNetworkUpdate();
}
}
void RigidBody::SetPosition(const Vector3& position)
{
if (body_)
{
btTransform& worldTrans = body_->getWorldTransform();
worldTrans.setOrigin(ToBtVector3(position + ToQuaternion(worldTrans.getRotation()) * centerOfMass_));
// When forcing the physics position, set also interpolated position so that there is no jitter
// When not inside the simulation loop, this may lead to erratic movement of parented rigidbodies
// so skip in that case. Exception made before first simulation tick so that interpolation position
// of e.g. instantiated prefabs will be correct from the start
if (!hasSimulated_ || physicsWorld_->IsSimulating())
{
btTransform interpTrans = body_->getInterpolationWorldTransform();
interpTrans.setOrigin(worldTrans.getOrigin());
body_->setInterpolationWorldTransform(interpTrans);
}
Activate();
MarkNetworkUpdate();
}
}
void RigidBody::SetRotation(const Quaternion& rotation)
{
if (body_)
{
Vector3 oldPosition = GetPosition();
btTransform& worldTrans = body_->getWorldTransform();
worldTrans.setRotation(ToBtQuaternion(rotation));
if (!centerOfMass_.Equals(Vector3::ZERO))
worldTrans.setOrigin(ToBtVector3(oldPosition + rotation * centerOfMass_));
if (!hasSimulated_ || physicsWorld_->IsSimulating())
{
btTransform interpTrans = body_->getInterpolationWorldTransform();
interpTrans.setRotation(worldTrans.getRotation());
if (!centerOfMass_.Equals(Vector3::ZERO))
interpTrans.setOrigin(worldTrans.getOrigin());
body_->setInterpolationWorldTransform(interpTrans);
}
body_->updateInertiaTensor();
Activate();
MarkNetworkUpdate();
}
}
void RigidBody::SetTransform(const Vector3& position, const Quaternion& rotation)
{
if (body_)
{
btTransform& worldTrans = body_->getWorldTransform();
worldTrans.setRotation(ToBtQuaternion(rotation));
worldTrans.setOrigin(ToBtVector3(position + rotation * centerOfMass_));
if (!hasSimulated_ || physicsWorld_->IsSimulating())
{
btTransform interpTrans = body_->getInterpolationWorldTransform();
interpTrans.setOrigin(worldTrans.getOrigin());
interpTrans.setRotation(worldTrans.getRotation());
body_->setInterpolationWorldTransform(interpTrans);
}
body_->updateInertiaTensor();
Activate();
MarkNetworkUpdate();
}
}
void RigidBody::SetLinearVelocity(const Vector3& velocity)
{
if (body_)
{
body_->setLinearVelocity(ToBtVector3(velocity));
if (velocity != Vector3::ZERO)
Activate();
MarkNetworkUpdate();
}
}
void RigidBody::SetLinearFactor(const Vector3& factor)
{
if (body_)
{
body_->setLinearFactor(ToBtVector3(factor));
MarkNetworkUpdate();
}
}
void RigidBody::SetLinearRestThreshold(float threshold)
{
if (body_)
{
body_->setSleepingThresholds(threshold, body_->getAngularSleepingThreshold());
MarkNetworkUpdate();
}
}
void RigidBody::SetLinearDamping(float damping)
{
if (body_)
{
body_->setDamping(damping, body_->getAngularDamping());
MarkNetworkUpdate();
}
}
void RigidBody::SetAngularVelocity(const Vector3& velocity)
{
if (body_)
{
body_->setAngularVelocity(ToBtVector3(velocity));
if (velocity != Vector3::ZERO)
Activate();
MarkNetworkUpdate();
}
}
void RigidBody::SetAngularFactor(const Vector3& factor)
{
if (body_)
{
body_->setAngularFactor(ToBtVector3(factor));
MarkNetworkUpdate();
}
}
void RigidBody::SetAngularRestThreshold(float threshold)
{
if (body_)
{
body_->setSleepingThresholds(body_->getLinearSleepingThreshold(), threshold);
MarkNetworkUpdate();
}
}
void RigidBody::SetAngularDamping(float damping)
{
if (body_)
{
body_->setDamping(body_->getLinearDamping(), damping);
MarkNetworkUpdate();
}
}
void RigidBody::SetFriction(float friction)
{
if (body_)
{
body_->setFriction(friction);
MarkNetworkUpdate();
}
}
void RigidBody::SetAnisotropicFriction(const Vector3& friction)
{
if (body_)
{
body_->setAnisotropicFriction(ToBtVector3(friction));
MarkNetworkUpdate();
}
}
void RigidBody::SetRollingFriction(float friction)
{
if (body_)
{
body_->setRollingFriction(friction);
MarkNetworkUpdate();
}
}
void RigidBody::SetRestitution(float restitution)
{
if (body_)
{
body_->setRestitution(restitution);
MarkNetworkUpdate();
}
}
void RigidBody::SetContactProcessingThreshold(float threshold)
{
if (body_)
{
body_->setContactProcessingThreshold(threshold);
MarkNetworkUpdate();
}
}
void RigidBody::SetCcdRadius(float radius)
{
radius = Max(radius, 0.0f);
if (body_)
{
body_->setCcdSweptSphereRadius(radius);
MarkNetworkUpdate();
}
}
void RigidBody::SetCcdMotionThreshold(float threshold)
{
threshold = Max(threshold, 0.0f);
if (body_)
{
body_->setCcdMotionThreshold(threshold);
MarkNetworkUpdate();
}
}
void RigidBody::SetUseGravity(bool enable)
{
if (enable != useGravity_)
{
useGravity_ = enable;
UpdateGravity();
MarkNetworkUpdate();
}
}
void RigidBody::SetGravityOverride(const Vector3& gravity)
{
if (gravity != gravityOverride_)
{
gravityOverride_ = gravity;
UpdateGravity();
MarkNetworkUpdate();
}
}
void RigidBody::SetKinematic(bool enable)
{
if (enable != kinematic_)
{
kinematic_ = enable;
AddBodyToWorld();
MarkNetworkUpdate();
}
}
void RigidBody::SetTrigger(bool enable)
{
if (enable != trigger_)
{
trigger_ = enable;
AddBodyToWorld();
MarkNetworkUpdate();
}
}
void RigidBody::SetCollisionLayer(unsigned layer)
{
if (layer != collisionLayer_)
{
collisionLayer_ = layer;
AddBodyToWorld();
MarkNetworkUpdate();
}
}
void RigidBody::SetCollisionMask(unsigned mask)
{
if (mask != collisionMask_)
{
collisionMask_ = mask;
AddBodyToWorld();
MarkNetworkUpdate();
}
}
void RigidBody::SetCollisionLayerAndMask(unsigned layer, unsigned mask)
{
if (layer != collisionLayer_ || mask != collisionMask_)
{
collisionLayer_ = layer;
collisionMask_ = mask;
AddBodyToWorld();
MarkNetworkUpdate();
}
}
void RigidBody::SetCollisionEventMode(CollisionEventMode mode)
{
collisionEventMode_ = mode;
MarkNetworkUpdate();
}
void RigidBody::ApplyForce(const Vector3& force)
{
if (body_ && force != Vector3::ZERO)
{
Activate();
body_->applyCentralForce(ToBtVector3(force));
}
}
void RigidBody::ApplyForce(const Vector3& force, const Vector3& position)
{
if (body_ && force != Vector3::ZERO)
{
Activate();
body_->applyForce(ToBtVector3(force), ToBtVector3(position - centerOfMass_));
}
}
void RigidBody::ApplyTorque(const Vector3& torque)
{
if (body_ && torque != Vector3::ZERO)
{
Activate();
body_->applyTorque(ToBtVector3(torque));
}
}
void RigidBody::ApplyImpulse(const Vector3& impulse)
{
if (body_ && impulse != Vector3::ZERO)
{
Activate();
body_->applyCentralImpulse(ToBtVector3(impulse));
}
}
void RigidBody::ApplyImpulse(const Vector3& impulse, const Vector3& position)
{
if (body_ && impulse != Vector3::ZERO)
{
Activate();
body_->applyImpulse(ToBtVector3(impulse), ToBtVector3(position - centerOfMass_));
}
}
void RigidBody::ApplyTorqueImpulse(const Vector3& torque)
{
if (body_ && torque != Vector3::ZERO)
{
Activate();
body_->applyTorqueImpulse(ToBtVector3(torque));
}
}
void RigidBody::ResetForces()
{
if (body_)
body_->clearForces();
}
void RigidBody::Activate()
{
if (body_ && mass_ > 0.0f)
body_->activate(true);
}
void RigidBody::ReAddBodyToWorld()
{
if (body_ && inWorld_)
AddBodyToWorld();
}
void RigidBody::DisableMassUpdate()
{
enableMassUpdate_ = false;
}
void RigidBody::EnableMassUpdate()
{
if (!enableMassUpdate_)
{
enableMassUpdate_ = true;
UpdateMass();
}
}
Vector3 RigidBody::GetPosition() const
{
if (body_)
{
const btTransform& transform = body_->getWorldTransform();
return ToVector3(transform.getOrigin()) - ToQuaternion(transform.getRotation()) * centerOfMass_;
}
else
return Vector3::ZERO;
}
Quaternion RigidBody::GetRotation() const
{
return body_ ? ToQuaternion(body_->getWorldTransform().getRotation()) : Quaternion::IDENTITY;
}
Vector3 RigidBody::GetLinearVelocity() const
{
return body_ ? ToVector3(body_->getLinearVelocity()) : Vector3::ZERO;
}
Vector3 RigidBody::GetLinearFactor() const
{
return body_ ? ToVector3(body_->getLinearFactor()) : Vector3::ZERO;
}
Vector3 RigidBody::GetVelocityAtPoint(const Vector3& position) const
{
return body_ ? ToVector3(body_->getVelocityInLocalPoint(ToBtVector3(position - centerOfMass_))) : Vector3::ZERO;
}
float RigidBody::GetLinearRestThreshold() const
{
return body_ ? body_->getLinearSleepingThreshold() : 0.0f;
}
float RigidBody::GetLinearDamping() const
{
return body_ ? body_->getLinearDamping() : 0.0f;
}
Vector3 RigidBody::GetAngularVelocity() const
{
return body_ ? ToVector3(body_->getAngularVelocity()) : Vector3::ZERO;
}
Vector3 RigidBody::GetAngularFactor() const
{
return body_ ? ToVector3(body_->getAngularFactor()) : Vector3::ZERO;
}
float RigidBody::GetAngularRestThreshold() const
{
return body_ ? body_->getAngularSleepingThreshold() : 0.0f;
}
float RigidBody::GetAngularDamping() const
{
return body_ ? body_->getAngularDamping() : 0.0f;
}
float RigidBody::GetFriction() const
{
return body_ ? body_->getFriction() : 0.0f;
}
Vector3 RigidBody::GetAnisotropicFriction() const
{
return body_ ? ToVector3(body_->getAnisotropicFriction()) : Vector3::ZERO;
}
float RigidBody::GetRollingFriction() const
{
return body_ ? body_->getRollingFriction() : 0.0f;
}
float RigidBody::GetRestitution() const
{
return body_ ? body_->getRestitution() : 0.0f;
}
float RigidBody::GetContactProcessingThreshold() const
{
return body_ ? body_->getContactProcessingThreshold() : 0.0f;
}
float RigidBody::GetCcdRadius() const
{
return body_ ? body_->getCcdSweptSphereRadius() : 0.0f;
}
float RigidBody::GetCcdMotionThreshold() const
{
return body_ ? body_->getCcdMotionThreshold() : 0.0f;
}
bool RigidBody::IsActive() const
{
return body_ ? body_->isActive() : false;
}
void RigidBody::GetCollidingBodies(PODVector<RigidBody*>& result) const
{
if (physicsWorld_)
physicsWorld_->GetCollidingBodies(result, this);
else
result.Clear();
}
void RigidBody::ApplyWorldTransform(const Vector3& newWorldPosition, const Quaternion& newWorldRotation)
{
// In case of holding an extra reference to the RigidBody, this could be called in a situation
// where node is already null
if (!node_ || !physicsWorld_)
return;
physicsWorld_->SetApplyingTransforms(true);
// Apply transform to the SmoothedTransform component instead of node transform if available
if (smoothedTransform_)
{
smoothedTransform_->SetTargetWorldPosition(newWorldPosition);
smoothedTransform_->SetTargetWorldRotation(newWorldRotation);
lastPosition_ = newWorldPosition;
lastRotation_ = newWorldRotation;
}
else
{
node_->SetWorldPosition(newWorldPosition);
node_->SetWorldRotation(newWorldRotation);
lastPosition_ = node_->GetWorldPosition();
lastRotation_ = node_->GetWorldRotation();
}
physicsWorld_->SetApplyingTransforms(false);
}
void RigidBody::UpdateMass()
{
if (!body_ || !enableMassUpdate_)
return;
btTransform principal;
principal.setRotation(btQuaternion::getIdentity());
principal.setOrigin(btVector3(0.0f, 0.0f, 0.0f));
// Calculate center of mass shift from all the collision shapes
unsigned numShapes = (unsigned)compoundShape_->getNumChildShapes();
if (numShapes)
{
PODVector<float> masses(numShapes);
for (unsigned i = 0; i < numShapes; ++i)
{
// The actual mass does not matter, divide evenly between child shapes
masses[i] = 1.0f;
}
btVector3 inertia(0.0f, 0.0f, 0.0f);
compoundShape_->calculatePrincipalAxisTransform(&masses[0], principal, inertia);
}
// Add child shapes to shifted compound shape with adjusted offset
while (shiftedCompoundShape_->getNumChildShapes())
shiftedCompoundShape_->removeChildShapeByIndex(shiftedCompoundShape_->getNumChildShapes() - 1);
for (unsigned i = 0; i < numShapes; ++i)
{
btTransform adjusted = compoundShape_->getChildTransform(i);
adjusted.setOrigin(adjusted.getOrigin() - principal.getOrigin());
shiftedCompoundShape_->addChildShape(adjusted, compoundShape_->getChildShape(i));
}
// If shifted compound shape has only one child with no offset/rotation, use the child shape
// directly as the rigid body collision shape for better collision detection performance
bool useCompound = !numShapes || numShapes > 1;
if (!useCompound)
{
const btTransform& childTransform = shiftedCompoundShape_->getChildTransform(0);
if (!ToVector3(childTransform.getOrigin()).Equals(Vector3::ZERO) ||
!ToQuaternion(childTransform.getRotation()).Equals(Quaternion::IDENTITY))
useCompound = true;
}
body_->setCollisionShape(useCompound ? shiftedCompoundShape_ : shiftedCompoundShape_->getChildShape(0));
// If we have one shape and this is a triangle mesh, we use a custom material callback in order to adjust internal edges
if (!useCompound && body_->getCollisionShape()->getShapeType() == SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE &&
physicsWorld_->GetInternalEdge())
body_->setCollisionFlags(body_->getCollisionFlags() | btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK);
else
body_->setCollisionFlags(body_->getCollisionFlags() & ~btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK);
// Reapply rigid body position with new center of mass shift
Vector3 oldPosition = GetPosition();
centerOfMass_ = ToVector3(principal.getOrigin());
SetPosition(oldPosition);
// Calculate final inertia
btVector3 localInertia(0.0f, 0.0f, 0.0f);
if (mass_ > 0.0f)
shiftedCompoundShape_->calculateLocalInertia(mass_, localInertia);
body_->setMassProps(mass_, localInertia);
body_->updateInertiaTensor();
// Reapply constraint positions for new center of mass shift
if (node_)
{
for (PODVector<Constraint*>::Iterator i = constraints_.Begin(); i != constraints_.End(); ++i)
(*i)->ApplyFrames();
}
}
void RigidBody::UpdateGravity()
{
if (physicsWorld_ && body_)
{
btDiscreteDynamicsWorld* world = physicsWorld_->GetWorld();
int flags = body_->getFlags();
if (useGravity_ && gravityOverride_ == Vector3::ZERO)
flags &= ~BT_DISABLE_WORLD_GRAVITY;
else
flags |= BT_DISABLE_WORLD_GRAVITY;
body_->setFlags(flags);
if (useGravity_)
{
// If override vector is zero, use world's gravity
if (gravityOverride_ == Vector3::ZERO)
body_->setGravity(world->getGravity());
else
body_->setGravity(ToBtVector3(gravityOverride_));
}
else
body_->setGravity(btVector3(0.0f, 0.0f, 0.0f));
}
}
void RigidBody::SetNetAngularVelocityAttr(const PODVector<unsigned char>& value)
{
float maxVelocity = physicsWorld_ ? physicsWorld_->GetMaxNetworkAngularVelocity() : DEFAULT_MAX_NETWORK_ANGULAR_VELOCITY;
MemoryBuffer buf(value);
SetAngularVelocity(buf.ReadPackedVector3(maxVelocity));
}
const PODVector<unsigned char>& RigidBody::GetNetAngularVelocityAttr() const
{
float maxVelocity = physicsWorld_ ? physicsWorld_->GetMaxNetworkAngularVelocity() : DEFAULT_MAX_NETWORK_ANGULAR_VELOCITY;
attrBuffer_.Clear();
attrBuffer_.WritePackedVector3(GetAngularVelocity(), maxVelocity);
return attrBuffer_.GetBuffer();
}
void RigidBody::AddConstraint(Constraint* constraint)
{
constraints_.Push(constraint);
}
void RigidBody::RemoveConstraint(Constraint* constraint)
{
constraints_.Remove(constraint);
// A constraint being removed should possibly cause the object to eg. start falling, so activate
Activate();
}
void RigidBody::ReleaseBody()
{
if (body_)
{
// Release all constraints which refer to this body
// Make a copy for iteration
PODVector<Constraint*> constraints = constraints_;
for (PODVector<Constraint*>::Iterator i = constraints.Begin(); i != constraints.End(); ++i)
(*i)->ReleaseConstraint();
RemoveBodyFromWorld();
delete body_;
body_ = 0;
}
}
void RigidBody::OnMarkedDirty(Node* node)
{
// If node transform changes, apply it back to the physics transform. However, do not do this when a SmoothedTransform
// is in use, because in that case the node transform will be constantly updated into smoothed, possibly non-physical
// states; rather follow the SmoothedTransform target transform directly
// Also, for kinematic objects Bullet asks the position from us, so we do not need to apply ourselves
// (exception: initial setting of transform)
if ((!kinematic_ || !hasSimulated_) && (!physicsWorld_ || !physicsWorld_->IsApplyingTransforms()) && !smoothedTransform_)
{
// Physics operations are not safe from worker threads
Scene* scene = GetScene();
if (scene && scene->IsThreadedUpdate())
{
scene->DelayedMarkedDirty(this);
return;
}
// Check if transform has changed from the last one set in ApplyWorldTransform()
Vector3 newPosition = node_->GetWorldPosition();
Quaternion newRotation = node_->GetWorldRotation();
if (!newRotation.Equals(lastRotation_))
{
lastRotation_ = newRotation;
SetRotation(newRotation);
}
if (!newPosition.Equals(lastPosition_))
{
lastPosition_ = newPosition;
SetPosition(newPosition);
}
}
}
void RigidBody::OnNodeSet(Node* node)
{
if (node)
node->AddListener(this);
}
void RigidBody::OnSceneSet(Scene* scene)
{
if (scene)
{
if (scene == node_)
URHO3D_LOGWARNING(GetTypeName() + " should not be created to the root scene node");
physicsWorld_ = scene->GetOrCreateComponent<PhysicsWorld>();
physicsWorld_->AddRigidBody(this);
AddBodyToWorld();
}
else
{
ReleaseBody();
if (physicsWorld_)
physicsWorld_->RemoveRigidBody(this);
}
}
void RigidBody::AddBodyToWorld()
{
if (!physicsWorld_)
return;
URHO3D_PROFILE(AddBodyToWorld);
if (mass_ < 0.0f)
mass_ = 0.0f;
if (body_)
RemoveBodyFromWorld();
else
{
// Correct inertia will be calculated below
btVector3 localInertia(0.0f, 0.0f, 0.0f);
body_ = new btRigidBody(mass_, this, shiftedCompoundShape_, localInertia);
body_->setUserPointer(this);
// Check for existence of the SmoothedTransform component, which should be created by now in network client mode.
// If it exists, subscribe to its change events
smoothedTransform_ = GetComponent<SmoothedTransform>();
if (smoothedTransform_)
{
SubscribeToEvent(smoothedTransform_, E_TARGETPOSITION, URHO3D_HANDLER(RigidBody, HandleTargetPosition));
SubscribeToEvent(smoothedTransform_, E_TARGETROTATION, URHO3D_HANDLER(RigidBody, HandleTargetRotation));
}
// Check if CollisionShapes already exist in the node and add them to the compound shape.
// Do not update mass yet, but do it once all shapes have been added
PODVector<CollisionShape*> shapes;
node_->GetComponents<CollisionShape>(shapes);
for (PODVector<CollisionShape*>::Iterator i = shapes.Begin(); i != shapes.End(); ++i)
(*i)->NotifyRigidBody(false);
// Check if this node contains Constraint components that were waiting for the rigid body to be created, and signal them
// to create themselves now
PODVector<Constraint*> constraints;
node_->GetComponents<Constraint>(constraints);
for (PODVector<Constraint*>::Iterator i = constraints.Begin(); i != constraints.End(); ++i)
(*i)->CreateConstraint();
}
UpdateMass();
UpdateGravity();
int flags = body_->getCollisionFlags();
if (trigger_)
flags |= btCollisionObject::CF_NO_CONTACT_RESPONSE;
else
flags &= ~btCollisionObject::CF_NO_CONTACT_RESPONSE;
if (kinematic_)
flags |= btCollisionObject::CF_KINEMATIC_OBJECT;
else
flags &= ~btCollisionObject::CF_KINEMATIC_OBJECT;
body_->setCollisionFlags(flags);
body_->forceActivationState(kinematic_ ? DISABLE_DEACTIVATION : ISLAND_SLEEPING);
if (!IsEnabledEffective())
return;
btDiscreteDynamicsWorld* world = physicsWorld_->GetWorld();
world->addRigidBody(body_, (short)collisionLayer_, (short)collisionMask_);
inWorld_ = true;
readdBody_ = false;
hasSimulated_ = false;
if (mass_ > 0.0f)
Activate();
else
{
SetLinearVelocity(Vector3::ZERO);
SetAngularVelocity(Vector3::ZERO);
}
}
void RigidBody::RemoveBodyFromWorld()
{
if (physicsWorld_ && body_ && inWorld_)
{
btDiscreteDynamicsWorld* world = physicsWorld_->GetWorld();
world->removeRigidBody(body_);
inWorld_ = false;
}
}
void RigidBody::HandleTargetPosition(StringHash eventType, VariantMap& eventData)
{
// Copy the smoothing target position to the rigid body
if (!physicsWorld_ || !physicsWorld_->IsApplyingTransforms())
SetPosition(static_cast<SmoothedTransform*>(GetEventSender())->GetTargetWorldPosition());
}
void RigidBody::HandleTargetRotation(StringHash eventType, VariantMap& eventData)
{
// Copy the smoothing target rotation to the rigid body
if (!physicsWorld_ || !physicsWorld_->IsApplyingTransforms())
SetRotation(static_cast<SmoothedTransform*>(GetEventSender())->GetTargetWorldRotation());
}
}
| [
"baisaichen@live.com"
] | baisaichen@live.com |
781774102230a78e9fdbfebcc84da7ea0353bfb6 | d0dcd8492a5afd746bad488ee90c2c282998728f | /src/Pose/Development/DummyData/CreateDummyData.h | b84f502a3dd9c824fbaca12e4c8cdae3de41983a | [] | no_license | dgitz/icarus_rover_v2 | 4c99bcf31b83701cfb130348acb3113721aa4c9e | 1d25266f4bf9872bb5b98912d9c938e0d280756c | refs/heads/master | 2021-03-09T05:55:47.352511 | 2020-04-05T20:07:07 | 2020-04-05T20:07:07 | 47,700,940 | 1 | 0 | null | 2020-04-05T20:07:08 | 2015-12-09T15:44:10 | C++ | UTF-8 | C++ | false | false | 825 | h | #ifndef CREATEDUMMYDATA_H
#define CREATEDUMMYDATA_H
#include <stdio.h>
#include <iostream>
#include "../../PoseModel/Definitions/PoseDefinitions.h"
#include <eros/signal.h>
class CreateDummyData
{
public:
enum DummyDataType
{
NONE = 0,
SAWTOOTH = 1,
SINWAVE = 2
};
CreateDummyData();
~CreateDummyData();
//Initialization Functions
//Attribute Functions
//Message Functions
//Support Functions
std::vector<SensorSignal> Create_SensorSignal(DummyDataType dummydata_type);
std::vector<TimedSignal> Create_TimedSignal(DummyDataType dummydata_type);
std::vector<std::vector<PostProcessedSignal> > Create_ProcessedSignalVector();
//Printing Functions
private:
std::vector<eros::signal> create_sensorsignal(bool rand_time,std::string name, uint8_t signal_type,DummyDataType dummydata_type);
};
#endif
| [
"davidgitz@gmail.com"
] | davidgitz@gmail.com |
fdda5c4f9837575feefddf228e8a45020ea0ec82 | ca0a5f15b69c09d79e417fb9fcbeae725ce17749 | /boost/asynchronous/servant_proxy.hpp | 939eae8e227a59f77f03d8f04df58d51f4663305 | [
"MIT",
"BSL-1.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | henry-ch/asynchronous | 1e31ddb3615590b1c301e878ae0903a2eb2adead | d61e0e65d6bf67d3a0b78c31b29f873359fac42c | refs/heads/master | 2023-05-25T21:32:16.398110 | 2023-05-23T16:05:40 | 2023-05-23T16:05:40 | 11,562,526 | 35 | 8 | null | 2022-06-10T13:54:51 | 2013-07-21T14:07:22 | HTML | UTF-8 | C++ | false | false | 62,567 | hpp | // Boost.Asynchronous library
// Copyright (C) Christophe Henry 2016
//
// Use, modification and distribution is subject to 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)
//
// For more information, see http://www.boost.org
// servant_proxy is the proxy to every servant, trackable or not.
// its job is to protect a thread-unsafe object from other threads by serializing calls to it (see Active Object Pattern / Proxy).
// It also takes responsibility of creating the servant. It is a shareable object, the last instance will destroy the servant safely.
// This file also provides the following macros for use withing servant_proxy:
// BOOST_ASYNC_FUTURE_MEMBER(member [,priority]): calls the desired member of the servant, returns a future<return type of member>
// BOOST_ASYNC_FUTURE_MEMBER_LOG(member, taskname [,priority]): as above but will be logged with this name if the job type supports it.
// BOOST_ASYNC_POST_MEMBER(member [,priority]): calls the desired member of the servant, returns nothing
// BOOST_ASYNC_POST_MEMBER_LOG(member, taskname [,priority]): as above but will be logged with this name if the job type supports it.
// more exotic:
// BOOST_ASYNC_MEMBER_UNSAFE_CALLBACK(member [,priority]): calls the desired member of the servant, takes as first argument a callback
// Useful when a servant wants to call a member of another servant and being a trackable_servant, needs no future but a callback.
// UNSAFE means the calling servant must provide safety itself, at best using make_safe_callback.
// BOOST_ASYNC_MEMBER_UNSAFE_CALLBACK_LOG(member, taskname [,priority]): as above but will be logged with this name if the job type supports it.
// Tested in test_servant_proxy_unsafe_callback.cpp.
#ifndef BOOST_ASYNC_SERVANT_PROXY_H
#define BOOST_ASYNC_SERVANT_PROXY_H
#include <functional>
#include <utility>
#include <exception>
#include <cstddef>
#include <type_traits>
#include <future>
#ifndef BOOST_THREAD_PROVIDES_FUTURE
#define BOOST_THREAD_PROVIDES_FUTURE
#endif
#include <boost/preprocessor/facilities/overload.hpp>
#include <boost/thread/thread.hpp>
#include <memory>
#include <boost/type_traits/has_trivial_constructor.hpp>
#include <boost/mpl/has_xxx.hpp>
#include <boost/preprocessor/facilities/overload.hpp>
#include <boost/asynchronous/callable_any.hpp>
#include <boost/asynchronous/post.hpp>
#include <boost/asynchronous/job_traits.hpp>
#include <boost/asynchronous/detail/move_bind.hpp>
namespace boost { namespace asynchronous
{
BOOST_MPL_HAS_XXX_TRAIT_DEF(simple_ctor)
BOOST_MPL_HAS_XXX_TRAIT_DEF(simple_dtor)
BOOST_MPL_HAS_XXX_TRAIT_DEF(requires_weak_scheduler)
BOOST_MPL_HAS_XXX_TRAIT_DEF(servant_type)
#ifndef BOOST_ASYNCHRONOUS_REQUIRE_ALL_ARGUMENTS
#define BOOST_ASYNC_POST_MEMBER_1(funcname) \
template <typename... Args> \
void funcname(Args... args)const \
{ \
auto servant = this->m_servant; \
std::size_t p = 100000 * this->m_offset_id; \
this->post(typename boost::asynchronous::job_traits<callable_type>::wrapper_type(boost::asynchronous::any_callable \
(boost::asynchronous::move_bind([servant](Args... as){servant->funcname(std::move(as)...);},std::move(args)...))),p); \
}
#endif
#define BOOST_ASYNC_POST_MEMBER_2(funcname,prio) \
template <typename... Args> \
void funcname(Args... args)const \
{ \
auto servant = this->m_servant; \
std::size_t p = prio + 100000 * this->m_offset_id; \
this->post(typename boost::asynchronous::job_traits<callable_type>::wrapper_type(boost::asynchronous::any_callable \
(boost::asynchronous::move_bind([servant](Args... as){servant->funcname(std::move(as)...);},std::move(args)...))),p); \
}
#define BOOST_ASYNC_POST_MEMBER(...) \
BOOST_PP_CAT(BOOST_PP_OVERLOAD(BOOST_ASYNC_POST_MEMBER_,__VA_ARGS__)(__VA_ARGS__), BOOST_PP_EMPTY())
#ifndef BOOST_ASYNCHRONOUS_REQUIRE_ALL_ARGUMENTS
#define BOOST_ASYNC_POST_MEMBER_LOG_2(funcname,taskname) \
template <typename... Args> \
void funcname(Args... args)const \
{ \
auto servant = this->m_servant; \
std::size_t prio = 100000 * this->m_offset_id; \
typename boost::asynchronous::job_traits<callable_type>::wrapper_type a(boost::asynchronous::any_callable \
(boost::asynchronous::move_bind([servant](Args... as){servant->funcname(std::move(as)...);},std::move(args)...))); \
a.set_name(taskname); \
this->post(std::move(a),prio); \
}
#endif
#define BOOST_ASYNC_POST_MEMBER_LOG_3(funcname,taskname,prio) \
template <typename... Args> \
void funcname(Args... args)const \
{ \
auto servant = this->m_servant; \
std::size_t p = prio + 100000 * this->m_offset_id; \
typename boost::asynchronous::job_traits<callable_type>::wrapper_type a(boost::asynchronous::any_callable \
(boost::asynchronous::move_bind([servant](Args... as){servant->funcname(std::move(as)...);},std::move(args)...))); \
a.set_name(taskname); \
this->post(std::move(a),p); \
}
#define BOOST_ASYNC_POST_MEMBER_LOG(...) \
BOOST_PP_CAT(BOOST_PP_OVERLOAD(BOOST_ASYNC_POST_MEMBER_LOG_,__VA_ARGS__)(__VA_ARGS__), BOOST_PP_EMPTY())
#ifndef BOOST_ASYNCHRONOUS_REQUIRE_ALL_ARGUMENTS
#ifdef BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
#define BOOST_ASYNC_FUTURE_MEMBER_LOG_2(funcname,taskname) \
template <typename... Args> \
auto funcname(Args... args)const \
-> std::future<decltype(std::shared_ptr<servant_type>()->funcname(std::move(args)...))> \
{ \
auto servant = this->m_servant; \
std::size_t prio = 100000 * this->m_offset_id; \
return boost::asynchronous::post_future(this->m_proxy, \
boost::asynchronous::move_bind([servant](Args... as) \
{return servant->funcname(std::move(as)...); \
},std::move(args)...),taskname,prio); \
}
#else
#define BOOST_ASYNC_FUTURE_MEMBER_LOG_2(funcname,taskname) \
template <typename... Args> \
auto funcname(Args... args)const \
{ \
auto servant = this->m_servant; \
std::size_t prio = 100000 * this->m_offset_id; \
return boost::asynchronous::post_future(this->m_proxy, \
boost::asynchronous::move_bind([servant](Args... as) \
{return servant->funcname(std::move(as)...); \
},std::move(args)...),taskname,prio); \
}
#endif
#endif
#ifdef BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
#define BOOST_ASYNC_FUTURE_MEMBER_LOG_3(funcname,taskname,prio) \
template <typename... Args> \
auto funcname(Args... args)const \
-> std::future<decltype(std::shared_ptr<servant_type>()->funcname(std::move(args)...))> \
{ \
auto servant = this->m_servant; \
std::size_t p = prio + 100000 * this->m_offset_id; \
return boost::asynchronous::post_future(this->m_proxy, \
boost::asynchronous::move_bind([servant](Args... as) \
{return servant->funcname(std::move(as)...); \
},std::move(args)...),taskname,p); \
}
#else
#define BOOST_ASYNC_FUTURE_MEMBER_LOG_3(funcname,taskname,prio) \
template <typename... Args> \
auto funcname(Args... args)const \
{ \
auto servant = this->m_servant; \
std::size_t p = prio + 100000 * this->m_offset_id; \
return boost::asynchronous::post_future(this->m_proxy, \
boost::asynchronous::move_bind([servant](Args... as) \
{return servant->funcname(std::move(as)...); \
},std::move(args)...),taskname,p); \
}
#endif
#define BOOST_ASYNC_FUTURE_MEMBER_LOG(...) \
BOOST_PP_CAT(BOOST_PP_OVERLOAD(BOOST_ASYNC_FUTURE_MEMBER_LOG_,__VA_ARGS__)(__VA_ARGS__), BOOST_PP_EMPTY())
#ifndef BOOST_ASYNCHRONOUS_REQUIRE_ALL_ARGUMENTS
#ifdef BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
#define BOOST_ASYNC_FUTURE_MEMBER_1(funcname) \
template <typename... Args> \
auto funcname(Args... args)const \
-> std::future<decltype(std::shared_ptr<servant_type>()->funcname(std::move(args)...))> \
{ \
auto servant = this->m_servant; \
std::size_t prio = 100000 * this->m_offset_id; \
return boost::asynchronous::post_future(this->m_proxy, \
boost::asynchronous::move_bind([servant](Args... as) \
{return servant->funcname(std::move(as)...); \
},std::move(args)...),"",prio); \
}
#else
#define BOOST_ASYNC_FUTURE_MEMBER_1(funcname) \
template <typename... Args> \
auto funcname(Args... args)const \
{ \
auto servant = this->m_servant; \
std::size_t prio = 100000 * this->m_offset_id; \
return boost::asynchronous::post_future(this->m_proxy, \
boost::asynchronous::move_bind([servant](Args... as) \
{return servant->funcname(std::move(as)...); \
},std::move(args)...),"",prio); \
}
#endif
#endif
#ifdef BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
#define BOOST_ASYNC_FUTURE_MEMBER_2(funcname,prio) \
template <typename... Args> \
auto funcname(Args... args)const \
-> std::future<decltype(std::shared_ptr<servant_type>()->funcname(std::move(args)...))> \
{ \
auto servant = this->m_servant; \
std::size_t p = prio + 100000 * this->m_offset_id; \
return boost::asynchronous::post_future(this->m_proxy, \
boost::asynchronous::move_bind([servant](Args... as) \
{return servant->funcname(std::move(as)...); \
},std::move(args)...),"",p); \
}
#else
#define BOOST_ASYNC_FUTURE_MEMBER_2(funcname,prio) \
template <typename... Args> \
auto funcname(Args... args)const \
{ \
auto servant = this->m_servant; \
std::size_t p = prio + 100000 * this->m_offset_id; \
return boost::asynchronous::post_future(this->m_proxy, \
boost::asynchronous::move_bind([servant](Args... as) \
{return servant->funcname(std::move(as)...); \
},std::move(args)...),"",p); \
}
#endif
#define BOOST_ASYNC_FUTURE_MEMBER(...) \
BOOST_PP_CAT(BOOST_PP_OVERLOAD(BOOST_ASYNC_FUTURE_MEMBER_,__VA_ARGS__)(__VA_ARGS__), BOOST_PP_EMPTY())
#ifndef BOOST_ASYNCHRONOUS_REQUIRE_ALL_ARGUMENTS
#define BOOST_ASYNC_MEMBER_UNSAFE_CALLBACK_1(funcname) \
template <typename F,typename... Args> \
auto funcname(F&& cb_func, Args... args)const \
-> typename std::enable_if<!std::is_same<decltype(std::shared_ptr<servant_type>()->funcname(std::move(args)...)),void>::value,void>::type \
{ \
struct workaround_gcc{typedef decltype(std::shared_ptr<servant_type>()->funcname(std::move(args)...)) servant_return;}; \
auto servant = this->m_servant; \
std::size_t prio = 100000 * this->m_offset_id; \
using servant_return = typename workaround_gcc::servant_return; \
boost::asynchronous::post_future(this->m_proxy, \
boost::asynchronous::move_bind([servant,cb_func](Args... as) \
{try{ cb_func(boost::asynchronous::expected<servant_return>(servant->funcname(std::move(as)...)));} \
catch(...){cb_func(boost::asynchronous::expected<servant_return>(std::current_exception()));} \
},std::move(args)...),"",prio); \
} \
template <typename F,typename... Args> \
auto funcname(F&& cb_func, Args... args)const \
-> typename std::enable_if<std::is_same<decltype(std::shared_ptr<servant_type>()->funcname(std::move(args)...)),void>::value,void>::type \
{ \
auto servant = this->m_servant; \
std::size_t prio = 100000 * this->m_offset_id; \
boost::asynchronous::post_future(this->m_proxy, \
boost::asynchronous::move_bind([servant,cb_func](Args... as) \
{try{servant->funcname(std::move(as)...); cb_func(boost::asynchronous::expected<void>());} \
catch(...){cb_func(boost::asynchronous::expected<void>(std::current_exception()));} \
},std::move(args)...),"",prio); \
}
#endif
#define BOOST_ASYNC_MEMBER_UNSAFE_CALLBACK_2(funcname,prio) \
template <typename F,typename... Args> \
auto funcname(F&& cb_func, Args... args)const \
-> typename std::enable_if<!std::is_same<decltype(std::shared_ptr<servant_type>()->funcname(std::move(args)...)),void>::value,void>::type \
{ \
struct workaround_gcc{typedef decltype(std::shared_ptr<servant_type>()->funcname(std::move(args)...)) servant_return;}; \
auto servant = this->m_servant; \
std::size_t p = prio + 100000 * this->m_offset_id; \
using servant_return = typename workaround_gcc::servant_return; \
boost::asynchronous::post_future(this->m_proxy, \
boost::asynchronous::move_bind([servant,cb_func](Args... as) \
{try{ cb_func(boost::asynchronous::expected<servant_return>(servant->funcname(std::move(as)...)));} \
catch(...){cb_func(boost::asynchronous::expected<servant_return>(std::current_exception()));} \
},std::move(args)...),"",p); \
} \
template <typename F,typename... Args> \
auto funcname(F&& cb_func, Args... args)const \
-> typename std::enable_if<std::is_same<decltype(std::shared_ptr<servant_type>()->funcname(std::move(args)...)),void>::value,void>::type \
{ \
auto servant = this->m_servant; \
std::size_t p = prio + 100000 * this->m_offset_id; \
boost::asynchronous::post_future(this->m_proxy, \
boost::asynchronous::move_bind([servant,cb_func](Args... as) \
{try{servant->funcname(std::move(as)...); cb_func(boost::asynchronous::expected<void>());} \
catch(...){cb_func(boost::asynchronous::expected<void>(std::current_exception()));} \
},std::move(args)...),"",p); \
}
#if !defined(_MSC_VER) || defined(__clang__)
#define BOOST_ASYNC_MEMBER_UNSAFE_CALLBACK(...) \
BOOST_PP_OVERLOAD(BOOST_ASYNC_MEMBER_UNSAFE_CALLBACK_,__VA_ARGS__)(__VA_ARGS__)
#else
#define BOOST_ASYNC_MEMBER_UNSAFE_CALLBACK(...) \
BOOST_PP_CAT(BOOST_PP_OVERLOAD(BOOST_ASYNC_MEMBER_UNSAFE_CALLBACK_,__VA_ARGS__)(__VA_ARGS__), BOOST_PP_EMPTY())
#endif
#ifndef BOOST_ASYNCHRONOUS_REQUIRE_ALL_ARGUMENTS
#define BOOST_ASYNC_MEMBER_UNSAFE_CALLBACK_LOG_2(funcname,taskname) \
template <typename F,typename... Args> \
auto funcname(F&& cb_func, Args... args)const \
-> typename std::enable_if<!std::is_same<decltype(std::shared_ptr<servant_type>()->funcname(std::move(args)...)),void>::value,void>::type \
{ \
struct workaround_gcc{typedef decltype(std::shared_ptr<servant_type>()->funcname(std::move(args)...)) servant_return;}; \
auto servant = this->m_servant; \
std::size_t prio = 100000 * this->m_offset_id; \
using servant_return = typename workaround_gcc::servant_return; \
boost::asynchronous::post_future(this->m_proxy, \
boost::asynchronous::move_bind([servant,cb_func](Args... as) \
{try{ cb_func(boost::asynchronous::expected<servant_return>(servant->funcname(std::move(as)...)));} \
catch(...){cb_func(boost::asynchronous::expected<servant_return>(std::current_exception()));} \
},std::move(args)...),taskname,prio); \
} \
template <typename F,typename... Args> \
auto funcname(F&& cb_func, Args... args)const \
-> typename std::enable_if<std::is_same<decltype(std::shared_ptr<servant_type>()->funcname(std::move(args)...)),void>::value,void>::type \
{ \
auto servant = this->m_servant; \
std::size_t prio = 100000 * this->m_offset_id; \
boost::asynchronous::post_future(this->m_proxy, \
boost::asynchronous::move_bind([servant,cb_func](Args... as) \
{try{servant->funcname(std::move(as)...); cb_func(boost::asynchronous::expected<void>());} \
catch(...){cb_func(boost::asynchronous::expected<void>(std::current_exception()));} \
},std::move(args)...),taskname,prio); \
}
#endif
#define BOOST_ASYNC_MEMBER_UNSAFE_CALLBACK_LOG_3(funcname,taskname,prio) \
template <typename F,typename... Args> \
auto funcname(F&& cb_func, Args... args)const \
-> typename std::enable_if<!std::is_same<decltype(std::shared_ptr<servant_type>()->funcname(std::move(args)...)),void>::value,void>::type \
{ \
struct workaround_gcc{typedef decltype(std::shared_ptr<servant_type>()->funcname(std::move(args)...)) servant_return;}; \
auto servant = this->m_servant; \
std::size_t p = prio + 100000 * this->m_offset_id; \
using servant_return = typename workaround_gcc::servant_return; \
boost::asynchronous::post_future(this->m_proxy, \
boost::asynchronous::move_bind([servant,cb_func](Args... as) \
{try{ cb_func(boost::asynchronous::expected<servant_return>(servant->funcname(std::move(as)...)));} \
catch(...){cb_func(boost::asynchronous::expected<servant_return>(std::current_exception()));} \
},std::move(args)...),taskname,p); \
} \
template <typename F,typename... Args> \
auto funcname(F&& cb_func, Args... args)const \
-> typename std::enable_if<std::is_same<decltype(std::shared_ptr<servant_type>()->funcname(std::move(args)...)),void>::value,void>::type \
{ \
auto servant = this->m_servant; \
std::size_t p = prio + 100000 * this->m_offset_id; \
boost::asynchronous::post_future(this->m_proxy, \
boost::asynchronous::move_bind([servant,cb_func](Args... as) \
{try{servant->funcname(std::move(as)...); cb_func(boost::asynchronous::expected<void>());} \
catch(...){cb_func(boost::asynchronous::expected<void>(std::current_exception()));} \
},std::move(args)...),taskname,p); \
}
#if !defined(_MSC_VER) || defined(__clang__)
#define BOOST_ASYNC_MEMBER_UNSAFE_CALLBACK_LOG(...) \
BOOST_PP_OVERLOAD(BOOST_ASYNC_MEMBER_UNSAFE_CALLBACK_LOG_,__VA_ARGS__)(__VA_ARGS__)
#else
#define BOOST_ASYNC_MEMBER_UNSAFE_CALLBACK_LOG(...) \
BOOST_PP_CAT(BOOST_PP_OVERLOAD(BOOST_ASYNC_MEMBER_UNSAFE_CALLBACK_LOG_,__VA_ARGS__)(__VA_ARGS__), BOOST_PP_EMPTY())
#endif
#ifndef BOOST_ASYNCHRONOUS_REQUIRE_ALL_ARGUMENTS
#define BOOST_ASYNC_POST_CALLBACK_MEMBER_1(funcname) \
template <typename F, typename S,typename... Args> \
void funcname(F&& cb_func,S const& weak_cb_scheduler,std::size_t cb_prio, Args... args)const \
{ \
auto servant = this->m_servant; \
std::size_t prio = 100000 * this->m_offset_id; \
boost::asynchronous::post_callback(m_proxy, \
boost::asynchronous::move_bind([servant](Args... as) \
{return servant->funcname(std::move(as)...); \
},std::move(args)...),weak_cb_scheduler,std::forward<F>(cb_func),"",prio,cb_prio); \
}
#endif
#define BOOST_ASYNC_POST_CALLBACK_MEMBER_2(funcname,prio) \
template <typename F, typename S,typename... Args> \
void funcname(F&& cb_func,S const& weak_cb_scheduler,std::size_t cb_prio, Args... args)const \
{ \
auto servant = this->m_servant; \
std::size_t p = prio + 100000 * this->m_offset_id; \
boost::asynchronous::post_callback(m_proxy, \
boost::asynchronous::move_bind([servant](Args... as) \
{return servant->funcname(std::move(as)...); \
},std::move(args)...),weak_cb_scheduler,std::forward<F>(cb_func),"",p,cb_prio); \
}
#define BOOST_ASYNC_POST_CALLBACK_MEMBER(...) \
BOOST_PP_CAT(BOOST_PP_OVERLOAD(BOOST_ASYNC_POST_CALLBACK_MEMBER_,__VA_ARGS__)(__VA_ARGS__), BOOST_PP_EMPTY())
#ifdef BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
#define BOOST_ASYNC_UNSAFE_MEMBER(funcname) \
template <typename... Args> \
auto funcname(Args... args)const \
-> std::function<decltype(std::shared_ptr<servant_type>()->funcname(std::move(args)...))()> \
{ \
auto servant = m_servant; \
return boost::asynchronous::move_bind([servant](Args... as){return servant->funcname(std::move(as)...);},std::move(args)...); \
}
#else
#define BOOST_ASYNC_UNSAFE_MEMBER(funcname) \
template <typename... Args> \
auto funcname(Args... args)const \
{ \
auto servant = m_servant; \
return boost::asynchronous::move_bind([servant](Args... as){return servant->funcname(std::move(as)...);},std::move(args)...); \
}
#endif
#ifndef BOOST_ASYNCHRONOUS_REQUIRE_ALL_ARGUMENTS
#define BOOST_ASYNC_SERVANT_POST_CTOR_0() \
static std::size_t get_ctor_prio() {return 0;}
#endif
#define BOOST_ASYNC_SERVANT_POST_CTOR_1(priority) \
static std::size_t get_ctor_prio() {return priority;}
#define BOOST_ASYNC_SERVANT_POST_CTOR(...) \
BOOST_PP_CAT(BOOST_PP_OVERLOAD(BOOST_ASYNC_SERVANT_POST_CTOR_,__VA_ARGS__)(__VA_ARGS__), BOOST_PP_EMPTY())
#ifndef BOOST_ASYNCHRONOUS_REQUIRE_ALL_ARGUMENTS
#define BOOST_ASYNC_SERVANT_POST_CTOR_LOG_1(taskname) \
static const char* get_ctor_name() {return taskname;}
#endif
#define BOOST_ASYNC_SERVANT_POST_CTOR_LOG_2(taskname,priority) \
static std::size_t get_ctor_prio() {return priority;} \
static const char* get_ctor_name() {return taskname;}
#define BOOST_ASYNC_SERVANT_POST_CTOR_LOG(...) \
BOOST_PP_CAT(BOOST_PP_OVERLOAD(BOOST_ASYNC_SERVANT_POST_CTOR_LOG_,__VA_ARGS__)(__VA_ARGS__), BOOST_PP_EMPTY())
#ifndef BOOST_ASYNCHRONOUS_REQUIRE_ALL_ARGUMENTS
#define BOOST_ASYNC_SERVANT_POST_DTOR_0() \
static std::size_t get_dtor_prio() {return 0;}
#endif
#define BOOST_ASYNC_SERVANT_POST_DTOR_1(priority) \
static std::size_t get_dtor_prio() {return priority;}
#define BOOST_ASYNC_SERVANT_POST_DTOR(...) \
BOOST_PP_CAT(BOOST_PP_OVERLOAD(BOOST_ASYNC_SERVANT_POST_DTOR_,__VA_ARGS__)(__VA_ARGS__), BOOST_PP_EMPTY())
#ifndef BOOST_ASYNCHRONOUS_REQUIRE_ALL_ARGUMENTS
#define BOOST_ASYNC_SERVANT_POST_DTOR_LOG_1(taskname) \
static const char* get_dtor_name() {return taskname;}
#endif
#define BOOST_ASYNC_SERVANT_POST_DTOR_LOG_2(taskname,priority) \
static std::size_t get_dtor_prio() {return priority;} \
static const char* get_dtor_name() {return taskname;}
#define BOOST_ASYNC_SERVANT_POST_DTOR_LOG(...) \
BOOST_PP_CAT(BOOST_PP_OVERLOAD(BOOST_ASYNC_SERVANT_POST_DTOR_LOG_,__VA_ARGS__)(__VA_ARGS__), BOOST_PP_EMPTY())
struct servant_proxy_timeout : public virtual boost::exception, public virtual std::exception
{
};
struct empty_servant : public virtual boost::exception, public virtual std::exception
{
};
template <class ServantProxy,class Servant, class Callable = BOOST_ASYNCHRONOUS_DEFAULT_JOB,int max_create_wait_ms = 5000>
class servant_proxy
{
public:
typedef Servant servant_type;
typedef Callable callable_type;
typedef ServantProxy derived_proxy_type;
typedef boost::asynchronous::any_shared_scheduler_proxy<callable_type> scheduler_proxy_type;
typedef boost::asynchronous::any_weak_scheduler<callable_type> weak_scheduler_proxy_type;
//constexpr int max_create_wait = max_create_wait_ms;
typedef std::integral_constant<int,max_create_wait_ms > max_create_wait;
// private constructor for use with dynamic_servant_proxy_cast
protected:
// AnotherProxy must be a derived class of a servant_proxy (used by dynamic_servant_proxy_cast)
template <class AnotherProxy>
servant_proxy(AnotherProxy p, typename std::enable_if<boost::asynchronous::has_servant_type<AnotherProxy>::value>::type* = 0)BOOST_NOEXCEPT
: m_proxy(p.m_proxy)
, m_servant(std::dynamic_pointer_cast<typename AnotherProxy::servant_type>(p.m_servant))
, m_offset_id(0)
{
}
public:
/*!
* \brief Constructor
* \brief Constructs a servant_proxy and a servant. The any_shared_scheduler_proxy<Callable> will be saved and
* \brief passed as an any_weak_scheduler<Callable> to the servant. Variadic parameters will be forwarded to the servant.
* \param p any_shared_scheduler_proxy<Callable> where the servant will execute.
* \param args variadic number of parameters, number and type defined by the servant, which will be forwarded to the servant.
*/
template <typename... Args>
servant_proxy(scheduler_proxy_type p, Args... args)
: m_proxy(p)
, m_servant()
, m_offset_id(0)
{
std::vector<boost::thread::id> ids = m_proxy.thread_ids();
if ((std::find(ids.begin(),ids.end(),boost::this_thread::get_id()) != ids.end()))
{
// our thread, not possible to wait for a future
// TODO forward
// if a servant has a simple_ctor, then he MUST get a weak scheduler as he might get it too late with tss
//m_servant = std::make_shared<servant_type>(m_proxy.get_weak_scheduler(),args...);
m_servant = servant_create_helper::template create<servant_type>(m_proxy.get_weak_scheduler(),std::move(args)...);
}
else
{
// outside thread, create in scheduler thread if no other choice
init_servant_proxy<servant_type>(std::move(args)...);
}
}
/*!
* \brief Constructor
* \brief Constructs a servant_proxy from an already existing servant. The any_shared_scheduler_proxy<Callable> will be saved and
* \brief used to serialize calls to the servant.
* \param p any_shared_scheduler_proxy where the servant was created and calls executed.
* \param s servant created in the thread context of the provided scheduler proxy.
*/
servant_proxy(scheduler_proxy_type p, std::future<std::shared_ptr<servant_type> > s)
: m_proxy(p)
, m_servant()
, m_offset_id(0)
{
bool ok = (s.wait_for(std::chrono::milliseconds(max_create_wait_ms)) == std::future_status::ready);
if(ok)
{
m_servant = std::move(s.get());
// servant ought not be empty
if (!m_servant)
{
throw empty_servant();
}
}
else
{
throw servant_proxy_timeout();
}
}
// templatize to avoid gcc complaining in case servant is pure virtual
/*!
* \brief Constructor
* \brief Constructs a servant_proxy from an already existing servant. The any_shared_scheduler_proxy<Callable> will be saved and
* \brief used to serialize calls to the servant.
* \param p any_shared_scheduler_proxy where the servant was created and calls executed.
* \param s servant created in the thread context of the provided scheduler proxy.
*/
template <class CServant>
servant_proxy(scheduler_proxy_type p, std::future<CServant> s)
: m_proxy(p)
, m_servant()
, m_offset_id(0)
{
bool ok = s.wait_for(std::chrono::milliseconds(max_create_wait_ms)) == std::future_status::ready;
if(ok)
{
m_servant = std::make_shared<servant_type>(std::move(s.get()));
// servant ought not be empty
if (!m_servant)
{
throw empty_servant();
}
}
else
{
throw servant_proxy_timeout();
}
}
// version for multiple_thread_scheduler
//TODO other ctors
template <typename... Args>
servant_proxy(std::tuple<scheduler_proxy_type, std::size_t> p, Args... args)
: m_proxy(std::get<0>(p))
, m_servant()
, m_offset_id(std::get<1>(p))
{
std::vector<boost::thread::id> ids = m_proxy.thread_ids();
if ((std::find(ids.begin(),ids.end(),boost::this_thread::get_id()) != ids.end()))
{
// our thread, not possible to wait for a future
// TODO forward
// if a servant has a simple_ctor, then he MUST get a weak scheduler as he might get it too late with tss
//m_servant = std::make_shared<servant_type>(m_proxy.get_weak_scheduler(),args...);
m_servant = servant_create_helper::template create<servant_type>(m_proxy.get_weak_scheduler(),std::move(args)...);
}
else
{
// outside thread, create in scheduler thread if no other choice
init_servant_proxy<servant_type>(std::move(args)...);
}
}
/*!
* \brief Destructor
* \brief Decrements servant count usage.
* \brief Joins threads of scheduler if holding last instance of it.
*/
~servant_proxy()
{
if (!!m_servant)
{
servant_deleter n(std::move(m_servant));
typename boost::asynchronous::job_traits<callable_type>::wrapper_type a(std::move(n));
a.set_name(ServantProxy::get_dtor_name());
m_proxy.post(std::move(a),ServantProxy::get_dtor_prio());
m_servant.reset();
}
m_proxy.reset();
}
// we provide destructor so we need to provide the other 4
/*!
* \brief Move constructor.
*/
servant_proxy(servant_proxy&&) =default;
/*!
* \brief Move assignment.
*/
servant_proxy& operator=(servant_proxy&&) =default;
/*!
* \brief Copy constructor.
*/
servant_proxy(servant_proxy const&) =default;
/*!
* \brief Copy assignment.
*/
servant_proxy& operator=(servant_proxy const&)=default;
#ifdef BOOST_ASYNCHRONOUS_REQUIRE_ALL_ARGUMENTS
void post(callable_type job, std::size_t prio) const
#else
void post(callable_type job, std::size_t prio=0) const
#endif
{
m_proxy.post(std::move(job),prio + 100000 * m_offset_id);
}
/*!
* \brief Returns the underlying any_shared_scheduler_proxy
*/
scheduler_proxy_type get_proxy()const
{
return m_proxy;
}
// for derived to overwrite if needed
/*!
* \brief Returns priority of the servant constructor. It is advised to set the priority using BOOST_ASYNC_SERVANT_POST_CTOR or
* \brief BOOST_ASYNC_SERVANT_POST_CTOR_LOG
*/
static std::size_t get_ctor_prio() {return 0;}
/*!
* \brief Returns priority of the servant destructor. It is advised to set the priority using BOOST_ASYNC_SERVANT_POST_DTOR or
* \brief BOOST_ASYNC_SERVANT_POST_DTOR_LOG
*/
static std::size_t get_dtor_prio() {return 0;}
/*!
* \brief Returns name of the servant constructor task. It can be overriden by derived class
*/
static const char* get_ctor_name() {return "ctor";}
/*!
* \brief Returns name of the servant destructor task. It can be overriden by derived class
*/
static const char* get_dtor_name() {return "dtor";}
/*!
* \brief return a shared_ptr to our servant (careful! Use at own risk)
*/
std::shared_ptr<servant_type> get_servant() const
{
return m_servant;
}
scheduler_proxy_type m_proxy;
std::shared_ptr<servant_type> m_servant;
std::size_t m_offset_id;
private:
// safe creation of servant in our thread ctor is trivial or told us so
template <typename S,typename... Args>
typename std::enable_if<
boost::has_trivial_constructor<S>::value ||
boost::asynchronous::has_simple_ctor<S>::value,
void>::type
init_servant_proxy(Args... args)
{
// TODO forward
// if a servant has a simple_ctor, then he MUST get a weak scheduler as he might get it too late with tss
m_servant = std::make_shared<servant_type>(m_proxy.get_weak_scheduler(),std::move(args)...);
}
// ctor has to be posted
template <typename S,typename... Args>
typename std::enable_if<
!(boost::has_trivial_constructor<S>::value ||
boost::asynchronous::has_simple_ctor<S>::value),
void>::type
init_servant_proxy(Args... args)
{
// outside thread, create in scheduler thread
std::shared_ptr<std::promise<std::shared_ptr<servant_type> > > p =
std::make_shared<std::promise<std::shared_ptr<servant_type> > >();
std::future<std::shared_ptr<servant_type> > fu (p->get_future());
typename boost::asynchronous::job_traits<callable_type>::wrapper_type a(
boost::asynchronous::any_callable(
boost::asynchronous::move_bind(init_helper(p),m_proxy.get_weak_scheduler(),std::move(args)...)));
a.set_name(ServantProxy::get_ctor_name());
#ifndef BOOST_NO_RVALUE_REFERENCES
post(std::move(a),ServantProxy::get_ctor_prio());
#else
post(a,ServantProxy::get_ctor_prio());
#endif
bool ok = (fu.wait_for(std::chrono::milliseconds(max_create_wait_ms)) == std::future_status::ready);
if(ok)
{
m_servant = std::move(fu.get());
}
else
{
throw servant_proxy_timeout();
}
}
struct init_helper : public boost::asynchronous::job_traits<callable_type>::diagnostic_type
{
init_helper(std::shared_ptr<std::promise<std::shared_ptr<servant_type> > > p)
:boost::asynchronous::job_traits<callable_type>::diagnostic_type(),m_promise(p){}
init_helper(init_helper const& rhs)
:boost::asynchronous::job_traits<callable_type>::diagnostic_type(),m_promise(rhs.m_promise){}
#ifndef BOOST_NO_RVALUE_REFERENCES
init_helper(init_helper&& rhs) noexcept :m_promise(std::move(rhs.m_promise)){}
init_helper& operator= (init_helper const&& rhs)noexcept {m_promise = std::move(rhs.m_promise);}
#endif
template <typename... Args>
void operator()(weak_scheduler_proxy_type proxy,Args... as)const
{
try
{
m_promise->set_value(servant_create_helper::template create<servant_type>(proxy,std::move(as)...));
}
catch(...){m_promise->set_exception(std::current_exception());}
}
std::shared_ptr<std::promise<std::shared_ptr<servant_type> > > m_promise;
};
struct servant_create_helper
{
template <typename S,typename... Args>
static
typename std::enable_if< boost::asynchronous::has_requires_weak_scheduler<S>::value ||
boost::has_trivial_constructor<S>::value ||
boost::asynchronous::has_simple_ctor<S>::value,
std::shared_ptr<servant_type> >::type
create(weak_scheduler_proxy_type proxy,Args... args)
{
std::shared_ptr<servant_type> res = std::make_shared<servant_type>(proxy,std::move(args)...);
return res;
}
template <typename S,typename... Args>
static
typename std::enable_if<!(boost::asynchronous::has_requires_weak_scheduler<S>::value ||
boost::has_trivial_constructor<S>::value ||
boost::asynchronous::has_simple_ctor<S>::value),
std::shared_ptr<servant_type> >::type
create(weak_scheduler_proxy_type ,Args... args)
{
std::shared_ptr<servant_type> res = std::make_shared<servant_type>(std::move(args)...);
return res;
}
};
struct servant_deleter : public boost::asynchronous::job_traits<callable_type>::diagnostic_type
{
#ifndef BOOST_NO_RVALUE_REFERENCES
servant_deleter(std::shared_ptr<servant_type> t)
: boost::asynchronous::job_traits<callable_type>::diagnostic_type()
, data(std::move(t))
, done_promise(std::make_shared<std::promise<void>>())
{
t.reset();
}
servant_deleter(servant_deleter&& rhs) noexcept
: boost::asynchronous::job_traits<callable_type>::diagnostic_type()
, data(std::move(rhs.data))
, done_promise(std::move(rhs.done_promise))
{
}
#endif
servant_deleter(std::shared_ptr<servant_type> & t):boost::asynchronous::job_traits<callable_type>::diagnostic_type(), data(t)
{
t.reset();
}
servant_deleter(servant_deleter const& r): boost::asynchronous::job_traits<callable_type>::diagnostic_type(), data(r.data)
{
const_cast<servant_deleter&>(r).data.reset();
done_promise = std::move(const_cast<servant_deleter&>(r).done_promise);
}
servant_deleter& operator= (servant_deleter const& r)noexcept
{
std::swap(data,r.data);
std::swap(done_promise,const_cast<servant_deleter&>(r).done_promise);
return *this;
}
#ifndef BOOST_NO_RVALUE_REFERENCES
servant_deleter& operator= (servant_deleter&& r) noexcept
{
std::swap(data,r.data);
std::swap(done_promise,r.done_promise);
return *this;
}
#endif
~servant_deleter()
{
// this has to be done whatever happens
if(done_promise)
done_promise->set_value();
}
void operator()()
{
data.reset();
}
std::shared_ptr<servant_type> data;
std::shared_ptr<std::promise<void>> done_promise;
};
};
/*!
* \brief Casts a servant_proxy to the servant type into a servant_proxy to a servant's base type.
* \brief considering struct Servant : public Base and class BaseServantProxy : public boost::asynchronous::servant_proxy<BaseServantProxy,Base>
* \brief and class ServantProxy : public boost::asynchronous::servant_proxy<ServantProxy,Servant>
* \brief then ServantProxy proxy can be casted:
* \brief BaseServantProxy base_proxy = boost::asynchronous::dynamic_servant_proxy_cast<BaseServantProxy>(proxy);
* \param p any_shared_scheduler_proxy where the servant was created and calls executed.
* \param s servant created in the thread context of the provided scheduler proxy.
*/
template<class T, class U>
T dynamic_servant_proxy_cast( U const & r ) BOOST_NOEXCEPT
{
return T(r);
}
}} // boost::async
#endif // BOOST_ASYNC_SERVANT_PROXY_H
| [
"christophe.j.henry@googlemail.com"
] | christophe.j.henry@googlemail.com |
966149d51fb387e285bd13a9c9ba0e15b3b52dec | 8c90e0ffb2819653c566aa7894e73b2726fb3640 | /dokushu/chapter5/list5-16.cpp | e238435ec8476e193f0026ebdcf3e22d2ee1e125 | [] | no_license | Tetta8/CPP_test | f842390ad60a0aeb259240910d12d1b273ce58ed | a4692aae32bbc6bfce2af61567a9fa0575e47fe0 | refs/heads/master | 2021-01-04T17:20:09.526885 | 2020-09-17T05:09:19 | 2020-09-17T05:09:19 | 240,681,912 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 685 | cpp | #include <iostream>
class Marker{
public:
Marker();
~Marker();
};
Marker::Marker(){
std::cout << "コンストラクタ:" << this << std::endl;
}
Marker::~Marker(){
std::cout << "デストラクタ:" << this << std::endl;
}
void copy(Marker m){
std::cout << "copy:" << &m << std::endl;
}
void reference(const Marker& m){
std::cout << "reference:" << &m << std::endl;
}
int main(){
Marker m;
std::cout << "値渡し前" << std::endl;
copy(m);
std::cout << "値渡し後" << std::endl;
std::cout << "参照渡し前" << std::endl;
reference(m);
std::cout << "参照渡し前" << std::endl;
} | [
"tester.ta8@gmail.com"
] | tester.ta8@gmail.com |
0c02e941187b37db5a7ebe0132a885a237267af9 | 3379407ab216f5ad9402b9fcaef814e8546fa12d | /mainwindow.h | 52893bb12f1e0d408cef50fd746f5732161d8065 | [] | no_license | RomanSheyko/PostClient | f8bd210822f49ff897750c16c132762804802c98 | 25b990f413b222eae08c898bf4df608aac2b654c | refs/heads/master | 2023-04-05T05:43:36.923561 | 2021-04-06T16:05:06 | 2021-04-06T16:05:06 | 355,248,551 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 883 | h | #ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "account.h"
#include <QVector>
#include <QTreeWidget>
#include <QMap>
#include <QListWidget>
#include <QListWidgetItem>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
private slots:
void on_actionAdd_account_triggered();
void on_add_mailbox_close();
void on_treeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column);
void on_listWidget_itemDoubleClicked(QListWidgetItem *item);
void on_actionNew_message_triggered();
void on_download_attach_clicked();
private:
Ui::MainWindow *ui;
QVector<IMAP_Account*> account_list;
QMap<int, mailio::message> messages;
mailio::message cur_msg;
};
#endif // MAINWINDOW_H
| [
"roman@romans-mbp.kauri-iot.com"
] | roman@romans-mbp.kauri-iot.com |
88dbf9d383dc56d6976fab02aaef8de17731c279 | 2ac18de671c83dbb886ec37ead5036dffb200938 | /cpp/3.MemoryManager/Trash/test4.cpp | 29e1a11a7181a3051223f3766a1ca88e0718c7fc | [] | no_license | ArikDavidov/work | 63541877df6d48f78864aa598b30a165d5e59ff8 | 624b75375b9832812b7de793104bb6ecdac09db1 | refs/heads/master | 2021-05-14T07:13:21.670976 | 2018-01-10T10:46:00 | 2018-01-10T10:46:00 | 116,259,333 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,403 | cpp | #include <iostream>
using namespace std;
class MemManager_t {
public:
virtual ~MemManager_t() { cout << "Destructor of MemManager_t" << endl; }
protected:
MemManager_t() { cout << "Constructor of MemManager_t" << endl; }
MemManager_t(const MemManager_t& _memManager) { cout << "Copy Constructor of MemManager_t" << endl; }
MemManager_t & operator=(const MemManager_t& _memManager) { cout << "operator= of MemManager_t" << endl; return *this;}
private:
};
class MemPage_t : public MemManager_t {
public:
MemPage_t(/*unsigned int _capacity*/) { cout << "Constructor of MemPage_t" << endl; }
protected:
virtual ~MemPage_t() { cout << "Destructor of MemPage_t" << endl; }
};
class MemPool_t : public MemManager_t {
public:
MemPool_t(/*unsigned int _capacity*/) { cout << "Constructor of MemPool_t" << endl; }
protected:
virtual ~MemPool_t() { cout << "Destructor of MemPool_t" << endl; }
};
MemManager_t* MemManagerCreate(unsigned int _capacity = 512)
{
//return new MemPage_t;
return (1024 < _capacity) ? (MemManager_t*)new MemPool_t
: (MemManager_t*)new MemPage_t;
}
int main() {
//object of type MemManager_t can't be constructed
//MemManager_t* memManager = new MemManager_t; //compilation error
MemManager_t* memManager = MemManagerCreate(1000);
//MemManager_t secondManager = *memManager;
delete memManager;
}
| [
"arik.davidov@gmail.com"
] | arik.davidov@gmail.com |
56dba58652c9e8e14458ab8815970d257d5e0da2 | 183b96661938399377e1a78d1134ec1e9370e316 | /3rdparty/lexy/include/lexy/dsl/repeat.hpp | 256ae2264bbc8a736a2638b4795979312531ebc0 | [
"MIT",
"BSL-1.0"
] | permissive | hiter-fzq/BehaviorTree.CPP | 3b6c3804cdda71b019c05127e45f630dd0f90eaf | 5f961942d74e2f441a51a126cb6b8eb9298ff445 | refs/heads/master | 2022-11-12T11:54:30.322222 | 2022-11-03T11:28:29 | 2022-11-03T11:28:29 | 252,464,467 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,696 | hpp | // Copyright (C) 2020-2022 Jonathan Müller and lexy contributors
// SPDX-License-Identifier: BSL-1.0
#ifndef LEXY_DSL_REPEAT_HPP_INCLUDED
#define LEXY_DSL_REPEAT_HPP_INCLUDED
#include <lexy/dsl/base.hpp>
#include <lexy/dsl/branch.hpp>
#include <lexy/dsl/parse_as.hpp>
#include <lexy/lexeme.hpp>
namespace lexyd
{
template <typename Item, typename Sep>
struct _rep_impl
{
// Sink can either be present or not;
// we only use variadic arguments to get rid of code duplication.
template <typename Context, typename Reader, typename... Sink>
static constexpr bool loop(Context& context, Reader& reader, std::size_t count, Sink&... sink)
{
using sink_parser
= std::conditional_t<sizeof...(Sink) == 0, lexy::pattern_parser<>, lexy::sink_parser>;
if (count == 0)
return true;
using item_parser = lexy::parser_for<Item, sink_parser>;
if (!item_parser::parse(context, reader, sink...))
return false;
for (std::size_t i = 1; i != count; ++i)
{
using sep_parser = lexy::parser_for<typename Sep::rule, sink_parser>;
if (!sep_parser::parse(context, reader, sink...))
return false;
if (!item_parser::parse(context, reader, sink...))
return false;
}
using trailing_parser = lexy::parser_for<typename Sep::trailing_rule, sink_parser>;
return trailing_parser::parse(context, reader, sink...);
}
};
template <typename Item>
struct _rep_impl<Item, void>
{
// Sink can either be present or not;
// we only use variadic arguments to get rid of code duplication.
template <typename Context, typename Reader, typename... Sink>
static constexpr bool loop(Context& context, Reader& reader, std::size_t count, Sink&... sink)
{
using sink_parser
= std::conditional_t<sizeof...(Sink) == 0, lexy::pattern_parser<>, lexy::sink_parser>;
if (count == 0)
return true;
using item_parser = lexy::parser_for<Item, sink_parser>;
if (!item_parser::parse(context, reader, sink...))
return false;
for (std::size_t i = 1; i != count; ++i)
{
if (!item_parser::parse(context, reader, sink...))
return false;
}
return true;
}
};
template <typename Item, typename Sep>
struct _repd : rule_base // repeat, discard
{
template <typename NextParser>
struct p
{
template <typename Context, typename Reader, typename... Args>
LEXY_PARSER_FUNC static bool parse(Context& context, Reader& reader, std::size_t count,
Args&&... args)
{
if (!_rep_impl<Item, Sep>::loop(context, reader, count))
return false;
return NextParser::parse(context, reader, LEXY_FWD(args)...);
}
};
};
template <typename Item, typename Sep>
struct _repl : rule_base // repeat, list
{
template <typename NextParser>
struct p
{
template <typename Context, typename Reader, typename... Args>
LEXY_PARSER_FUNC static bool parse(Context& context, Reader& reader, std::size_t count,
Args&&... args)
{
auto sink = context.value_callback().sink();
if (!_rep_impl<Item, Sep>::loop(context, reader, count, sink))
return false;
return lexy::sink_finish_parser<NextParser>::parse(context, reader, sink,
LEXY_FWD(args)...);
}
};
};
template <typename Item, typename Sep>
struct _repc : rule_base // repeat, capture
{
template <typename NextParser>
struct p
{
template <typename Context, typename Reader, typename... Args>
LEXY_PARSER_FUNC static bool parse(Context& context, Reader& reader, std::size_t count,
Args&&... args)
{
auto begin = reader.position();
if (!_rep_impl<Item, Sep>::loop(context, reader, count))
return false;
return NextParser::parse(context, reader, LEXY_FWD(args)...,
lexy::lexeme(reader, begin));
}
};
};
template <typename Count, typename Loop>
struct _rep : decltype(_maybe_branch(_pas<std::size_t, Count, true>{}, Loop{}))
{};
template <typename Count>
struct _rep_dsl
{
template <typename Item>
constexpr auto operator()(Item) const
{
return _rep<Count, _repd<Item, void>>{};
}
template <typename Item, typename Sep>
constexpr auto operator()(Item, Sep) const
{
static_assert(lexy::is_separator<Sep>);
return _rep<Count, _repd<Item, Sep>>{};
}
template <typename Item>
constexpr auto list(Item) const
{
return _rep<Count, _repl<Item, void>>{};
}
template <typename Item, typename Sep>
constexpr auto list(Item, Sep) const
{
static_assert(lexy::is_separator<Sep>);
return _rep<Count, _repl<Item, Sep>>{};
}
template <typename Item>
constexpr auto capture(Item) const
{
return _rep<Count, _repc<Item, void>>{};
}
template <typename Item, typename Sep>
constexpr auto capture(Item, Sep) const
{
static_assert(lexy::is_separator<Sep>);
return _rep<Count, _repc<Item, Sep>>{};
}
};
/// Parses a rule `n` times, where `n` is the value produced by `Count`.
template <typename Count>
constexpr auto repeat(Count)
{
return _rep_dsl<Count>{};
}
} // namespace lexyd
#endif // LEXY_DSL_REPEAT_HPP_INCLUDED
| [
"davide.faconti@gmail.com"
] | davide.faconti@gmail.com |
e9f88e1c659aef2348dd8dce927d41c98ce1b34f | 0f9736e6f7fad2168c877697228a482eae9c680d | /CocoTeens7_SamplePlayer/CocoTeens7_SamplePlayer.ino | cd314a9dd6abcbd3b60afeae75629a6e0016c5a6 | [] | no_license | gitter-badger/CocoTeens7 | 74c4f3618c92984dcca784d4f64ee2b0ec2e3620 | 9c5edd2036eed1148341b0c20c330ed6a1266232 | refs/heads/master | 2021-01-21T17:02:54.902904 | 2015-06-21T15:43:01 | 2015-06-21T15:43:01 | 37,860,242 | 0 | 0 | null | 2015-06-22T14:32:12 | 2015-06-22T14:32:12 | null | UTF-8 | C++ | false | false | 5,073 | ino | #include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <Bounce.h>
// WAV files converted to code by wav2sketch
#include "AudioSampleArp.h" // http://www.freesound.org/people/KEVOY/sounds/82583/
#include "AudioSamplePerc.h" // http://www.freesound.org/people/zgump/sounds/86334/
#include "AudioSamplePulse.h" // http://www.freesound.org/people/mhc/sounds/102790/
#include "AudioSampleKick.h" // http://www.freesound.org/people/DWSD/sounds/171104/
#include "AudioSampleGong.h" // http://www.freesound.org/people/juskiddink/sounds/86773/
#include "AudioSampleCashregister.h" // http://www.freesound.org/people/kiddpark/sounds/201159/
// Create the Audio components. These should be created in the
// order data flows, inputs/sources -> processing -> outputs
//
AudioPlayMemory sound0;
AudioPlayMemory sound1; // six memory players, so we can play
AudioPlayMemory sound2; // all six sounds simultaneously
AudioPlayMemory sound3;
AudioPlayMemory sound4;
AudioPlayMemory sound5;
AudioMixer4 mix1; // two 4-channel mixers are needed in
AudioMixer4 mix2; // tandem to combine 6 audio sources
//AudioOutputI2S headphones;
AudioOutputAnalog dac; // play to both I2S audio board and on-chip DAC
// Create Audio connections between the components
//
AudioConnection c1(sound0, 0, mix1, 0);
AudioConnection c2(sound1, 0, mix1, 1);
AudioConnection c3(sound2, 0, mix1, 2);
AudioConnection c4(sound3, 0, mix1, 3);
AudioConnection c5(mix1, 0, mix2, 0); // output of mix1 into 1st input on mix2
AudioConnection c6(sound4, 0, mix2, 1);
AudioConnection c7(sound5, 0, mix2, 2);
//AudioConnection c8(mix2, 0, headphones, 0);
//AudioConnection c9(mix2, 0, headphones, 1);
AudioConnection c10(mix2, 0, dac, 0);
// Create an object to control the audio shield.
//
AudioControlSGTL5000 audioShield;
// Bounce objects to read six pushbuttons (pins 0-5)
//
Bounce button0 = Bounce(12, 5);
int led1 = 10;
int led2 = 9;
int led3 = 5;
int led4 = 4;
int Coconut = A1;
int Banana = A2;
int Sausage = A3;
int Cheese = A4;
int capValue1 = 0;
int capRef1 = 0;
int capValue2 = 0;
int capRef2 = 0;
int capValue3 = 0;
int capRef3 = 0;
int capValue4 = 0;
int capRef4 = 0;
int samples = 20;
boolean played1 = false;
boolean played2 = false;
boolean played3 = false;
boolean played4 = false;
void setup() {
// Configure the pushbutton pins for pullups.
// Each button should connect from the pin to GND.
pinMode(12, INPUT_PULLUP);
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
capRef1 = touchRead(Coconut);
capRef2 = touchRead(Banana);
capRef3 = touchRead(Sausage);
capRef4 = touchRead(Cheese);
// Audio connections require memory to work. For more
// detailed information, see the MemoryAndCpuUsage example
AudioMemory(10);
// turn on the output
// by default the Teensy 3.1 DAC uses 3.3Vp-p output
// if your 3.3V power has noise, switching to the
// internal 1.2V reference can give you a clean signal
//dac.analogReference(INTERNAL);
// reduce the gain on mixer channels, so more than 1
// sound can play simultaneously without clipping
mix1.gain(0, 0.4);
mix1.gain(1, 0.4);
mix1.gain(2, 0.4);
mix1.gain(3, 0.4);
mix2.gain(1, 0.4);
mix2.gain(2, 0.4);
}
void loop() {
// Update all the button objects
button0.update();
for(int counter = 0; counter < samples; counter ++)
{
capValue1 += touchRead(Coconut) - capRef1;
}
capValue1 /= samples;
if (capValue1 >= 100 && !played1) {
played1 = true;
sound0.play(AudioSampleKick);
digitalWrite(led1, HIGH);
} else if (capValue1 <= 50) {
played1 = false;
digitalWrite(led1, LOW);
}
capValue1 = 0;
for(int counter = 0; counter < samples; counter ++)
{
capValue2 += touchRead(Banana) - capRef2;
}
capValue2 /= samples;
if (capValue2 >= 100 && !played2) {
played2 = true;
sound1.play(AudioSamplePulse);
digitalWrite(led2, HIGH);
} else if (capValue2 <= 50) {
played2 = false;
digitalWrite(led2, LOW);
}
capValue2 = 0;
for(int counter = 0; counter < samples; counter ++)
{
capValue3 += touchRead(Sausage) - capRef3;
}
capValue3 /= samples;
if (capValue3 >= 100 && !played3) {
played3 = true;
sound2.play(AudioSamplePerc);
digitalWrite(led3, HIGH);
} else if (capValue3 <= 50) {
played3 = false;
digitalWrite(led3, LOW);
}
capValue3 = 0;
for(int counter = 0; counter < samples; counter ++)
{
capValue4 += touchRead(Cheese) - capRef4;
}
capValue4 /= samples;
if (capValue4 >= 100 && !played4) {
played4 = true;
sound3.play(AudioSampleArp);
digitalWrite(led4, HIGH);
} else if (capValue4 <= 50) {
played4 = false;
digitalWrite(led4, LOW);
}
capValue4 = 0;
if (button0.fallingEdge()) {
// comment this line to work with Teensy 3.0.
// the Gong sound is very long, too much for 3.0's memory
sound4.play(AudioSampleGong);
}
}
| [
"marc@dusseiller.ch"
] | marc@dusseiller.ch |
349f181912e8e60a9142fe3937bde8e375906e16 | 24845554937247a963f4386fac959d60ca444d4f | /uva/10405.cpp | 4ee507ed895bcfff4f2439a452ff8b6ab34c4442 | [] | no_license | TahseenSust/Competitive-programming | 128a19a9861a26f87178bb41f900ad4a9442310e | 98ae11e9ccebce35111944c7d0197a294fb1e4e1 | refs/heads/master | 2023-06-29T02:06:43.544052 | 2023-06-21T10:29:07 | 2023-06-21T10:29:07 | 172,978,848 | 6 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 650 | cpp | #include<bits/stdc++.h>
using namespace std;
#define MAX 1050
string a,b;
int dp[MAX][MAX];
bool visit[MAX][MAX];
int LCS(int i,int j)
{
if(a[i]=='\0'||b[j]=='\0') return 0;
if(visit[i][j]) return dp[i][j];
int ans=0;
if(a[i]==b[j]){
ans=1+LCS(i+1,j+1);
}else{
ans=max(LCS(i+1,j),LCS(i,j+1));
}
visit[i][j]=true;
dp[i][j]=ans;
return dp[i][j];
}
int main()
{
//freopen("input.txt","r",stdin);
while(getline(cin,a)){
getline(cin,b);
memset(visit,false,sizeof(visit));
cout<<LCS(0,0)<<endl;
a[0]='\0';
b[0]='\0';
}
}
| [
"noreply@github.com"
] | noreply@github.com |
94cc49ee3deb3a2665db50ca963f94b63e5048c7 | ab670893478a1915c79b74219b14c6b44fe85196 | /STL/C++ STL| Set 2(pair)/Code.cpp | 296fd37dc3d7a3bd176a54d1fb970cd01ca8ff9f | [
"MIT"
] | permissive | swatinarang1225/GeeksforGeeks-Code | ce15b8b6c90e4f41a05290de85038a3f09b6aed1 | 9df33f7b8986134fa0ae600fe72c4873334f64a6 | refs/heads/master | 2023-08-25T21:15:28.064945 | 2023-08-24T15:13:24 | 2023-08-24T15:13:24 | 254,869,159 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,898 | cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
void add_pair(vector<pair<string,pair<int,int> > > &A,string str,int x,int y);
int get_size(vector<pair<string,pair<int,int> > > &A);
void print_values(vector<pair<string,pair<int,int> > > &A);
void sort_pair(vector<pair<string,pair<int,int> > > &A);
int main() {
// your code goes here
int t;
cin>>t;
while(t--)
{
vector<pair<string,pair<int,int> > > A;
int q;
cin>>q;
while(q--)
{
char c;
cin>>c;
if(c=='a')
{
string name;
cin>>name;
int x,y;
cin>>x>>y;
add_pair(A,name,x,y);
}
if(c=='b')
{
cout<<get_size(A)<<" ";
}
if(c=='c')
{
print_values(A);
}
if(c=='d')
{
sort_pair(A);
}
}
cout<<endl;
}
return 0;
}
// } Driver Code Ends
/* Inserts a pair <string, pair<x, y> > > into the vector A */
void add_pair(vector<pair<string,pair<int,int> > > &A, string str, int x, int y)
{
// Your code here
A.push_back({str,{x,y}});
}
/* Returns the size of the vector A */
int get_size(vector<pair<string,pair<int,int> > > &A)
{
// Your code here
return A.size();
}
/* Prints space separated values of vector A */
void print_values(vector<pair<string,pair<int,int> > > &A)
{
// Your code here
vector<pair<string,pair<int,int> > >::iterator v1;
for(v1 = A.begin();v1!=A.end();v1++){
cout<< v1->first<<" "<<v1->second.first<<" "<<v1->second.second<<" ";
}
}
/* Sorts the vector A based on value x and y*/
void sort_pair(vector<pair<string,pair<int,int> > > &A)
{
// Your code here
sort(A.begin(), A.end(), [](const pair<string, pair<int, int>>& a, const pair<string, pair<int, int>>& b) {
if (a.second.first == b.second.first) {
return a.second.second < b.second.second;
}
return a.second.first < b.second.first;
});
}
| [
"noreply@github.com"
] | noreply@github.com |
c4e32ca00cf6d4ce5950009d72168b1ab192ded0 | ff4fe07752b61aa6404f85a8b4752e21e8a5bac8 | /challenge-194/paulo-custodio/cpp/ch-1.cpp | f4b8a6c537440ec91223b03e3fe93d74d0e6157a | [] | no_license | choroba/perlweeklychallenge-club | 7c7127b3380664ca829158f2b6161c2f0153dfd9 | 2b2c6ec6ece04737ba9a572109d5e7072fdaa14a | refs/heads/master | 2023-08-10T08:11:40.142292 | 2023-08-06T20:44:13 | 2023-08-06T20:44:13 | 189,776,839 | 0 | 1 | null | 2019-06-01T20:56:32 | 2019-06-01T20:56:32 | null | UTF-8 | C++ | false | false | 1,160 | cpp | /*
Challenge 194
Task 1: Digital Clock
Submitted by: Mohammad S Anwar
You are given time in the format hh:mm with one missing digit.
Write a script to find the highest digit between 0-9 that makes it valid time.
Example 1
Input: $time = '?5:00'
Output: 1
Since 05:00 and 15:00 are valid time and no other digits can fit in the missing place.
Example 2
Input: $time = '?3:00'
Output: 2
Example 3
Input: $time = '1?:00'
Output: 9
Example 4
Input: $time = '2?:00'
Output: 3
Example 5
Input: $time = '12:?5'
Output: 5
Example 6
Input: $time = '12:5?'
Output: 9
*/
#include <iostream>
#include <string>
int missing_digit(const std::string& clock) {
if (clock.size()!=5) return -1;
if (clock[0]=='?' && clock[1]<='3') return 2;
if (clock[0]=='?') return 1;
if (clock[0]<='1' && clock[1]=='?') return 9;
if (clock[1]=='?') return 3;
if (clock[3]=='?') return 5;
if (clock[4]=='?') return 9;
return -1;
}
int main(int argc, char* argv[]) {
argv++; argc--;
if (argc != 1) {
std::cerr << "usage: ch-1 hh:mm" << std::endl;
return EXIT_FAILURE;
}
std::cout << missing_digit(argv[0]) << std::endl;
}
| [
"pauloscustodio@gmail.com"
] | pauloscustodio@gmail.com |
ba95985699d9853eb3d435ec05897bc829e92781 | 08b8cf38e1936e8cec27f84af0d3727321cec9c4 | /data/crawl/squid/new_hunk_1594.cpp | d2e4465dcaa7b21beab3d3a01a28030e7ff4fdc3 | [] | no_license | ccdxc/logSurvey | eaf28e9c2d6307140b17986d5c05106d1fd8e943 | 6b80226e1667c1e0760ab39160893ee19b0e9fb1 | refs/heads/master | 2022-01-07T21:31:55.446839 | 2018-04-21T14:12:43 | 2018-04-21T14:12:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 633 | cpp | Ssl::CertificateStorageAction::Pointer Ssl::CertificateStorageAction::Create(const Mgr::Command::Pointer &cmd) STUB_RETSTATREF(Ssl::CertificateStorageAction::Pointer)
void Ssl::CertificateStorageAction::dump(StoreEntry *sentry) STUB
void Ssl::GlobalContextStorage::addLocalStorage(Ip::Address const & address, size_t size_of_store) STUB
Ssl::LocalContextStorage *Ssl::GlobalContextStorage::getLocalStorage(Ip::Address const & address)
{ fatal(STUB_API " required"); static Ssl::LocalContextStorage v(0,0); return &v; }
void Ssl::GlobalContextStorage::reconfigureStart() STUB
//Ssl::GlobalContextStorage Ssl::TheGlobalContextStorage;
| [
"993273596@qq.com"
] | 993273596@qq.com |
8c5e2daf0c239fe11687ce61354dc03ce5c956ab | 1fd9fd0a31d71009985c1815534a40f6ade15ca3 | /词法分析器/lex.h | 8e91c7adb8fc32d3ed0aa6f1cd8847f898d993cb | [] | no_license | blingmoon/Lex | d174683926d04def07a7b66e3686459514e9c24d | a66f6b2b4666c5a1ca1a45becce7b67053020ff0 | refs/heads/master | 2020-03-10T23:04:37.328719 | 2019-04-17T17:52:51 | 2019-04-17T17:52:51 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 7,464 | h | #ifndef LEX_H_
#define LEX_H_
#include<string>
#include<vector>
using namespace std;
//图的转移,主要是来表示
struct Arc{
int nodeIndex;//下一个节点的下标,节点采用的是数组,所以采用这种形式
char changeValue;//变化的值"\0"表示为空值
Arc* nextArc = NULL;//表示下一个
};
//图的节点,这个表示一个个状态
struct Node
{
std::string value;//状态的值,但是不是用这个来寻找节点
Arc* firstArc=NULL;//这个点的出度的边,采用的是链表方式
};
//采用class是为了内存的管理方向,可以实现自动调用析构函数
class Graph
{
private:
int maxLength;//nodes的最大长度,node采用new的方式来管理,当最大的时候会采用扩充的形式
int tail; //现在节点用到的位置
public:
void CopyGraph(const Graph& g);//拷贝构造函数
void clearG();
Node* nodes;//各个节点,采用的数组形式
int newNode();//获得最最后一个节点的下一个,相当于分配
bool extendNodes();//扩展nodes数组
void insertArc(int index,Arc* a);//给index这个节点插入一条弧
int getTail();
Graph(int maxLength=100);
Graph(const Graph& g);//拷贝构造函数
~Graph(); //析构函数,主要是回收nodes和nodes的链表的内存空间
};
//栈的中间结果
struct MidResult
{
int S0;
int F0;
};
//运算写入一个类中
class Operation
{
private:
int index = 0;//解析到表达式的位置;
//运算符号的优先级,六个运算符("(",")","#","|",".","*"),pri[i][j],表示i的优先级是不是大于j,i在j的左边
//1表示不需要操作,直接入栈,0表示需要进行操作
bool pri[6][6];
char ops[7];
//展开运算式子,主要是用来将正规式子的一些特殊的含义字符展开,为只有上面的几个运算符合运算元素的字符串
char* unfoldExpre(char* expression);
int getopIndex(char op);//找到op的下标
bool connectOp(Graph& g, MidResult& a, MidResult& b);//连接运算。,a=a。b
bool andOp(Graph& g, MidResult& a, MidResult& b);//与运算|,a=a|b
bool closureOp(Graph& g, MidResult& a);//闭包运算, a=a*
char getNextChar(const char* expression);//针对于正规式,和算术表达式不一样,对于正规是操作数和操作符都只会占一个字符位置
bool isOp(const char a);//判断a是不是操作符,如果是则返回1不是则返回0
MidResult conversion(Graph& g, char a);//将字符串转化一下,同时也需要在图上给他分配空间
public:
Operation();
~Operation();
//计算一个正规式子,输出一个NFA,计算没有出错会返回1出错会返回0,同时也需要给出S0和F0,采用这种方法构造的终态只有一个
bool calute(Graph& g, const char* expression, int& S0, int& F0);
};
//考虑NFA,几个转化都是在这个类中实现的
class NFA
{
protected:
Graph g;//包括了状态S和mov函数
int S0;//初始状态
char* words;//字母表
int wordLength;//对应字母表的数组长度
int* F0;//终态
int tail;//F0的实际个数
int maxF0Length;//对应终态的数组长度
//判断elem是不是在v中,是则返回在v中的下标,否则返回-1
int elemInVector(int elem, const vector<int>& v);
int elemInVector(const vector<int>& elem, const vector<vector<int>>& v);
//计算result=Smove(s,c)
vector<int>& smove(int s, vector<int>& result, char c);
//求空闭包
vector<int>& NULLClose(vector<int>& states);
//防止F0不够进行扩展
bool extendsF0();
//result=result+(result-c)
vector<int>& combineVector(vector<int>& result, const vector<int>& c);
public:
string name;
int getF0(){
return this->F0[0];
}
int getS0(){
return this->S0;
}
//设置F0s,返回的是tail
int setF0(vector<int>& F0S);
//无表达式子构造的就是一个空串到空串的状态机
//无参的构造函数words长度为空
NFA(const char* name, const char* words = "\0", const char *expression = "#", int maxF0Length = 100);
NFA(const NFA& nfa);//拷贝构造函数
//获得图
Graph& getG();
//设置图,为了析构,不知道直接等于会不会直接将原来的Graph析构
void setG(Graph& g);
~NFA();//不用析构g了,g会被g的析构函数自动析构,主要是需要去析构allWords和F0
};
//DFA公有继承NFA,主要的目的是为了是程序的各个部分功能更加明确
//这个类主要完成的工作有
/*
1.NFA到DFA的图的转化
2.DFA的最小化
3.DFA的模拟器
*/
class DFA:public NFA
{
private:
int** DFAtable;//状态转化表
int Length_of_S;//S的状态数目
//DFA主要是在这三个函数中使用的节点
void convertDFAG(vector<Node>& DFA);//用在构造函数中,在父类构造完后,子类调用获得DFA
//将DFA化简,将简化的结果直接放到g中就行
void simplify();
void setG(vector<Node>& DFA);//根据vector<Node>给G赋值,最小化后要使用的
void setTable();//设置状态转化表
int getCharOfWords(char a);//获得字符串在words里面的下标
bool isInF0(int state);//判断states
bool DFA::divide(const vector<vector<int>>& newTable, vector<vector<int>>& states);
void DFA::updateNewTable(vector<vector<int>>& newTable, const vector<vector<int>>& states);
public:
void convertString(string& s);//将这个类转化为TXT格式
//识别字符串,主要的对外服务
/*这里的str不是针对一个完整的字符串,而是一个字符串流,由字符串的beginIndex位置开始,
一直检测到不在这个DFA表达字母表(a+)中的或者接受对于某个节点没有这个字符串的边(1234,a1234)
返回值为结束的位置下标,同时这个值会被存在result中
*/
bool simDFA(const char* str, int beginIndex, int& endIndex,char* result);
//构造函数
DFA(const char* name = "", const char* words = "\0", const char *expression = "#", int maxF0Length = 100);
DFA(const char* name , const char* words,vector<int>& F0,int S0,int table[400][300],int Length_of_S);
void getF0s(vector<int>& F0S);
void getWords(vector<char>& Words);
DFA(const DFA& dfa);
~DFA();
};
enum CONSTRUCT_TYPE{
PARSING_REGULAR,//这个是根据正规式来通过运算得到
PARSING_CLASS,//这个不需要通过运算
};
//将所有的整合形成一个词法分析器
class LexicalAnalyzer
{
public:
//注意,这里面需要读取一个文件里面的为各个定义,默认是通过正规式来解析
LexicalAnalyzer(string path = "", CONSTRUCT_TYPE type = PARSING_REGULAR);
~LexicalAnalyzer();
//将xx.c文件转化为记号流,保存在xxMark.txt中
void getMarkStream(string cpath="");
private:
//解析正规式的构造函数选项入口
void parsingRegular(string path);
//解析类的类文件构造函数入口
void parsingClass(string path);
//分析str,同时将str分为两部分,一个部分为表达式,一个部分为名字,最后在表达式上面获得字母表
//name=expression(包括#),所有的char*最后都是以\0结束
//返回为1则表示正确分析成功,返回为0则表示分析失败
bool analyString(const char* str, char* expression, char* name, char* words);
//将表达式展开,主要需要处理的有.显现,A1-An转化为A1|A2|A3|A4....|An
//暂时未实现,请期待
void extendsExpression(const char*expression,char* extendsExp);
//在表达式上面获取words
void analyWords(char* expression,char* words);
vector<DFA> wordsDefine;
};
#endif | [
"297977761@qq.com"
] | 297977761@qq.com |
7f8029927ff59b3aebd4ed5223f9d1143fbee96b | 2f557f60fc609c03fbb42badf2c4f41ef2e60227 | /CondTools/SiPhase2Tracker/plugins/DTCCablingMapTestReader.cc | fa0973807e1b583420bfa1527a95282c72a32066 | [
"Apache-2.0"
] | permissive | CMS-TMTT/cmssw | 91d70fc40a7110832a2ceb2dc08c15b5a299bd3b | 80cb3a25c0d63594fe6455b837f7c3cbe3cf42d7 | refs/heads/TMTT_1060 | 2020-03-24T07:49:39.440996 | 2020-03-04T17:21:36 | 2020-03-04T17:21:36 | 142,576,342 | 3 | 5 | Apache-2.0 | 2019-12-05T21:16:34 | 2018-07-27T12:48:13 | C++ | UTF-8 | C++ | false | false | 4,258 | cc | // -*- C++ -*-
//
// Package: CondTools/SiPhase2Tracker
// Class: DTCCablingMapTestReader
//
/**\class DTCCablingMapTestReader DTCCablingMapTestReader.cc CondTools/SiPhase2Tracker/plugins/DTCCablingMapTestReader.cc
Description: [one line class summary]
Implementation:
[Notes on implementation]
*/
//
// Original Author: Luigi Calligaris, SPRACE, São Paulo, BR
// Created : Wed, 27 Feb 2019 21:41:13 GMT
//
//
#include <memory>
#include <utility>
#include <unordered_map>
#include <string>
#include <iostream>
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "CondFormats/SiPhase2TrackerObjects/interface/TrackerDetToDTCELinkCablingMap.h"
#include "CondFormats/SiPhase2TrackerObjects/interface/DTCELinkId.h"
#include "CondFormats/DataRecord/interface/TrackerDetToDTCELinkCablingMapRcd.h"
class DTCCablingMapTestReader : public edm::one::EDAnalyzer<>
{
public:
explicit DTCCablingMapTestReader(const edm::ParameterSet&);
~DTCCablingMapTestReader() override;
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
private:
void beginJob() override;
void analyze(const edm::Event&, const edm::EventSetup&) override;
void endJob() override;
};
void DTCCablingMapTestReader::fillDescriptions(edm::ConfigurationDescriptions& descriptions)
{
//The following says we do not know what parameters are allowed so do no validation
// Please change this to state exactly what you do use, even if it is no parameters
edm::ParameterSetDescription desc;
desc.setUnknown();
descriptions.add("DTCCablingMapTestReader", desc);
}
DTCCablingMapTestReader::DTCCablingMapTestReader(const edm::ParameterSet& iConfig)
{
}
DTCCablingMapTestReader::~DTCCablingMapTestReader()
{
}
void DTCCablingMapTestReader::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
{
using namespace edm;
using namespace std;
edm::ESHandle<TrackerDetToDTCELinkCablingMap> cablingMapHandle;
iSetup.get<TrackerDetToDTCELinkCablingMapRcd>().get( cablingMapHandle );
TrackerDetToDTCELinkCablingMap const* p_cablingMap = cablingMapHandle.product();
{
ostringstream dump_DetToElink;
dump_DetToElink << "Det To DTC ELink map elements dump (Python-style):" << endl;
std::vector<uint32_t> const knownDetIds = p_cablingMap->getKnownDetIds();
dump_DetToElink << "{";
for (uint32_t detId : knownDetIds)
{
dump_DetToElink << "(" << detId << " : [";
auto equal_range = p_cablingMap->detIdToDTCELinkId(detId);
for (auto it = equal_range.first; it != equal_range.second; ++it)
dump_DetToElink << "(" << unsigned(it->second.dtc_id()) << ", " << unsigned(it->second.gbtlink_id()) << ", " << unsigned(it->second.elink_id()) << "), ";
dump_DetToElink << "], ";
}
dump_DetToElink << "}" << endl;
edm::LogInfo("DetToElinkCablingMapDump") << dump_DetToElink.str();
}
{
ostringstream dump_ElinkToDet;
dump_ElinkToDet << "DTC Elink To Det map elements dump (Python-style):" << endl;
std::vector<DTCELinkId> const knownDTCELinkIds = p_cablingMap->getKnownDTCELinkIds();
dump_ElinkToDet << "{";
for (DTCELinkId const& currentELink : knownDTCELinkIds)
{
dump_ElinkToDet << "(" << unsigned(currentELink.dtc_id()) << ", " << unsigned(currentELink.gbtlink_id()) << ", " << unsigned(currentELink.elink_id()) << ") " << " : ";
auto detId_it = p_cablingMap->dtcELinkIdToDetId(currentELink);
dump_ElinkToDet << detId_it->second << ", ";
}
dump_ElinkToDet << "}" << endl;
edm::LogInfo("DetToElinkCablingMapDump") << dump_ElinkToDet.str();
}
}
void DTCCablingMapTestReader::beginJob()
{
}
void DTCCablingMapTestReader::endJob()
{
}
//define this as a plug-in
DEFINE_FWK_MODULE(DTCCablingMapTestReader);
| [
"fabio.cossutti@ts.infn.it"
] | fabio.cossutti@ts.infn.it |
d85e9da11fe76e61b0d1bc4c317e8c9f1fc1a3e5 | 70bfb854966ea1b42f9bc3cc1a138dcafbe3078b | /chrome/credential_provider/extension/app_inventory_manager.cc | 80178b1107d728e2cfea19b67d04a5556628c365 | [
"BSD-3-Clause"
] | permissive | HazemSamir/chromium | ba5e0f3143f18b6b4bcc0bd6f8befedea7cc716d | 200642f2f3b3e378c2a4e8f533fdc701743920ac | refs/heads/main | 2023-06-27T07:50:25.102105 | 2021-09-02T16:27:25 | 2021-09-02T16:27:25 | 402,493,037 | 1 | 0 | BSD-3-Clause | 2021-09-02T16:40:00 | 2021-09-02T16:40:00 | null | UTF-8 | C++ | false | false | 10,611 | cc | // Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/credential_provider/extension/app_inventory_manager.h"
#include <memory>
#include "base/strings/utf_string_conversions.h"
#include "chrome/credential_provider/common/gcp_strings.h"
#include "chrome/credential_provider/gaiacp/gcp_utils.h"
#include "chrome/credential_provider/gaiacp/gcpw_strings.h"
#include "chrome/credential_provider/gaiacp/logging.h"
#include "chrome/credential_provider/gaiacp/mdm_utils.h"
#include "chrome/credential_provider/gaiacp/os_user_manager.h"
#include "chrome/credential_provider/gaiacp/reg_utils.h"
#include "chrome/credential_provider/gaiacp/win_http_url_fetcher.h"
namespace credential_provider {
const base::TimeDelta kDefaultUploadAppInventoryRequestTimeout =
base::TimeDelta::FromMilliseconds(12000);
namespace {
// Constants used for contacting the gem service.
const char kGemServiceUploadAppInventoryPath[] = "/v1/uploadDeviceDetails";
const char kUploadAppInventoryRequestUserSidParameterName[] = "user_sid";
const char kUploadAppInventoryRequestDeviceResourceIdParameterName[] =
"device_resource_id";
const char kUploadAppInventoryRequestWin32AppsParameterName[] =
"windows_gpcw_app_info";
const char kDmToken[] = "dm_token";
const char kObfuscatedGaiaId[] = "obfuscated_gaia_id";
const char kAppDisplayName[] = "name";
const char kAppDisplayVersion[] = "version";
const char kAppPublisher[] = "publisher";
const char kAppType[] = "app_type";
const wchar_t kInstalledWin32AppsRegistryPath[] =
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
const wchar_t kInstalledWin32AppsRegistryPathWOW6432[] =
L"SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
const wchar_t kDelimiter[] = L"\\";
const wchar_t kAppDisplayNameRegistryKey[] = L"DisplayName";
const wchar_t kAppDisplayVersionRegistryKey[] = L"DisplayVersion";
const wchar_t kAppPublisherRegistryKey[] = L"Publisher";
// Registry key to control whether upload app data from ESA feature is
// enabled.
const wchar_t kUploadAppInventoryFromEsaEnabledRegKey[] =
L"upload_app_inventory_from_esa";
// The period of uploading app inventory to the backend.
const base::TimeDelta kUploadAppInventoryExecutionPeriod =
base::TimeDelta::FromHours(3);
// True when upload device details from ESA feature is enabled.
bool g_upload_app_inventory_from_esa_enabled = false;
// Maximum number of retries if a HTTP call to the backend fails.
constexpr unsigned int kMaxNumHttpRetries = 3;
// Defines a task that is called by the ESA to upload app data.
class UploadAppInventoryTask : public extension::Task {
public:
static std::unique_ptr<extension::Task> Create() {
std::unique_ptr<extension::Task> esa_task(new UploadAppInventoryTask());
return esa_task;
}
// ESA calls this to retrieve a configuration for the task execution. Return
// a default config for now.
extension::Config GetConfig() final {
extension::Config config;
config.execution_period = kUploadAppInventoryExecutionPeriod;
return config;
}
// ESA calls this to set all the user-device contexts for the execution of the
// task.
HRESULT SetContext(const std::vector<extension::UserDeviceContext>& c) final {
context_ = c;
return S_OK;
}
// ESA calls execute function to perform the actual task.
HRESULT Execute() final {
HRESULT task_status = S_OK;
for (const auto& c : context_) {
HRESULT hr = AppInventoryManager::Get()->UploadAppInventory(c);
if (FAILED(hr)) {
LOGFN(ERROR) << "Failed uploading device details for " << c.user_sid
<< ". hr=" << putHR(hr);
task_status = hr;
}
}
return task_status;
}
private:
std::vector<extension::UserDeviceContext> context_;
};
} // namespace
// static
AppInventoryManager* AppInventoryManager::Get() {
return *GetInstanceStorage();
}
// static
AppInventoryManager** AppInventoryManager::GetInstanceStorage() {
static AppInventoryManager instance(kDefaultUploadAppInventoryRequestTimeout);
static AppInventoryManager* instance_storage = &instance;
return &instance_storage;
}
// static
extension::TaskCreator AppInventoryManager::UploadAppInventoryTaskCreator() {
return base::BindRepeating(&UploadAppInventoryTask::Create);
}
AppInventoryManager::AppInventoryManager(
base::TimeDelta upload_app_inventory_request_timeout)
: upload_app_inventory_request_timeout_(
upload_app_inventory_request_timeout) {
g_upload_app_inventory_from_esa_enabled =
GetGlobalFlagOrDefault(kUploadAppInventoryFromEsaEnabledRegKey, 1) == 1;
}
AppInventoryManager::~AppInventoryManager() = default;
GURL AppInventoryManager::GetGemServiceUploadAppInventoryUrl() {
GURL gem_service_url = GetGcpwServiceUrl();
return gem_service_url.Resolve(kGemServiceUploadAppInventoryPath);
}
bool AppInventoryManager::UploadAppInventoryFromEsaFeatureEnabled() const {
return g_upload_app_inventory_from_esa_enabled;
}
// Uploads the app data into GEM database using |dm_token|
// for authentication and authorization. The GEM service would use
// |resource_id| for identifying the device entry in GEM database.
HRESULT AppInventoryManager::UploadAppInventory(
const extension::UserDeviceContext& context) {
std::wstring obfuscated_user_id;
HRESULT status = GetIdFromSid(context.user_sid.c_str(), &obfuscated_user_id);
if (FAILED(status)) {
LOGFN(ERROR) << "Could not get user id from sid " << context.user_sid;
return status;
}
if (obfuscated_user_id.empty()) {
LOGFN(ERROR) << "Got empty user id from sid " << context.user_sid;
return E_FAIL;
}
std::wstring dm_token_value = context.dm_token;
HRESULT hr;
if (dm_token_value.empty()) {
hr = GetGCPWDmToken(context.user_sid, &dm_token_value);
if (FAILED(hr)) {
LOGFN(WARNING) << "Failed to fetch DmToken hr=" << putHR(hr);
return hr;
}
}
request_dict_ = std::make_unique<base::Value>(base::Value::Type::DICTIONARY);
request_dict_->SetStringKey(kUploadAppInventoryRequestUserSidParameterName,
base::WideToUTF8(context.user_sid));
request_dict_->SetStringKey(kDmToken, base::WideToUTF8(dm_token_value));
request_dict_->SetStringKey(kObfuscatedGaiaId,
base::WideToUTF8(obfuscated_user_id));
std::wstring known_resource_id =
context.device_resource_id.empty()
? GetUserDeviceResourceId(context.user_sid)
: context.device_resource_id;
// ResourceId cannot be empty while uploading app data. App data is updated
// only for devices with existing device record.
if (known_resource_id.empty()) {
LOGFN(ERROR) << "Could not find valid resourceId for sid:"
<< context.user_sid;
return E_FAIL;
}
request_dict_->SetStringKey(
kUploadAppInventoryRequestDeviceResourceIdParameterName,
base::WideToUTF8(known_resource_id));
request_dict_->SetKey(kUploadAppInventoryRequestWin32AppsParameterName,
GetInstalledWin32Apps());
absl::optional<base::Value> request_result;
hr = WinHttpUrlFetcher::BuildRequestAndFetchResultFromHttpService(
AppInventoryManager::Get()->GetGemServiceUploadAppInventoryUrl(),
/* access_token= */ std::string(), {}, *request_dict_,
upload_app_inventory_request_timeout_, kMaxNumHttpRetries,
&request_result);
if (FAILED(hr)) {
LOGFN(ERROR) << "BuildRequestAndFetchResultFromHttpService hr="
<< putHR(hr);
return E_FAIL;
}
return hr;
}
base::Value AppInventoryManager::GetInstalledWin32Apps() {
std::vector<std::wstring> app_name_list;
std::vector<std::wstring> app_path_list;
GetChildrenAtPath(kInstalledWin32AppsRegistryPath, app_name_list);
for (std::wstring a : app_name_list) {
app_path_list.push_back(std::wstring(kInstalledWin32AppsRegistryPath)
.append(std::wstring(kDelimiter))
.append(a));
}
app_name_list.clear();
GetChildrenAtPath(kInstalledWin32AppsRegistryPathWOW6432, app_name_list);
for (std::wstring a : app_name_list) {
app_path_list.push_back(std::wstring(kInstalledWin32AppsRegistryPathWOW6432)
.append(std::wstring(kDelimiter))
.append(a));
}
base::Value app_info_value_list(base::Value::Type::LIST);
for (std::wstring regPath : app_path_list) {
std::unique_ptr<base::Value> request_dict_;
request_dict_ =
std::make_unique<base::Value>(base::Value::Type::DICTIONARY);
wchar_t display_name[256];
ULONG display_length = base::size(display_name);
HRESULT hr =
GetMachineRegString(regPath, std::wstring(kAppDisplayNameRegistryKey),
display_name, &display_length);
if (hr == S_OK) {
request_dict_->SetStringKey(kAppDisplayName,
base::WideToUTF8(display_name));
wchar_t display_version[256];
ULONG version_length = base::size(display_version);
hr = GetMachineRegString(regPath,
std::wstring(kAppDisplayVersionRegistryKey),
display_version, &version_length);
if (hr == S_OK) {
request_dict_->SetStringKey(kAppDisplayVersion,
base::WideToUTF8(display_version));
}
wchar_t publisher[256];
ULONG publisher_length = base::size(publisher);
hr = GetMachineRegString(regPath, std::wstring(kAppPublisherRegistryKey),
publisher, &publisher_length);
if (hr == S_OK) {
request_dict_->SetStringKey(kAppPublisher, base::WideToUTF8(publisher));
}
// App_type value 1 refers to WIN_32 applications.
request_dict_->SetIntKey(kAppType, 1);
app_info_value_list.Append(
base::Value::FromUniquePtrValue(std::move(request_dict_)));
}
}
return app_info_value_list;
}
void AppInventoryManager::SetUploadAppInventoryFromEsaFeatureEnabledForTesting(
bool value) {
g_upload_app_inventory_from_esa_enabled = value;
}
void AppInventoryManager::SetFakesForTesting(FakesForTesting* fakes) {
DCHECK(fakes);
WinHttpUrlFetcher::SetCreatorForTesting(
fakes->fake_win_http_url_fetcher_creator);
if (fakes->os_user_manager_for_testing) {
OSUserManager::SetInstanceForTesting(fakes->os_user_manager_for_testing);
}
}
} // namespace credential_provider
| [
"chromium-scoped@luci-project-accounts.iam.gserviceaccount.com"
] | chromium-scoped@luci-project-accounts.iam.gserviceaccount.com |
8559feba1bb05a10e5e6bdc76a8b92fbd55412ce | b395fca4065fd496715a0c306d5ff643cecd31cc | /tools/Aria/Database/DbValueBase.hpp | 7423b4957a88b01babb2c0e9f18ef48b203d98eb | [
"MIT"
] | permissive | vn-os/Castor3D | e357372268f94a76d61e5b0059bf40f5c1f4f66a | fdaf4067e1a657979690ef6c6746079602e29d8e | refs/heads/master | 2023-06-05T19:45:24.819879 | 2021-02-19T01:39:54 | 2021-02-19T01:39:54 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 870 | hpp | /*
See LICENSE file in root folder
*/
#ifndef ___CTP_DbValueBase_HPP___
#define ___CTP_DbValueBase_HPP___
#include "DbPrerequisites.hpp"
namespace aria::db
{
class ValueBase
{
public:
explicit ValueBase( Connection & connection );
virtual ~ValueBase() = default;
virtual void setValue( ValueBase const & value ) = 0;
virtual std::string getQueryValue()const = 0;
virtual void * getPtrValue() = 0;
virtual const void * getPtrValue() const = 0;
unsigned long & getPtrSize()
{
return m_valueSize;
}
const unsigned long & getPtrSize()const
{
return m_valueSize;
}
bool isNull() const
{
return m_isNull;
}
void setNull( bool null = true )
{
m_isNull = null;
}
protected:
virtual void doSetNull() = 0;
protected:
Connection & m_connection;
unsigned long m_valueSize{};
bool m_isNull{ true };
};
}
#endif
| [
"noreply@github.com"
] | noreply@github.com |
c63cd5018f98079f111eca75a2688aa8c3d9ef75 | 999be97660f0c3e9482a6da75c52fb0923db3169 | /ESP32_MoveCore/ESP32_MoveCore.ino | 91e14a29762b9543cdbe8cc7fe808212dc898c52 | [] | no_license | kishor0199/ESP32-Dual-Core | 54b5578b1fe21263d5e439268e6f94c394513815 | 436b8f31aad0312c64a148039736193522236885 | refs/heads/master | 2021-02-07T10:32:27.974880 | 2018-02-04T17:12:21 | 2018-02-04T17:12:21 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,104 | ino | /*
* This sketch moves the blink sketch from Core 1 in loop to Core 0
*/
#define LED1 14
TaskHandle_t Task1;
void codeForTask1( void * parameter )
{
for (;;) {
Serial.print("This Task runs on Core: ");
Serial.println(xPortGetCoreID());
digitalWrite(LED1, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED1, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
}
void setup() {
Serial.begin(115200);
pinMode(LED1, OUTPUT);
xTaskCreatePinnedToCore(
codeForTask1, /* Task function. */
"Task_1", /* name of task. */
1000, /* Stack size of task */
NULL, /* parameter of the task */
1, /* priority of the task */
&Task1, /* Task handle to keep track of created task */
0); /* Core */
}
// the loop function runs over and over again forever
void loop() {
delay(1000);
}
| [
"andreas.spiess@arumba.com"
] | andreas.spiess@arumba.com |
0313863c808280ffde8ce416e625b1bee241d34d | 3b441322d8da2c2cbb2844775f0eed87dead26e8 | /myLisp/fnexpand.cpp | a64f14ff7e3cc80889836464d84bb1d3ce55997b | [] | no_license | itmm/myLisp | 5f9b21589d7f03e03455bd4efc548bb4018d293b | 80f63860d234d4ed7f3d2dc44a86904607fd375e | refs/heads/master | 2021-01-10T10:23:33.115070 | 2015-08-30T08:58:47 | 2015-08-30T08:58:47 | 36,672,463 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 676 | cpp | #include "fnexpand.h"
#include "pair.h"
#include "expander.h"
#include "function_creator.h"
static SimpleFunctionCreator<FunctionExpand> _creator("expand");
EPtr FunctionExpand::apply(EPtr arguments, State &state) {
if (Pair::cdr(Pair::cdr(arguments))) return state.error("expand needs two arguments");
Dictionary *dictionary = Element::as_dictionary(state.eval(EPtr(Pair::car(arguments), state.collector())));
if (! dictionary) return state.error("first argument must be dictionary");
Element *root = Pair::car(Pair::cdr(arguments));
Expander expander(EPtr(dictionary, state.collector()));
return expander.rewrite(EPtr(root, state.collector()), *state.creator());
}
| [
"timm@kna-st.de"
] | timm@kna-st.de |
0a6c3ea99e6e676781c8b2097fe0db48d99c5860 | 1fd0bc1dd6db02280819a37ddacbab2a982bcbea | /kovalenko.alexey/A4/main.cpp | 54ff1200d732f511bdeb7ea3343308d0fff5eb03 | [] | no_license | alexmustdie/cpp-labs-1st-sem | ed25e7ddab26f049ea8cedf5ae34bdfdc2596a4a | af2c2d584520be6039b7450d2766f689bcc95d22 | refs/heads/master | 2020-03-21T18:01:07.546477 | 2018-07-03T20:49:03 | 2018-07-03T20:49:03 | 138,867,638 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 921 | cpp | #include <iostream>
#include <cmath>
#include "rectangle.hpp"
#include "circle.hpp"
#include "matrix-shape.hpp"
using namespace kovalenko;
int main()
{
try
{
auto rectangle_1 = std::make_shared<Rectangle>(point_t{-1, -2.5}, 6, 3);
std::cout << "rectangle_1 was created\n\n";
rectangle_1->printData();
auto circle = std::make_shared<Circle>(point_t{3, 0}, 3);
std::cout << "\ncircle was created\n\n";
circle->printData();
auto rectangle_2 = std::make_shared<Rectangle>(point_t{-2.5, 1}, 3, 2);
std::cout << "\nrectangle_2 was created\n\n";
rectangle_2->printData();
MatrixShape matrix_shape(rectangle_1);
std::cout << "\nmatrix was created\n\n";
matrix_shape.addShape(circle);
matrix_shape.addShape(rectangle_2);
matrix_shape.print();
}
catch (const std::invalid_argument &e)
{
std::cerr << e.what() << "\n";
return 1;
}
return 0;
}
| [
"epfly@ya.ru"
] | epfly@ya.ru |
b051e6206567dd5e730199a0b7151fec2275ac3a | 29b81bdc013d76b057a2ba12e912d6d4c5b033ef | /boost/include/boost/geometry/index/rtree.hpp | 7888d9c93f704ed1f4bb58c1d073354a5767dfa1 | [] | no_license | GSIL-Monitor/third_dependences | 864d2ad73955ffe0ce4912966a4f0d1c60ebd960 | 888ebf538db072a92d444a9e5aaa5e18b0f11083 | refs/heads/master | 2020-04-17T07:32:49.546337 | 2019-01-18T08:47:28 | 2019-01-18T08:47:28 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 130 | hpp | version https://git-lfs.github.com/spec/v1
oid sha256:d2753d3999b99bb74ce16e8e1214154463648f9ca7ba9f26e7401680b20d7d4e
size 78617
| [
"you@example.com"
] | you@example.com |
f128b7048069567a32f7c0acb8d7333744b1cfe8 | b330bba7e8792aeb8fee27467d6414837a96ab04 | /wave-mixed/Stiff.h | b76775d5e9dc3315536dfbff61bbb7e1ac2b2138 | [] | no_license | Psywah/seismic-wave | bd7b370253a581307b6ad2ef0a176056034771a4 | 5a1ab4a294c0fecaaca1b2c35ede6ab07da0814d | refs/heads/master | 2021-05-12T10:25:34.930636 | 2018-01-13T15:13:10 | 2018-01-13T15:13:10 | 117,352,908 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 66,515 | h | // This code conforms with the UFC specification version 1.4.0
// and was automatically generated by FFC version 1.4.0.
//
// This code was generated with the option '-l dolfin' and
// contains DOLFIN-specific wrappers that depend on DOLFIN.
//
// This code was generated with the following parameters:
//
// cache_dir: ''
// convert_exceptions_to_warnings: False
// cpp_optimize: True
// cpp_optimize_flags: '-O2'
// epsilon: 1e-14
// error_control: False
// form_postfix: True
// format: 'dolfin'
// log_level: 20
// log_prefix: ''
// optimize: True
// output_dir: '.'
// precision: 15
// quadrature_degree: 'auto'
// quadrature_rule: 'auto'
// representation: 'auto'
// restrict_keyword: ''
// split: True
#ifndef __STIFF_H
#define __STIFF_H
#include <cmath>
#include <stdexcept>
#include <fstream>
#include <ufc.h>
/// This class defines the interface for a finite element.
class stiff_finite_element_0: public ufc::finite_element
{
public:
/// Constructor
stiff_finite_element_0();
/// Destructor
virtual ~stiff_finite_element_0();
/// Return a string identifying the finite element
virtual const char* signature() const;
/// Return the cell shape
virtual ufc::shape cell_shape() const;
/// Return the topological dimension of the cell shape
virtual std::size_t topological_dimension() const;
/// Return the geometric dimension of the cell shape
virtual std::size_t geometric_dimension() const;
/// Return the dimension of the finite element function space
virtual std::size_t space_dimension() const;
/// Return the rank of the value space
virtual std::size_t value_rank() const;
/// Return the dimension of the value space for axis i
virtual std::size_t value_dimension(std::size_t i) const;
/// Evaluate basis function i at given point x in cell (actual implementation)
static void _evaluate_basis(std::size_t i,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation);
/// Evaluate basis function i at given point x in cell (non-static member function)
virtual void evaluate_basis(std::size_t i,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation) const
{
_evaluate_basis(i, values, x, vertex_coordinates, cell_orientation);
}
/// Evaluate all basis functions at given point x in cell (actual implementation)
static void _evaluate_basis_all(double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation);
/// Evaluate all basis functions at given point x in cell (non-static member function)
virtual void evaluate_basis_all(double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation) const
{
_evaluate_basis_all(values, x, vertex_coordinates, cell_orientation);
}
/// Evaluate order n derivatives of basis function i at given point x in cell (actual implementation)
static void _evaluate_basis_derivatives(std::size_t i,
std::size_t n,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation);
/// Evaluate order n derivatives of basis function i at given point x in cell (non-static member function)
virtual void evaluate_basis_derivatives(std::size_t i,
std::size_t n,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation) const
{
_evaluate_basis_derivatives(i, n, values, x, vertex_coordinates, cell_orientation);
}
/// Evaluate order n derivatives of all basis functions at given point x in cell (actual implementation)
static void _evaluate_basis_derivatives_all(std::size_t n,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation);
/// Evaluate order n derivatives of all basis functions at given point x in cell (non-static member function)
virtual void evaluate_basis_derivatives_all(std::size_t n,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation) const
{
_evaluate_basis_derivatives_all(n, values, x, vertex_coordinates, cell_orientation);
}
/// Evaluate linear functional for dof i on the function f
virtual double evaluate_dof(std::size_t i,
const ufc::function& f,
const double* vertex_coordinates,
int cell_orientation,
const ufc::cell& c) const;
/// Evaluate linear functionals for all dofs on the function f
virtual void evaluate_dofs(double* values,
const ufc::function& f,
const double* vertex_coordinates,
int cell_orientation,
const ufc::cell& c) const;
/// Interpolate vertex values from dof values
virtual void interpolate_vertex_values(double* vertex_values,
const double* dof_values,
const double* vertex_coordinates,
int cell_orientation,
const ufc::cell& c) const;
/// Map coordinate xhat from reference cell to coordinate x in cell
virtual void map_from_reference_cell(double* x,
const double* xhat,
const ufc::cell& c) const;
/// Map from coordinate x in cell to coordinate xhat in reference cell
virtual void map_to_reference_cell(double* xhat,
const double* x,
const ufc::cell& c) const;
/// Return the number of sub elements (for a mixed element)
virtual std::size_t num_sub_elements() const;
/// Create a new finite element for sub element i (for a mixed element)
virtual ufc::finite_element* create_sub_element(std::size_t i) const;
/// Create a new class instance
virtual ufc::finite_element* create() const;
};
/// This class defines the interface for a finite element.
class stiff_finite_element_1: public ufc::finite_element
{
public:
/// Constructor
stiff_finite_element_1();
/// Destructor
virtual ~stiff_finite_element_1();
/// Return a string identifying the finite element
virtual const char* signature() const;
/// Return the cell shape
virtual ufc::shape cell_shape() const;
/// Return the topological dimension of the cell shape
virtual std::size_t topological_dimension() const;
/// Return the geometric dimension of the cell shape
virtual std::size_t geometric_dimension() const;
/// Return the dimension of the finite element function space
virtual std::size_t space_dimension() const;
/// Return the rank of the value space
virtual std::size_t value_rank() const;
/// Return the dimension of the value space for axis i
virtual std::size_t value_dimension(std::size_t i) const;
/// Evaluate basis function i at given point x in cell (actual implementation)
static void _evaluate_basis(std::size_t i,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation);
/// Evaluate basis function i at given point x in cell (non-static member function)
virtual void evaluate_basis(std::size_t i,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation) const
{
_evaluate_basis(i, values, x, vertex_coordinates, cell_orientation);
}
/// Evaluate all basis functions at given point x in cell (actual implementation)
static void _evaluate_basis_all(double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation);
/// Evaluate all basis functions at given point x in cell (non-static member function)
virtual void evaluate_basis_all(double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation) const
{
_evaluate_basis_all(values, x, vertex_coordinates, cell_orientation);
}
/// Evaluate order n derivatives of basis function i at given point x in cell (actual implementation)
static void _evaluate_basis_derivatives(std::size_t i,
std::size_t n,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation);
/// Evaluate order n derivatives of basis function i at given point x in cell (non-static member function)
virtual void evaluate_basis_derivatives(std::size_t i,
std::size_t n,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation) const
{
_evaluate_basis_derivatives(i, n, values, x, vertex_coordinates, cell_orientation);
}
/// Evaluate order n derivatives of all basis functions at given point x in cell (actual implementation)
static void _evaluate_basis_derivatives_all(std::size_t n,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation);
/// Evaluate order n derivatives of all basis functions at given point x in cell (non-static member function)
virtual void evaluate_basis_derivatives_all(std::size_t n,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation) const
{
_evaluate_basis_derivatives_all(n, values, x, vertex_coordinates, cell_orientation);
}
/// Evaluate linear functional for dof i on the function f
virtual double evaluate_dof(std::size_t i,
const ufc::function& f,
const double* vertex_coordinates,
int cell_orientation,
const ufc::cell& c) const;
/// Evaluate linear functionals for all dofs on the function f
virtual void evaluate_dofs(double* values,
const ufc::function& f,
const double* vertex_coordinates,
int cell_orientation,
const ufc::cell& c) const;
/// Interpolate vertex values from dof values
virtual void interpolate_vertex_values(double* vertex_values,
const double* dof_values,
const double* vertex_coordinates,
int cell_orientation,
const ufc::cell& c) const;
/// Map coordinate xhat from reference cell to coordinate x in cell
virtual void map_from_reference_cell(double* x,
const double* xhat,
const ufc::cell& c) const;
/// Map from coordinate x in cell to coordinate xhat in reference cell
virtual void map_to_reference_cell(double* xhat,
const double* x,
const ufc::cell& c) const;
/// Return the number of sub elements (for a mixed element)
virtual std::size_t num_sub_elements() const;
/// Create a new finite element for sub element i (for a mixed element)
virtual ufc::finite_element* create_sub_element(std::size_t i) const;
/// Create a new class instance
virtual ufc::finite_element* create() const;
};
/// This class defines the interface for a finite element.
class stiff_finite_element_2: public ufc::finite_element
{
public:
/// Constructor
stiff_finite_element_2();
/// Destructor
virtual ~stiff_finite_element_2();
/// Return a string identifying the finite element
virtual const char* signature() const;
/// Return the cell shape
virtual ufc::shape cell_shape() const;
/// Return the topological dimension of the cell shape
virtual std::size_t topological_dimension() const;
/// Return the geometric dimension of the cell shape
virtual std::size_t geometric_dimension() const;
/// Return the dimension of the finite element function space
virtual std::size_t space_dimension() const;
/// Return the rank of the value space
virtual std::size_t value_rank() const;
/// Return the dimension of the value space for axis i
virtual std::size_t value_dimension(std::size_t i) const;
/// Evaluate basis function i at given point x in cell (actual implementation)
static void _evaluate_basis(std::size_t i,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation);
/// Evaluate basis function i at given point x in cell (non-static member function)
virtual void evaluate_basis(std::size_t i,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation) const
{
_evaluate_basis(i, values, x, vertex_coordinates, cell_orientation);
}
/// Evaluate all basis functions at given point x in cell (actual implementation)
static void _evaluate_basis_all(double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation);
/// Evaluate all basis functions at given point x in cell (non-static member function)
virtual void evaluate_basis_all(double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation) const
{
_evaluate_basis_all(values, x, vertex_coordinates, cell_orientation);
}
/// Evaluate order n derivatives of basis function i at given point x in cell (actual implementation)
static void _evaluate_basis_derivatives(std::size_t i,
std::size_t n,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation);
/// Evaluate order n derivatives of basis function i at given point x in cell (non-static member function)
virtual void evaluate_basis_derivatives(std::size_t i,
std::size_t n,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation) const
{
_evaluate_basis_derivatives(i, n, values, x, vertex_coordinates, cell_orientation);
}
/// Evaluate order n derivatives of all basis functions at given point x in cell (actual implementation)
static void _evaluate_basis_derivatives_all(std::size_t n,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation);
/// Evaluate order n derivatives of all basis functions at given point x in cell (non-static member function)
virtual void evaluate_basis_derivatives_all(std::size_t n,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation) const
{
_evaluate_basis_derivatives_all(n, values, x, vertex_coordinates, cell_orientation);
}
/// Evaluate linear functional for dof i on the function f
virtual double evaluate_dof(std::size_t i,
const ufc::function& f,
const double* vertex_coordinates,
int cell_orientation,
const ufc::cell& c) const;
/// Evaluate linear functionals for all dofs on the function f
virtual void evaluate_dofs(double* values,
const ufc::function& f,
const double* vertex_coordinates,
int cell_orientation,
const ufc::cell& c) const;
/// Interpolate vertex values from dof values
virtual void interpolate_vertex_values(double* vertex_values,
const double* dof_values,
const double* vertex_coordinates,
int cell_orientation,
const ufc::cell& c) const;
/// Map coordinate xhat from reference cell to coordinate x in cell
virtual void map_from_reference_cell(double* x,
const double* xhat,
const ufc::cell& c) const;
/// Map from coordinate x in cell to coordinate xhat in reference cell
virtual void map_to_reference_cell(double* xhat,
const double* x,
const ufc::cell& c) const;
/// Return the number of sub elements (for a mixed element)
virtual std::size_t num_sub_elements() const;
/// Create a new finite element for sub element i (for a mixed element)
virtual ufc::finite_element* create_sub_element(std::size_t i) const;
/// Create a new class instance
virtual ufc::finite_element* create() const;
};
/// This class defines the interface for a finite element.
class stiff_finite_element_3: public ufc::finite_element
{
public:
/// Constructor
stiff_finite_element_3();
/// Destructor
virtual ~stiff_finite_element_3();
/// Return a string identifying the finite element
virtual const char* signature() const;
/// Return the cell shape
virtual ufc::shape cell_shape() const;
/// Return the topological dimension of the cell shape
virtual std::size_t topological_dimension() const;
/// Return the geometric dimension of the cell shape
virtual std::size_t geometric_dimension() const;
/// Return the dimension of the finite element function space
virtual std::size_t space_dimension() const;
/// Return the rank of the value space
virtual std::size_t value_rank() const;
/// Return the dimension of the value space for axis i
virtual std::size_t value_dimension(std::size_t i) const;
/// Evaluate basis function i at given point x in cell (actual implementation)
static void _evaluate_basis(std::size_t i,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation);
/// Evaluate basis function i at given point x in cell (non-static member function)
virtual void evaluate_basis(std::size_t i,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation) const
{
_evaluate_basis(i, values, x, vertex_coordinates, cell_orientation);
}
/// Evaluate all basis functions at given point x in cell (actual implementation)
static void _evaluate_basis_all(double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation);
/// Evaluate all basis functions at given point x in cell (non-static member function)
virtual void evaluate_basis_all(double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation) const
{
_evaluate_basis_all(values, x, vertex_coordinates, cell_orientation);
}
/// Evaluate order n derivatives of basis function i at given point x in cell (actual implementation)
static void _evaluate_basis_derivatives(std::size_t i,
std::size_t n,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation);
/// Evaluate order n derivatives of basis function i at given point x in cell (non-static member function)
virtual void evaluate_basis_derivatives(std::size_t i,
std::size_t n,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation) const
{
_evaluate_basis_derivatives(i, n, values, x, vertex_coordinates, cell_orientation);
}
/// Evaluate order n derivatives of all basis functions at given point x in cell (actual implementation)
static void _evaluate_basis_derivatives_all(std::size_t n,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation);
/// Evaluate order n derivatives of all basis functions at given point x in cell (non-static member function)
virtual void evaluate_basis_derivatives_all(std::size_t n,
double* values,
const double* x,
const double* vertex_coordinates,
int cell_orientation) const
{
_evaluate_basis_derivatives_all(n, values, x, vertex_coordinates, cell_orientation);
}
/// Evaluate linear functional for dof i on the function f
virtual double evaluate_dof(std::size_t i,
const ufc::function& f,
const double* vertex_coordinates,
int cell_orientation,
const ufc::cell& c) const;
/// Evaluate linear functionals for all dofs on the function f
virtual void evaluate_dofs(double* values,
const ufc::function& f,
const double* vertex_coordinates,
int cell_orientation,
const ufc::cell& c) const;
/// Interpolate vertex values from dof values
virtual void interpolate_vertex_values(double* vertex_values,
const double* dof_values,
const double* vertex_coordinates,
int cell_orientation,
const ufc::cell& c) const;
/// Map coordinate xhat from reference cell to coordinate x in cell
virtual void map_from_reference_cell(double* x,
const double* xhat,
const ufc::cell& c) const;
/// Map from coordinate x in cell to coordinate xhat in reference cell
virtual void map_to_reference_cell(double* xhat,
const double* x,
const ufc::cell& c) const;
/// Return the number of sub elements (for a mixed element)
virtual std::size_t num_sub_elements() const;
/// Create a new finite element for sub element i (for a mixed element)
virtual ufc::finite_element* create_sub_element(std::size_t i) const;
/// Create a new class instance
virtual ufc::finite_element* create() const;
};
/// This class defines the interface for a local-to-global mapping of
/// degrees of freedom (dofs).
class stiff_dofmap_0: public ufc::dofmap
{
public:
/// Constructor
stiff_dofmap_0();
/// Destructor
virtual ~stiff_dofmap_0();
/// Return a string identifying the dofmap
virtual const char* signature() const;
/// Return true iff mesh entities of topological dimension d are needed
virtual bool needs_mesh_entities(std::size_t d) const;
/// Return the topological dimension of the associated cell shape
virtual std::size_t topological_dimension() const;
/// Return the geometric dimension of the associated cell shape
virtual std::size_t geometric_dimension() const;
/// Return the dimension of the global finite element function space
virtual std::size_t global_dimension(const std::vector<std::size_t>&
num_global_entities) const;
/// Return the dimension of the local finite element function space for a cell
virtual std::size_t local_dimension() const;
/// Return the number of dofs on each cell facet
virtual std::size_t num_facet_dofs() const;
/// Return the number of dofs associated with each cell entity of dimension d
virtual std::size_t num_entity_dofs(std::size_t d) const;
/// Tabulate the local-to-global mapping of dofs on a cell
virtual void tabulate_dofs(std::size_t* dofs,
const std::vector<std::size_t>& num_global_entities,
const ufc::cell& c) const;
/// Tabulate the local-to-local mapping from facet dofs to cell dofs
virtual void tabulate_facet_dofs(std::size_t* dofs,
std::size_t facet) const;
/// Tabulate the local-to-local mapping of dofs on entity (d, i)
virtual void tabulate_entity_dofs(std::size_t* dofs,
std::size_t d, std::size_t i) const;
/// Tabulate the coordinates of all dofs on a cell
virtual void tabulate_coordinates(double** coordinates,
const double* vertex_coordinates) const;
/// Return the number of sub dofmaps (for a mixed element)
virtual std::size_t num_sub_dofmaps() const;
/// Create a new dofmap for sub dofmap i (for a mixed element)
virtual ufc::dofmap* create_sub_dofmap(std::size_t i) const;
/// Create a new class instance
virtual ufc::dofmap* create() const;
};
/// This class defines the interface for a local-to-global mapping of
/// degrees of freedom (dofs).
class stiff_dofmap_1: public ufc::dofmap
{
public:
/// Constructor
stiff_dofmap_1();
/// Destructor
virtual ~stiff_dofmap_1();
/// Return a string identifying the dofmap
virtual const char* signature() const;
/// Return true iff mesh entities of topological dimension d are needed
virtual bool needs_mesh_entities(std::size_t d) const;
/// Return the topological dimension of the associated cell shape
virtual std::size_t topological_dimension() const;
/// Return the geometric dimension of the associated cell shape
virtual std::size_t geometric_dimension() const;
/// Return the dimension of the global finite element function space
virtual std::size_t global_dimension(const std::vector<std::size_t>&
num_global_entities) const;
/// Return the dimension of the local finite element function space for a cell
virtual std::size_t local_dimension() const;
/// Return the number of dofs on each cell facet
virtual std::size_t num_facet_dofs() const;
/// Return the number of dofs associated with each cell entity of dimension d
virtual std::size_t num_entity_dofs(std::size_t d) const;
/// Tabulate the local-to-global mapping of dofs on a cell
virtual void tabulate_dofs(std::size_t* dofs,
const std::vector<std::size_t>& num_global_entities,
const ufc::cell& c) const;
/// Tabulate the local-to-local mapping from facet dofs to cell dofs
virtual void tabulate_facet_dofs(std::size_t* dofs,
std::size_t facet) const;
/// Tabulate the local-to-local mapping of dofs on entity (d, i)
virtual void tabulate_entity_dofs(std::size_t* dofs,
std::size_t d, std::size_t i) const;
/// Tabulate the coordinates of all dofs on a cell
virtual void tabulate_coordinates(double** coordinates,
const double* vertex_coordinates) const;
/// Return the number of sub dofmaps (for a mixed element)
virtual std::size_t num_sub_dofmaps() const;
/// Create a new dofmap for sub dofmap i (for a mixed element)
virtual ufc::dofmap* create_sub_dofmap(std::size_t i) const;
/// Create a new class instance
virtual ufc::dofmap* create() const;
};
/// This class defines the interface for a local-to-global mapping of
/// degrees of freedom (dofs).
class stiff_dofmap_2: public ufc::dofmap
{
public:
/// Constructor
stiff_dofmap_2();
/// Destructor
virtual ~stiff_dofmap_2();
/// Return a string identifying the dofmap
virtual const char* signature() const;
/// Return true iff mesh entities of topological dimension d are needed
virtual bool needs_mesh_entities(std::size_t d) const;
/// Return the topological dimension of the associated cell shape
virtual std::size_t topological_dimension() const;
/// Return the geometric dimension of the associated cell shape
virtual std::size_t geometric_dimension() const;
/// Return the dimension of the global finite element function space
virtual std::size_t global_dimension(const std::vector<std::size_t>&
num_global_entities) const;
/// Return the dimension of the local finite element function space for a cell
virtual std::size_t local_dimension() const;
/// Return the number of dofs on each cell facet
virtual std::size_t num_facet_dofs() const;
/// Return the number of dofs associated with each cell entity of dimension d
virtual std::size_t num_entity_dofs(std::size_t d) const;
/// Tabulate the local-to-global mapping of dofs on a cell
virtual void tabulate_dofs(std::size_t* dofs,
const std::vector<std::size_t>& num_global_entities,
const ufc::cell& c) const;
/// Tabulate the local-to-local mapping from facet dofs to cell dofs
virtual void tabulate_facet_dofs(std::size_t* dofs,
std::size_t facet) const;
/// Tabulate the local-to-local mapping of dofs on entity (d, i)
virtual void tabulate_entity_dofs(std::size_t* dofs,
std::size_t d, std::size_t i) const;
/// Tabulate the coordinates of all dofs on a cell
virtual void tabulate_coordinates(double** coordinates,
const double* vertex_coordinates) const;
/// Return the number of sub dofmaps (for a mixed element)
virtual std::size_t num_sub_dofmaps() const;
/// Create a new dofmap for sub dofmap i (for a mixed element)
virtual ufc::dofmap* create_sub_dofmap(std::size_t i) const;
/// Create a new class instance
virtual ufc::dofmap* create() const;
};
/// This class defines the interface for a local-to-global mapping of
/// degrees of freedom (dofs).
class stiff_dofmap_3: public ufc::dofmap
{
public:
/// Constructor
stiff_dofmap_3();
/// Destructor
virtual ~stiff_dofmap_3();
/// Return a string identifying the dofmap
virtual const char* signature() const;
/// Return true iff mesh entities of topological dimension d are needed
virtual bool needs_mesh_entities(std::size_t d) const;
/// Return the topological dimension of the associated cell shape
virtual std::size_t topological_dimension() const;
/// Return the geometric dimension of the associated cell shape
virtual std::size_t geometric_dimension() const;
/// Return the dimension of the global finite element function space
virtual std::size_t global_dimension(const std::vector<std::size_t>&
num_global_entities) const;
/// Return the dimension of the local finite element function space for a cell
virtual std::size_t local_dimension() const;
/// Return the number of dofs on each cell facet
virtual std::size_t num_facet_dofs() const;
/// Return the number of dofs associated with each cell entity of dimension d
virtual std::size_t num_entity_dofs(std::size_t d) const;
/// Tabulate the local-to-global mapping of dofs on a cell
virtual void tabulate_dofs(std::size_t* dofs,
const std::vector<std::size_t>& num_global_entities,
const ufc::cell& c) const;
/// Tabulate the local-to-local mapping from facet dofs to cell dofs
virtual void tabulate_facet_dofs(std::size_t* dofs,
std::size_t facet) const;
/// Tabulate the local-to-local mapping of dofs on entity (d, i)
virtual void tabulate_entity_dofs(std::size_t* dofs,
std::size_t d, std::size_t i) const;
/// Tabulate the coordinates of all dofs on a cell
virtual void tabulate_coordinates(double** coordinates,
const double* vertex_coordinates) const;
/// Return the number of sub dofmaps (for a mixed element)
virtual std::size_t num_sub_dofmaps() const;
/// Create a new dofmap for sub dofmap i (for a mixed element)
virtual ufc::dofmap* create_sub_dofmap(std::size_t i) const;
/// Create a new class instance
virtual ufc::dofmap* create() const;
};
/// This class defines the interface for the tabulation of the cell
/// tensor corresponding to the local contribution to a form from
/// the integral over a cell.
class stiff_cell_integral_0_otherwise: public ufc::cell_integral
{
public:
/// Constructor
stiff_cell_integral_0_otherwise();
/// Destructor
virtual ~stiff_cell_integral_0_otherwise();
/// Tabulate which form coefficients are used by this integral
virtual const std::vector<bool> & enabled_coefficients() const;
/// Tabulate the tensor for the contribution from a local cell
virtual void tabulate_tensor(double* A,
const double * const * w,
const double* vertex_coordinates,
int cell_orientation) const;
};
/// This class defines the interface for the tabulation of the
/// interior facet tensor corresponding to the local contribution to
/// a form from the integral over an interior facet.
class stiff_interior_facet_integral_0_otherwise: public ufc::interior_facet_integral
{
public:
/// Constructor
stiff_interior_facet_integral_0_otherwise();
/// Destructor
virtual ~stiff_interior_facet_integral_0_otherwise();
/// Tabulate which form coefficients are used by this integral
virtual const std::vector<bool> & enabled_coefficients() const;
/// Tabulate the tensor for the contribution from a local interior facet
virtual void tabulate_tensor(double* A,
const double * const * w,
const double* vertex_coordinates_0,
const double* vertex_coordinates_1,
std::size_t facet_0,
std::size_t facet_1,
int cell_orientation_0,
int cell_orientation_1) const;
};
/// This class defines the interface for the tabulation of the cell
/// tensor corresponding to the local contribution to a form from
/// the integral over a cell.
class stiff_cell_integral_1_otherwise: public ufc::cell_integral
{
public:
/// Constructor
stiff_cell_integral_1_otherwise();
/// Destructor
virtual ~stiff_cell_integral_1_otherwise();
/// Tabulate which form coefficients are used by this integral
virtual const std::vector<bool> & enabled_coefficients() const;
/// Tabulate the tensor for the contribution from a local cell
virtual void tabulate_tensor(double* A,
const double * const * w,
const double* vertex_coordinates,
int cell_orientation) const;
};
/// This class defines the interface for the assembly of the global
/// tensor corresponding to a form with r + n arguments, that is, a
/// mapping
///
/// a : V1 x V2 x ... Vr x W1 x W2 x ... x Wn -> R
///
/// with arguments v1, v2, ..., vr, w1, w2, ..., wn. The rank r
/// global tensor A is defined by
///
/// A = a(V1, V2, ..., Vr, w1, w2, ..., wn),
///
/// where each argument Vj represents the application to the
/// sequence of basis functions of Vj and w1, w2, ..., wn are given
/// fixed functions (coefficients).
class stiff_form_0: public ufc::form
{
public:
/// Constructor
stiff_form_0();
/// Destructor
virtual ~stiff_form_0();
/// Return a string identifying the form
virtual const char* signature() const;
/// Return the rank of the global tensor (r)
virtual std::size_t rank() const;
/// Return the number of coefficients (n)
virtual std::size_t num_coefficients() const;
/// Return the number of cell domains
virtual std::size_t num_cell_domains() const;
/// Return the number of exterior facet domains
virtual std::size_t num_exterior_facet_domains() const;
/// Return the number of interior facet domains
virtual std::size_t num_interior_facet_domains() const;
/// Return the number of point domains
virtual std::size_t num_point_domains() const;
/// Return the number of custom domains
virtual std::size_t num_custom_domains() const;
/// Return whether the form has any cell integrals
virtual bool has_cell_integrals() const;
/// Return whether the form has any exterior facet integrals
virtual bool has_exterior_facet_integrals() const;
/// Return whether the form has any interior facet integrals
virtual bool has_interior_facet_integrals() const;
/// Return whether the form has any point integrals
virtual bool has_point_integrals() const;
/// Return whether the form has any custom integrals
virtual bool has_custom_integrals() const;
/// Create a new finite element for argument function i
virtual ufc::finite_element* create_finite_element(std::size_t i) const;
/// Create a new dofmap for argument function i
virtual ufc::dofmap* create_dofmap(std::size_t i) const;
/// Create a new cell integral on sub domain i
virtual ufc::cell_integral* create_cell_integral(std::size_t i) const;
/// Create a new exterior facet integral on sub domain i
virtual ufc::exterior_facet_integral* create_exterior_facet_integral(std::size_t i) const;
/// Create a new interior facet integral on sub domain i
virtual ufc::interior_facet_integral* create_interior_facet_integral(std::size_t i) const;
/// Create a new point integral on sub domain i
virtual ufc::point_integral* create_point_integral(std::size_t i) const;
/// Create a new custom integral on sub domain i
virtual ufc::custom_integral* create_custom_integral(std::size_t i) const;
/// Create a new cell integral on everywhere else
virtual ufc::cell_integral* create_default_cell_integral() const;
/// Create a new exterior facet integral on everywhere else
virtual ufc::exterior_facet_integral* create_default_exterior_facet_integral() const;
/// Create a new interior facet integral on everywhere else
virtual ufc::interior_facet_integral* create_default_interior_facet_integral() const;
/// Create a new point integral on everywhere else
virtual ufc::point_integral* create_default_point_integral() const;
/// Create a new custom integral on everywhere else
virtual ufc::custom_integral* create_default_custom_integral() const;
};
/// This class defines the interface for the assembly of the global
/// tensor corresponding to a form with r + n arguments, that is, a
/// mapping
///
/// a : V1 x V2 x ... Vr x W1 x W2 x ... x Wn -> R
///
/// with arguments v1, v2, ..., vr, w1, w2, ..., wn. The rank r
/// global tensor A is defined by
///
/// A = a(V1, V2, ..., Vr, w1, w2, ..., wn),
///
/// where each argument Vj represents the application to the
/// sequence of basis functions of Vj and w1, w2, ..., wn are given
/// fixed functions (coefficients).
class stiff_form_1: public ufc::form
{
public:
/// Constructor
stiff_form_1();
/// Destructor
virtual ~stiff_form_1();
/// Return a string identifying the form
virtual const char* signature() const;
/// Return the rank of the global tensor (r)
virtual std::size_t rank() const;
/// Return the number of coefficients (n)
virtual std::size_t num_coefficients() const;
/// Return the number of cell domains
virtual std::size_t num_cell_domains() const;
/// Return the number of exterior facet domains
virtual std::size_t num_exterior_facet_domains() const;
/// Return the number of interior facet domains
virtual std::size_t num_interior_facet_domains() const;
/// Return the number of point domains
virtual std::size_t num_point_domains() const;
/// Return the number of custom domains
virtual std::size_t num_custom_domains() const;
/// Return whether the form has any cell integrals
virtual bool has_cell_integrals() const;
/// Return whether the form has any exterior facet integrals
virtual bool has_exterior_facet_integrals() const;
/// Return whether the form has any interior facet integrals
virtual bool has_interior_facet_integrals() const;
/// Return whether the form has any point integrals
virtual bool has_point_integrals() const;
/// Return whether the form has any custom integrals
virtual bool has_custom_integrals() const;
/// Create a new finite element for argument function i
virtual ufc::finite_element* create_finite_element(std::size_t i) const;
/// Create a new dofmap for argument function i
virtual ufc::dofmap* create_dofmap(std::size_t i) const;
/// Create a new cell integral on sub domain i
virtual ufc::cell_integral* create_cell_integral(std::size_t i) const;
/// Create a new exterior facet integral on sub domain i
virtual ufc::exterior_facet_integral* create_exterior_facet_integral(std::size_t i) const;
/// Create a new interior facet integral on sub domain i
virtual ufc::interior_facet_integral* create_interior_facet_integral(std::size_t i) const;
/// Create a new point integral on sub domain i
virtual ufc::point_integral* create_point_integral(std::size_t i) const;
/// Create a new custom integral on sub domain i
virtual ufc::custom_integral* create_custom_integral(std::size_t i) const;
/// Create a new cell integral on everywhere else
virtual ufc::cell_integral* create_default_cell_integral() const;
/// Create a new exterior facet integral on everywhere else
virtual ufc::exterior_facet_integral* create_default_exterior_facet_integral() const;
/// Create a new interior facet integral on everywhere else
virtual ufc::interior_facet_integral* create_default_interior_facet_integral() const;
/// Create a new point integral on everywhere else
virtual ufc::point_integral* create_default_point_integral() const;
/// Create a new custom integral on everywhere else
virtual ufc::custom_integral* create_default_custom_integral() const;
};
// DOLFIN wrappers
// Standard library includes
#include <string>
// DOLFIN includes
#include <dolfin/common/NoDeleter.h>
#include <dolfin/mesh/Restriction.h>
#include <dolfin/fem/FiniteElement.h>
#include <dolfin/fem/DofMap.h>
#include <dolfin/fem/Form.h>
#include <dolfin/function/FunctionSpace.h>
#include <dolfin/function/GenericFunction.h>
#include <dolfin/function/CoefficientAssigner.h>
#include <dolfin/adaptivity/ErrorControl.h>
#include <dolfin/adaptivity/GoalFunctional.h>
namespace Stiff
{
class CoefficientSpace_f: public dolfin::FunctionSpace
{
public:
//--- Constructors for standard function space, 2 different versions ---
// Create standard function space (reference version)
CoefficientSpace_f(const dolfin::Mesh& mesh):
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_2()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_2()), mesh)))
{
// Do nothing
}
// Create standard function space (shared pointer version)
CoefficientSpace_f(std::shared_ptr<const dolfin::Mesh> mesh):
dolfin::FunctionSpace(mesh,
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_2()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_2()), *mesh)))
{
// Do nothing
}
//--- Constructors for constrained function space, 2 different versions ---
// Create standard function space (reference version)
CoefficientSpace_f(const dolfin::Mesh& mesh, const dolfin::SubDomain& constrained_domain):
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_2()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_2()), mesh,
dolfin::reference_to_no_delete_pointer(constrained_domain))))
{
// Do nothing
}
// Create standard function space (shared pointer version)
CoefficientSpace_f(std::shared_ptr<const dolfin::Mesh> mesh, std::shared_ptr<const dolfin::SubDomain> constrained_domain):
dolfin::FunctionSpace(mesh,
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_2()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_2()), *mesh, constrained_domain)))
{
// Do nothing
}
//--- Constructors for restricted function space, 2 different versions ---
// Create restricted function space (reference version)
CoefficientSpace_f(const dolfin::Restriction& restriction):
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(restriction.mesh()),
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_2()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_2()),
reference_to_no_delete_pointer(restriction))))
{
// Do nothing
}
// Create restricted function space (shared pointer version)
CoefficientSpace_f(std::shared_ptr<const dolfin::Restriction> restriction):
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(restriction->mesh()),
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_2()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_2()),
restriction)))
{
// Do nothing
}
// Copy constructor
~CoefficientSpace_f()
{
}
};
class Form_a_FunctionSpace_0: public dolfin::FunctionSpace
{
public:
//--- Constructors for standard function space, 2 different versions ---
// Create standard function space (reference version)
Form_a_FunctionSpace_0(const dolfin::Mesh& mesh):
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_3()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_3()), mesh)))
{
// Do nothing
}
// Create standard function space (shared pointer version)
Form_a_FunctionSpace_0(std::shared_ptr<const dolfin::Mesh> mesh):
dolfin::FunctionSpace(mesh,
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_3()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_3()), *mesh)))
{
// Do nothing
}
//--- Constructors for constrained function space, 2 different versions ---
// Create standard function space (reference version)
Form_a_FunctionSpace_0(const dolfin::Mesh& mesh, const dolfin::SubDomain& constrained_domain):
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_3()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_3()), mesh,
dolfin::reference_to_no_delete_pointer(constrained_domain))))
{
// Do nothing
}
// Create standard function space (shared pointer version)
Form_a_FunctionSpace_0(std::shared_ptr<const dolfin::Mesh> mesh, std::shared_ptr<const dolfin::SubDomain> constrained_domain):
dolfin::FunctionSpace(mesh,
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_3()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_3()), *mesh, constrained_domain)))
{
// Do nothing
}
//--- Constructors for restricted function space, 2 different versions ---
// Create restricted function space (reference version)
Form_a_FunctionSpace_0(const dolfin::Restriction& restriction):
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(restriction.mesh()),
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_3()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_3()),
reference_to_no_delete_pointer(restriction))))
{
// Do nothing
}
// Create restricted function space (shared pointer version)
Form_a_FunctionSpace_0(std::shared_ptr<const dolfin::Restriction> restriction):
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(restriction->mesh()),
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_3()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_3()),
restriction)))
{
// Do nothing
}
// Copy constructor
~Form_a_FunctionSpace_0()
{
}
};
class Form_a_FunctionSpace_1: public dolfin::FunctionSpace
{
public:
//--- Constructors for standard function space, 2 different versions ---
// Create standard function space (reference version)
Form_a_FunctionSpace_1(const dolfin::Mesh& mesh):
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_3()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_3()), mesh)))
{
// Do nothing
}
// Create standard function space (shared pointer version)
Form_a_FunctionSpace_1(std::shared_ptr<const dolfin::Mesh> mesh):
dolfin::FunctionSpace(mesh,
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_3()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_3()), *mesh)))
{
// Do nothing
}
//--- Constructors for constrained function space, 2 different versions ---
// Create standard function space (reference version)
Form_a_FunctionSpace_1(const dolfin::Mesh& mesh, const dolfin::SubDomain& constrained_domain):
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_3()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_3()), mesh,
dolfin::reference_to_no_delete_pointer(constrained_domain))))
{
// Do nothing
}
// Create standard function space (shared pointer version)
Form_a_FunctionSpace_1(std::shared_ptr<const dolfin::Mesh> mesh, std::shared_ptr<const dolfin::SubDomain> constrained_domain):
dolfin::FunctionSpace(mesh,
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_3()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_3()), *mesh, constrained_domain)))
{
// Do nothing
}
//--- Constructors for restricted function space, 2 different versions ---
// Create restricted function space (reference version)
Form_a_FunctionSpace_1(const dolfin::Restriction& restriction):
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(restriction.mesh()),
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_3()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_3()),
reference_to_no_delete_pointer(restriction))))
{
// Do nothing
}
// Create restricted function space (shared pointer version)
Form_a_FunctionSpace_1(std::shared_ptr<const dolfin::Restriction> restriction):
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(restriction->mesh()),
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_3()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_3()),
restriction)))
{
// Do nothing
}
// Copy constructor
~Form_a_FunctionSpace_1()
{
}
};
class Form_a: public dolfin::Form
{
public:
// Constructor
Form_a(const dolfin::FunctionSpace& V1, const dolfin::FunctionSpace& V0):
dolfin::Form(2, 0)
{
_function_spaces[0] = reference_to_no_delete_pointer(V0);
_function_spaces[1] = reference_to_no_delete_pointer(V1);
_ufc_form = std::shared_ptr<const ufc::form>(new stiff_form_0());
}
// Constructor
Form_a(std::shared_ptr<const dolfin::FunctionSpace> V1, std::shared_ptr<const dolfin::FunctionSpace> V0):
dolfin::Form(2, 0)
{
_function_spaces[0] = V0;
_function_spaces[1] = V1;
_ufc_form = std::shared_ptr<const ufc::form>(new stiff_form_0());
}
// Destructor
~Form_a()
{}
/// Return the number of the coefficient with this name
virtual std::size_t coefficient_number(const std::string& name) const
{
dolfin::dolfin_error("generated code for class Form",
"access coefficient data",
"There are no coefficients");
return 0;
}
/// Return the name of the coefficient with this number
virtual std::string coefficient_name(std::size_t i) const
{
dolfin::dolfin_error("generated code for class Form",
"access coefficient data",
"There are no coefficients");
return "unnamed";
}
// Typedefs
typedef Form_a_FunctionSpace_0 TestSpace;
typedef Form_a_FunctionSpace_1 TrialSpace;
// Coefficients
};
class Form_L_FunctionSpace_0: public dolfin::FunctionSpace
{
public:
//--- Constructors for standard function space, 2 different versions ---
// Create standard function space (reference version)
Form_L_FunctionSpace_0(const dolfin::Mesh& mesh):
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_3()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_3()), mesh)))
{
// Do nothing
}
// Create standard function space (shared pointer version)
Form_L_FunctionSpace_0(std::shared_ptr<const dolfin::Mesh> mesh):
dolfin::FunctionSpace(mesh,
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_3()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_3()), *mesh)))
{
// Do nothing
}
//--- Constructors for constrained function space, 2 different versions ---
// Create standard function space (reference version)
Form_L_FunctionSpace_0(const dolfin::Mesh& mesh, const dolfin::SubDomain& constrained_domain):
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(mesh),
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_3()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_3()), mesh,
dolfin::reference_to_no_delete_pointer(constrained_domain))))
{
// Do nothing
}
// Create standard function space (shared pointer version)
Form_L_FunctionSpace_0(std::shared_ptr<const dolfin::Mesh> mesh, std::shared_ptr<const dolfin::SubDomain> constrained_domain):
dolfin::FunctionSpace(mesh,
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_3()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_3()), *mesh, constrained_domain)))
{
// Do nothing
}
//--- Constructors for restricted function space, 2 different versions ---
// Create restricted function space (reference version)
Form_L_FunctionSpace_0(const dolfin::Restriction& restriction):
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(restriction.mesh()),
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_3()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_3()),
reference_to_no_delete_pointer(restriction))))
{
// Do nothing
}
// Create restricted function space (shared pointer version)
Form_L_FunctionSpace_0(std::shared_ptr<const dolfin::Restriction> restriction):
dolfin::FunctionSpace(dolfin::reference_to_no_delete_pointer(restriction->mesh()),
std::shared_ptr<const dolfin::FiniteElement>(new dolfin::FiniteElement(std::shared_ptr<ufc::finite_element>(new stiff_finite_element_3()))),
std::shared_ptr<const dolfin::DofMap>(new dolfin::DofMap(std::shared_ptr<ufc::dofmap>(new stiff_dofmap_3()),
restriction)))
{
// Do nothing
}
// Copy constructor
~Form_L_FunctionSpace_0()
{
}
};
typedef CoefficientSpace_f Form_L_FunctionSpace_1;
class Form_L: public dolfin::Form
{
public:
// Constructor
Form_L(const dolfin::FunctionSpace& V0):
dolfin::Form(1, 1), f(*this, 0)
{
_function_spaces[0] = reference_to_no_delete_pointer(V0);
_ufc_form = std::shared_ptr<const ufc::form>(new stiff_form_1());
}
// Constructor
Form_L(const dolfin::FunctionSpace& V0, const dolfin::GenericFunction& f):
dolfin::Form(1, 1), f(*this, 0)
{
_function_spaces[0] = reference_to_no_delete_pointer(V0);
this->f = f;
_ufc_form = std::shared_ptr<const ufc::form>(new stiff_form_1());
}
// Constructor
Form_L(const dolfin::FunctionSpace& V0, std::shared_ptr<const dolfin::GenericFunction> f):
dolfin::Form(1, 1), f(*this, 0)
{
_function_spaces[0] = reference_to_no_delete_pointer(V0);
this->f = *f;
_ufc_form = std::shared_ptr<const ufc::form>(new stiff_form_1());
}
// Constructor
Form_L(std::shared_ptr<const dolfin::FunctionSpace> V0):
dolfin::Form(1, 1), f(*this, 0)
{
_function_spaces[0] = V0;
_ufc_form = std::shared_ptr<const ufc::form>(new stiff_form_1());
}
// Constructor
Form_L(std::shared_ptr<const dolfin::FunctionSpace> V0, const dolfin::GenericFunction& f):
dolfin::Form(1, 1), f(*this, 0)
{
_function_spaces[0] = V0;
this->f = f;
_ufc_form = std::shared_ptr<const ufc::form>(new stiff_form_1());
}
// Constructor
Form_L(std::shared_ptr<const dolfin::FunctionSpace> V0, std::shared_ptr<const dolfin::GenericFunction> f):
dolfin::Form(1, 1), f(*this, 0)
{
_function_spaces[0] = V0;
this->f = *f;
_ufc_form = std::shared_ptr<const ufc::form>(new stiff_form_1());
}
// Destructor
~Form_L()
{}
/// Return the number of the coefficient with this name
virtual std::size_t coefficient_number(const std::string& name) const
{
if (name == "f")
return 0;
dolfin::dolfin_error("generated code for class Form",
"access coefficient data",
"Invalid coefficient");
return 0;
}
/// Return the name of the coefficient with this number
virtual std::string coefficient_name(std::size_t i) const
{
switch (i)
{
case 0:
return "f";
}
dolfin::dolfin_error("generated code for class Form",
"access coefficient data",
"Invalid coefficient");
return "unnamed";
}
// Typedefs
typedef Form_L_FunctionSpace_0 TestSpace;
typedef Form_L_FunctionSpace_1 CoefficientSpace_f;
// Coefficients
dolfin::CoefficientAssigner f;
};
// Class typedefs
typedef Form_a BilinearForm;
typedef Form_a JacobianForm;
typedef Form_L LinearForm;
typedef Form_L ResidualForm;
typedef Form_a::TestSpace FunctionSpace;
}
#endif
| [
"psywah@gmail.com"
] | psywah@gmail.com |
b97ef6393d535a438baee7f31ed838fd4804d4ef | c3f83532f5e1d516a6ac90f840fa4866bedb1f7e | /DimmableLEDActuator/DimmableLEDActuator.ino | 592ed9436fe7c8bb4e64c1e8bd1cd7c149469728 | [] | no_license | CarstenLeonhardt/Sensors | 7af4494e60750cd426b958ab517a058075b6a0b0 | ee7aa441624e0051bf6598c63e423210cbcc7016 | refs/heads/master | 2020-04-07T14:42:41.770564 | 2020-01-23T13:15:21 | 2020-01-23T13:15:21 | 124,219,963 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,784 | ino | /**
The MySensors Arduino library handles the wireless radio link and protocol
between your home built sensors/actuators and HA controller of choice.
The sensors forms a self healing radio network with optional repeaters. Each
repeater and gateway builds a routing tables in EEPROM which keeps track of the
network topology allowing messages to be routed to nodes.
Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
Copyright (C) 2013-2015 Sensnology AB
Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
Documentation: http://www.mysensors.org
Support Forum: http://forum.mysensors.org
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
*******************************
REVISION HISTORY
Version 1.0 - February 15, 2014 - Bruce Lacey
Version 1.1 - August 13, 2014 - Converted to 1.4 (hek)
Version 1.2 - 21-11-2017 - Used seperate inputs, for each output, adjusted timeout time
DESCRIPTION
This sketch provides a Dimmable LED Light using PWM and based Henrik Ekblad
<henrik.ekblad@gmail.com> Vera Arduino Sensor project.
Developed by Bruce Lacey, inspired by Hek's MySensor's example sketches.
The circuit uses a MOSFET for Pulse-Wave-Modulation to dim the attached LED or LED strip.
The MOSFET Gate pin is connected to Arduino pin 3 (LED_PIN), the MOSFET Drain pin is connected
to the LED negative terminal and the MOSFET Source pin is connected to ground.
This sketch is extensible to support more than one MOSFET/PWM dimmer per circuit.
http://www.mysensors.org/build/dimmer
*/
/// LED Controller 1. floor cabinets
// Enable mysensor support
//#define MYSENSOR 1
// Enable serial port logging
#define LED_DIMMING_LOG_ENABLE 1// Log LED levels
#define DIGITAL_IN_LOG_ENABLE 1 // Log digital input state
//#define MY_DEBUG 1
#ifdef MYSENSOR
// Enable debug prints to serial monitor
#define MY_DEBUG
// Enable and select radio type attached
#define MY_RADIO_NRF24
// Sets a static id for a node
#define MY_NODE_ID 45
/////needs testing with radion on another pin
#define MY_RF24_CE_PIN 9//4 // Radio specific settings for RF24
// Include the MySensorLib
#include <MySensors.h>
//Name
#define SN "DimmableLED"
// Software Version
#define SV "1.1"
#endif
#define IN_PIN1 14 // A0 Arduino pin attached to magnetic sensor
#define IN_PIN2 15 // A1 Arduino pin attached to magnetic sensor
#define IN_PIN3 16 // A2 Arduino pin attached to magnetic sensor
#define IN_PIN4 17 // A3 Arduino pin attached to magnetic sensor
#define LED_PIN1 3 // Arduino pin attached to MOSFET Gate pin
#define LED_PIN2 5 // Arduino pin attached to MOSFET Gate pin
#define LED_PIN3 6 // Arduino pin attached to MOSFET Gate pin
#define LED_PIN4 9 //grr., used by mysensor for radio Arduino pin attached to MOSFET Gate pin
#define LED_COUNT 4 // number of LEDS/inputs
#define FADE_DELAY 5//10 // Delay in ms for each percentage fade up/down (10ms = 1s full-range dim)
#define LED_MAX 100//255 // LED max light level
#define LED_MIN 0 // LED min light level
#define LED__STEP_UP 5 // LED steps whe dimming up
#define LED__STEP_DOWN 10 // LED steps whe dimming down
//led service interval
#define LED_LOOP_INTERVAL 100
// LED max on time ms
#define TIME_ON_MAX 10000 //1000 = 1m35s
#ifdef MYSENSOR
MyMessage dimmerMsg(0, V_DIMMER);
MyMessage lightMsg(0, V_LIGHT);
#endif
unsigned char ledPins [LED_COUNT] = {LED_PIN1, LED_PIN2, LED_PIN3, LED_PIN4}; // {LED_PIN1,LED_PIN2,LED_PIN3}; //
unsigned char inputPins [LED_COUNT] = {IN_PIN1, IN_PIN2, IN_PIN3, IN_PIN4}; //{IN_PIN1,IN_PIN1,IN_PIN1};
enum states {
S_OFF,
S_ON,
S_DimUp,
S_DimDown,
S_TimeOut,
S_TimeOutDoneWaitForOff
};
struct Cabinet
{
unsigned char ledPin;
unsigned char inputPin;
int16_t currentLevel = 0;
int16_t ToLevel = 0;
int timeOn = 0;
unsigned char state = S_OFF;
};
Cabinet cab[LED_COUNT];
unsigned long currentMillis;
unsigned long previousMillis = 0;
/***
Dimmable LED initialization method
*/
void setup()
{
unsigned char i;
#ifdef MYSENSOR
// Pull the gateway's current dim level - restore light level upon sendor node power-up
request( 0, V_DIMMER );
#endif
// Setup pins for led and door sensors
for (i = 0; i < LED_COUNT; i++)
{
cab[i].inputPin = inputPins[i];
cab[i].ledPin = ledPins[i];
pinMode(cab[i].inputPin, INPUT_PULLUP); //set as input with pullup resister
pinMode(cab[i].ledPin, OUTPUT); // sets the pin as output
}
}
void presentation()
{
#ifdef MYSENSOR
// Register the LED Dimmable Light with the gateway
present( 0, S_DIMMER );
sendSketchInfo(SN, SV);
#endif
}
/***
Dimmable LED main processing loop
*/
void loop()
{
currentMillis = millis();
//Serial.println( "Service leds " );
ServiceInputs();
// only serve the led sometimes every xx ms
if (currentMillis - previousMillis >= LED_LOOP_INTERVAL)
{
// save the last time you blinked the LED
previousMillis = currentMillis;
ServiceLeds();
}
}
/*
Service the Digital inputs
*/
void ServiceInputs(void)
{
unsigned char i;
for (i = 0; i < LED_COUNT; i++)
{
// Handle LED ON/OFF if Dorsensor state changes
if ( (digitalRead(cab[i].inputPin) == HIGH) && (cab[i].state == S_OFF))
{
#ifdef DIGITAL_IN_LOG_ENABLE
Serial.print( "Door ");
Serial.print( i );
Serial.println( " open");
#endif
cab[i].state = S_DimUp; //changing to state on
cab[i].timeOn = TIME_ON_MAX; //Start the time
cab[i].ToLevel = LED_MIN;
}
else if ( (digitalRead(cab[i].inputPin) == LOW) && ( (cab[i].state == S_ON) || (cab[i].state == S_TimeOutDoneWaitForOff)) )
{
#ifdef DIGITAL_IN_LOG_ENABLE
Serial.print( "Door ");
Serial.print( i );
Serial.print( " closed");
#endif
if (cab[i].state == S_TimeOutDoneWaitForOff)
{
#ifdef DIGITAL_IN_LOG_ENABLE
Serial.print( " - timeout Off");
#endif
cab[i].state = S_OFF; //changing to state off
}
else
{
cab[i].state = S_DimDown; //changing to state off
cab[i].timeOn = 0; //Stop the time
cab[i].ToLevel = LED_MAX;
}
#ifdef DIGITAL_IN_LOG_ENABLE
Serial.println( " "); // finish the line
#endif
}
}
}
/*
Service the LED outputs
*/
void ServiceLeds(void)
{
unsigned char i;
for (i = 0; i < LED_COUNT; i++)
{
//If the time is up, turn off leds
if ((cab[i].state == S_ON) && (cab[i].timeOn >= LED_LOOP_INTERVAL))
{
cab[i].timeOn -= 1;
}
else if ((cab[i].state == S_ON) && (cab[i].timeOn < LED_LOOP_INTERVAL))
{
cab[i].state = S_TimeOut;
cab[i].timeOn = 0;
#ifdef LED_DIMMING_LOG_ENABLE
Serial.print( "Channel: " );
Serial.print( i );
Serial.println( " - timeout, turn off " );
#endif
}
// Handle LED ON/OFF if Dorsensor state changes
if ( cab[i].state == S_DimUp)
{
cab[i].ToLevel = LED_MAX;
#ifdef LED_DIMMING_LOG_ENABLE
Serial.print( "Channel: " );
Serial.print( i );
Serial.print( " - Changing level to " );
Serial.print( cab[i].ToLevel );
Serial.print( ", from " );
Serial.println( cab[i].currentLevel );
#endif
fadeToLevel( cab[i].ToLevel , cab[i].ledPin, &cab[i].currentLevel);
cab[i].state = S_ON;
/*
if (cab[i].ToLevel >= LED_MAX)
cab[i].state = S_ON;
else
cab[i].ToLevel += LED__STEP_UP;
*/
}
else if ((cab[i].state == S_DimDown) || (cab[i].state == S_TimeOut))
{
cab[i].ToLevel = LED_MIN;
#ifdef LED_DIMMING_LOG_ENABLE
Serial.print( "Channel: " );
Serial.print( i );
Serial.print( " - Changing level to " );
Serial.print( cab[i].ToLevel );
Serial.print( ", from " );
Serial.println( cab[i].currentLevel );
#endif
fadeToLevel( cab[i].ToLevel , cab[i].ledPin, &cab[i].currentLevel);
if (cab[i].state == S_DimDown)
{
cab[i].state = S_OFF;
}
else if (cab[i].state == S_TimeOut)
{
cab[i].state = S_TimeOutDoneWaitForOff;
}
/*
if (cab[i].ToLevel <= LED_MIN)
cab[i].state = S_OFF;
else
cab[i].ToLevel -= LED__STEP_DOWN;
*/
}
}
}
#ifdef MYSENSOR
void receive(const MyMessage &message)
{
if (message.type == V_LIGHT || message.type == V_DIMMER) {
// Retrieve the power or dim level from the incoming request message
int requestedLevel = atoi( message.data );
// Adjust incoming level if this is a V_LIGHT variable update [0 == off, 1 == on]
requestedLevel *= ( message.type == V_LIGHT ? 100 : 1 );
// Clip incoming level to valid range of 0 to 100
requestedLevel = requestedLevel > 100 ? 100 : requestedLevel;
requestedLevel = requestedLevel < 0 ? 0 : requestedLevel;
Serial.print( "Changing level to " );
Serial.print( requestedLevel );
Serial.print( ", from " );
//Serial.println( currentLevel );
// Inform the gateway of the current DimmableLED's SwitchPower1 and LoadLevelStatus value...
// send(lightMsg.set(currentLevel > 0));
// hek comment: Is this really nessesary?
/// send( dimmerMsg.set(currentLevel) );
}
}
#endif
/***
This method provides a graceful fade up/down effect
*/
void fadeToLevel( int toLevel, char channel, int* curLevel )
{
int currentLevel = *curLevel;
int delta = ( toLevel - currentLevel ) < 0 ? -1 : 1;
while ( currentLevel != toLevel )
{
currentLevel += delta;
analogWrite( channel, (int)(currentLevel / 100. * 255) );
delay( FADE_DELAY );
}
*curLevel = currentLevel;
}
| [
"24877208+CarstenLeonhardt@users.noreply.github.com"
] | 24877208+CarstenLeonhardt@users.noreply.github.com |
d7586c8ae9382d98094719331a6b4fa01a807077 | 5236606f2e6fb870fa7c41492327f3f8b0fa38dc | /srpc/test/ForwardingFunctorTest.cpp | 19824188a303a64f31f9d512378e66438e8519bd | [] | no_license | jcloudpld/srpc | aa8ecf4ffc5391b7183b19d217f49fb2b1a67c88 | f2483c8177d03834552053e8ecbe788e15b92ac0 | refs/heads/master | 2021-01-10T08:54:57.140800 | 2010-02-08T07:03:00 | 2010-02-08T07:03:00 | 44,454,693 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,058 | cpp | #include "stdafx.h"
#include <srpc/detail/ForwardingFunctors.h>
#include "StreamFixture.h"
#include <srpc/RpcTypes.h>
using namespace srpc;
/**
* @class ForwardingFunctorTest
*
* marshaling functor test
*/
class ForwardingFunctorTest : public BitStreamFixture
{
};
TEST_F(ForwardingFunctorTest, testP0)
{
ForwardingFunctorT<SRPC_TYPELIST_0()> functor;
functor.marshal(*ostream_);
EXPECT_EQ(0, ostream_->getTotalSize()) << "empty";
}
TEST_F(ForwardingFunctorTest, testP1)
{
const RInt32 expected = 1234;
ForwardingFunctorT<SRPC_TYPELIST_1(RInt32)> functor(expected);
functor.marshal(*ostream_);
EXPECT_EQ(4, ostream_->getTotalSize());
Int32 value;
istream_->read(value);
EXPECT_EQ(expected.get(), value);
}
TEST_F(ForwardingFunctorTest, testP2)
{
ForwardingFunctorT<SRPC_TYPELIST_2(RInt32, RInt32)> functor(1234, 4321);
functor.marshal(*ostream_);
EXPECT_EQ(4 + 4, ostream_->getTotalSize());
Int32 value1;
istream_->read(value1);
EXPECT_EQ(1234, value1);
Int32 value2;
istream_->read(value2);
EXPECT_EQ(4321, value2);
}
TEST_F(ForwardingFunctorTest, testP3)
{
ForwardingFunctorT<SRPC_TYPELIST_3(RInt32, RInt32, RInt32)> functor(0, 1, 2);
functor.marshal(*ostream_);
EXPECT_EQ(4 * 3, ostream_->getTotalSize());
for (int i = 0; i < 3; ++i) {
Int32 value;
istream_->read(value);
EXPECT_EQ(i, value);
}
}
TEST_F(ForwardingFunctorTest, testP4)
{
ForwardingFunctorT<SRPC_TYPELIST_4(RInt32, RInt32, RInt32, RInt32)>
functor(0, 1, 2, 3);
functor.marshal(*ostream_);
EXPECT_EQ(4 * 4, ostream_->getTotalSize());
for (int i = 0; i < 4; ++i) {
Int32 value;
istream_->read(value);
EXPECT_EQ(i, value);
}
}
TEST_F(ForwardingFunctorTest, testP5)
{
ForwardingFunctorT<SRPC_TYPELIST_5(RInt32, RInt32, RInt32, RInt32, RInt32)>
functor(0, 1, 2, 3, 4);
functor.marshal(*ostream_);
EXPECT_EQ(4 * 5, ostream_->getTotalSize());
for (int i = 0; i < 5; ++i) {
Int32 value;
istream_->read(value);
EXPECT_EQ(i, value);
}
}
TEST_F(ForwardingFunctorTest, testP6)
{
ForwardingFunctorT<SRPC_TYPELIST_6(RInt32, RInt32, RInt32, RInt32, RInt32,
RInt32)> functor(0, 1, 2, 3, 4, 5);
functor.marshal(*ostream_);
EXPECT_EQ(4 * 6, ostream_->getTotalSize());
for (int i = 0; i < 6; ++i) {
Int32 value;
istream_->read(value);
EXPECT_EQ(i, value);
}
}
TEST_F(ForwardingFunctorTest, testP7)
{
ForwardingFunctorT<SRPC_TYPELIST_7(RInt32, RInt32, RInt32, RInt32, RInt32,
RInt32, RInt32)> functor(0, 1, 2, 3, 4, 5, 6);
functor.marshal(*ostream_);
EXPECT_EQ(4 * 7, ostream_->getTotalSize());
for (int i = 0; i < 7; ++i) {
Int32 value;
istream_->read(value);
EXPECT_EQ(i, value);
}
}
TEST_F(ForwardingFunctorTest, testComplex)
{
typedef RpcNumericType<UInt8, 4> RUInt4;
RString s("0123456789");
ForwardingFunctorT<SRPC_TYPELIST_4(RUInt4, RInt8, RInt16, RString)>
functor(0xFF, -1, -1, s);
functor.marshal(*ostream_);
EXPECT_EQ(1 + 1 + 2 + (2 + 10), ostream_->getTotalSize());
RUInt4 value1;
value1.serialize(*istream_);
EXPECT_EQ(0x0F, static_cast<int>(value1));
RInt8 value2;
value2.serialize(*istream_);
EXPECT_EQ(-1, static_cast<int>(value2));
Int16 value3;
istream_->read(value3);
EXPECT_EQ(-1, static_cast<int>(value3));
String value4;
istream_->read(value4, USHRT_MAX, Bits<UInt16>::size);
EXPECT_EQ(s.ref(), value4);
}
TEST_F(ForwardingFunctorTest, testP1_with_PrimitiveType)
{
ForwardingFunctorT<SRPC_TYPELIST_1(Int32)> functor(1234);
functor.marshal(*ostream_);
EXPECT_EQ(4, ostream_->getTotalSize());
Int32 value;
istream_->read(value);
EXPECT_EQ(1234, value);
}
| [
"kcando@6d7ccee0-1a3b-0410-bfa1-83648d9ec9a4"
] | kcando@6d7ccee0-1a3b-0410-bfa1-83648d9ec9a4 |
fde1d277576a3b99eb76b78a3149193124397ab8 | a4c86e1aa7573ec15a87aaf954c8b4f64d512d56 | /Chapter18/test/stdmove.cc | 30d18ef8cd41f288ffdab45a9cc479a2922fe69c | [] | no_license | ghostxiu/CplusplusPrimerPlus6thEditions | b0916b5ac0f5adfd8b6f4daa40d3a4c996eb1592 | c7bd797cf2028eb31b20acc2a7511260e04f5b67 | refs/heads/master | 2020-07-05T17:02:47.512468 | 2018-01-19T03:32:52 | 2018-01-19T03:32:52 | 73,989,525 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,657 | cc | //Changed by Ghostxiu 2018/1/16
//原書程序清單18.3內容
//移动语义和右值引用
//std::move()
#include <iostream>
#include <utility>
using namespace std ;
class Useless
{
private:
int n ;//元素个数
char * pc ;//数据指针
static int ct ;//对象数量
void ShowObject() const ;//显示工程
public:
Useless();//默认构造函数
explicit Useless(int k);
Useless(int k , char ch );
Useless(const Useless & f);//复制构造函数
Useless(Useless && f) ;//移动构造函数
~Useless();
Useless operator +(const Useless & f) const ;
Useless & operator =(const Useless & f) ;//赋值运算符
Useless & operator =(Useless && f);//移动复制运算符,因为修改了源值,所以不能用const
void ShowData() const;//显示数据
};
int Useless::ct = 0 ;
Useless::Useless()
{
++ct ;
n = 0 ;
pc = nullptr ;
cout << "Default constractor called; number of objects: " << ct << endl ;
ShowObject();
}
Useless::Useless(int k ) : n(k)
{
++ct ;
cout << "Int constractor called; number of objects: " << ct << endl ;
pc = new char[n];
ShowObject();
}
Useless::Useless(int k,char ch) : n(k)
{
++ct ;
cout << "Int constractor called; number of objects: " << ct << endl ;
pc = new char[n];
for(int i = 0 ; i < n ; ++i)
{
pc[i] = ch ;
}
ShowObject();
}
Useless::Useless(const Useless & f) : n(f.n)
{
++ct ;
cout << "Copy constractor called; number of objects: " << ct << endl ;
pc = new char[n];
for(int i = 0 ; i < n ; ++i)
pc[i] = f.pc[i];
ShowObject();
}
Useless::Useless(Useless && f) : n(f.n)
{
++ct ;
cout << "Move constractor called; number of objects: " << ct << endl ;
pc = f.pc;
f.pc = nullptr ;
f.n = 0 ;
ShowObject();
}
Useless::~Useless()
{
cout << "Destructor called ; objects left: " << --ct << endl;
cout << "Deleted object:\n";
ShowObject();
delete [] pc ;
}
Useless Useless::operator+(const Useless & f) const
{
cout << "Entering operator+()\n";
Useless temp = Useless(n + f.n);
for(int i = 0 ; i < n ; i++)
{
temp.pc[i] = pc[i];
}
for(int i = n ; i < temp.n ; i++)
{
temp.pc[i] = f.pc[i-n];
}
cout << "Temp elements: \n";
cout << "Leaving operator+()\n";
return temp;
}
Useless & Useless::operator=(const Useless & f)
{
if(this == &f)
return *this ;
delete [] pc ;
n = f.n ;
pc = new char[n];
for(int i = 0 ; i < n ; ++i)
{
pc[i] = f.pc[i];
}
return *this ;
}
Useless & Useless::operator=(Useless && f)
{
if(this == &f)
return *this ;
delete [] pc ;
n = f.n ;
pc = f.pc;
f.n = 0 ;
f.pc = nullptr ;
return *this ;
}
void Useless::ShowObject() const
{
cout << "Number of elements: " << n ;
cout << " Data address: " << (void *) pc << endl;
}
void Useless::ShowData() const
{
if(n == 0)
cout << "(object empty)";
else
for(int i = 0 ; i < n ; ++i)
cout << pc[i] ;
cout << endl;
}
int main()
{
{
Useless one(10,'x');
Useless two = one + one;
cout << "Object one: ";
one.ShowData();
cout << "Object two: ";
two.ShowData();
Useless three,four;
cout << "three = one\n";
three = one ;
cout << "Now object three:";
three.ShowData();
cout << "And object one:";
one.ShowData();
cout << "Four = one + two\n" ;
four = one + two ;
cout << "Now object four:";
four.ShowData();
cout << "four = move(one).\n ";
four = move(one);
cout << "And object one:";
one.ShowData();
}
return 0;
}
//文件地址:https://github.com/ghostxiu/CplusplusPrimerPlus6thEditions/tree/master/Chapter18/test
| [
"noreply@github.com"
] | noreply@github.com |
dc22d18655a52f18130a3a471402f01913a0b3a8 | 477204843e3c28bfc8c5411c05cc50ccbf60dbd9 | /Week3/4.cpp | e74f7301a737f27e1d96905a6c8b681e0b520490 | [] | no_license | UNKJay/PKU_Cpp | e433fe0518ea89adfcde4522e11554739ea87c26 | 562036f82b6045f4396696c95bc49058e30a263b | refs/heads/master | 2021-03-01T03:49:51.226641 | 2020-03-22T14:37:41 | 2020-03-22T14:37:41 | 245,751,634 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 229 | cpp | #include <iostream>
using namespace std;
struct A
{
int v;
A(int vv):v(vv) { }
const A* getPointer () const {return this;}
};
int main()
{
const A a(10);
const A * p = a.getPointer();
cout << p->v << endl;
return 0;
} | [
"1417752158@qq.com"
] | 1417752158@qq.com |
7fa231e12147297a109ac856416ec0bc0d3c2218 | 1e8bc724d3c69300a55e3f4c42945db167158a82 | /src/plugins/thirdParty/LLVM/tools/clang/lib/Analysis/FormatStringParsing.h | c08d12545a41388c74993c6d50839a5f6d0262d8 | [
"Apache-2.0"
] | permissive | mirams/opencor | 9104d821a16da92b5023e98ab1c3a07f8b8fbf1d | 71dd884194ec8080f96f8e982c5afedec8473405 | refs/heads/master | 2021-01-18T10:49:32.934690 | 2016-07-21T10:30:57 | 2016-07-21T10:30:57 | 9,960,636 | 0 | 0 | null | 2016-07-21T10:30:57 | 2013-05-09T14:18:17 | C++ | UTF-8 | C++ | false | false | 2,260 | h | #ifndef LLVM_CLANG_LIB_ANALYSIS_FORMATSTRINGPARSING_H
#define LLVM_CLANG_LIB_ANALYSIS_FORMATSTRINGPARSING_H
#include "clang/AST/ASTContext.h"
#include "clang/AST/Type.h"
#include "clang/Analysis/Analyses/FormatString.h"
#include "llvm/Support/raw_ostream.h"
namespace clang {
class LangOptions;
template <typename T>
class UpdateOnReturn {
T &ValueToUpdate;
const T &ValueToCopy;
public:
UpdateOnReturn(T &valueToUpdate, const T &valueToCopy)
: ValueToUpdate(valueToUpdate), ValueToCopy(valueToCopy) {}
~UpdateOnReturn() {
ValueToUpdate = ValueToCopy;
}
};
namespace analyze_format_string {
OptionalAmount ParseAmount(const char *&Beg, const char *E);
OptionalAmount ParseNonPositionAmount(const char *&Beg, const char *E,
unsigned &argIndex);
OptionalAmount ParsePositionAmount(FormatStringHandler &H,
const char *Start, const char *&Beg,
const char *E, PositionContext p);
bool ParseFieldWidth(FormatStringHandler &H,
FormatSpecifier &CS,
const char *Start, const char *&Beg, const char *E,
unsigned *argIndex);
bool ParseArgPosition(FormatStringHandler &H,
FormatSpecifier &CS, const char *Start,
const char *&Beg, const char *E);
/// Returns true if a LengthModifier was parsed and installed in the
/// FormatSpecifier& argument, and false otherwise.
bool ParseLengthModifier(FormatSpecifier &FS, const char *&Beg, const char *E,
const LangOptions &LO, bool IsScanf = false);
template <typename T> class SpecifierResult {
T FS;
const char *Start;
bool Stop;
public:
SpecifierResult(bool stop = false)
: Start(nullptr), Stop(stop) {}
SpecifierResult(const char *start,
const T &fs)
: FS(fs), Start(start), Stop(false) {}
const char *getStart() const { return Start; }
bool shouldStop() const { return Stop; }
bool hasValue() const { return Start != nullptr; }
const T &getValue() const {
assert(hasValue());
return FS;
}
const T &getValue() { return FS; }
};
} // end analyze_format_string namespace
} // end clang namespace
#endif
| [
"agarny@hellix.com"
] | agarny@hellix.com |
e5541ce8dc7b62ca0e979fe238b5846b3947734c | a933bb22e41d212ecb1ea3db6725e34f7580c7c2 | /res/Character/Player.cpp | 8eef2e74d29cff2933f820e99197c6f2b99745e6 | [] | no_license | ZFhuang/Project_CcPG | e72e6e8cb5cb4288fec981d5c5b06e3b5f140afb | 2f22979391e9d9eccd13bbebe5ed057ecdf9c367 | refs/heads/master | 2020-05-06T12:27:59.864867 | 2019-06-27T06:39:10 | 2019-06-27T06:39:10 | 180,124,279 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 12,867 | cpp | #include "Player.h"
#include "SimpleAudioEngine.h"
#include "proj.win32\res\MainConfig.h"
extern CocosDenshion::SimpleAudioEngine *audio;
Player::Player()
{
}
Player::~Player()
{
}
void Player::init(Vec2 pos)
{
if (center == nullptr) {
// 添加玩家
center = Sprite::create(PLAYER_IMG);
// 强制设置大小
center->setContentSize(Size(PLAYER_WIDTH, PLAYER_HEIGHT));
// 设置tag
center->setTag(PLAYER_TAG);
// 注意要调好锚点方便接下来的旋转等操作
center->setAnchorPoint(Vec2(0.5, 0.5));
// 刷新大小
PLAYER_WIDTH = center->getContentSize().width;
PLAYER_HEIGHT = center->getContentSize().height;
keyNum = 0;
lastKey = nullptr;
// 添加物理碰撞盒
auto size = center->getContentSize();
auto body = PhysicsBody::createBox(center->getContentSize());
body->setGravityEnable(false);
// 初始位置
center->setPosition(pos);
cocostudio::ArmatureDataManager::getInstance()->addArmatureFileInfo(PLAYER_ANIFILE_INFO);
m_armature = cocostudio::Armature::create("ProtagonistAnimation");
//校准一下初始值
m_armature->setPosition(Vec2(PLAYER_WIDTH/2, PLAYER_HEIGHT/2));
m_armature->setScaleX(SCALEX);
m_armature->setScaleY(SCALEY);
center->addChild(m_armature);
m_armature->getAnimation()->play("jump");
nowAni = JUMP;
}
}
void Player::setAnimation()
{
if (dashTimer == -1) {
if (isGround) {
if (Speed.x == 0 && nowAni != IDLE) {
m_armature->getAnimation()->play("common");
nowAni = IDLE;
}
}
}
if (!isSliping && !isHolding) {
if (Speed.x > 0) {
if (m_armature->getScaleX() != 1 * SCALEX)
{
m_armature->setScaleX(1 * SCALEX);
}
}
else if (Speed.x < 0) {
if (m_armature->getScaleX() != -1 * SCALEX)
{
m_armature->setScaleX(-1 * SCALEX);
}
}
}
}
bool Player::moveTo(Vec2 pos, Vec2 speed)
{
// 计算出位置差值然后再加上增量
// 当位置在其附近时将会不能移动,返回true表示到达
Vec2 delta = pos - center->getPosition();
// 获得其归一化向量
Vec2 dir = delta.getNormalized();
// x是否在附近
if (delta.x - dir.x*speed.x<1 && delta.x - dir.x*speed.x>-1) {
speed.x = 0;
}
else {
speed.x *= dir.x;
}
// y是否在附近
if (delta.y - dir.y*speed.y<1 && delta.y - dir.y*speed.y>-1) {
speed.y = 0;
}
else {
speed.y *= dir.y;
}
// 都在附近返回true
if (speed.x == 0 && speed.y == 0) {
return true;
}
//否则移动
center->setPosition(center->getPosition() + speed);
return false;
}
// 设置为新位置
void Player::toNewPos(Vec2 pos)
{
center->setPosition(pos);
}
Sprite* Player::getSprite()
{
return center;
}
void Player::update(float dt)
{
this->dt = dt;
timer();
if (Speed.x > 0) {
isRight = true;
}
else if (Speed.x < 0) {
isRight = false;
}
// 刷新动画
setAnimation();
}
Vec2 Player::getPos()
{
return center->getPosition();
}
// 进行跳跃
void Player::jump()
{
if (isGround && !isJumping) {
//普通跳
isJumping = true;
isGround = false;
setSpeedY(JUMPSPEED);
prejumpTimer = -1;
// 播放跳跃
if (nowAni != JUMP) {
m_armature->getAnimation()->play("jump");
nowAni = JUMP;
audio->playEffect(SOUND_JUMP.c_str());
}
}
else if (isSliping && !isJumping) {
//反身跳
isJumping = true;
isSliping = false;
setSpeedY(JUMPSPEED*0.75);
setSpeedX(-MAX_RUN*backDir);
prejumpTimer = -1;
backjumpTimer = 0;
if (nowAni != JUMP) {
m_armature->getAnimation()->play("jump");
nowAni = JUMP;
audio->playEffect(SOUND_JUMP.c_str());
}
}
else {
if (prejumpTimer < 0)
prejumpTimer = 0;
}
}
// 八方向冲刺
void Player::dash(int dir)
{
if (dashNum > 0 && (dashTimer<0 || dashTimer>TIMER_DASH / 2)) {
switch (dir)
{
case 0:
// dir 0 当前水平方向
if (isRight) {
// dir 3 D
setSpeedX(MAX_X*0.8);
setSpeedY(0);
isJumping = true;
isGround = false;
if (nowAni != DASH) {
m_armature->getAnimation()->play("rightRush");
nowAni = DASH;
audio->playEffect(SOUND_RUSH.c_str());
}
}
else
{
// dir 7 A
//要照顾根号2距离
setSpeedX(-MAX_X*0.8);
setSpeedY(0);
isJumping = true;
isGround = false;
if (nowAni != DASH) {
m_armature->getAnimation()->play("rightRush");
nowAni = DASH;
audio->playEffect(SOUND_RUSH.c_str());
}
}
break;
case 1:
// dir 1 W
setSpeedX(0);
setSpeedY(MAX_Y*0.8);
isJumping = true;
isGround = false;
if (nowAni != DASH) {
m_armature->getAnimation()->play("topRush");
nowAni = DASH;
audio->playEffect(SOUND_RUSH.c_str());
}
break;
case 2:
// dir 2 WD
//要照顾根号2距离
setSpeedX(MAX_X*0.8 / 1.4);
setSpeedY(MAX_Y*0.8 / 1.4);
isJumping = true;
isGround = false;
if (nowAni != DASH) {
m_armature->getAnimation()->play("top-rightRush");
nowAni = DASH;
audio->playEffect(SOUND_RUSH.c_str());
}
break;
case 3:
// dir 3 D
setSpeedX(MAX_X*0.8);
setSpeedY(0);
isJumping = true;
isGround = false;
if (nowAni != DASH) {
m_armature->getAnimation()->play("rightRush");
nowAni = DASH;
audio->playEffect(SOUND_RUSH.c_str());
}
break;
case 4:
// dir 4 DS
setSpeedX(MAX_X*0.8 / 1.4);
setSpeedY(-MAX_Y*0.8 / 1.4);
isJumping = true;
isGround = false;
if (nowAni != DASH) {
m_armature->getAnimation()->play("bottom-rightRush");
nowAni = DASH;
audio->playEffect(SOUND_RUSH.c_str());
}
break;
case 5:
// dir 5 S
setSpeedX(0);
setSpeedY(-MAX_Y*0.8);
isJumping = true;
isGround = false;
if (nowAni != DASH) {
m_armature->getAnimation()->play("bottomRush");
nowAni = DASH;
audio->playEffect(SOUND_RUSH.c_str());
}
break;
case 6:
// dir 6 SA
//要照顾根号2距离
setSpeedX(-MAX_X*0.8 / 1.4);
setSpeedY(-MAX_Y*0.8 / 1.4);
isJumping = true;
isGround = false;
if (nowAni != DASH) {
m_armature->getAnimation()->play("bottom-rightRush");
nowAni = DASH;
audio->playEffect(SOUND_RUSH.c_str());
}
break;
case 7:
// dir 7 A
setSpeedX(-MAX_X*0.8);
setSpeedY(0);
isJumping = true;
isGround = false;
if (nowAni != DASH) {
m_armature->getAnimation()->play("rightRush");
nowAni = DASH;
audio->playEffect(SOUND_RUSH.c_str());
}
break;
case 8:
// dir 8 AW
//要照顾根号2距离
setSpeedX(-MAX_X*0.8 / 1.4);
setSpeedY(MAX_Y*0.8 / 1.4);
isJumping = true;
isGround = false;
if (nowAni != DASH) {
m_armature->getAnimation()->play("top-rightRush");
nowAni = DASH;
audio->playEffect(SOUND_RUSH.c_str());
}
break;
default:
break;
}
dashTimer = 0;
dashNum--;
}
}
// 结束下落
void Player::jumpend()
{
if (isJumping) {
//防止跳跃高度过低
if (Speed.y > JUMPSPEED / 2) {
setSpeedY(Speed.y / 1.5);
}
else if (Speed.y > 0) {
//使下落自然
setSpeedY(Speed.y / 2);
}
isJumping = false;
}
}
// 跑动
void Player::run(int dir)
{
//限制抓取和反身跳途中不可以移动
if (!isHolding&&backjumpTimer < 0) {
if (isGround || isSliping) {
//乘三是为了加速快一点
addSpeedX(dir*MAX_RUN * 8);
if (Speed.x > MAX_RUN) {
setSpeedX(MAX_RUN);
}
else if (Speed.x < -MAX_RUN) {
setSpeedX(-MAX_RUN);
}
if (isGround) {
if (Speed.x != 0) {
runTimer += dt;
if (runTimer > TIMER_RUN) {
audio->playEffect(SOUND_RUN.c_str());
runTimer = 0;
}
}
else {
runTimer = -1;
}
if (Speed.x != 0 && nowAni != RUN) {
m_armature->getAnimation()->play("run");
nowAni = RUN;
runTimer = 1;
}
}
else {
runTimer = -1;
}
}
else {
//空中加速慢一点
addSpeedX(dir*MAX_RUN * 3);
if (Speed.x > MAX_RUN) {
setSpeedX(MAX_RUN);
}
else if (Speed.x < -MAX_RUN) {
setSpeedX(-MAX_RUN);
}
}
}
}
// 攀爬
void Player::climb(int dir)
{
if (isHolding && (!isGround) && wallDir != 0) {
if (climbTimer < -1) {
climbTimer = 0;
}
if (climbTimer < TIMER_CLIMBING) {
//由于是爬行所以无需阻力
setSpeedY(dir*MAX_CLIMB);
//上爬3dt, 不动2dt, 下爬1dt, 落地刷新
climbTimer += dt*(dir + 2);
if (dir == 0) {
if (nowAni == CLIMB) {
m_armature->getAnimation()->pause();
m_armature->setScaleX(wallDir*SCALEX);
nowAni = CLIMB;
}
}
else {
if (nowAni != CLIMB) {
m_armature->getAnimation()->play("climb");
nowAni = CLIMB;
m_armature->setScaleX(wallDir*SCALEX);
}
else {
m_armature->getAnimation()->resume();
m_armature->setScaleX(wallDir*SCALEX);
audio->playEffect(SOUND_RUN.c_str());
}
}
}
else {
isHolding = false;
}
}
}
void Player::setSpeedX(float x)
{
// 非冲刺状态才能自由改变Speed
if (dashTimer < 0)
Speed.x = x;
}
void Player::addSpeedX(float x)
{
setSpeedX(Speed.x + x*dt);
if (Speed.x > MAX_X) {
setSpeedX(MAX_X);
}
if (Speed.x < -MAX_X) {
setSpeedX(-MAX_X);
}
}
void Player::setSpeedY(float y)
{
// 非冲刺状态才能自由改变Speed
if (dashTimer < 0)
Speed.y = y;
}
void Player::addSpeedY(float y)
{
setSpeedY(Speed.y + y*dt);
if (Speed.y > MAX_Y) {
setSpeedY(MAX_Y);
}
if (Speed.y < -MAX_Y) {
setSpeedY(-MAX_Y);
}
}
// 计时器刷新
void Player::timer()
{
if (fallTimer >= 0) {
fallTimer += dt;
if (fallTimer >= TIMER_FALL) {
isGround = false;
fallTimer = -1;
}
}
if (prejumpTimer >= 0) {
prejumpTimer += dt;
if (prejumpTimer >= TIMER_PREJUMP) {
prejumpTimer = -1;
}
else {
jump();
}
}
if (outTimer >= 0) {
outTimer += dt;
if (outTimer >= TIMER_OUT) {
isSliping = false;
outTimer = -1;
}
}
if (backjumpTimer >= 0) {
backjumpTimer += dt;
if (backjumpTimer >= TIMER_BACKJUMP) {
backjumpTimer = -1;
}
}
if (dashTimer >= 0) {
dashTimer += dt;
if (dashTimer >= TIMER_DASH) {
dashTimer = -1;
//使得停止不会太突然
setSpeedX(Speed.x / 3);
setSpeedY(Speed.y / 3);
}
}
}
// 下落
void Player::fall(float speed)
{
if (!isHolding) {
if (isGround&&fallTimer < 0) {
fallTimer = 0;
}
if (isSliping) {
addSpeedY(speed / 2);
if (Speed.y > 0) {
setSpeedY(Speed.y / 2);
}
if (Speed.y < -MAX_SLIP)
setSpeedY(-MAX_SLIP);
}
else {
addSpeedY(speed);
}
}
}
// 撞到头
void Player::headCol()
{
//强制下落
jumpend();
setSpeedY(0);
}
// 下滑
void Player::slip(int wallDir)
{
//下滑
if (!isGround) {
if (this->wallDir != 0)
backDir = this->wallDir;
this->wallDir = wallDir;
if (this->wallDir != 0) {
isSliping = true;
outTimer = -1;
if (!isHolding&&nowAni != DASH&&nowAni != CLIMB) {
m_armature->getAnimation()->play("rightRush");
nowAni = DASH;
m_armature->setScaleX(-wallDir*SCALEX);
}
}
else {
if (isSliping == true && outTimer < 0)
outTimer = 0;
}
}
}
// 抓墙
void Player::hold(bool isHolding)
{
if (isSliping&&wallDir != 0 && (climbTimer < TIMER_CLIMBING)) {
//可抓墙
if ((!this->isHolding) && isHolding) {
setSpeedY(0);
}
this->isHolding = isHolding;
if (this->isHolding) {
setSpeedX(wallDir * 70);
}
}
else {
//不可抓墙
this->isHolding = false;
this->isJumping = false;
}
}
// 地面
void Player::ground(bool isGround)
{
if (isGround) {
//落地
this->isGround = true;
isJumping = false;
isSliping = false;
isHolding = false;
fallTimer = -1;
climbTimer = -1;
dashNum = DASH_TIMES;
setSpeedY(0);
}
else {
if (fallTimer < 0) {
if (!isHolding &&!isSliping&& nowAni != JUMP) {
m_armature->getAnimation()->play("jump");
nowAni = JUMP;
audio->playEffect(SOUND_JUMP.c_str());
}
this->isGround = false;
}
}
}
// 缓速停止
void Player::slow(float speed)
{
if (!isHolding) {
//阻力不能影响到反向
if (isGround) {
if (Speed.x > 0) {
addSpeedX(speed);
if (Speed.x < 0) {
setSpeedX(0);
}
}
else if (Speed.x < 0) {
addSpeedX(-speed);
if (Speed.x > 0) {
setSpeedX(0);
}
}
}
else {
//空中阻力稍小一点
if (Speed.x > 0) {
addSpeedX(speed / 2);
if (Speed.x < 0) {
setSpeedX(0);
}
}
else if (Speed.x < 0) {
addSpeedX(-speed / 2);
if (Speed.x > 0) {
setSpeedX(0);
}
}
}
}
}
void Player::initKeyNum(int num)
{
keyNum = num;
}
Sprite * Player::getLastKey(Sprite * newKey)
{
keyNum -= 1;
if (lastKey == nullptr) {
lastKey = newKey;
return center;
}
else {
Sprite * temp = lastKey;
lastKey = newKey;
return temp;
}
}
int Player::getKeyNum()
{
return keyNum;
}
// 恢复冲刺次数
bool Player::getBattery()
{
//这行也可以去掉,这样更有趣些,就可以做些类似空中攒能量的关卡
if (dashNum < DASH_TIMES) {
dashNum++;
return true;
}
else {
return false;
}
}
Vec2 Player::getSpeed()
{
return Speed;
}
| [
"huangsnake@gmail.com"
] | huangsnake@gmail.com |
60a2d32d9973745fc5da77dc939001b9f1e07c84 | c97098b838ef5968431c716bd13f4f063412002e | /graph/CG/Morph/CpTrans/ChildView.cpp | 8ddc605e5b5d02219f169934a92b40eb77e0b5e9 | [] | no_license | hackerlank/usnap | 9cc6f2969639c529cd81a4f4662e81850dd80465 | 2ab43c81c85ddb3d3aa23a15905d965d14710c2b | refs/heads/master | 2020-06-11T00:14:53.268772 | 2012-10-15T09:51:46 | 2012-10-15T09:51:46 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 9,700 | cpp | // ChildView.cpp : implementation of the CChildView class
//
#include "stdafx.h"
#include "CpTrans.h"
#include "ChildView.h"
#include "MainFrm.h"
#include "CpTransI.h"
#include "CpTransI_easy.h"
#include <math.h>
#define CIRCLE_PIXELS 16
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CChildView
REAL CChildView::_sleep_val = 10;
BOOL CChildView::IsChkWait = FALSE;
BOOL CChildView::MouseDownChecker = FALSE;
const int D_WIDTH = 100;
const int D_HEIGHT = 100;
const int D_X0 = 80;
const int D_Y0 = 60;
const int D_X1 = D_X0 + 50 + D_WIDTH;
const int D_Y1 = D_Y0 + 40 + D_HEIGHT;
CChildView::CChildView()
{
initData();
}
CChildView::~CChildView()
{
}
BEGIN_MESSAGE_MAP(CChildView,CWnd )
//{{AFX_MSG_MAP(CChildView)
ON_WM_PAINT()
ON_COMMAND(ID_BUTTON_LINE, OnButtonLine)
ON_COMMAND(ID_BUTTON_RECT, OnButtonRect)
ON_COMMAND(ID_BUTTON_CIRCLE, OnButtonCircle)
ON_COMMAND(ID_SPEED_FAST, OnSpeedFast)
ON_COMMAND(ID_SPEED_SLOW, OnSpeedSlow)
ON_COMMAND(ID_BUTTON_CHKRES, OnButtonChkRes)
ON_COMMAND(ID_BUTTON_CHKWAIT, OnButtonChkWait)
ON_COMMAND(ID_BUTTON_CLS, OnButtonCls)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChildView message handlers
void STDCALL CChildView::initData() {
int i ;
cpLine[0].x = 20;
cpLine[0].y = 20;
cpLine[1].x = 80;
cpLine[1].y = 80;
cpRect[0].x = 20;
cpRect[0].y = 80;
cpRect[1].x = 80;
cpRect[1].y = 80;
cpRect[2].x = 80;
cpRect[2].y = 20;
cpRect[3].x = 20;
cpRect[3].y = 20;
for (i = 0; i < CIRCLE_PIXELS; i++) {
cpCircle[i].x = (INT)(50 + cos(6.28 * i / CIRCLE_PIXELS) * 40);
cpCircle[i].y = (INT)(50 + sin(6.28 * i / CIRCLE_PIXELS) * 40);
}
}
void STDCALL CChildView::switchTo(INT i) {
CPPACK cpp;
CPREFERPROC referProc = cp_refer_easy;
cpp.cpSrc = cpLine;
cpp.nSrc = 2;
cpp.cpDst = cpRect;
cpp.nDst = 4;
switch (lastOp) {
case 'l':
cpp.cpSrc = cpLine;
cpp.nSrc = 2;
break;
case 'r':
cpp.cpSrc = cpRect;
cpp.nSrc = 4;
break;
case 'c':
cpp.cpSrc = cpCircle;
cpp.nSrc = CIRCLE_PIXELS;
break;
}
switch (i) {
case 'l':
cpp.cpDst = cpLine;
cpp.nDst = 2;
break;
case 'r':
cpp.cpDst = cpRect;
cpp.nDst = 4;
break;
case 'c':
cpp.cpDst = cpCircle;
cpp.nDst = CIRCLE_PIXELS;
break;
}
CMainFrame * pFrame = (CMainFrame *)GetParentFrame();
IsChkWait = pFrame->getChkwait();
referProc = pFrame->getChkprecise() ? cp_refer : cp_refer_easy;
CDC *pDC = GetDC();
if (((CMainFrame *)GetParentFrame())->getChkres()) {
cpp.pDC = pDC;
cp_transform(
cpp.cpSrc, cpp.nSrc, cpp.cpDst, cpp.nDst,
DEFAULT_SAMPLE,
distance_e,
NULL, 0,
chkrel, (DWORD)&cpp,
TRUE,
referProc);
} else {
cp_transform(cpp.cpSrc, cpp.nSrc, cpp.cpDst, cpp.nDst,
DEFAULT_SAMPLE,
distance_e,
draw, (DWORD)pDC,
NULL, 0,
FALSE,
referProc);
}
ReleaseDC(pDC);
lastOp = i;
}
BOOL CChildView::PreCreateWindow(CREATESTRUCT& cs)
{
if (!CWnd::PreCreateWindow(cs))
return FALSE;
cs.dwExStyle |= WS_EX_CLIENTEDGE;
cs.style &= ~WS_BORDER;
cs.lpszClass = AfxRegisterWndClass(CS_DBLCLKS | CS_SAVEBITS,
::LoadCursor(NULL, IDC_ARROW), HBRUSH(COLOR_WINDOW+1), NULL);
return TRUE;
}
void CChildView::OnPaint()
{
CPaintDC dc(this); // device context for painting
// Do not call CWnd::OnPaint() for painting messages
}
void CChildView::OnButtonLine()
{
// TODO: Add your command handler code here
switchTo('l');
}
void CChildView::OnButtonRect()
{
// TODO: Add your command handler code here
switchTo('r');
}
void CChildView::OnButtonCircle()
{
// TODO: Add your command handler code here
switchTo('c');
}
void CChildView::OnSpeedFast()
{
// TODO: Add your command handler code here
char curval[20];
if (_sleep_val > 0) _sleep_val--;
sprintf(curval, "当前速度 = %3.0f", _sleep_val);
((CMainFrame *)GetParentFrame())->setStatus(0, curval);
}
void CChildView::OnSpeedSlow()
{
// TODO: Add your command handler code here
char curval[20];
if (_sleep_val < 100) _sleep_val++;
sprintf(curval, "当前速度 = %3.0lf", _sleep_val);
((CMainFrame *)GetParentFrame())->setStatus(0, curval);
}
BOOL STDCALL waitcycle() {
AfxGetApp()->OnIdle(0);
return TRUE;
}
BOOL STDCALL CChildView::waitunit() {
DWORD tick = GetTickCount();
if (IsChkWait) {
::MessageBox(NULL, "按任意键继续", "等待按键", MB_OK);
} else {
while (tick - GetTickCount() <= _sleep_val) {
waitcycle();
}
}
return TRUE;
}
BOOL STDCALL CChildView::draw(REAL slider, LPPOINT cp, INT ncp, DWORD dwParam) {
CDC *pDC = (CDC *)dwParam;
BOOL bLine = FALSE;
int i;
pDC->Rectangle(D_X0 + 1, D_Y0 + 1, D_X0 + D_WIDTH - 1, D_Y0 + D_HEIGHT - 1);
bLine = ((CMainFrame *)AfxGetMainWnd())->getChkpixelorline();
pDC->MoveTo(D_X0 + cp[0].x, D_Y0 + cp[0].y);
for (i = 0; i < ncp; i++) {
if (bLine) {
pDC->LineTo(D_X0 + cp[i].x, D_Y0 + cp[i].y);
} else {
drawPixel(pDC, D_X0 + cp[i].x, D_Y0 + cp[i].y, 2, 0x0);
}
}
if (bLine) pDC->LineTo(D_X0 + cp[0].x, D_Y0 + cp[0].y);
waitunit();
return TRUE;
}
BOOL STDCALL drawPixel(CDC *pDC, int x, int y, REAL pradius, COLORREF c) {
CPen *pNewPen = new CPen(PS_SOLID, 1, c);
CPen *pOldPen;
pOldPen = pDC->SelectObject(pNewPen);
pDC->Ellipse(x - (INT)pradius, y - (INT)pradius, x + (INT)pradius, y + (INT)pradius);
pDC->SelectObject(pOldPen);
pNewPen->DeleteObject();
return TRUE;
}
BOOL STDCALL arrowLine(CDC *pDC, int x0, int y0, int x1, int y1, COLORREF c) {
CPen *pOldPen;
CPen *pNewPen = new CPen(PS_SOLID, 1, c);
pOldPen = pDC->SelectObject(pNewPen);
pDC->MoveTo(x0, y0);
pDC->LineTo(x1, y1);
const double trimlen = 10.0;
const double rotangle = 0.45;
double w = x1 - x0, h = y1 - y0;
double L = sqrt(w * w + h * h);
if (L > 1) {
double tx = x1 + (x1 - x0) * trimlen / L;
double ty = y1 + (y1 - y0) * trimlen / L;
double a, a1, a2;
a = atan2(-h, -w);
a1 = a - rotangle, a2 = a + rotangle;
w = tx - x1; h = ty - y1;
L = sqrt(w * w + h * h);
pDC->MoveTo(x1, y1);
pDC->LineTo((INT)(x1 + L * cos(a1)), (INT)(y1 + L * sin(a1)));
pDC->MoveTo(x1, y1);
pDC->LineTo((INT)(x1 + L * cos(a2)), (INT)(y1 + L * sin(a2)));
}
pDC->SelectObject(pOldPen);
pNewPen->DeleteObject();
return TRUE;
}
BOOL STDCALL setColor(CDC *pDC, COLORREF c) {
CPen *pNewPen = new CPen(PS_SOLID, 1, c);
return pDC->SelectObject(pNewPen)->DeleteObject();
}
BOOL STDCALL setBackColor(CDC *pDC, COLORREF c) {
CBrush *pNewBrush = new CBrush(c);
return pDC->SelectObject(pNewBrush)->DeleteObject();
}
BOOL STDCALL textOut(CDC *pDC, int tx, int ty, LPCTSTR pzText, COLORREF c) {
CPen *pOldPen;
CPen *pNewPen = new CPen(PS_SOLID, 1, c);
pOldPen = pDC->SelectObject(pNewPen);
pDC->TextOut(tx, ty, pzText, strlen(pzText));
pDC->SelectObject(pOldPen);
pNewPen->DeleteObject();
return TRUE;
}
BOOL STDCALL CChildView::chkrel(LPPOINTR rtSrc, INT nSrc, LPPOINTR rtDst, INT nDst, DWORD dwParam) {
LPCPPACK ppp = (LPCPPACK)dwParam;
CDC *pDC = ppp->pDC;
int i;
LPPOINT p1, p2;
TCHAR numbuf[64];
textOut(pDC, 10, 10, "控制点变形", 0xAAAAAA);
setBackColor(pDC, 0xFFFFFF);
setColor(pDC, 0);
pDC->Rectangle(D_X0 - 3, D_Y0 - 3, D_X1 + D_WIDTH + 3, D_Y0 + D_HEIGHT + 3);
textOut(pDC, D_X0, D_Y0 - 25, "源控制点-->目标控制点", 0xAA0000);
pDC->Rectangle(D_X0 - 1, D_Y0 - 1, D_X0 + D_WIDTH + 1, D_Y0 + D_HEIGHT + 1);
pDC->Rectangle(D_X1 - 1, D_Y0 - 1, D_X1 + D_WIDTH + 1, D_Y0 + D_HEIGHT + 1);
pDC->Rectangle(D_X0 - 3, D_Y1 - 3, D_X1 + D_WIDTH + 3, D_Y1 + D_HEIGHT + 3);
textOut(pDC, D_X0, D_Y1 - 25, "源控制点<--目标控制点", 0xAA0000);
pDC->Rectangle(D_X0 - 1, D_Y1 - 1, D_X0 + D_WIDTH + 1, D_Y1 + D_HEIGHT + 1);
pDC->Rectangle(D_X1 - 1, D_Y1 - 1, D_X1 + D_WIDTH + 1, D_Y1 + D_HEIGHT + 1);
for (i = 0; i < nSrc; i++) {
p1 = ppp->cpSrc + rtSrc[i].ref;
p2 = ppp->cpDst + rtSrc[i].obj;
sprintf(numbuf, "%d", i);
textOut(pDC, (D_X0 + p1->x + D_X1 + p2->x) / 2, (D_Y0 + p1->y + D_Y0 + p2->y) / 2, numbuf, 0x00AAAA);
drawPixel(pDC, D_X0 + p1->x, D_Y0 + p1->y, 3, 0xFF0000);
drawPixel(pDC, D_X1 + p2->x, D_Y0 + p2->y, 3, 0xFF0000);
arrowLine(pDC, D_X0 + p1->x, D_Y0 + p1->y, D_X1 + p2->x, D_Y0 + p2->y, 0x00AA00);
}
for (i = 0; i < nDst; i++) {
p1 = ppp->cpSrc + rtDst[i].obj;
p2 = ppp->cpDst + rtDst[i].ref;
sprintf(numbuf, "%d", i);
textOut(pDC, (D_X0 + p1->x + D_X1 + p2->x) / 2, (D_Y1 + p1->y + D_Y1 + p2->y) / 2, numbuf, 0x00AAAA);
drawPixel(pDC, D_X0 + p1->x, D_Y1 + p1->y, 3, 0xFF0000);
drawPixel(pDC, D_X1 + p2->x, D_Y1 + p2->y, 3, 0xFF0000);
arrowLine(pDC, D_X1 + p2->x, D_Y1 + p2->y, D_X0 + p1->x, D_Y1 + p1->y, 0x00AA00);
}
const COLORREF CPP_COLOR = 0x80AA80;
setBackColor(pDC, CPP_COLOR);
for (i = 0; i < ppp->nSrc; i++) {
drawPixel(pDC, D_X0 + ppp->cpSrc[i].x, D_Y0 + ppp->cpSrc[i].y, 2, CPP_COLOR);
drawPixel(pDC, D_X0 + ppp->cpSrc[i].x, D_Y1 + ppp->cpSrc[i].y, 2, CPP_COLOR);
}
for (i = 0; i < ppp->nDst; i++) {
drawPixel(pDC, D_X1 + ppp->cpDst[i].x, D_Y0 + ppp->cpDst[i].y, 2, CPP_COLOR);
drawPixel(pDC, D_X1 + ppp->cpDst[i].x, D_Y1 + ppp->cpDst[i].y, 2, CPP_COLOR);
}
setBackColor(pDC, 0xFFFFFF);
waitunit();
return TRUE;
}
void CChildView::OnButtonChkRes()
{
// TODO: Add your command handler code here
}
void CChildView::OnButtonChkWait()
{
// TODO: Add your command handler code here
}
void CChildView::OnButtonCls()
{
// TODO: Add your command handler code here
Invalidate();
}
| [
"pub.lenik@bodz.net"
] | pub.lenik@bodz.net |
7b79f895c0c8cc1d6625c1ad4d947e7800c40e28 | 4f60cd8af91309b80a95762b78036d6adf05c500 | /tests/src/auto/create_slash-or-dots.cpp | 9997d95c09c85a3c88f5280dd07ecca77fce3804 | [
"MIT"
] | permissive | Delebrith/simple-fs | 7bedb43a6640afb982091124f44e1f58afddc656 | 36f09ac1413c715a79822953f6fca51a71512899 | refs/heads/master | 2020-04-12T22:52:31.274211 | 2019-01-19T21:28:47 | 2019-01-19T21:28:47 | 162,801,473 | 0 | 0 | MIT | 2019-01-17T00:00:35 | 2018-12-22T10:16:50 | C++ | UTF-8 | C++ | false | false | 849 | cpp | #include "lib/src/simplefs.h"
#include <iostream>
int main(int argc, char **argv) {
char *path = "/";
int ret = simplefs::simplefs_create(path, 0);
if (ret < 0) {
int err = errno;
std::cout << "Error: " << err << std::endl;
if (err != EEXIST)
return -1;
} else {
return -1;
}
path = "/.";
ret = simplefs::simplefs_create(path, 0);
if (ret < 0) {
int err = errno;
std::cout << "Error: " << err << std::endl;
if (err != EEXIST)
return -1;
} else {
return -1;
}
path = "/..";
ret = simplefs::simplefs_create(path, 0);
if (ret < 0) {
int err = errno;
std::cout << "Error: " << err << std::endl;
if (err == EEXIST)
return 0;
} else {
return -1;
}
} | [
"paulina.szwed.1996@gmail.com"
] | paulina.szwed.1996@gmail.com |
b4e00c211124430a5afb3b8d60054ed125cea12e | 6ebf8469e07b45b49be866f7f333cd4e3e46ed84 | /viewer/Renderer/ViewerRenderer.cpp | 41e9b623e23cfaa30c60086e27660fc375265bb1 | [] | no_license | 15831944/vltest | 21086ddc754ca50d347b4eb202afd86913f50081 | d2e203f8ba92aee09069f705dd33595d8b884bf4 | refs/heads/master | 2022-01-27T06:43:52.130539 | 2013-08-28T07:58:20 | 2013-08-28T07:58:20 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,737 | cpp | #include "stdafx.h"
#include "math.h"
#include "float.h"
#include "math/GeometryMath.h"
#include "ViewerRenderer.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
ViewerRenderer::ViewerRenderer() :
_displayFaces(true),
_displayEdges(false),
_displayVertices(false),
_displayOrtho(true)
{
_cameraPosition[0] = 0;
_cameraPosition[1] = 0;
_cameraPosition[2] = 50;
_cameraTarget[0] = 0;
_cameraTarget[1] = 0;
_cameraTarget[2] = 0;
_cameraUp[0] = 0;
_cameraUp[1] = 1;
_cameraUp[2] = 0;
SetFieldOfView(45);
_totalTriCount = 0;
}
ViewerRenderer::~ViewerRenderer()
{
}
void
ViewerRenderer::Initialize(HWND wnd, CClientDC* pDC, int width, int height)
{
SetWindowExtents(width, height);
}
void
ViewerRenderer::Terminate()
{
}
void
ViewerRenderer::SetDisplayFaces(bool displayFaces)
{
_displayFaces = displayFaces;
}
void
ViewerRenderer::SetDisplayEdges(bool displayEdges)
{
_displayEdges = displayEdges;
}
void
ViewerRenderer::SetDisplayVertices(bool displayVertices)
{
_displayVertices = displayVertices;
}
bool
ViewerRenderer::GetDisplayFaces() const
{
return _displayFaces;
}
bool
ViewerRenderer::GetDisplayEdges() const
{
return _displayEdges;
}
bool
ViewerRenderer::GetDisplayVertices() const
{
return _displayVertices;
}
void
ViewerRenderer::SetGeometryExtents(float center[3], float radius)
{
for (int i = 0; i < 3; i++)
{
_geometryCenter[i] = center[i];
}
_geometryRadius = radius;
}
void
ViewerRenderer::SetWindowExtents(int width, int height)
{
_windowWidth = (float)width;
_windowHeight = (float)height;
}
const float*
ViewerRenderer::GetGeometryCenter() const
{
return &_geometryCenter[0];
}
const float
ViewerRenderer::GetGeometryRadius() const
{
return _geometryRadius;
}
void
ViewerRenderer::SetDisplayOrtho(bool displayOrtho)
{
_displayOrtho = displayOrtho;
}
bool
ViewerRenderer::GetDisplayOrtho() const
{
return _displayOrtho;
}
bool IsANumber( float x )
{
return ( x == x );
}
bool IsFinite( float x )
{
return ( x <= FLT_MAX && x >= -FLT_MAX );
}
void
ViewerRenderer::SetCamera(float* cameraPosition, float* cameraTarget, float* cameraUp)
{
Normalize( cameraUp );
bool good_numbers = true;
for ( int i = 0; i < 3 && good_numbers; i++ )
{
if ( ! IsANumber( cameraPosition[ i ] ) || ! IsFinite( cameraPosition[ i ] ) )
good_numbers = false;
if ( ! IsANumber( cameraTarget[ i ] ) || ! IsFinite( cameraTarget[ i ] ) )
good_numbers = false;
if ( ! IsANumber( cameraUp[ i ] ) || ! IsFinite( cameraUp[ i ] ) )
good_numbers = false;
}
if ( ! good_numbers )
return;
float viewVector[ 3 ];
Normalize( Subtract( cameraTarget, cameraPosition, viewVector ) );
if ( Length( viewVector ) < 0.0001 )
return; // Can't have cameraPosition == cameraTarget
float dot = DotProduct( viewVector, cameraUp );
if ( dot < -0.999f || 0.999f < dot )
return; // Can't have view vector parallel to up vector
if ( dot < -.1 || 1 < dot )
{ // Change the up vector to form a 90 degree angle with the view vector...
float cameraRight[ 3 ];
CrossProduct( viewVector, cameraUp, cameraRight );
CrossProduct( cameraRight, viewVector, cameraUp );
dot = DotProduct( viewVector, cameraUp );
if ( dot < -0.999f || 0.999f < dot )
return; // Can't have view vector parallel to up vector
}
for (int i = 0; i < 3; i++)
{
_cameraPosition[i] = cameraPosition[i];
_cameraTarget[i] = cameraTarget[i];
_cameraUp[i] = cameraUp[i];
}
}
void
ViewerRenderer::Zoom(float delta)
{
float cameraPosition[3], cameraTarget[3], cameraUp[3];
GetCamera(cameraPosition, cameraTarget, cameraUp);
for (int i = 0; i < 3; i++)
{
cameraPosition[i] = cameraTarget[i] +
(delta + 1.f) * (cameraPosition[i] - cameraTarget[i]);
}
SetCamera(cameraPosition, cameraTarget, cameraUp);
}
void
ViewerRenderer::GetCamera(float* cameraPosition, float* cameraTarget, float* cameraUp)
{
for (int i = 0; i < 3; i++)
{
cameraPosition[i] = _cameraPosition[i];
cameraTarget[i] = _cameraTarget[i];
cameraUp[i] = _cameraUp[i];
}
}
void
ViewerRenderer::SetFieldOfView(float degrees)
{
_FOV = degrees * 3.1415926f / 180.0f;
}
float
ViewerRenderer::GetFieldOfView()
{
return _FOV * 180.0f / 3.1415926f;
}
float
ViewerRenderer::GetFieldOfViewRadians()
{
return _FOV;
}
void
ViewerRenderer::ZoomAll()
{
float geomRadius = GetGeometryRadius();
float eye[3], target[3], up[3];
GetCamera(eye, target, up);
float oldView[3];
for (int i = 0; i < 3; i++)
oldView[i] = eye[i] - target[i];
Normalize(oldView);
const float* geomCenter = GetGeometryCenter();
target[0] = geomCenter[0];
target[1] = geomCenter[1];
target[2] = geomCenter[2];
float distEyeToTarget = geomRadius / (tan(GetFieldOfViewRadians() / 2.0f));
for (int i = 0; i < 3; i++)
oldView[i] *= distEyeToTarget;
for (int i = 0; i < 3; i++)
eye[i] = oldView[i] + target[i];
SetCamera(eye, target, up);
}
void
ViewerRenderer::SetStandardCameraPositionAndUp(float* cameraPosition, float* cameraTarget, float* cameraUp)
{
GetCamera( cameraPosition, cameraTarget, cameraUp );
float dist[3];
float distance = 0;
for (int i = 0; i < 3; i++)
{
dist[i] = cameraTarget[i] - cameraPosition[i];
dist[i] *= dist[i];
distance += dist[i];
cameraPosition[i] = cameraTarget[i];
}
distance = sqrt( distance );
cameraPosition[2] += distance;
cameraUp[0] = 0;
cameraUp[1] = 1;
cameraUp[2] = 0;
}
void
ViewerRenderer::Top()
{
float cameraPosition[3], cameraTarget[3], cameraUp[3], axis[3];
SetStandardCameraPositionAndUp(cameraPosition, cameraTarget, cameraUp);
axis[0] = 0;
axis[1] = 0;
axis[2] = -1;
RotatePoint(cameraPosition, 90, cameraTarget, axis, cameraPosition);
cameraUp[0] = -1;
cameraUp[1] = 0;
cameraUp[2] = 0;
SetCamera(cameraPosition, cameraTarget, cameraUp);
}
void
ViewerRenderer::Front()
{
float cameraPosition[3], cameraTarget[3], cameraUp[3], axis[3];
SetStandardCameraPositionAndUp(cameraPosition, cameraTarget, cameraUp);
axis[0] = -1;
axis[1] = 0;
axis[2] = 0;
RotatePoint(cameraPosition, 90, cameraTarget, axis, cameraPosition);
axis[0] = 0;
axis[1] = 0;
axis[2] = -1;
RotatePoint(cameraPosition, 90, cameraTarget, axis, cameraPosition);
cameraUp[0] = 0;
cameraUp[1] = 0;
cameraUp[2] = 1;
SetCamera(cameraPosition, cameraTarget, cameraUp);
}
void
ViewerRenderer::Right()
{
float cameraPosition[3], cameraTarget[3], cameraUp[3], axis[3];
SetStandardCameraPositionAndUp(cameraPosition, cameraTarget, cameraUp);
axis[0] = 1;
axis[1] = 0;
axis[2] = 0;
RotatePoint(cameraPosition, 90, cameraTarget, axis, cameraPosition);
axis[0] = 0;
axis[1] = 0;
axis[2] = 1;
RotatePoint(cameraPosition, 180, cameraTarget, axis, cameraPosition);
cameraUp[0] = 0;
cameraUp[1] = 0;
cameraUp[2] = 1;
SetCamera(cameraPosition, cameraTarget, cameraUp);
}
void
ViewerRenderer::Isometric()
{
Top();
float cameraPosition[3], cameraTarget[3], cameraUp[3], axis[3], origin[3];
GetCamera(cameraPosition, cameraTarget, cameraUp);
axis[0] = -1.0f / (float)sqrt(2.0);
axis[1] = 1.0f / (float)sqrt(2.0);
axis[2] = 0;
RotatePoint(cameraPosition, 45, cameraTarget, axis, cameraPosition);
cameraUp[0] = -1;
cameraUp[1] = -1;
cameraUp[2] = 0;
origin[0] = 0;
origin[1] = 0;
origin[2] = 0;
RotatePoint(cameraUp, 45, origin, axis, cameraUp);
SetCamera(cameraPosition, cameraTarget, cameraUp);
}
| [
"minwu.ds@gmail.com@e7a13355-e1cc-705a-528b-60ba919bedae"
] | minwu.ds@gmail.com@e7a13355-e1cc-705a-528b-60ba919bedae |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.